Package net.sourceforge.uiq3.fx603p
Class Desktop_Calculator
- java.lang.Object
-
- net.sourceforge.uiq3.fx603p.Calculator
-
- net.sourceforge.uiq3.fx603p.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.fx603p.Calculator
Calculator.Execution_Type, Calculator.Indicator_Type, Calculator.Keyboard_Mode, Calculator.Program_Type, Calculator.Row_Type, 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 private static Logger
logger
class logger instanceprivate static String
TAG
class logger tag.-
Fields inherited from class net.sourceforge.uiq3.fx603p.Calculator
Display_Error, Execution_Error, FA6, Form, FP40, Ignore_Clear, Internal_Steps_Low, L_CHANGED, L_Count, L_Used, L_X, L_Y, M_CHANGED, M_Count, M_n, M_Sx, M_Sx2, Merge_Key, Merged_Operations, Null_Program, Null_Return, Program_Stack, Realistic_Speed, Row_Numeric, Row_Steps, Row_Text, RS232, Stack_Count, STATUS_CHANGED, STEP_CHANGED, Steps_Count, User_Steps_High, User_Steps_Low
-
-
Constructor Summary
Constructors Constructor Description Desktop_Calculator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
displayException(@NotNull Throwable exception)
display additional information on the error. this is device and setup dependent.protected void
Execute_Mode_Run()
Handles running the calculatorString
Get_A(net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType Nr)
String
Get_Display()
Get content of Calculator DisplayString
Get_F(int Nr)
String
Get_L(int Nr)
String
Get_M(int Nr)
String
Get_Memory()
String
Get_P(net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType Nr)
String
Get_Registers()
Get text for clipboardString
Get_Stack(int Nr)
Returns the memory step x as debug info or null for step 0xff which is the empty step.long
getPauseTime()
The manual says that a PAUSE takes about a second.long
getPauseWait()
Intermediate wait in milliseconds while pause is executedlong
getRealisticSpeedWait()
additional wait to make simulator more realistic.void
load()
Load the current status of the system from default filenamevoid
save()
Load the current status of the systemvoid
save(@NotNull String filename)
Save Calculator stateString
Step_Image(int Nr)
Returns the memory step x as debug info or null for step 0xff which is the empty step.String
Steps_Image()
get all program steps for clipboard@NotNull String
toString()
-
Methods inherited from class net.sourceforge.uiq3.fx603p.Calculator
A, A_Active, A_Active, addPropertyChangeListener, addPropertyChangeListener, Alpha_Mode, BaseN, Clear, Constant_Mode, Constant_Mode, Current_Program, Current_Program, Decrement_Program_Store, Display_A, Display_Program_Overview, displayClear, displayFormatted, displayKey, displayL, displayMessage, Enable_BaseN, Execute_Key, FA6, forceIO, Form, FP40, Free_Steps, Get_Steps_Text, getDisplayMode, 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_Steps, Is_2nd_Mode, Is_Alpha, Is_Alpha_Mode, Is_BaseN, Is_BaseN_B, Is_BaseN_D, Is_BaseN_H, Is_BaseN_O, Is_End_Program, Is_Mode, Is_Program_Stack_Empty, Is_Program_Stack_Full, Is_Shift_Mode, Is_Shutdown, isIndirect, isRunning, isWaiting, Keyboard_Mode, Keyboard_Mode, L, Last_Comp_Mode, Last_Operation, Last_Operation, load, M, M, Merge_Key, Merge_Key, Merge_Token, Merge_Token, Merged_Operations, MF, MF, Pop_L, Pop_L, Pop_Program_Stack, Previous_Step, Program_Counter, Program_Counter, Program_Position, Program_Store, Program_Store, Push_L, Push_Program_Stack, removePropertyChangeListener, removePropertyChangeListener, reset, RS232, run, Save_Status, SecondF, Service, Set_Current_Program, Set_Keyboard_No_Shift, Set_Mode, setDisplayMode, setDisplayMode, setExecutionMode, setIndirect, SHIFT, Steps, Steps, Steps_Delete, stop, Stop_Execution, Store_Operation, Text_To_Display, Token_Plane, Token_Plane, Write_Steps, Wrt_Is_Alpha
-
-
-
-
Method Detail
-
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
-
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
- file to save to
-
Execute_Mode_Run
protected void Execute_Mode_Run() throws Error
Handles running the calculator- Overrides:
Execute_Mode_Run
in 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() throws Error
Get content of Calculator Display- Returns:
- content of Calculator Display
- Throws:
Error
-
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) throws Error
- Parameters:
Nr
- number- Returns:
- Register content as debug informations
- Throws:
Error
-
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(net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType Nr)
- Returns:
- Printer value
-
Get_Registers
public String Get_Registers() throws Error
Get text for clipboard- Returns:
- Test with all register
- Throws:
Error
-
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 informations
-
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_Image
public String Steps_Image()
get all program steps for clipboard- Returns:
- all program steps
-
toString
@TestOnly @NotNull public @NotNull String toString()
- Overrides:
toString
in classCalculator
-
-