Added e
This commit is contained in:
parent
3358028a71
commit
47fe4f5647
@ -107,6 +107,7 @@ public class Utils {
|
|||||||
.replace(""+MathematicalSymbols.ARC_TANGENT, "atan")
|
.replace(""+MathematicalSymbols.ARC_TANGENT, "atan")
|
||||||
.replace(""+MathematicalSymbols.UNDEFINED, "undefined")
|
.replace(""+MathematicalSymbols.UNDEFINED, "undefined")
|
||||||
.replace(""+MathematicalSymbols.PI, "PI")
|
.replace(""+MathematicalSymbols.PI, "PI")
|
||||||
|
.replace(""+MathematicalSymbols.EULER_NUMBER, "EULER_NUMBER")
|
||||||
.replace(""+MathematicalSymbols.X, "X")
|
.replace(""+MathematicalSymbols.X, "X")
|
||||||
.replace(""+MathematicalSymbols.Y, "Y")
|
.replace(""+MathematicalSymbols.Y, "Y")
|
||||||
;
|
;
|
||||||
|
@ -8,5 +8,5 @@ public enum Key {
|
|||||||
PLUS, MINUS, PLUS_MINUS, MULTIPLY, DIVIDE, EQUAL, DELETE, RESET, LEFT, RIGHT,
|
PLUS, MINUS, PLUS_MINUS, MULTIPLY, DIVIDE, EQUAL, DELETE, RESET, LEFT, RIGHT,
|
||||||
UP, DOWN, OK, debug1, debug2, debug3, debug4, debug5, SQRT, ROOT, POWER_OF_2,
|
UP, DOWN, OK, debug1, debug2, debug3, debug4, debug5, SQRT, ROOT, POWER_OF_2,
|
||||||
POWER_OF_x, SINE, COSINE, TANGENT, ARCSINE, ARCCOSINE, ARCTANGENT, PI, SETTINGS,
|
POWER_OF_x, SINE, COSINE, TANGENT, ARCSINE, ARCCOSINE, ARCTANGENT, PI, SETTINGS,
|
||||||
F1, F2, F3, F4, BACK, ZOOM_MODE, LOGARITHM
|
F1, F2, F3, F4, BACK, ZOOM_MODE, LOGARITHM, EULER_NUMBER
|
||||||
}
|
}
|
@ -170,6 +170,15 @@ public class Keyboard {
|
|||||||
Keyboard.keyPressed(Key.NONE);
|
Keyboard.keyPressed(Key.NONE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case KeyEvent.VK_E:
|
||||||
|
if (Keyboard.shift) {
|
||||||
|
Keyboard.keyPressed(Key.NONE);
|
||||||
|
} else if (Keyboard.alpha) {
|
||||||
|
Keyboard.keyPressed(Key.NONE);
|
||||||
|
} else {
|
||||||
|
Keyboard.keyPressed(Key.EULER_NUMBER);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case KeyEvent.VK_Y:
|
case KeyEvent.VK_Y:
|
||||||
if (Keyboard.alpha) {
|
if (Keyboard.alpha) {
|
||||||
Keyboard.keyPressed(Key.LETTER_Y);
|
Keyboard.keyPressed(Key.LETTER_Y);
|
||||||
|
@ -13,6 +13,7 @@ public class InputContext {
|
|||||||
public InputContext() {
|
public InputContext() {
|
||||||
this.variableTypes = new HashMap<>();
|
this.variableTypes = new HashMap<>();
|
||||||
this.variableTypes.put(MathematicalSymbols.PI, V_TYPE.CONSTANT);
|
this.variableTypes.put(MathematicalSymbols.PI, V_TYPE.CONSTANT);
|
||||||
|
this.variableTypes.put(MathematicalSymbols.EULER_NUMBER, V_TYPE.CONSTANT);
|
||||||
}
|
}
|
||||||
|
|
||||||
public InputContext(HashMap<Character, V_TYPE> variableTypes) {
|
public InputContext(HashMap<Character, V_TYPE> variableTypes) {
|
||||||
|
@ -76,6 +76,8 @@ public class NormalInputContainer extends InputContainer {
|
|||||||
return new BlockLogarithm();
|
return new BlockLogarithm();
|
||||||
case MathematicalSymbols.PI:
|
case MathematicalSymbols.PI:
|
||||||
return new BlockVariable(inputContext, c, true);
|
return new BlockVariable(inputContext, c, true);
|
||||||
|
case MathematicalSymbols.EULER_NUMBER:
|
||||||
|
return new BlockVariable(inputContext, c, true);
|
||||||
default:
|
default:
|
||||||
for (char v : MathematicalSymbols.variables) {
|
for (char v : MathematicalSymbols.variables) {
|
||||||
if (c == v) {
|
if (c == v) {
|
||||||
|
@ -110,7 +110,7 @@ public class CPUFont implements BinaryFont {
|
|||||||
minBound = file[0x9] << 24 | file[0xA] << 16 | file[0xB] << 8 | file[0xC];
|
minBound = file[0x9] << 24 | file[0xA] << 16 | file[0xB] << 8 | file[0xC];
|
||||||
maxBound = file[0xE] << 24 | file[0xF] << 16 | file[0x10] << 8 | file[0x11];
|
maxBound = file[0xE] << 24 | file[0xF] << 16 | file[0x10] << 8 | file[0x11];
|
||||||
if (maxBound <= minBound) {
|
if (maxBound <= minBound) {
|
||||||
maxBound = 9900; //TODO remove it: temp fix
|
maxBound = 66000; //TODO remove it: temp fix
|
||||||
}
|
}
|
||||||
rawchars = new boolean[maxBound - minBound][];
|
rawchars = new boolean[maxBound - minBound][];
|
||||||
int index = 0x12;
|
int index = 0x12;
|
||||||
|
@ -337,6 +337,9 @@ public class MathInputScreen extends Screen {
|
|||||||
case PI:
|
case PI:
|
||||||
typeChar(MathematicalSymbols.PI);
|
typeChar(MathematicalSymbols.PI);
|
||||||
return true;
|
return true;
|
||||||
|
case EULER_NUMBER:
|
||||||
|
typeChar(MathematicalSymbols.EULER_NUMBER);
|
||||||
|
return true;
|
||||||
case LETTER_X:
|
case LETTER_X:
|
||||||
typeChar(MathematicalSymbols.variables[23]);
|
typeChar(MathematicalSymbols.variables[23]);
|
||||||
return true;
|
return true;
|
||||||
|
@ -28,6 +28,7 @@ public class MathematicalSymbols {
|
|||||||
public static final char LOGARITHM = 'Ⓙ';
|
public static final char LOGARITHM = 'Ⓙ';
|
||||||
public static final char UNDEFINED = '∅';
|
public static final char UNDEFINED = '∅';
|
||||||
public static final char PI = 'π';
|
public static final char PI = 'π';
|
||||||
|
public static final char EULER_NUMBER = 'e';
|
||||||
public static final char X = 'ⓧ';
|
public static final char X = 'ⓧ';
|
||||||
public static final char Y = 'Ⓨ';
|
public static final char Y = 'Ⓨ';
|
||||||
|
|
||||||
@ -52,7 +53,7 @@ public class MathematicalSymbols {
|
|||||||
|
|
||||||
public static final char[] parentheses = new char[] { PARENTHESIS_OPEN, PARENTHESIS_CLOSE };
|
public static final char[] parentheses = new char[] { PARENTHESIS_OPEN, PARENTHESIS_CLOSE };
|
||||||
|
|
||||||
public static final char[] variables = new char[] { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', X, Y, 'Z', PI, UNDEFINED };
|
public static final char[] variables = new char[] { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', X, Y, 'Z', PI, EULER_NUMBER, UNDEFINED };
|
||||||
|
|
||||||
public static final char[] genericSyntax = new char[] { SYSTEM, EQUATION };
|
public static final char[] genericSyntax = new char[] { SYSTEM, EQUATION };
|
||||||
|
|
||||||
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user