Class Calculator

  • All Implemented Interfaces:
    Runnable, net.sourceforge.uiq3.calculator.ICalculator, IClear, net.sourceforge.uiq3.IPropertyNotifier
    Direct Known Subclasses:
    Desktop_Calculator

    public abstract class Calculator
    extends Object
    implements net.sourceforge.uiq3.calculator.ICalculator, IClear
    Author:
    "Martin Krischik" «krischik@users.sourceforge.net»
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Calculator.Execution_Type
      Do a single step and return to Execution_Halt.
      static class  Calculator.Indicator_Type
      Mode was pressed Inv Keyboard in inverse move Hyp Keyboard in hyperbolic mode - also used for password entry K Constant calculation mode Hlt halted program - also used for debugger Run Mode1, interactive or program run mode Wrt Mode2, write programs Pcl Mode3, clear, save, load programs. Deg Mode4, Tr Rad Mode5 Gra Mode6 Keyboard_Alpha Alpha entry and display mode
      static class  Calculator.Keyboard_Mode
      Keyboard is in normal mode Keyboard_Normal Keyboard is in normal mode Keyboard_Inv Keyboard is in inverse mode Keyboard_Hyp Keyboard is in hyperbolic mode Keyboard_Inv_Hyp Keyboard is in inverse hyperbolic mode Keyboard_Alpha Keyboard is in alpha mode Keyboard_Inv_Alpha Keyboard is in inverse alpha mode
      static class  Calculator.Program_Type
      A Program which may be from P0 … P19
      static class  Calculator.Row_Type
      Alpha register to display messages.
      static class  Calculator.Token_Plane_Type
      Available Token Planes
      • 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 @NotNull A_Register @NotNull [] A
      The A Register contains the Keyboard_Alpha data of the display.
      private @NotNull net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType @NotNull [] A_Active
      Active A register for row.
      private boolean Calculator_Running
      Calculator is running - needed for power saving.
      private boolean Calculator_Shutdown
      Calculator is not running - needed for end program.
      private @NotNull Calculator.Program_Type Current_Program
      Current Current_Program
      private boolean Display_Enable
      Display enable - used to switch off the display so that intermediate result are not shown to the user.
      static @NotNull String Display_Error
      Error Message displayed on using the wrong display mode!
      private @NotNull net.sourceforge.uiq3.calculator.ICalculator.DisplayType @NotNull [] Display_Mode
      Current display mode Display_Alpha Displays the content of the Alpha register. Display_L Displays the content of the L0 aka X register. Display_Formated Displays the content of the L0 aka X register inside an alpha
      (package private) static @NotNull String Execution_Error
      Error Message displayed on using the wrong execution mode!
      private @NotNull Calculator.Execution_Type Execution_Mode
      Current Execution mode.
      (package private) Tape FA6
      A simulated cassette Interface
      (package private) net.sourceforge.uiq3.ui.ICalculatorCanvas Form
      Canvas class where we display our result or get our keycodes
      (package private) Printer FP40
      A simulated Printer Printer
      private static int Half_Second  
      private int Hlt_Position
      Return Position for HLT Mode.
      (package private) boolean Ignore_Clear
      The last operation was one of the operations (+-) which disable the clear key.
      private boolean @NotNull [] Indicators
      Indicator_Type.
      private boolean Indirect
      Currently indirect addressing is active
      private static short Internal_Steps_High
      The memory from 10000 .. 10022 is used internally. 10023 is reserved as stop marker.
      (package private) static short Internal_Steps_Low
      The memory from 10000 .. 10023 is used internally.
      private int IO_Count
      Number of virtual CPU cycles until next IO run.
      private int Key_Buffer
      last key pressed
      private boolean Key_Flag
      a key was pressed
      private @NotNull Keyboard @NotNull [] Key_Operations
      Operations as they come from the keyboard.
      private long Key_Time
      System time when last Key was clicked or the last PAUSE started.
      private static @NotNull String Keyboard_Error
      Error Message displayed on using the wrong keyboard mode!
      private @NotNull L_Register @NotNull [] L
      The L-Register are used for general calculations.
      static String L_CHANGED
      The L or A register where changed.
      static int L_Count
      Amount of L Register
      (package private) int L_Used
      Amount of L Register used
      static int L_X
      L [0] is also the X register.
      (package private) static int L_Y
      L [1] is also the Y register.
      private Calculator.Indicator_Type Last_Comp_Mode
      the last comp mode used.
      private L_Register.Operation_Type Last_Operation
      Last operation chosen by user - used for the K option.
      private static Logger Logger
      class Logger instance
      private @Nullable Number @NotNull [] M
      The M-Register are used for general data storage.
      static String M_CHANGED
      An M or MF register has changed.
      static int M_Count
      Amount of M Register
      (package private) static int M_n
      M [9] is also the statistical register n.
      (package private) static int M_Sx
      M [8] is also the statistical register Σx.
      (package private) static int M_Sx2
      M [7] is also the statistical register Σx².
      (package private) @Nullable Keyboard Merge_Key
      Key Operations which currently merged to a Calculator operation.
      private @Nullable IProgrammable_Operation Merge_Token
      Multi Keystroke Operation like Alpha, Degree, Eng, Save, Load in progress
      (package private) @NotNull IProgrammable_Operation @NotNull [] Merged_Operations
      Operations as they executed by the calculator.
      private @Nullable Number @NotNull [] MF
      The MF-Register are used for special data storage.
      static @NotNull Calculator.Program_Type Null_Program
      no program
      (package private) static int Null_Return
      The memory from 1000 .. 1022 is used internally. 1023 is reserved as stop marker - which is also used as a null value on the program and hlt stack.
      private static short @NotNull [] Null_Steps
      Do not display the steps.
      private static short @NotNull [] Off_Text
      Text to display when ( is pressed
      private static int P1x_Info_Character  
      private static short @NotNull [] Parenthesis_Text
      Text to display when ( is pressed
      private int Program_Counter
      Current Program counter .
      (package private) int @NotNull [] Program_Stack
      Program stack used for GSB commands .
      private int Program_Stack_Pointer
      Program stack poiunter used for GSB commands .
      private int Program_Store
      Where to store the next merged operations.
      private PropertyChangeSupport propertyChangeSupport
      Handle property changes.
      (package private) boolean Realistic_Speed
      Run calculator with realistic speed - just about as fast as the original.
      static int Row_Numeric
      Numeric / Lower Row.Convenience and performance constants — so we don't have to go thou the enum for constant access
      static int Row_Steps
      The 4 Steps charactersConvenience and performance constants — so we don't have to go though the enum for constant access<
      static int Row_Text
      Text / Upper RowConvenience and performance constants — so we don't have to go though the enum for constant access<
      (package private) Serial RS232
      A simulated serial Interface
      private Serial Serial
      A simulated RS232
      private net.sourceforge.uiq3.calculator.IService Service
      Canvas class where we display our result or get our keycodes
      static int Stack_Count
      deeps of the program stack.
      static String STATUS_CHANGED
      Program or program counter where changes where changed.
      static String STEP_CHANGED
      Program or program counter where changes where changed.
      private short @NotNull [] Steps
      Calculator Program Memory
      private static int Steps_Between_IO  
      static int Steps_Count
      Amount of Steps.
      private short @NotNull [] Steps_Text
      The text to display in the steps field.
      private static String TAG
      class Logger tag.
      private Calculator.Token_Plane_Type Token_Plane
      Active plane: 0 Keyboard_Normal 1 $2B: Memory + 20, Fix instead of RND 2 $2C: Memory + 40 3 $2D: Memory + 60 4 $2F: Memory + 80 5 $EA: P1_ 6 $EB: ExFn Plane
      static short User_Steps_High
      The memory from 0 .. 9998 (9999 steps) is available to user programs. 9999 is reserved as stop marker
      (package private) static short User_Steps_Low
      The memory from 0 .. 9998 (9999 steps) is available for user programs.
      • Fields inherited from interface net.sourceforge.uiq3.calculator.ICalculator

        Companion
    • Constructor Summary

      Constructors 
      Constructor Description
      Calculator()
      just testing the Logger.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @NotNull A_Register A​(net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType Register)
      The A Register contains the Keyboard_Alpha data of the display.
      net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType A_Active​(@NotNull Calculator.Row_Type Row)
      Active A register for row.
      void A_Active​(@NotNull Calculator.Row_Type Row, net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType A)
      Active A register for row.
      private short @NotNull [] A_Text_To_Display()
      A_Text to be displayed.
      private void Add_Debug_Info​(int Position, short[] Retval)  
      private void Add_Steps​(int Steps)
      Add step count to text field
      void addPropertyChangeListener​(@NotNull String propertyName, PropertyChangeListener listener)
      Add a PropertyChangeListener for a specific property.
      void addPropertyChangeListener​(PropertyChangeListener listener)
      Add a PropertyChangeListener to the listener list.
      (package private) void Alpha_Mode​(boolean Alpha_Mode)
      Checks if the calculator is in Alpha mode by checking merged operation (when execution programms the alpha indicator is not set).
      private void ARegister_Display_Value_Changed​(PropertyChangeEvent event)  
      (package private) void BaseN​(Calculator.Indicator_Type Mode)
      activate or deactivate base n mode.
      void Clear​(boolean AC)
      Clean Calculator
      boolean Constant_Mode()
      Current mode
      (package private) void Constant_Mode​(boolean Constant_Mode)
      Current mode
      (package private) @NotNull Calculator.Program_Type Current_Program()  
      (package private) void Current_Program​(@NotNull Calculator.Program_Type Current_Program)  
      (package private) void Decrement_Program_Store()
      Decrement where to store the next merged operations.
      (package private) void Display_A​(Calculator.Row_Type Row, net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType Register)
      Display A register in given row
      private void Display_Error​(short @NotNull [] Text)
      Display an error message until C or AC is pressed.
      private void Display_Fatal​(short @NotNull [] Text)
      Display an error message until C or AC is pressed.
      private void Display_Message​(short @NotNull [] Text_0, short @NotNull [] Text_1)
      Display text as message
      private void Display_Program()
      Display program overview
      (package private) void Display_Program_Overview()
      Display program overview
      private void Display_Steps()
      Display Program Steps
      void displayClear()
      Clear all alpha register.
      void displayFormatted​(short @NotNull [] text)
      Display value as formatted text
      void displayKey​(short @NotNull [] text)
      * Display Key merge info.
      void displayL()
      Reset current value Display
      void displayMessage​(short @NotNull [] text)
      Display texts as dual line message
      (package private) void Enable_BaseN()
      enable Bin Mode
      private void Error_Reset()
      Brings the calculator into a defined state after an error condition.
      (package private) void Execute_Key​(short Opcode)
      Execute keyboard ob code
      private void Execute_Mode_IO()
      Handles the program I/O.
      private void Execute_Mode_Pcl()
      Handles the program clear, save and load.
      (package private) void Execute_Mode_Run()
      Handles running the calculator
      private void Execute_Mode_Wrt()
      Handles the program editing
      Tape FA6()
      A simulated cassette Interface
      (package private) void forceIO​(boolean resetKeyTime)
      Force IO Handling next round.
      void Form​(net.sourceforge.uiq3.ui.ICalculatorCanvas Form)
      Set Canvas to display result read keyboard
      Printer FP40()
      A simulated cassette Printer
      void Free_Steps()
      Add total amount of free steps to text;
      private short @NotNull [] Get_Program_Text​(boolean For_Debug)
      Display Program Steps
      short[] Get_Steps_Text()
      steps text
      net.sourceforge.uiq3.calculator.ICalculator.DisplayType getDisplayMode()
      Current display mode Display_Alpha Displays the content of the Alpha register. Display_L Displays the content of the L0 aka X register. Display_Formatted Displays the content of the L0 aka X register inside an alpha
      net.sourceforge.uiq3.calculator.ICalculator.DisplayType getDisplayMode​(Calculator.Row_Type Row)
      Current display mode Display_Alpha Displays the content of the Alpha register. Display_L Displays the content of the L0 aka X register. Display_Formmated Displays the content of the L0 aka X register inside an alpha
      @NotNull Calculator.Execution_Type getExecutionMode()
      Execution mode
      int getLastStep()
      locate the last step to display the free steps or for debugging.
      int getStackPointer()
      return current stack pointer
      @NotNull Number Half_Circle()
      convert an angle to Deg/Rad/Grad
      void Half_Circle​(@NotNull Number Half_Circle)
      convert an angle to Deg/Rad/Grad
      (package private) void Handle_IO()
      Display result and read keyboard
      private short[][] Handle_IO_HLT​(short[][] Text)
      Handles I/O for HLT and PAUSE mode
      private void Handle_IO_Mode_IO()
      Handles the IO in I/O mode
      private void Handle_IO_Mode_Pcl()
      Handles the IO in program-clear mode
      private void Handle_IO_Mode_Wrt()
      Handles I/O for program-write mode
      int Hlt_Position()
      Return Position for HLT Mode.
      (package private) void Hlt_Position​(int Hlt_Position)
      Return Position for HLT Mode.
      (package private) void Increment_Hlt_Position()
      Increment Current Program counter.
      (package private) void Increment_Program_Counter()
      Increment Current Program counter.
      (package private) void Increment_Program_Store()
      Increment where to store the next merged operations.
      void Init_A()
      Clears A-register
      void Init_Keycodes()
      Setup the keyboard
      void Init_L()
      Clears L-register
      (package private) void Init_M()
      Clears M-register.
      (package private) void Init_MF()
      Clears MF-register.
      void Init_Opcodes()
      Clears internal Memory
      private void Init_Program_Stack()
      init the GSB stack
      void Init_Steps()
      Clears Programm Steps
      (package private) boolean Is_2nd_Mode()
      2ndF Mode?
      boolean Is_Alpha​(int Step_Nr)
      check if Step "Nr" is an Alpha character
      (package private) boolean Is_Alpha_Mode()
      Alpha Mode?
      (package private) boolean Is_BaseN()
      Bin Mode?
      (package private) boolean Is_BaseN_B()
      Bin Mode?
      (package private) boolean Is_BaseN_D()
      Decimal Mode?
      (package private) boolean Is_BaseN_H()
      Hex Mode?
      (package private) boolean Is_BaseN_O()
      Oct Mode?
      (package private) boolean Is_End_Program​(int Position)
      check for end of program
      private boolean Is_Executing_Program()
      checks if we are running a program
      private boolean Is_HLT_Pause​(int Step_Nr)
      check if Step "Nr" is an Alpha character
      (package private) boolean Is_Mode()
      check if mode switch is active
      (package private) boolean Is_Program_Stack_Empty()
      Program stack used for GSB commands .
      (package private) boolean Is_Program_Stack_Full()
      Program stack used for GSB commands .
      (package private) boolean Is_Shift_Mode()
      Shift Mode?
      boolean Is_Shutdown()
      Calculator is not running - needed for end program.
      boolean isIndirect()  
      boolean isRunning()
      Calculator is running - needed for power saving.
      boolean isWaiting()
      is waiting in interactive mode for user input.
      Calculator.Keyboard_Mode Keyboard_Mode()
      Get current Keyboard mode
      (package private) void Keyboard_Mode​(Calculator.Keyboard_Mode Keyboard_Mode)
      set input mode
      @NotNull L_Register L​(int Register)  
      (package private) Calculator.Indicator_Type Last_Comp_Mode()
      the last comp mode used.
      (package private) L_Register.Operation_Type Last_Operation()  
      (package private) void Last_Operation​(L_Register.Operation_Type Last_Operation)  
      void load​(@NotNull String filename)
      Load the current status of the system
      private void Load_Status()
      Load the current status of the system
      @NotNull Number M​(int Register)
      The M-Register are used for general data storage.
      void M​(int Register, @NotNull Number M)
      The M-Register are used for general data storage.
      @Nullable Keyboard Merge_Key()
      Key Operations which currently merged to a Calculator operation.
      (package private) void Merge_Key​(@Nullable Keyboard Merge_Key)
      Key Operations which currently merged to a Calculator operation.
      @Nullable IProgrammable_Operation Merge_Token()
      Multi Keystroke Operation like Alpha, Degree, Eng, Save, Load in progress
      (package private) void Merge_Token​(@Nullable IProgrammable_Operation Merge_Token)
      Multi Keystroke Operation like Alpha, Degree, Eng, Save, Load in progress
      @NotNull IProgrammable_Operation Merged_Operations​(int Opcode)
      Operations as they executed by the calculator.
      @NotNull Number MF​(int Register)
      The MF-Register are used for special data storage.
      void MF​(int Register, Number MF)
      The MF-Register are used for special data storage.
      (package private) void Pop_L()
      Pop values from stack by triggering an calculation run up the the level Operation
      (package private) void Pop_L​(L_Register.Operation_Type Operation)
      Pop values from stack by triggering an calculation run up the the level Operation
      (package private) int Pop_Program_Stack()
      Program stack used for GSB commands .
      short Previous_Step​(int Step_Nr)
      get the previous step to a given step number or 255 when there is none.
      int Program_Counter()
      Get current Program counter.
      (package private) void Program_Counter​(int Program_Counter)
      Set Current Program counter.
      (package private) short Program_Position​(@NotNull Calculator.Program_Type Program)
      Return step-position of given program
      int Program_Store()
      get where to store the next merged operations.
      (package private) void Program_Store​(int Program_Store)
      Set where to store the next merged operations.
      private void Push_L()
      Push stack one down.
      (package private) void Push_L​(L_Register.Operation_Type Operation)
      Push value and given operation to stack. depending on what operation is used this might also trigger a calculation run.
      (package private) void Push_Program_Stack​(int Program_Counter)
      Program stack used for GSB commands .
      private void Remove_Steps()
      Remove step count from text field
      void removePropertyChangeListener​(@NotNull String propertyName, PropertyChangeListener listener)
      Remove a PropertyChangeListener for a specific property.
      void removePropertyChangeListener​(PropertyChangeListener listener)
      Remove a PropertyChangeListener from the listener list.
      void reset()
      Total Reset calculator.
      Serial RS232()
      A simulated cassette Interface
      void run()
      Start Calculator
      (package private) void Save_Status()
      Save the current status of the system
      boolean SecondF()
      check if 2ndF mode is active
      void Service​(net.sourceforge.uiq3.calculator.IService Service)
      Set Canvas to display result read keyboard
      (package private) void Set_Current_Program()
      Set Current program to programm at program counter
      (package private) void Set_Keyboard_No_Shift()
      reset shift indicators
      (package private) void Set_Mode​(boolean activate)
      activate or deactivate mode switch
      void setDisplayMode​(net.sourceforge.uiq3.calculator.ICalculator.DisplayType displayMode)
      Current display mode Display_Alpha Displays the content of the Alpha register. Display_L Displays the content of the L0 aka X register. Display_Formatted Displays the content of the L0 aka X register inside an alpha
      void setDisplayMode​(Calculator.Row_Type Row, net.sourceforge.uiq3.calculator.ICalculator.DisplayType Display_Mode)
      Current display mode Display_Alpha Displays the content of the Alpha register. Display_L Displays the content of the L0 aka X register. Display_Formatted Displays the content of the L0 aka X register inside an alpha
      (package private) void setExecutionMode​(@NotNull Calculator.Execution_Type Execution_Mode)
      Set new Execution mode
      void setIndirect​(boolean indirect)  
      boolean SHIFT()
      check is shift mode is active
      short Steps​(int Step)
      Calculator Program Memory
      void Steps​(int Step, short Value)
      Calculator Program Memory
      (package private) void Steps_Delete​(int Start, int End, int Skip)
      Calculator Program Memory
      void stop()  
      (package private) void Stop_Execution()
      Stop calculator executing an reset interactive mode.
      (package private) void Store_Operation​(short Opcode)
      Store an operation at into calculator memory
      short[] @Nullable [] Text_To_Display()
      Text to be displayed.
      Calculator.Token_Plane_Type Token_Plane()
      Active plane: 0 Keyboard_Normal 1 $2B: Memory + 20, Fix instead of RND 2 $2C: Memory + 40 3 $2D: Memory + 60 4 $2F: Memory + 80 5 $EA: P1_ 6 $EB: ExFn Plane
      (package private) void Token_Plane​(Calculator.Token_Plane_Type Token_Plane)
      Active plane: 0 Keyboard_Normal 1 Memory + 20, Fix instead of RND 2 Memory + 40 3 Memory + 60 4 Memory + 80 Programm + 10 ExFn
      @NotNull String toString()  
      (package private) void Write_Steps()
      Writes program steps to simulated cassette interface.
      (package private) boolean Wrt_Is_Alpha​(boolean For_Debug)
      check if - in wrt mode - we are currently in alpha mode.
      • Methods inherited from interface net.sourceforge.uiq3.calculator.ICalculator

        displayException, enableSaveEnergy, getPauseTime, getPauseWait, getRealisticSpeedWait, load, load, resetAll, save, save, save
    • Field Detail

      • STATUS_CHANGED

        public static final String STATUS_CHANGED
        Program or program counter where changes where changed. This flag is used by the debug calculator to notify debug panels.
        See Also:
        Constant Field Values
      • STEP_CHANGED

        public static final String STEP_CHANGED
        Program or program counter where changes where changed. This flag is used by the debug calculator to notify debug panels.
        See Also:
        Constant Field Values
      • M_CHANGED

        public static final String M_CHANGED
        An M or MF register has changed. This flag is used by the debug calculator to notify debug
        See Also:
        Constant Field Values
      • L_CHANGED

        public static final String L_CHANGED
        The L or A register where changed. This flag is used by the debug calculator to notify debug panels.
        See Also:
        Constant Field Values
      • Internal_Steps_High

        private static final short Internal_Steps_High
        The memory from 10000 .. 10022 is used internally. 10023 is reserved as stop marker.
      • Keyboard_Error

        @NotNull
        private static final @NotNull String Keyboard_Error
        Error Message displayed on using the wrong keyboard mode!
      • Logger

        private static final Logger Logger

        class Logger instance

      • Null_Steps

        private static final short @NotNull [] Null_Steps

        Do not display the steps.

      • Off_Text

        private static final short @NotNull [] Off_Text
        Text to display when ( is pressed
      • Parenthesis_Text

        private static final short @NotNull [] Parenthesis_Text
        Text to display when ( is pressed
      • TAG

        private static final String TAG

        class Logger tag.

      • Execution_Error

        @NotNull
        static final @NotNull String Execution_Error
        Error Message displayed on using the wrong execution mode!
      • Internal_Steps_Low

        static final short Internal_Steps_Low
        The memory from 10000 .. 10023 is used internally.
      • L_Y

        static final int L_Y
        L [1] is also the Y register.
      • M_Sx

        static final int M_Sx
        M [8] is also the statistical register Σx.
      • M_Sx2

        static final int M_Sx2
        M [7] is also the statistical register Σx².
      • M_n

        static final int M_n
        M [9] is also the statistical register n.
      • Null_Return

        static final int Null_Return
        The memory from 1000 .. 1022 is used internally. 1023 is reserved as stop marker - which is also used as a null value on the program and hlt stack.
      • User_Steps_Low

        static final short User_Steps_Low
        The memory from 0 .. 9998 (9999 steps) is available for user programs.
      • Display_Error

        @NotNull
        public static final @NotNull String Display_Error
        Error Message displayed on using the wrong display mode!
      • L_X

        public static final int L_X
        L [0] is also the X register.
      • Row_Numeric

        public static final int Row_Numeric

        Numeric / Lower Row.Convenience and performance constants — so we don't have to go thou the enum for constant access

        See Also:
        Constant Field Values
      • Row_Steps

        public static final int Row_Steps

        The 4 Steps charactersConvenience and performance constants — so we don't have to go though the enum for constant access<

        See Also:
        Constant Field Values
      • Row_Text

        public static final int Row_Text

        Text / Upper RowConvenience and performance constants — so we don't have to go though the enum for constant access<

        See Also:
        Constant Field Values
      • Stack_Count

        public static final int Stack_Count

        deeps of the program stack.

        See Also:
        Constant Field Values
      • Steps_Count

        public static final int Steps_Count

        Amount of Steps.

      • User_Steps_High

        public static final short User_Steps_High
        The memory from 0 .. 9998 (9999 steps) is available to user programs. 9999 is reserved as stop marker
      • A_Active

        @NotNull
        private final @NotNull net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType @NotNull [] A_Active
        Active A register for row. With Row 0
        A_Numeric
        Alpha register to enter and display numeric results.
        A_Text
        Alpha register to enter and display textual results.
        A_Message
        Alpha register to display messages.
        A_Key
        Alpha register to merge key operations.
      • Display_Mode

        @NotNull
        private final @NotNull net.sourceforge.uiq3.calculator.ICalculator.DisplayType @NotNull [] Display_Mode
        Current display mode
        Display_Alpha
        Displays the content of the Alpha register.
        Display_L
        Displays the content of the L0 aka X register.
        Display_Formated
        Displays the content of the L0 aka X register inside an alpha
      • Indicators

        private final boolean @NotNull [] Indicators
        Indicator_Type.
        Inv
        Keyboard in inverse move
        Hyp
        Keyboard in hyperbolic mode - also used for password entry
        K
        Constant calculation mode
        Hlt
        halted programm - also used for debugger
        Run
        Mode1, interactive or program run mode
        Wrt
        Mode2, write programms
        Pcl
        Mode3, clear, save, load programs.
        Deg
        Mode4, Tr
        Rad
        Mode5
        Gra
        Mode6
        Keyboard_Alpha
        Alpha entry and display mofe
      • Steps

        private final short @NotNull [] Steps
        Calculator Program Memory
      • A

        @NotNull
        private @NotNull A_Register @NotNull [] A

        The A Register contains the Keyboard_Alpha data of the display. There are two of them - one for input and one for temporary messages.

        Not null after Init_A

      • Calculator_Running

        private volatile boolean Calculator_Running
        Calculator is running - needed for power saving. If you are wondering why there is a Calculator_Running and and a Calculator_Shutdown - there is that little time between the calculator stop running and beeing full shutdown.
      • Calculator_Shutdown

        private volatile boolean Calculator_Shutdown
        Calculator is not running - needed for end program. If you are wondering why there is a Calculator_Running and and a Calculator_Shutdown - there is that little time between the calculator stop running and beeing full shutdown
      • Display_Enable

        private boolean Display_Enable
        Display enable - used to switch off the display so that intermediate result are not shown to the user.
      • Execution_Mode

        @NotNull
        private @NotNull Calculator.Execution_Type Execution_Mode
        Current Execution mode.
        Execution_Interactiv
        Calculator is used interactively.
        Execution_Running
        Calculator running a program.
        Execution_Halt
        Calculator debugging a program.
        Execution_Pause
        Calculator pauses for a sec.
        Execution_1_Step
        Do a single step and return to Execution_Halt.
        Calcluator is in write programm mode.
        Execution_Clear
        Calcluator is in clear memory mode.
        Execution_Alpha_Pause
        Initial pause when alpha starts scrolling.
      • Hlt_Position

        private int Hlt_Position
        Return Position for HLT Mode.
      • IO_Count

        private int IO_Count
        Number of virtual CPU cycles until next IO run.
      • Key_Buffer

        private int Key_Buffer
        last key pressed
      • Key_Flag

        private boolean Key_Flag
        a key was pressed
      • Key_Operations

        @NotNull
        private @NotNull Keyboard @NotNull [] Key_Operations

        Operations as they come from the keyboard.

        Not null after Init_Keycodes

      • Key_Time

        private long Key_Time
        System time when last Key was clicked or the last PAUSE started.
      • L

        @NotNull
        private @NotNull L_Register @NotNull [] L

        The L-Register are used for general calculations. There is a total of 12 register. L0 is also called X L1 is also called Y

        Not null after Init_L

      • Last_Comp_Mode

        private Calculator.Indicator_Type Last_Comp_Mode
        the last comp mode used. Needed to restore the mode on Mode-
      • M

        @Nullable
        private @Nullable Number @NotNull [] M
        The M-Register are used for general data storage.
      • MF

        @Nullable
        private @Nullable Number @NotNull [] MF
        The MF-Register are used for special data storage.
      • Merge_Token

        @Nullable
        private @Nullable IProgrammable_Operation Merge_Token
        Multi Keystroke Operation like Alpha, Degree, Eng, Save, Load in progress
      • Program_Counter

        private int Program_Counter
        Current Program counter .
      • Program_Stack_Pointer

        private int Program_Stack_Pointer
        Program stack poiunter used for GSB commands .
      • Program_Store

        private int Program_Store
        Where to store the next merged operations.
      • Serial

        @Nullable
        private Serial Serial
        A simulated RS232
      • Service

        @Nullable
        private net.sourceforge.uiq3.calculator.IService Service
        Canvas class where we display our result or get our keycodes
      • Realistic_Speed

        final boolean Realistic_Speed
        Run calculator with realistic speed - just about as fast as the original.
      • Steps_Text

        private short @NotNull [] Steps_Text

        The text to display in the steps field.

      • Token_Plane

        private Calculator.Token_Plane_Type Token_Plane
        Active plane:
        0
        Keyboard_Normal
        1
        $2B: Memory + 20, Fix instead of RND
        2
        $2C: Memory + 40
        3
        $2D: Memory + 60
        4
        $2F: Memory + 80
        5
        $EA: P1_
        6
        $EB: ExFn Plane
      • FA6

        @Nullable
        Tape FA6
        A simulated cassette Interface
      • FP40

        @Nullable
        Printer FP40
        A simulated Printer Printer
      • Form

        @Nullable
        net.sourceforge.uiq3.ui.ICalculatorCanvas Form
        Canvas class where we display our result or get our keycodes
      • Ignore_Clear

        boolean Ignore_Clear
        The last operation was one of the operations (+-) which disable the clear key.
      • Indirect

        private boolean Indirect
        Currently indirect addressing is active
      • L_Used

        int L_Used
        Amount of L Register used
      • Merge_Key

        @Nullable
        @Nullable Keyboard Merge_Key
        Key Operations which currently merged to a Calculator operation.
      • Merged_Operations

        @NotNull
        @NotNull IProgrammable_Operation @NotNull [] Merged_Operations

        Operations as they executed by the calculator.

        Not null after Init_Opcodes
      • propertyChangeSupport

        private final PropertyChangeSupport propertyChangeSupport
        Handle property changes. We don't use the full feature with oldValue and new newValue as that would be overkill.
      • Program_Stack

        int @NotNull [] Program_Stack
        Program stack used for GSB commands .
      • RS232

        @Nullable
        Serial RS232
        A simulated serial Interface
    • Constructor Detail

      • Calculator

        Calculator()
        just testing the Logger.
    • Method Detail

      • isIndirect

        public boolean isIndirect()
      • setIndirect

        public void setIndirect​(boolean indirect)
      • addPropertyChangeListener

        public void addPropertyChangeListener​(@NotNull
                                              PropertyChangeListener listener)
        Add a PropertyChangeListener to the listener list. The listener is registered for all properties. The same listener object may be added more than once, and will be called as many times as it is added. If listener is null, no exception is thrown and no action is taken.
        Specified by:
        addPropertyChangeListener in interface net.sourceforge.uiq3.IPropertyNotifier
        Parameters:
        listener - The PropertyChangeListener to be added
      • addPropertyChangeListener

        public void addPropertyChangeListener​(@NotNull
                                              @NotNull String propertyName,
                                              @NotNull
                                              PropertyChangeListener listener)
        Add a PropertyChangeListener for a specific property. The listener will be invoked only when a call on firePropertyChange names that specific property. The same listener object may be added more than once. For each property, the listener will be invoked the number of times it was added for that property.
        Specified by:
        addPropertyChangeListener in interface net.sourceforge.uiq3.IPropertyNotifier
        Parameters:
        propertyName - The name of the property to listen on.
        listener - The PropertyChangeListener to be added
        Since:
        1.2
      • removePropertyChangeListener

        public void removePropertyChangeListener​(@NotNull
                                                 PropertyChangeListener listener)
        Remove a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties. If listener was added more than once to the same event source, it will be notified one less time after being removed. If listener is null, or was never added, no exception is thrown and no action is taken.
        Specified by:
        removePropertyChangeListener in interface net.sourceforge.uiq3.IPropertyNotifier
        Parameters:
        listener - The PropertyChangeListener to be removed
      • removePropertyChangeListener

        public void removePropertyChangeListener​(@NotNull
                                                 @NotNull String propertyName,
                                                 @NotNull
                                                 PropertyChangeListener listener)
        Remove a PropertyChangeListener for a specific property. If `listener` was added more than once to the same event source for the specified property, it will be notified one less time after being removed.
        Specified by:
        removePropertyChangeListener in interface net.sourceforge.uiq3.IPropertyNotifier
        Parameters:
        propertyName - The name of the property that was listened on.
        listener - The PropertyChangeListener to be removed
        Since:
        1.2
      • ARegister_Display_Value_Changed

        private void ARegister_Display_Value_Changed​(PropertyChangeEvent event)
      • A

        @NotNull
        public final @NotNull A_Register A​(@NotNull
                                           net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType Register)

        The A Register contains the Keyboard_Alpha data of the display. There are four of them - one for input and three for messages.

      • A_Active

        @NotNull
        public net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType A_Active​(@NotNull
                                                                                      @NotNull Calculator.Row_Type Row)
        Active A register for row. With Row 0
        A_Numeric
        Alpha register to enter and display numeric results.
        A_Text
        Alpha register to enter and display textual results.
        A_Message
        Alpha register to display messages.
        A_Key
        Alpha register to merge key operations.
      • A_Active

        public void A_Active​(@NotNull
                             @NotNull Calculator.Row_Type Row,
                             @NotNull
                             net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType A)
        Active A register for row. With Row 0
        A_Numeric
        Alpha register to enter and display numeric results.
        A_Text
        Alpha register to enter and display textual results.
        A_Message
        Alpha register to display messages.
        A_Key
        Alpha register to merge key operations.
      • A_Text_To_Display

        private short @NotNull [] A_Text_To_Display()
        A_Text to be displayed. A_Text is not always shown but can is blanked out.
        Returns:
        Text to Display
      • Add_Debug_Info

        private void Add_Debug_Info​(int Position,
                                    short[] Retval)
      • Add_Steps

        private void Add_Steps​(int Steps)
        Add step count to text field
        Parameters:
        Steps - Steps to add to exponent
      • Alpha_Mode

        void Alpha_Mode​(boolean Alpha_Mode)
        Checks if the calculator is in Alpha mode by checking merged operation (when execution programms the alpha indicator is not set).
        Parameters:
        Alpha_Mode - new alpha mode
      • Clear

        public void Clear​(boolean AC)

        Clean Calculator

        Specified by:
        Clear in interface IClear
        Parameters:
        AC - true when AC (all clear) is requested.
        See Also:
        IClear.Clear(boolean)
      • Constant_Mode

        public final boolean Constant_Mode()
        Current mode
        Returns:
        current constant calculation mode
      • Constant_Mode

        final void Constant_Mode​(boolean Constant_Mode)
        Current mode
        Parameters:
        Constant_Mode - new constant calculation mode
      • Current_Program

        @NotNull
        @NotNull Calculator.Program_Type Current_Program()
        Returns:
        the current_Program, not null
      • Current_Program

        void Current_Program​(@NotNull
                             @NotNull Calculator.Program_Type Current_Program)
        Parameters:
        Current_Program - the current_Program to set
      • Decrement_Program_Store

        void Decrement_Program_Store()
        Decrement where to store the next merged operations.
      • Display_A

        void Display_A​(@NotNull
                       Calculator.Row_Type Row,
                       @NotNull
                       net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType Register)
        Display A register in given row
        Parameters:
        Row - row to display the A register in.
        Register - A register to display
      • displayClear

        public void displayClear()
        Clear all alpha register. And just calling "Clear" is not enough.
        Specified by:
        displayClear in interface net.sourceforge.uiq3.calculator.ICalculator
      • Display_Error

        private void Display_Error​(short @NotNull [] Text)
        Display an error message until C or AC is pressed.
        Parameters:
        Text - Test to be displayed
      • Display_Fatal

        private void Display_Fatal​(short @NotNull [] Text)
        Display an error message until C or AC is pressed.
        Parameters:
        Text - Test to be displayed
      • displayFormatted

        public void displayFormatted​(short @NotNull [] text)
        Display value as formatted text
        Specified by:
        displayFormatted in interface net.sourceforge.uiq3.calculator.ICalculator
        Parameters:
        text - to be displayed
      • displayKey

        public void displayKey​(short @NotNull [] text)
        * Display Key merge info.
        Specified by:
        displayKey in interface net.sourceforge.uiq3.calculator.ICalculator
        Parameters:
        text - info to be displayed
      • displayL

        public void displayL()
        Reset current value Display
        Specified by:
        displayL in interface net.sourceforge.uiq3.calculator.ICalculator
      • displayMessage

        public void displayMessage​(short @NotNull [] text)
        Display texts as dual line message
        Specified by:
        displayMessage in interface net.sourceforge.uiq3.calculator.ICalculator
        Parameters:
        text - to be displayed
      • Display_Message

        private void Display_Message​(short @NotNull [] Text_0,
                                     short @NotNull [] Text_1)
        Display text as message
        Parameters:
        Text_0 - Text 0 normally contains the alpha register (upper row)
        Text_1 - Text 1 normally contains the L register (lower row).
      • getDisplayMode

        @NotNull
        public net.sourceforge.uiq3.calculator.ICalculator.DisplayType getDisplayMode​(@NotNull
                                                                                      Calculator.Row_Type Row)
        Current display mode
        Display_Alpha
        Displays the content of the Alpha register.
        Display_L
        Displays the content of the L0 aka X register.
        Display_Formmated
        Displays the content of the L0 aka X register inside an alpha
        Returns:
        current display mode
      • getDisplayMode

        @NotNull
        public net.sourceforge.uiq3.calculator.ICalculator.DisplayType getDisplayMode()
        Current display mode
        Display_Alpha
        Displays the content of the Alpha register.
        Display_L
        Displays the content of the L0 aka X register.
        Display_Formatted
        Displays the content of the L0 aka X register inside an alpha
        Specified by:
        getDisplayMode in interface net.sourceforge.uiq3.calculator.ICalculator
        Returns:
        current display mode
      • setDisplayMode

        public void setDisplayMode​(@NotNull
                                   Calculator.Row_Type Row,
                                   @NotNull
                                   net.sourceforge.uiq3.calculator.ICalculator.DisplayType Display_Mode)
        Current display mode
        Display_Alpha
        Displays the content of the Alpha register.
        Display_L
        Displays the content of the L0 aka X register.
        Display_Formatted
        Displays the content of the L0 aka X register inside an alpha
        Parameters:
        Display_Mode - new display mode
      • setDisplayMode

        public void setDisplayMode​(@NotNull
                                   net.sourceforge.uiq3.calculator.ICalculator.DisplayType displayMode)
        Current display mode
        Display_Alpha
        Displays the content of the Alpha register.
        Display_L
        Displays the content of the L0 aka X register.
        Display_Formatted
        Displays the content of the L0 aka X register inside an alpha
        Specified by:
        setDisplayMode in interface net.sourceforge.uiq3.calculator.ICalculator
        Parameters:
        displayMode - new display mode
      • Display_Program

        private final void Display_Program()
        Display program overview
      • Display_Program_Overview

        void Display_Program_Overview()

        Display program overview

      • Display_Steps

        private void Display_Steps()
        Display Program Steps
      • Enable_BaseN

        void Enable_BaseN()
        enable Bin Mode
      • Error_Reset

        private void Error_Reset()
        Brings the calculator into a defined state after an error condition.
      • Execute_Key

        void Execute_Key​(short Opcode)
                  throws Error

        Execute keyboard ob code

        Parameters:
        Opcode - the key to execute
        Throws:
        Error - something went wrong.
      • Execute_Mode_IO

        private void Execute_Mode_IO()
                              throws Error
        Handles the program I/O.
        Throws:
        Error - General calculator error
      • Execute_Mode_Pcl

        private void Execute_Mode_Pcl()
                               throws Error
        Handles the program clear, save and load.
        Throws:
        Error - General calculator error
      • Execute_Mode_Run

        void Execute_Mode_Run()
                       throws Error
        Handles running the calculator
        Throws:
        Error - an error occurred while executing
      • Execute_Mode_Wrt

        private void Execute_Mode_Wrt()
        Handles the program editing
      • getExecutionMode

        @NotNull
        public @NotNull Calculator.Execution_Type getExecutionMode()
        Execution mode
        Returns:
        Execution_Interactiv
        Calculator is used interactively.
        Execution_Running
        Calculator running a program.
        Execution_Halt
        Calculator debugging a program.
        Execution_Pause
        Calculator pauses for a sec.
        Execution_1_Step
        Do a single step and return to Execution_Halt.
        Execution_Write
        Calcluator is in write program mode.
        Execution_Clear
        Calcluator is in clear memory mode.
        Execution_Alpha_Pause
        Initial pause when alpha starts scrolling.
      • setExecutionMode

        void setExecutionMode​(@NotNull
                              @NotNull Calculator.Execution_Type Execution_Mode)
        Set new Execution mode
        Parameters:
        Execution_Mode -
        Execution_Interactiv
        Calculator is used interactively.
        Execution_Running
        Calculator running a program.
        Execution_Halt
        Calculator debugging a program.
        Execution_Pause
        Calculator pauses for a sec.
        Execution_1_Step
        Do a single step and return to Execution_Halt.
        Execution_Write
        Calcluator is in write program mode.
        Execution_Clear
        Calcluator is in clear memory mode.
        Execution_Alpha_Pause
        Initial pause when alpha starts scrolling.
      • FA6

        @Nullable
        public final Tape FA6()
        A simulated cassette Interface
        Returns:
        FA-6 interface
      • FP40

        @Nullable
        public final Printer FP40()
        A simulated cassette Printer
        Returns:
        FP-10 Printer
      • forceIO

        void forceIO​(boolean resetKeyTime)
        Force IO Handling next round.
        Parameters:
        resetKeyTime - Reset keyboard as well.
      • Form

        public void Form​(@Nullable
                         net.sourceforge.uiq3.ui.ICalculatorCanvas Form)
        Set Canvas to display result read keyboard
        Parameters:
        Form - Formular where calculator is displayed in
      • Free_Steps

        public final void Free_Steps()
        Add total amount of free steps to text;
      • Get_Program_Text

        private short @NotNull [] Get_Program_Text​(boolean For_Debug)
        Display Program Steps
        Parameters:
        For_Debug - Show active program as well
        Returns:
        Debug Text
      • Get_Steps_Text

        @TestOnly
        public short[] Get_Steps_Text()

        steps text

        Returns:
        the current text shown in the 4 step digits.
      • Half_Circle

        @NotNull
        public final @NotNull Number Half_Circle()
        convert an angle to Deg/Rad/Grad
        Returns:
        angle in Deg/Rad/Grad.
      • Half_Circle

        public final void Half_Circle​(@NotNull
                                      @NotNull Number Half_Circle)
        convert an angle to Deg/Rad/Grad
        Parameters:
        Half_Circle - new Half circle to use
      • Handle_IO

        void Handle_IO()
                throws Error
        Display result and read keyboard
        Throws:
        Error
      • Handle_IO_HLT

        private short[][] Handle_IO_HLT​(short[][] Text)
                                 throws Error

        Handles I/O for HLT and PAUSE mode

        Throws:
        Error
      • Handle_IO_Mode_IO

        private void Handle_IO_Mode_IO()
                                throws Error
        Handles the IO in I/O mode
        Throws:
        Error
      • Handle_IO_Mode_Pcl

        private void Handle_IO_Mode_Pcl()
                                 throws Error
        Handles the IO in program-clear mode
        Throws:
        Error
      • Handle_IO_Mode_Wrt

        private void Handle_IO_Mode_Wrt()
        Handles I/O for program-write mode
      • Hlt_Position

        public int Hlt_Position()
        Return Position for HLT Mode.
        Returns:
        current halt position
      • Hlt_Position

        void Hlt_Position​(int Hlt_Position)
        Return Position for HLT Mode.
        Parameters:
        Hlt_Position - new halt position
      • Increment_Hlt_Position

        void Increment_Hlt_Position()
        Increment Current Program counter.
      • Increment_Program_Counter

        void Increment_Program_Counter()
        Increment Current Program counter.
      • Increment_Program_Store

        void Increment_Program_Store()
        Increment where to store the next merged operations.
      • Init_A

        public void Init_A()
        Clears A-register
      • Init_Keycodes

        public void Init_Keycodes()
        Setup the keyboard
      • Init_L

        public void Init_L()
        Clears L-register
      • Init_M

        void Init_M()
             throws OutOfMemoryError
        Clears M-register. The M-Register are used for general data storage. throws OutOfMemoryError not much we can do without memory
        Throws:
        OutOfMemoryError
      • Init_MF

        void Init_MF()
        Clears MF-register. The MF-register are used for special data storage.
      • Init_Opcodes

        public void Init_Opcodes()
        Clears internal Memory
      • Init_Program_Stack

        private void Init_Program_Stack()
        init the GSB stack
      • Init_Steps

        public void Init_Steps()
        Clears Programm Steps
      • Is_2nd_Mode

        boolean Is_2nd_Mode()
        2ndF Mode?
        Returns:
        true when 2ndF is active
      • Is_Alpha

        public boolean Is_Alpha​(int Step_Nr)
        check if Step "Nr" is an Alpha character
        Parameters:
        Step_Nr - Step to test
        Returns:
        true if we are writing alpha characters
      • Is_Alpha_Mode

        boolean Is_Alpha_Mode()
        Alpha Mode?
        Returns:
        true when Alpha is activ
      • Is_BaseN

        boolean Is_BaseN()
        Bin Mode?
        Returns:
        true when Base-N Binary is active
      • Is_BaseN_B

        boolean Is_BaseN_B()
        Bin Mode?
        Returns:
        true when Base-N Binary is active
      • Is_BaseN_D

        boolean Is_BaseN_D()
        Decimal Mode?
        Returns:
        true when Base-N Decimal is active
      • Is_BaseN_H

        boolean Is_BaseN_H()
        Hex Mode?
        Returns:
        true when Base-N Hexdezimal is active
      • Is_BaseN_O

        boolean Is_BaseN_O()
        Oct Mode?
        Returns:
        true when Base-N Octal is active
      • Is_End_Program

        final boolean Is_End_Program​(int Position)

        check for end of program

        Parameters:
        Position - postion to check
        Returns:
        True if Porsiton is the end of a program.
      • Is_Executing_Program

        private boolean Is_Executing_Program()
        checks if we are running a program
        Returns:
        true wen a program is running
      • Is_HLT_Pause

        private boolean Is_HLT_Pause​(int Step_Nr)
        check if Step "Nr" is an Alpha character
        Parameters:
        Step_Nr - Step to test
        Returns:
        true if we are writing alpha characters
      • Is_Mode

        boolean Is_Mode()

        check if mode switch is active

        Returns:
        true when a mode switch is active
      • Is_Program_Stack_Empty

        boolean Is_Program_Stack_Empty()
        Program stack used for GSB commands .
        Returns:
        true when stack is empty
      • Is_Program_Stack_Full

        boolean Is_Program_Stack_Full()
        Program stack used for GSB commands .
        Returns:
        true when stack us full
      • isRunning

        public boolean isRunning()
        Calculator is running - needed for power saving. If you are wondering why there is a Calculator_Running and and a Calculator_Shutdown - there is that little time between the calculator stop running and beeing full shutdown.
        Specified by:
        isRunning in interface net.sourceforge.uiq3.calculator.ICalculator
        Returns:
        true when calculator is running
        See Also:
        ICalculator.isRunning()
      • Is_Shift_Mode

        boolean Is_Shift_Mode()
        Shift Mode?
        Returns:
        true when shift is active
      • Is_Shutdown

        @TestOnly
        public final boolean Is_Shutdown()
        Calculator is not running - needed for end program. If you are wondering why there is a Calculator_Running and and a Calculator_Shutdown - there is that little time between the calculator stop running and being fully shutdown.
        Returns:
        when calculators is shut down
      • isWaiting

        public boolean isWaiting()
        is waiting in interactive mode for user input.
        Specified by:
        isWaiting in interface net.sourceforge.uiq3.calculator.ICalculator
        Returns:
        true when in interactive mode.
      • Keyboard_Mode

        @NotNull
        public final Calculator.Keyboard_Mode Keyboard_Mode()
        Get current Keyboard mode
        Returns:
        Keyboard_Normal
        Keyboard is in normal mode
        Keyboard_Inv
        Keyboard is in inverse mode
        Keyboard_Hyp
        Keyboard is in hyperbolic mode
        Keyboard_Inv_Hyp
        Keyboard is in inverse hyperbolic mode
        Keyboard_Alpha
        Keyboard is in alpha mode
        Keyboard_Inv_Alpha
        Keyboard is in inverse alpha mode
      • Keyboard_Mode

        void Keyboard_Mode​(@NotNull
                           Calculator.Keyboard_Mode Keyboard_Mode)
        set input mode
        Parameters:
        Keyboard_Mode - new input mode
      • L

        @NotNull
        public final @NotNull L_Register L​(int Register)
      • getLastStep

        public int getLastStep()

        locate the last step to display the free steps or for debugging.

        Specified by:
        getLastStep in interface net.sourceforge.uiq3.calculator.ICalculator
        Returns:
        last step
      • load

        public void load​(@NotNull
                         @NotNull String filename)
        Load the current status of the system
        Specified by:
        load in interface net.sourceforge.uiq3.calculator.ICalculator
      • Load_Status

        private void Load_Status()
        Load the current status of the system
      • M

        @NotNull
        public final @NotNull Number M​(int Register)
        The M-Register are used for general data storage.
        Parameters:
        Register - register to get
        Returns:
        a single M register
      • M

        public final void M​(int Register,
                            @NotNull
                            @NotNull Number M)
                     throws NullPointerException
        The M-Register are used for general data storage.
        Parameters:
        Register - register to get
        M - a single M register
        Throws:
        NullPointerException
      • MF

        @NotNull
        public final @NotNull Number MF​(int Register)
        The MF-Register are used for special data storage.
        Parameters:
        Register - register to get
        Returns:
        a single MF register
      • MF

        public final void MF​(int Register,
                             Number MF)
        The MF-Register are used for special data storage.
        Parameters:
        Register - register to get
        MF - a single MF register
      • Merge_Key

        @Nullable
        public @Nullable Keyboard Merge_Key()
        Key Operations which currently merged to a Calculator operation.
        Returns:
        currend key merged
      • Merge_Key

        void Merge_Key​(@Nullable
                       @Nullable Keyboard Merge_Key)
        Key Operations which currently merged to a Calculator operation.
        Parameters:
        Merge_Key - new key to merge
      • Merge_Token

        @Nullable
        public @Nullable IProgrammable_Operation Merge_Token()
        Multi Keystroke Operation like Alpha, Degree, Eng, Save, Load in progress
        Returns:
        current token merged
      • Merge_Token

        void Merge_Token​(@Nullable
                         @Nullable IProgrammable_Operation Merge_Token)
        Multi Keystroke Operation like Alpha, Degree, Eng, Save, Load in progress
        Parameters:
        Merge_Token - new token to merge
      • Merged_Operations

        @NotNull
        public final @NotNull IProgrammable_Operation Merged_Operations​(int Opcode)
        Operations as they executed by the calculator.
        Parameters:
        Opcode - operation to get
        Returns:
        a single operation
      • Pop_L

        void Pop_L()
        Pop values from stack by triggering an calculation run up the the level Operation
      • Pop_L

        void Pop_L​(@NotNull
                   L_Register.Operation_Type Operation)
            throws Error
        Pop values from stack by triggering an calculation run up the the level Operation
        Parameters:
        Operation - last operation requested by user
        Throws:
        Error - stack exhausted
      • Pop_Program_Stack

        int Pop_Program_Stack()
        Program stack used for GSB commands .
        Returns:
        current programm stack
      • Previous_Step

        public short Previous_Step​(int Step_Nr)

        get the previous step to a given step number or 255 when there is none.

        Parameters:
        Step_Nr - step number to get
        Returns:
        previous step or 255 when there is none
      • Program_Counter

        public int Program_Counter()
        Get current Program counter.
        Returns:
        Current Program counter.
      • Program_Counter

        void Program_Counter​(int Program_Counter)
        Set Current Program counter.
        Parameters:
        Program_Counter - new position
      • Program_Position

        short Program_Position​(@NotNull
                               @NotNull Calculator.Program_Type Program)
        Return step-position of given program
        Parameters:
        Program - program we search
        Returns:
        program step
      • Program_Store

        public int Program_Store()
        get where to store the next merged operations.
        Returns:
        where the next merged operations is stored.
      • Program_Store

        void Program_Store​(int Program_Store)
        Set where to store the next merged operations.
        Parameters:
        Program_Store - new position
      • Push_L

        private void Push_L()
                     throws Error
        Push stack one down.
        Throws:
        P_Error - I/O Error
        Error
      • Push_L

        void Push_L​(@NotNull
                    L_Register.Operation_Type Operation)
             throws Error
        Push value and given operation to stack. depending on what operation is used this might also trigger a calculation run.
        Parameters:
        Operation - last operation requested by user
        Throws:
        P_Error - "() Error" - Stack exhausted
        Error - stack exhausted
      • Push_Program_Stack

        void Push_Program_Stack​(int Program_Counter)
        Program stack used for GSB commands .
        Parameters:
        Program_Counter - New program counter
      • RS232

        @Nullable
        public final Serial RS232()
        A simulated cassette Interface
        Returns:
        FA-6 interface
      • Remove_Steps

        private void Remove_Steps()
        Remove step count from text field
      • reset

        public void reset()
        Total Reset calculator.
        Specified by:
        reset in interface net.sourceforge.uiq3.calculator.ICalculator
        See Also:
        ICalculator.reset()
      • SHIFT

        public boolean SHIFT()

        check is shift mode is active

        Returns:
        true for Keyboard_Mode.Shift, Keyboard_Mode.Shift_BaseN and Keyboard_Mode.Shift_Hyp
      • Save_Status

        void Save_Status()
        Save the current status of the system
      • SecondF

        public boolean SecondF()

        check if 2ndF mode is active

        Returns:
        true for Keyboard_Mode.Second Keyboard_Mode.Second_BaseN and Keyboard_Mode.Second_Hyp
      • Service

        public void Service​(@Nullable
                            net.sourceforge.uiq3.calculator.IService Service)
        Set Canvas to display result read keyboard
        Parameters:
        Service - Service executing the calculator
      • Set_Current_Program

        void Set_Current_Program()
        Set Current program to programm at program counter
      • Set_Keyboard_No_Shift

        void Set_Keyboard_No_Shift()

        reset shift indicators

      • Set_Mode

        void Set_Mode​(boolean activate)

        activate or deactivate mode switch

        Parameters:
        activate - true = activate Mode switch
      • getStackPointer

        public int getStackPointer()
        return current stack pointer
        Returns:
        stack pointer
      • Steps

        public final short Steps​(int Step)
        Calculator Program Memory
        Parameters:
        Step - Step to get
        Returns:
        a single Step
      • Steps

        public final void Steps​(int Step,
                                short Value)
        Calculator Program Memory
        Parameters:
        Step - Step to set
        Value - a single Step
      • Steps_Delete

        final void Steps_Delete​(int Start,
                                int End,
                                int Skip)

        Calculator Program Memory

        Parameters:
        Start - Start of move
        End - End of move
        Skip - Byte to remove
      • Stop_Execution

        void Stop_Execution()
        Stop calculator executing an reset interactive mode.
      • Store_Operation

        void Store_Operation​(short Opcode)
                      throws M_Error
        Store an operation at into calculator memory
        Parameters:
        Opcode - Opcode to be stored
        Throws:
        M_Error - Calculator memory exhausted
      • Text_To_Display

        public short[] @Nullable [] Text_To_Display()
                                             throws Error
        Text to be displayed. Depends on the active register, current display and execution modes.
        Returns:
        Text to Display
        Throws:
        Error
      • Token_Plane

        public Calculator.Token_Plane_Type Token_Plane()
        Active plane:
        0
        Keyboard_Normal
        1
        $2B: Memory + 20, Fix instead of RND
        2
        $2C: Memory + 40
        3
        $2D: Memory + 60
        4
        $2F: Memory + 80
        5
        $EA: P1_
        6
        $EB: ExFn Plane
        Returns:
        current token plane
      • Token_Plane

        void Token_Plane​(Calculator.Token_Plane_Type Token_Plane)
        Active plane:
        0
        Keyboard_Normal
        1
        Memory + 20, Fix instead of RND
        2
        Memory + 40
        3
        Memory + 60
        4
        Memory + 80
        Programm + 10
        ExFn
        Parameters:
        Token_Plane - new token plane
      • Write_Steps

        void Write_Steps()
                  throws Op_Error
        Writes program steps to simulated cassette interface.
        Throws:
        Op_Error - any kind of IO error
      • Wrt_Is_Alpha

        boolean Wrt_Is_Alpha​(boolean For_Debug)
        check if - in wrt mode - we are currently in alpha mode.
        Parameters:
        For_Debug - debug mode
        Returns:
        true if we are writing alpha characters
      • run

        public final void run()
        Start Calculator
        Specified by:
        run in interface net.sourceforge.uiq3.calculator.ICalculator
        Specified by:
        run in interface Runnable
        See Also:
        ICalculator.run()
      • stop

        public void stop()
        Specified by:
        stop in interface net.sourceforge.uiq3.calculator.ICalculator
        See Also:
        ICalculator.stop()
      • toString

        @TestOnly
        @NotNull
        public @NotNull String toString()
        Overrides:
        toString in class Object