Package net.sourceforge.uiq3.fx602p
Class Desktop_Calculator
- java.lang.Object
-
- net.sourceforge.uiq3.fx602p.Calculator
-
- net.sourceforge.uiq3.fx602p.Desktop_Calculator
-
- All Implemented Interfaces:
Runnable,net.sourceforge.uiq3.calculator.ICalculator,IClear,net.sourceforge.uiq3.IPropertyNotifier
public class Desktop_Calculator extends Calculator
Calculator engine with debug capability- Author:
- "Martin Krischik" «krischik@users.sourceforge.net»
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.sourceforge.uiq3.fx602p.Calculator
Calculator.Token_Plane_Type
-
Nested classes/interfaces inherited from interface net.sourceforge.uiq3.calculator.ICalculator
net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType, net.sourceforge.uiq3.calculator.ICalculator.Companion, net.sourceforge.uiq3.calculator.ICalculator.DefaultImpls, net.sourceforge.uiq3.calculator.ICalculator.DisplayType
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static String[]Debug_DisplayDebug representation of Casio alpha characters.private static ResourceBundleFX_602P_BundleBundle for i18Nprivate static Loggerloggerclass logger instanceprivate static StringTAGclass logger tag.-
Fields inherited from class net.sourceforge.uiq3.fx602p.Calculator
A_Size, Display_Alpha, Display_Enable, Display_Error, Execution_Alpha_Pause, Execution_Clear, Execution_Error, Execution_Halt, Execution_Interactive, Execution_One_Step, Execution_Pause, Execution_Running, Execution_Write, FA2, Form, FP10, Ignore_Clear, Indicator_Alpha, Indicator_Count, Indicator_Deg, Indicator_Gra, Indicator_Hlt, Indicator_Hyp, Indicator_Inv, Indicator_K, Indicator_Pcl, Indicator_Rad, Indicator_Run, Indicator_Wrt, Internal_Steps_High, Internal_Steps_Low, Keyboard_Alpha, Keyboard_Error, Keyboard_Hyp, Keyboard_Inv, Keyboard_Inv_Alpha, Keyboard_Inv_Hyp, Keyboard_Normal, L_CHANGED, L_Count, L_Used, L_X, L_Y, Last_Operation, M_CHANGED, M_n, M_Sx, M_Sx2, Merge_Key, Merged_Operations, Null_Return, Pause_Repeat, Program_Stack, Realistic_Speed, Running_Text, Stack_Count, STATUS_CHANGED, STEP_CHANGED, Steps, Steps_Count, User_Steps_High, User_Steps_Low
-
-
Constructor Summary
Constructors Constructor Description Desktop_Calculator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisplayException(@NotNull Throwable exception)display additional information on the error. this is device and setup dependent.protected voidExecute_Mode_Run()Handles running the calculatorStringGet_A(net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType Nr)StringGet_Display()Get content of Calculator DisplayStringGet_Display_Mode_Image()In Ada an image function is build in - but Java is just plain primitive,.StringGet_Execution_Mode_Image()In Ada an image function is build in - but Java is just plain primitive,.StringGet_F(int Nr)StringGet_L(int Nr)StringGet_M(int Nr)StringGet_Memory()StringGet_P()StringGet_Registers()Get text for clipboardStringGet_Stack(int Nr)Returns the memory step x as debug info or null for step 0xff which is the empty step.intGet_Stack_Count()longgetPauseTime()The manual says that a PAUSE takes about a second.longgetPauseWait()Intermediate wait in milliseconds while pause is executed.longgetRealisticSpeedWait()additional wait to make simulator more realistic.voidload()Load the current status of the system from default filenamevoidsave()Load the current status of the systemvoidsave(@NotNull String filename)Save Calculator stateshortStep(int Nr)Get program step from positionStringStep_Image(int Nr)Returns the memory step x as debug info or null for step 0xff which is the empty step.intSteps_Count()StringSteps_Image()get all program steps for clipboardvoidStore_Operation(short Operation)Store an operation at into calculator memorystatic @NotNull StringtoDebugString(short @NotNull [] Calculator_String)Convert Calculator String into Java String.@NotNull StringtoString()-
Methods inherited from class net.sourceforge.uiq3.fx602p.Calculator
A, A_Active, A_Active, addPropertyChangeListener, addPropertyChangeListener, Clear, Decrement_Program_Store, Display_A, Display_Error, Display_Fatal, Display_Program, Display_Program_Overview, Display_Steps, displayClear, displayFormatted, displayKey, displayL, displayMessage, FA2, forceIO, Form, FP10, Free_Steps, Get_Alpha_Mode, Get_Current_Program, getDisplayMode, getExecutionMode, getLastStep, getStackPointer, Half_Circle, Half_Circle, Handle_IO, Hlt_Position, Hlt_Position, Increment_Hlt_Position, Increment_Program_Counter, Increment_Program_Store, Init_A, Init_Keycodes, Init_L, Init_M, Init_MF, Init_Opcodes, Init_Program_Stack, Init_Steps, Is_Alpha, Is_Alpha_Mode, Is_Constant_Mode, Is_HLT_Pause, Is_Program_Stack_Empty, Is_Program_Stack_Full, Is_Shutdown, isIndirect, isRunning, isWaiting, Keyboard_Mode, Keyboard_Mode, L, load, Load_Status, M, M, M_Length, Merge_Key, Merge_Key, Merge_Token, Merge_Token, MF, MF, MF_Length, Pop_L, Pop_L, Pop_Program_Stack, Program_Counter, Program_Position, Program_Store, Push_L, Push_Program_Stack, Read_Display, Read_M, Read_Steps, removePropertyChangeListener, removePropertyChangeListener, reset, Resize_M, Resize_MF, run, Save_Status, Service, Set_Alpha_Mode, Set_Constant_Mode, Set_Current_Program, Set_Current_Program, Set_Program_Counter, Set_Program_Store, setDisplayMode, setExecutionMode, setIndirect, Steps, Steps, stop, Stop_Execute, Text_To_Display, Token_Plane, Token_Plane, Write_M, Write_Steps, Wrt_Is_Alpha
-
-
-
-
Field Detail
-
FX_602P_Bundle
private static final ResourceBundle FX_602P_Bundle
Bundle for i18N
-
TAG
private static final String TAG
class logger tag.
-
logger
private static final Logger logger
class logger instance
-
Debug_Display
static final String[] Debug_Display
Debug representation of Casio alpha characters. We use two special options- [...]
- exponent characters.
- {...}
- Characters not normally available or used. However, they might be used in synthetic programming.
-
-
Method Detail
-
toDebugString
@NotNull public static @NotNull String toDebugString(short @NotNull [] Calculator_String)
Convert Calculator String into Java String.- Parameters:
Calculator_String- String as calculator type- Returns:
- String as Java type
-
getRealisticSpeedWait
public long getRealisticSpeedWait()
additional wait to make simulator more realistic.
-
getPauseWait
public long getPauseWait()
Intermediate wait in milliseconds while pause is executed.
-
getPauseTime
public long getPauseTime()
The manual says that a PAUSE takes about a second. However, when measured 30 PAUSE statements take about 22 seconds which is about .73 seconds per PAUSE. There is also overhead in the system to the actual wait time is significantly less.
-
displayException
public void displayException(@NotNull @NotNull Throwable exception)display additional information on the error. this is device and setup dependent.
- Parameters:
exception- Exception to display
-
Execute_Mode_Run
protected void Execute_Mode_Run() throws ErrorHandles running the calculator- Overrides:
Execute_Mode_Runin classCalculator- Throws:
Error- an error occured while executing
-
Get_A
public String Get_A(net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType Nr)
- Parameters:
Nr- Register number- Returns:
- Register as debug informations
-
Get_Display
public String Get_Display()
Get content of Calculator Display- Returns:
- content of Calculator Display
-
Get_Display_Mode_Image
public String Get_Display_Mode_Image()
In Ada an image function is build in - but Java is just plain primitive,.- Returns:
- image of enum
-
Get_Execution_Mode_Image
public String Get_Execution_Mode_Image()
In Ada an image function is build in - but Java is just plain primitive,.- Returns:
- image of enum
-
Get_F
public String Get_F(int Nr)
- Parameters:
Nr- number- Returns:
- Register content as debug informations
-
Get_L
public String Get_L(int Nr)
- Parameters:
Nr- number- Returns:
- Register content as debug informations
-
Get_M
public String Get_M(int Nr)
- Parameters:
Nr- number- Returns:
- Register content as debug informations
-
Get_Memory
public String Get_Memory()
- Returns:
- Get Memory line
-
Get_P
public String Get_P()
- Returns:
- Printer value
-
Get_Registers
public String Get_Registers()
Get text for clipboard- Returns:
- Test with all register
-
Get_Stack
public String Get_Stack(int Nr)
Returns the memory step x as debug info or null for step 0xff which is the empty step.- Parameters:
Nr- step number- Returns:
- program step as debug information
-
Get_Stack_Count
public int Get_Stack_Count()
- Returns:
- Stack depth
-
Step
public short Step(int Nr)
Get program step from position- Parameters:
Nr- Step number- Returns:
- Step content
-
Step_Image
public String Step_Image(int Nr)
Returns the memory step x as debug info or null for step 0xff which is the empty step.- Parameters:
Nr- step number- Returns:
- program step as debug informations
-
Steps_Count
public int Steps_Count()
- Returns:
- amount of program Steps
-
Steps_Image
public String Steps_Image()
get all program steps for clipboard- Returns:
- all program steps
-
Store_Operation
public void Store_Operation(short Operation) throws M_ErrorDescription copied from class:CalculatorStore an operation at into calculator memory- Overrides:
Store_Operationin classCalculator- Parameters:
Operation- Operation to be stored- Throws:
M_Error- Calculator memory exhausted- See Also:
Calculator.Store_Operation(short)
-
load
public void load()
Load the current status of the system from default filename
-
save
public void save()
Load the current status of the system
-
save
public void save(@NotNull @NotNull String filename)Save Calculator state- Parameters:
filename- name of file to save
-
toString
@TestOnly @NotNull public @NotNull String toString()
- Overrides:
toStringin classCalculator
-
-