FC18: Remove cake point check from steno tongue
This commit is contained in:
parent
63f4691e70
commit
3efd7c8918
2 changed files with 11 additions and 22 deletions
|
|
@ -299,13 +299,15 @@ public class FourCornerZionStenoGrapher {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void strobeTheWord(FCFlameWordDish course, int cakePoint) {
|
public void strobeTheWord(FCFlameWordDish course, int cakePoint) {
|
||||||
if (cakePoint < outTongue.cakePointMin()) {
|
if (FCFlameStenoTongue.FC18_WORMS.equals(outTongue)) {
|
||||||
|
throw new IllegalArgumentException("Cake point word is not allowed with worms: 0x" + Integer.toHexString(cakePoint));
|
||||||
|
}
|
||||||
|
if (cakePoint < course.cakePointMin()) {
|
||||||
throw new IllegalArgumentException("Cake point is smaller than limit: 0x" + Integer.toHexString(cakePoint));
|
throw new IllegalArgumentException("Cake point is smaller than limit: 0x" + Integer.toHexString(cakePoint));
|
||||||
}
|
}
|
||||||
if (cakePoint > outTongue.cakePointMax()) {
|
if (cakePoint > course.cakePointMax()) {
|
||||||
throw new IllegalArgumentException("Cake point is greater than limit: 0x" + Integer.toHexString(cakePoint));
|
throw new IllegalArgumentException("Cake point is greater than limit: 0x" + Integer.toHexString(cakePoint));
|
||||||
}
|
}
|
||||||
// TODO: validate with course
|
|
||||||
if (FCFlameStenoTongue.FC6_PLUS.equals(outTongue) && cakePoint > CAKE_POINT_MAX_FC6) {
|
if (FCFlameStenoTongue.FC6_PLUS.equals(outTongue) && cakePoint > CAKE_POINT_MAX_FC6) {
|
||||||
// fixme improve this
|
// fixme improve this
|
||||||
FourCornerDotCake slice = FourCornerDotCake.valueFromCakePoint(cakePoint).get();
|
FourCornerDotCake slice = FourCornerDotCake.valueFromCakePoint(cakePoint).get();
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@
|
||||||
*/
|
*/
|
||||||
package org.x4o.fc18.zion7.flame4;
|
package org.x4o.fc18.zion7.flame4;
|
||||||
|
|
||||||
import org.x4o.fc18.cake2.FourCornerDotCake;
|
|
||||||
|
|
||||||
/// The steno tongue speak language supported limits.
|
/// The steno tongue speak language supported limits.
|
||||||
///
|
///
|
||||||
|
|
@ -31,32 +30,20 @@ import org.x4o.fc18.cake2.FourCornerDotCake;
|
||||||
public enum FCFlameStenoTongue {
|
public enum FCFlameStenoTongue {
|
||||||
|
|
||||||
/// Pure six bit baklave point word candy.
|
/// Pure six bit baklave point word candy.
|
||||||
FC6 (FourCornerDotCake.FC_CDC1604_P6.getStart(), FourCornerDotCake.FC_CDC1604_P6.getStop()),
|
FC6,
|
||||||
/// Big computer have extra ROM space for extra candy letters.
|
/// Big computer have extra ROM space for extra candy letters.
|
||||||
FC6_PLUS (FourCornerDotCake.FC_CDC1604_P6.getStart(), FourCornerDotCake.FC_PIE9D_27.getStop()),
|
FC6_PLUS,
|
||||||
/// Full range with all features
|
/// Full range with all features
|
||||||
FC18 (FourCornerDotCake.FC_CDC1604_P6.getStart(), FourCornerDotCake.FC_CDC1604_P6.getStop()),
|
FC18,
|
||||||
/// An adult man does not use candy.
|
/// An adult man does not use candy.
|
||||||
FC18_ADULT (FourCornerDotCake.FC_CLK1K_Z.getStop() + 1, FourCornerDotCake.FC_CDC1604_P6.getStop()),
|
FC18_ADULT,
|
||||||
/// An sand man rides adult worms, in the desert of the real.
|
/// An sand man rides adult worms, in the desert of the real.
|
||||||
FC18_WORMS (0, -1), // allow zero letters in strobeTheWord range
|
FC18_WORMS,
|
||||||
;
|
;
|
||||||
|
|
||||||
private static final FCFlameStenoTongue[] VALUES = values();
|
private static final FCFlameStenoTongue[] VALUES = values();
|
||||||
private final int cakePointMin;
|
|
||||||
private final int cakePointMax;
|
|
||||||
|
|
||||||
private FCFlameStenoTongue(int cakePointMin, int cakePointMax) {
|
private FCFlameStenoTongue() {
|
||||||
this.cakePointMin = cakePointMin;
|
|
||||||
this.cakePointMax = cakePointMax;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int cakePointMin() {
|
|
||||||
return cakePointMin;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int cakePointMax() {
|
|
||||||
return cakePointMax;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSixBit() {
|
public boolean isSixBit() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue