Class 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»
    • 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.
    • Constructor Detail

      • Desktop_Calculator

        public Desktop_Calculator()
    • 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 Error
        Handles running the calculator
        Overrides:
        Execute_Mode_Run in class Calculator
        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
      • 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