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

      • TAG

        private static final String TAG

        class logger tag.

      • logger

        private static final Logger logger

        class logger instance

    • Constructor Detail

      • Desktop_Calculator

        public Desktop_Calculator()
    • 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 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()
                           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