예제 #1
0
        public override byte tick(byte scancode)
        {
            RPN_Functions _rpnf = _parent.getFunctions();

            if (!_parent._m_backgroundWorker.IsBusy)
            {
                return(_rpnf.requestNextReceiver("AUTO_N"));
            }
            if (scancode == 8)
            {
                _parent._m_backgroundWorker.CancelAsync();
                return(0);
            }
            TimeSpan ts = DateTime.Now.Subtract(_lastUIUpdate);
            bool     update_required = ts.TotalMilliseconds > KBD_RUNNING_DELAY;

            if (!update_required)
            {
                return(0);
            }
            LCD_Manager lm = _parent.getLCD();

            lm.updateStatusPC(_rpnf.progMem.getCounter());
            lm.updateStatusMC(_rpnf.extMem.getCounter());
            lm.updateCalcRegister(0, _rpnf.rpnStack.X.toString());
            lm.requestUpdate();
            _lastUIUpdate = DateTime.Now;
            return(0);
        }
예제 #2
0
        protected virtual byte _mode2_Tick(byte scancode)
        {
            RPN_Functions _rpnf = _parent.getFunctions();

            switch (scancode)
            {
            case 0:
                return(0);

            case 31:
                completeEntry(toString());
                return(_rpnf.requestNextReceiver(_return_to));

            case 32:
                return(_rpnf.requestNextReceiver(_return_to));

            case 33:
                _rpnf.requestNextReceiver(_return_to);
                return(33);

            default:
                _mode = _Text;
                break;
            }
            return(scancode);
        }
예제 #3
0
        protected override void completeEntry(string value)
        {
            RPN_Functions _rpnf   = _parent.getFunctions();
            string        tmpName = _rpnf.formFileName(value);

            _rpnf.execute(RPN_Functions.FUNC_MKDIR, value);
            _parent.getFunctions().requestNextReceiver(_return_to);
            return;
        }
예제 #4
0
        private void fontToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (myRPN.current_Receiver.Moniker == "AUTO_R")
            {
                return;
            }
            RPN_Functions fn = _stopIfRunning();

            fn.requestNextReceiver("FontTest");
            myRPN.tick();
            timer1.Enabled = true;
        }
예제 #5
0
        private void dataLoad_Click(object sender, EventArgs e)
        {
            RPN_Functions fn   = _stopIfRunning();
            string        name = myRPN.getSD().getFolderName();

            openFileDialog2.InitialDirectory = name;
            openFileDialog2.FileName         = "";
            if (openFileDialog2.ShowDialog() == DialogResult.OK)
            {
                fn.loadData(openFileDialog2.FileName);
            }
            timer1.Enabled = true;
        }
예제 #6
0
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            RPN_Functions _rpnf = myRPN.getFunctions();

            while (!backgroundWorker1.CancellationPending)
            {
                _rpnf.executeRun();
                if (_rpnf._atStop)
                {
                    break;
                }
            }
        }
예제 #7
0
        private void programSaveAs_Click(object sender, EventArgs e)
        {
            RPN_Functions fn   = _stopIfRunning();
            string        name = myRPN.getSD().getWindowsFolderName();

            saveFileDialog1.InitialDirectory = name;
            saveFileDialog1.FileName         = "";
            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                fn.saveProgram(saveFileDialog1.FileName);
            }
            timer1.Enabled = true;
        }
예제 #8
0
        private RPN_Functions _stopIfRunning()
        {
            RPN_Functions fn = myRPN.getFunctions();

            if (myRPN.current_Receiver.Moniker != "AUTO_R")
            {
                return(fn);
            }
            timer1.Enabled = false;
            backgroundWorker1.CancelAsync();
            //fn.requestNextReceiver("AUTO_N");
            //myRPN.tick();
            return(fn);
        }
        protected override void completeEntry(string value)
        {
            RPN_Functions _rpnf = _parent.getFunctions();

            if (value.Length == 0)
            {
                _rpnf.execute(RPN_Functions.FUNC_A_M2X);
                _rpnf.extMem.decrementCounter();
            }
            else
            {
                _rpnf.execute(RPN_Functions.FUNC_A_M2X, value);
            }
        }
예제 #10
0
        public override byte tick(byte scancode)
        {
            RPN_Functions _rpnf = _parent.getFunctions();

            switch (scancode)
            {
            case 0:     // keyboard inactive
                return(0);

            // Column 0
            case 1:
                return(_rpnf.requestNextReceiver("FILE_FK"));

            case 3:
                return(_rpnf.requestNextReceiver("FILE_A"));

            // Column 1 does nothing (for now)

            // Column 2
            case 9:
                _rpnf.execute(RPN_Functions.FUNC_LOADALL);
                return(_rpnf.requestNextReceiver("AUTO_N"));

            case 10:
                return(_rpnf.requestNextReceiver("File_Overwrite_All"));

            case 12:
                return(_rpnf.requestNextReceiver("File_All"));

            // Column 3 does nothing (for now)
            // Column 4 does nothing (for now)
            // Column 5 does nothing (for now)
            // Column 6 does nothing (for now)

            // Column 7
            case 32:
                return(_rpnf.requestNextReceiver("Prog_Erase", "PROG_N"));

            case 33:
                // Shutdown signal
                _rpnf.requestNextReceiver("FILE_N");
                return(33);

            default:     // all other buttons do nothing, keeping K-mode
                return(0);
            }
            //return _rpnf.requestNextReceiver("FILE_N");
        }
예제 #11
0
        public override byte tick(byte scancode)
        {
            RPN_Functions _rpnf = _parent.getFunctions();
            char          c     = _convertButton(_AR_ButtonConversion, scancode);

            switch (c)
            {
            case 'e':     // entry completed
            case 'f':     // entry completed, action needed
                completeEntry(toTrimmedString());
                _rpnf.requestNextReceiver(_return_to);
                return((c == 'e') ? (byte)0 : scancode);

            case '0':
            case '1':
            case '2':
            case '3':
            case '4':
            case '5':
            case '6':
            case '7':
            case '8':
            case '9':
                _text.Remove(0, 1);
                _text.Append(c);
                if (_text[0] == ' ')
                {
                    break;
                }
                completeEntry(toTrimmedString());
                return(_rpnf.requestNextReceiver(_return_to));

            case 'c':     // erase
                _text.Remove(3, 1);
                _text.Insert(0, ' ');
                if (_text[3] != ' ')
                {
                    break;
                }
                completeEntry(toTrimmedString());
                return(_rpnf.requestNextReceiver(_return_to));

            default:
                break;
            }
            updateDisplay(toString());
            return(0);
        }
예제 #12
0
        private void programLoad_Click(object sender, EventArgs e)
        {
            RPN_Functions fn   = _stopIfRunning();
            string        name = myRPN.getSD().getWindowsFolderName();

            openFileDialog1.InitialDirectory = name;
            openFileDialog1.FileName         = "";
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                // Simulator - only (helps debugging!)
                FileInfo fi = new FileInfo(openFileDialog1.FileName);
                myRPN.getSD().setFolder_P(fi.DirectoryName);
                fn.loadProgram(fi.FullName);
                myRPN.current_Receiver.tick(0); // needed to redraw!
            }
            timer1.Enabled = true;
        }
예제 #13
0
 public override void execute(MK52_Host components, string command)
 {
     RPN_Functions   _rpnf = components._m_RPN_Functions;
     LCD_Manager     _lcd  = components._m_Hardware_LCD;
     RPN_Stack       _st   = components._m_RPN_Stack;
     Program_Memory  _pm   = components._m_Program_Memory;
     Extended_Memory _em   = components._m_Extended_Memory;
     //_lcd.updateStatus(_pm.getCounter(), _em.getCounter(), _st.getDModeName(), "RUN");
     //_lcd.updateCalcRegister(0, _st.X.toString());
     //_lcd.updateCalcLabel(0, _st.X_Label);
     //_lcd.updateCalcRegister(1, _st.Y.toString());
     //_lcd.updateCalcLabel(1, _st.Y_Label);
     //_lcd.updateCalcRegister(2, _st.Z.toString());
     //_lcd.updateCalcLabel(2, _st.Z_Label);
     //_lcd.updateCalcRegister(3, _st.T.toString());
     //_lcd.updateCalcLabel(3, _st.T_Label);
     //_lcd.requestUpdate();
 }
예제 #14
0
        public override byte tick(byte scancode)
        {
            RPN_Functions _rpnf = _parent.getFunctions();

            switch (scancode)
            {
            case 0:     // keyboard inactive
                return(0);

            // Column 0
            case 1:
                return(_rpnf.requestNextReceiver("DATA_F"));

            case 2:
                return(_rpnf.requestNextReceiver("DATA_K"));

            case 4:
                //_parent._m_RPN_Stack.toggleAngleMode();
                // return base.tick(0);
                return(0);

            // Column 1 does nothing (for now)
            // Column 2 does nothing (for now)
            // Column 3 does nothing (for now)
            // Column 4 does nothing (for now)

            // Column 5
            case 24:
                return(_rpnf.requestNextReceiver("FILE_N"));

            // Column 6 does nothing (for now)

            // Column 7
            case 32:
            case 33:
                _rpnf.requestNextReceiver("DATA_N");
                return(33);

            default:     // all other buttons do nothing, keeping A-mode
                return(0);
            }
            //return _rpnf.requestNextReceiver("DATA_N");
        }
예제 #15
0
        protected override void completeEntry(string value)
        {
            RPN_Functions _rpnf   = _parent.getFunctions();
            string        tmpName = _rpnf.formFileName(value);

            if (!UniversalValue._endsWith_P(value, _Ext))
            {
                tmpName += _Ext;
            }
            if (_rpnf.fileExists(tmpName))
            {
                _mode = _Overwrite;
                updateDisplay(toString());
                return;
            }
            _rpnf.saveData(tmpName);
            _parent.getFunctions().requestNextReceiver(_return_to);
            return;
        }
예제 #16
0
        public override byte tick(byte scancode)
        {
            RPN_Functions _rpnf = _parent.getFunctions();

            switch (scancode)
            {
            case 0:     // keyboard inactive
                return(0);

            // Column 0
            case 2:
                return(_rpnf.requestNextReceiver("AUTO_FK"));

            case 3:
                return(_rpnf.requestNextReceiver("AUTO_A"));

            case 4:
                _parent._m_RPN_Stack.toggleAngleMode();
                return(base.tick(0));

            // Column 7
            case 29:
                _parent._m_Hardware_KBD.LEDOn = true;
                break;

            case 30:
                _parent._m_Hardware_KBD.LEDOn = false;
                break;

            case 32:
                break;

            case 33:
                // Shutdown signal
                _rpnf.requestNextReceiver("AUTO_N");
                return(33);

            default:     // all other buttons do nothing, keeping FA-mode
                return(0);
            }
            return(_rpnf.requestNextReceiver("AUTO_N"));
        }
예제 #17
0
        public override byte tick(byte scancode)
        {
            RPN_Functions _rpnf = _parent.getFunctions();

            switch (scancode)
            {
            case 0:     // keyboard inactive
                return(0);

            // Column 0
            case 2:
                return(_rpnf.requestNextReceiver("PROG_K"));

            case 3:
                return(_rpnf.requestNextReceiver("PROG_FA"));

            case 4:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_DMOD_DEG);
                break;

            // Column 6
            case 27:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_POWYX);
                break;

            // Column 7
            case 32:
                // Clear FK mode
                return(_rpnf.requestNextReceiver("PROG_N"));

            case 33:
                // Shutdown signal
                _rpnf.requestNextReceiver("PROG_N");
                return(33);

            default:     // all other buttons do nothing, keeping FK-mode
                return(0);
            }
            _rpnf.progMem.incrementCounter();
            return(_rpnf.requestNextReceiver("PROG_N"));
        }
예제 #18
0
        public override byte tick(byte scancode)
        {
            RPN_Functions _rpnf = _parent.getFunctions();

            switch (scancode)
            {
            case 0:     // keyboard inactive
                return(0);

            // Column 0
            case 2:
                return(_rpnf.requestNextReceiver("AUTO_K"));

            case 3:
                return(_rpnf.requestNextReceiver("AUTO_FA"));

            case 4:
                _parent._m_RPN_Stack.toggleAngleMode();
                return(base.tick(0));

            // Column 6
            case 27:
                _rpnf.execute(RPN_Functions.FUNC_POWYX);
                break;

            // Column 7
            case 32:
                // Clear FK mode
                break;

            case 33:
                // Shutdown signal
                _rpnf.requestNextReceiver("AUTO_N");
                return(33);

            default:     // all other buttons do nothing, keeping FK-mode
                return(0);
            }
            return(_rpnf.requestNextReceiver("AUTO_N"));
        }
예제 #19
0
        public override byte tick(byte scancode)
        {
            RPN_Functions _rpnf = _parent.getFunctions();

            switch (scancode)
            {
            case 0:
                return(0);

            case 31:
                performAction();
                return(_rpnf.requestNextReceiver(_return_to));

            case 33:
                _rpnf.requestNextReceiver(_return_to);
                return(33);

            default:
                break;
            }
            return(_rpnf.requestNextReceiver(_return_to));
        }
예제 #20
0
        public override byte tick(byte scancode)
        {
            RPN_Functions _rpnf = _parent.getFunctions();
            char          c     = _convertButton(_RR_ButtonConversion, scancode);

            switch (c)
            {
            case (char)0:
                return(0);

            case 'f':     // entry completed, action needed
                _rpnf.requestNextReceiver(_return_to);
                return(scancode);

            case 'a':
                _text.Append("L0");
                break;

            case 'b':
                _text.Append("L1");
                break;

            case 'c':
                _text.Append("L2");
                break;

            case 'd':
                _text.Append("L3");
                break;

            default:
                _text.Append(c);
                break;
            }
            completeEntry(toString());
            return(_rpnf.requestNextReceiver(_return_to));
        }
예제 #21
0
        public override byte tick(byte scancode)
        {
            RPN_Functions _rpnf = _parent.getFunctions();

            switch (scancode)
            {
            case 0:     // keyboard inactive
                return(0);

            // Column 0
            case 1:
                return(_rpnf.requestNextReceiver("DATA_F"));

            case 2:
                return(_rpnf.requestNextReceiver("DATA_K"));

            case 3:
                return(_rpnf.requestNextReceiver("DATA_A"));

            case 4:
                // TODO: Insert mode
                //_parent._m_RPN_Stack.toggleAngleMode();
                // base.tick(0);
                return(0);

            // Column 1
            case 5:
                _rpnf.extMem.incrementCounter();
                break;

            case 6:
                _rpnf.extMem.decrementCounter();
                break;

            case 7:
                _rpnf.extMem.resetCounter();
                break;

            case 8:
                _rpnf.execute(RPN_Functions.FUNC_MEXTOX);
                _rpnf.extMem.incrementCounter();
                break;

            // Column 2
            case 9:
                // TODO
                return(_rpnf.requestNextReceiver("REGISTER_ME"));

            case 10:
                // TODO
                return(_rpnf.requestNextReceiver("REGISTER_EM"));

            case 11:
                return(_rpnf.requestNextReceiver("ADDRESS_MC", "DATA_N"));

            case 12:
                _rpnf.execute(RPN_Functions.FUNC_XTOMEX);
                _rpnf.extMem.incrementCounter();
                break;

            // Column 3-5 - number entry

            // Column 6
            case 25:
            case 26:
                break;

            case 27:
                _rpnf.execute(RPN_Functions.FUNC_MEMSWP);
                _rpnf.extMem.incrementCounter();
                break;

            // Column 7
            case 29:
            case 30:
                break;

            case 31:
                _rpnf.execute(RPN_Functions.FUNC_MEMSET,
                              _parent._m_RPN_Stack._DataEntry.ToString().Trim());
                _rpnf.extMem.incrementCounter();
                break;

            case 32:
                _parent._m_Extended_Memory.clearCurrent();
                _rpnf.extMem.incrementCounter();
                break;

            case 33:
                // Shutdown signal
                _rpnf.requestNextReceiver("OFF");
                return(33);

            default:     // all other buttons activate number entry
                _rpnf.requestNextReceiver("NUMBER_DATA");
                return(scancode);
            }
            return(base.tick(0));
        }
예제 #22
0
        public override byte tick(byte scancode)
        {
            RPN_Functions _rpnf = _parent.getFunctions();

            switch (scancode)
            {
            case 0:     // keyboard inactive
                return(0);

            // Column 0
            case 2:
                return(_rpnf.requestNextReceiver("PROG_FK"));

            case 3:
                return(_rpnf.requestNextReceiver("PROG_FA"));

            case 4:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_DMOD_DEG);
                break;

            // Column 1
            case 5:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_IFNOTLT0);
                return(_rpnf.requestNextReceiver("ADDRESS", "PROG_N"));

            case 6:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_IFNOTEQ0);
                return(_rpnf.requestNextReceiver("ADDRESS", "PROG_N"));

            case 7:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_IFNOTGE0);
                return(_rpnf.requestNextReceiver("ADDRESS", "PROG_N"));

            case 8:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_IFNOTNE0);
                return(_rpnf.requestNextReceiver("ADDRESS", "PROG_N"));

            // Column 2 does nothing (for now)
            case 9:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_L0);
                return(_rpnf.requestNextReceiver("ADDRESS", "PROG_N"));

            case 10:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_L1);
                return(_rpnf.requestNextReceiver("ADDRESS", "PROG_N"));

            case 11:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_L2);
                return(_rpnf.requestNextReceiver("ADDRESS", "PROG_N"));

            case 12:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_L3);
                return(_rpnf.requestNextReceiver("ADDRESS", "PROG_N"));

            // Column 3
            case 13:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_SIN);
                break;

            case 14:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_ARCSIN);
                break;

            case 15:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_EXP);
                break;

            case 16:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_10X);
                break;

            // Column 4
            case 17:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_COS);
                break;

            case 18:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_ARCCOS);
                break;

            case 19:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_LG);
                break;

            case 20:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_ROT);
                break;

            // Column 5
            case 21:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_TG);
                break;

            case 22:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_ARCTG);
                break;

            case 23:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_LN);
                break;

            case 24:
                return(_rpnf.requestNextReceiver("AUTO_N"));

            // Column 6
            case 25:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_SQRT);
                break;

            case 26:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_PI);
                break;

            case 27:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_POW);
                break;

            case 28:
                // PROG is already on
                return(_rpnf.requestNextReceiver("PROG_N"));

            // Column 7
            case 29:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_1X);
                break;

            case 30:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_X2);
                break;

            case 31:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_BX);
                break;

            case 32:
                // Clear F mode
                return(_rpnf.requestNextReceiver("PROG_N"));

            case 33:
                // Shutdown signal
                _rpnf.requestNextReceiver("PROG_N");
                return(33);

            default:     // all other buttons do nothing, keeping F-mode
                return(0);
            }
            _rpnf.progMem.incrementCounter();
            return(_rpnf.requestNextReceiver("PROG_N"));
        }
예제 #23
0
        public override byte tick(byte scancode)
        {
            RPN_Functions _rpnf = _parent.getFunctions();

            switch (scancode)
            {
            case 0:     // keyboard inactive
                return(0);

            // Column 0
            case 1:
                return(_rpnf.requestNextReceiver("PROG_F"));

            case 2:
                return(_rpnf.requestNextReceiver("PROG_K"));

            case 4:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_DMOD_GRD);
                break;

            // Column 1
            case 5:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_LBT);
                return(_rpnf.requestNextReceiver("TEXT", "PROG_N"));

            case 6:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_LBZ);
                return(_rpnf.requestNextReceiver("TEXT", "PROG_N"));

            case 7:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_LBY);
                return(_rpnf.requestNextReceiver("TEXT", "PROG_N"));

            case 8:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_LBX);
                return(_rpnf.requestNextReceiver("TEXT", "PROG_N"));

            // Column 2
            case 9:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_A_M2X);
                return(_rpnf.requestNextReceiver("ADDRESS", "PROG_N"));

            case 10:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_A_X2M);
                return(_rpnf.requestNextReceiver("ADDRESS", "PROG_N"));

            case 11:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_LBR);
                break;

            case 12:
                _rpnf.progMem.deleteLine();
                break;

            // Column 3
            case 16:
                _rpnf.progMem.commentLine();
                return(_rpnf.requestNextReceiver("TEXT", "PROG_N"));

            // Column 5
            case 22:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_D2RAD);
                break;

            case 23:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_MM2IN);
                break;

            case 24:
                return(_rpnf.requestNextReceiver("FILE_N"));

            // Column 6
            case 26:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_RAD2D);
                break;

            case 27:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_IN2MM);
                break;

            case 28:
                return(_rpnf.requestNextReceiver("DATA_N"));

            // Column 7
            case 31:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_SEED);
                break;

            case 32:
            case 33:
                _rpnf.requestNextReceiver("PROG_N");
                return(33);

            default:     // all other buttons do nothing, keeping A-mode
                return(0);
            }
            _rpnf.progMem.incrementCounter();
            return(_rpnf.requestNextReceiver("PROG_N"));
        }
예제 #24
0
        public override byte tick(byte scancode)
        {
            RPN_Functions _rpnf = _parent.getFunctions();

            switch (scancode)
            {
            case 0:     // keyboard inactive
                return(0);

            // Column 0
            case 1:
                return(_rpnf.requestNextReceiver("PROG_F"));

            case 3:
                return(_rpnf.requestNextReceiver("PROG_A"));

            case 4:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_DMOD_RAD);
                break;

            // Column 1
            case 5:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_IFNOTLTY);
                return(_rpnf.requestNextReceiver("ADDRESS", "PROG_N"));

            case 6:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_IFNOTEQY);
                return(_rpnf.requestNextReceiver("ADDRESS", "PROG_N"));

            case 7:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_IFNOTGEY);
                return(_rpnf.requestNextReceiver("ADDRESS", "PROG_N"));

            case 8:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_IFNOTNEY);
                return(_rpnf.requestNextReceiver("ADDRESS", "PROG_N"));

            // Column 2
            case 9:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_K_M2X);
                return(_rpnf.requestNextReceiver("REGISTER", "PROG_N"));

            case 10:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_K_X2M);
                return(_rpnf.requestNextReceiver("REGISTER", "PROG_N"));

            case 11:
                _rpnf.progMem.updateLine_P("# K-GOTO is bad!");
                break;

            case 12:
                _rpnf.progMem.updateLine_P("# K-GOSUB is bad!");
                break;

            // Column 3
            case 13:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_WHOLE);
                break;

            case 14:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_ABS);
                break;

            case 15:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_EE);
                break;

            case 16:
                _rpnf.progMem.commentLine();
                break;

            // Column 4
            case 17:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_FRAC);
                break;

            case 18:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_SIGN);
                break;

            case 19:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_LOG);
                break;

            case 20:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_AND);
                break;

            // Column 5
            case 21:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_MAX);
                break;

            case 22:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_DM2D);
                break;

            case 23:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_DMS2D);
                break;

            case 24:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_OR);
                break;

            // Column 6
            case 25:
                // TODO
                _rpnf.progMem.updateLine_P("#K-SQRT");
                break;

            case 26:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_D2DM);
                break;

            case 27:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_D2DMS);
                break;

            case 28:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_XOR);
                break;

            // Column 7
            case 29:
                // TODO
                _rpnf.progMem.updateLine_P("#K-1/X");
                break;

            case 30:
                // TODO
                _rpnf.progMem.updateLine_P("#K-X^2");
                break;

            case 31:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_RAND);
                break;

            case 32:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_NOT);
                break;

            case 33:
                // Shutdown signal
                _rpnf.requestNextReceiver("PROG_N");
                return(33);

            default:     // all other buttons do nothing, keeping K-mode
                return(0);
            }
            _rpnf.progMem.incrementCounter();
            return(_rpnf.requestNextReceiver("PROG_N"));
        }
예제 #25
0
        public override byte tick(byte scancode)
        {
            RPN_Functions _rpnf = _parent.getFunctions();

            switch (scancode)
            {
            case 0:     // keyboard inactive
                return(base.tick(0));

            // Column 0
            case 1:
                return(_rpnf.requestNextReceiver("AUTO_F"));

            case 2:
                return(_rpnf.requestNextReceiver("AUTO_K"));

            case 3:
                return(_rpnf.requestNextReceiver("AUTO_A"));

            case 4:
                _parent._m_RPN_Stack.toggleAngleMode();
                break;

            // Column 1
            case 5:
                _rpnf.progMem.incrementCounter();
                break;

            case 6:
                _rpnf.progMem.decrementCounter();
                break;

            case 7:
                _rpnf.progMem.resetCounter();
                break;

            case 8:
                return(_rpnf.requestNextReceiver("AUTO_R"));

            // Column 2
            case 9:
                return(_rpnf.requestNextReceiver("REGISTER_MX"));

            case 10:
                return(_rpnf.requestNextReceiver("REGISTER_XM"));

            case 11:
                return(_rpnf.requestNextReceiver("ADDRESS_PC"));

            case 12:
                _rpnf.executeStep();
                break;

            // Column 5
            case 24:
                _rpnf.execute(RPN_Functions.FUNC_NEGATE);
                break;

            // Column 6
            case 25:
                _rpnf.execute(RPN_Functions.FUNC_MINUS);
                break;

            case 26:
                _rpnf.execute(RPN_Functions.FUNC_PLUS);
                break;

            case 27:
                _rpnf.execute(RPN_Functions.FUNC_SWAP);
                break;

            // Column 7
            case 29:
                _rpnf.execute(RPN_Functions.FUNC_DIVIDE);
                break;

            case 30:
                _rpnf.execute(RPN_Functions.FUNC_MULTIPLY);
                break;

            case 31:
                _rpnf.execute(RPN_Functions.FUNC_ENTER);
                break;

            case 32:
                if (_parent._m_RPN_Stack.customLabels())
                {
                    _parent._m_RPN_Stack.resetLabels();
                }
                else
                {
                    _rpnf.execute(RPN_Functions.FUNC_CLEAR_X);
                }
                break;

            case 33:
                return(_rpnf.requestNextReceiver("OFF"));

            default:          // all other buttons activate number entry
                _rpnf.execute(RPN_Functions.FUNC_ENTER);
                base.tick(0); // redraw stack movement
                _rpnf.requestNextReceiver("NUMBER");
                return(scancode);
            }
            return(base.tick(0));
        }
예제 #26
0
        public override byte tick(byte scancode)
        {
            RPN_Functions _rpnf = _parent.getFunctions();

            switch (scancode)
            {
            case 0:     // keyboard inactive
                return(0);

            // Column 0
            case 2:
                return(_rpnf.requestNextReceiver("PROG_FK"));

            case 3:
                return(_rpnf.requestNextReceiver("PROG_A"));

            case 4:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_DMOD_DEG);
                break;

            // Column 1
            case 5:
                for (int i = 0; i < 9; i++)
                {
                    _rpnf.progMem.incrementCounter();
                }
                return(base.tick(0));

            case 6:
                for (int i = 0; i < 9; i++)
                {
                    _rpnf.progMem.decrementCounter();
                }
                return(base.tick(0));

            case 7:
                _rpnf.progMem.resetCounter();
                return(_rpnf.requestNextReceiver("PROG_N"));

            // Column 2
            case 11:
                return(_rpnf.requestNextReceiver("ADDRESS_PC", "PROG_N"));

            case 12:
                _rpnf.progMem.setCounterToBottom();
                return(_rpnf.requestNextReceiver("PROG_N"));

            // Column 6
            case 25:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_DELAY);
                return(_rpnf.requestNextReceiver("ADDRESS", "PROG_N"));

            case 26:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_UPDATE);
                break;

            // Column 7
            case 29:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_LEDON);
                break;

            case 30:
                _rpnf.appendProgramLine_P(RPN_Functions.FUNC_LEDOFF);
                break;

            case 31:
                _rpnf.progMem.updateLine(_rpnf.rpnStack.X.toString());
                break;

            case 32:
                // Clear FA mode
                return(_rpnf.requestNextReceiver("PROG_N"));

            case 33:
                // Shutdown signal
                _rpnf.requestNextReceiver("PROG_N");
                return(33);

            default:     // all other buttons do nothing, keeping FA-mode
                return(0);
            }
            _rpnf.progMem.incrementCounter();
            return(_rpnf.requestNextReceiver("PROG_N"));
        }
예제 #27
0
        public override byte tick(byte scancode)
        {
            RPN_Functions _rpnf = _parent.getFunctions();

            switch (scancode)
            {
            case 0:
                return(0);

            case 4:
                _mode++;
                if (_mode > _Number)
                {
                    _mode = _Text;
                }
                updateDisplay(toString());
                return(0);

            case 31:
                completeEntry(toString());
                return(_rpnf.requestNextReceiver(_return_to));

            case 32:
                if (_text.Length > 0)
                {
                    _text.Remove(_text.Length - 1, 1);
                }
                updateDisplay(toString());
                return(0);

            case 33:
                _rpnf.requestNextReceiver(_return_to);
                return(33);

            default:
                break;
            }

            char c = (char)0;

            switch (_mode)
            {
            case _Text:
                c = _convertButton(_RT_LetterConversion, scancode);
                break;

            case _Number:
                c = _convertButton(_RT_DigitConversion, scancode);
                break;

            default:
                break;
            }
            if (c == 0)
            {
                return(0);
            }
            if (_text.Length >= RPN_Functions.PROGRAM_LINE_LENGTH)
            {
                return(0);
            }
            _text.Append(c);
            updateDisplay(toString());
            return(0);
        }
예제 #28
0
        public override byte tick(byte scancode)
        {
            RPN_Functions _rpnf = _parent.getFunctions();

            switch (scancode)
            {
            case 0:     // keyboard inactive
                return(0);

            // Column 0
            case 1:
                return(_rpnf.requestNextReceiver("AUTO_FA"));

            case 2:
                return(_rpnf.requestNextReceiver("AUTO_K"));

            case 4:
                _parent._m_RPN_Stack.toggleAngleMode();
                return(base.tick(0));

            // Column 1
            case 5:
                _rpnf.extMem.incrementCounter();
                break;

            case 6:
                _rpnf.extMem.decrementCounter();
                break;

            case 7:
                _rpnf.extMem.resetCounter();
                break;

            case 8:
                return(0);

            // Column 2
            case 9:
                return(_rpnf.requestNextReceiver("ADDRESS_AMX"));

            case 10:
                return(_rpnf.requestNextReceiver("ADDRESS_AXM"));

            case 11:
                return(_rpnf.requestNextReceiver("ADDRESS_MC", "AUTO_N"));

            case 12:
                _rpnf.execute(RPN_Functions.FUNC_A_M2X);
                _rpnf.extMem.incrementCounter();
                break;

            // Column 3 does nothing
            // Column 4 does nothing

            // Column 5
            case 22:
                _rpnf.execute(RPN_Functions.FUNC_D2RAD);
                break;

            case 23:
                _rpnf.execute(RPN_Functions.FUNC_MM2IN);
                break;

            case 24:
                return(_rpnf.requestNextReceiver("FILE_N"));

            // Column 6
            case 25:
                // TODO
                _parent._m_RPN_Stack.setLabel_P(0, "A-SQRT is available!");
                break;

            case 26:
                _rpnf.execute(RPN_Functions.FUNC_RAD2D);
                break;

            case 27:
                _rpnf.execute(RPN_Functions.FUNC_IN2MM);
                break;

            case 28:
                return(_rpnf.requestNextReceiver("DATA_N"));

            // Column 7
            case 29:
                // TODO
                _parent._m_RPN_Stack.setLabel_P(0, "A-1/X is available!");
                break;

            case 30:
                // TODO
                _parent._m_RPN_Stack.setLabel_P(0, "A-X2 is available!");
                break;

            case 31:
                _rpnf.execute(RPN_Functions.FUNC_SEED);
                break;

            case 32:
            case 33:
                _rpnf.requestNextReceiver("AUTO_N");
                return(33);

            default:     // all other buttons do nothing, keeping A-mode
                return(0);
            }
            return(_rpnf.requestNextReceiver("AUTO_N"));
        }
예제 #29
0
        public override byte tick(byte scancode)
        {
            RPN_Functions _rpnf = _parent.getFunctions();

            switch (scancode)
            {
            case 0:     // keyboard inactive
                return(0);

            // Column 0
            case 1:
                return(_rpnf.requestNextReceiver("FILE_F"));

            case 2:
                return(_rpnf.requestNextReceiver("FILE_K"));

            case 3:
                return(_rpnf.requestNextReceiver("FILE_A"));

            // Column 1
            case 5:
                _parent.getSD().nextListingPosition();
                break;

            case 6:
                _parent.getSD().previousListingPosition();
                break;

            case 7:
                _parent.getSD().upFolder();
                break;

            case 8:
                _rpnf.stepIn();
                break;

            // Column 2
            case 9:
                _rpnf.execute(RPN_Functions.FUNC_LOAD);
                return(_rpnf.requestNextReceiver("PROG_N"));

            case 10:
                return(_rpnf.requestNextReceiver("File_Overwrite"));

            case 11:
                // find program TODO
                break;

            case 12:
                return(_rpnf.requestNextReceiver("File_Name"));

            // Column 3-5 - do nothing (for now)

            // Column 6
            case 28:
                return(_rpnf.requestNextReceiver("File_MkDir"));

            // Column 7
            case 31:
                _rpnf.stepIn();
                break;

            case 32:
                return(_rpnf.requestNextReceiver("File_Delete"));

            case 33:
                // Shutdown signal
                _rpnf.requestNextReceiver("OFF");
                return(33);

            default:     // all other buttons do nothing (for now)
                return(0);
            }
            return(base.tick(0));
        }
예제 #30
0
        public override byte tick(byte scancode)
        {
            RPN_Functions _rpnf = _parent.getFunctions();

            switch (scancode)
            {
            case 0:     // keyboard inactive
                return(0);

            // Column 0
            case 2:
                return(_rpnf.requestNextReceiver("AUTO_FK"));

            case 3:
                return(_rpnf.requestNextReceiver("AUTO_FA"));

            case 4:
                _parent._m_RPN_Stack.toggleAngleMode();
                return(base.tick(0));

            // Column 1 does nothing (for now)
            case 5:
            case 6:
            case 7:
            case 8:

            // Column 2 does nothing (for now)
            case 9:
            case 10:
            case 11:
            case 12:
                return(0);

            // Column 3
            case 13:
                _rpnf.execute(RPN_Functions.FUNC_SIN);
                break;

            case 14:
                _rpnf.execute(RPN_Functions.FUNC_ARCSIN);
                break;

            case 15:
                _rpnf.execute(RPN_Functions.FUNC_EXP);
                break;

            case 16:
                _rpnf.execute(RPN_Functions.FUNC_10X);
                break;

            // Column 4
            case 17:
                _rpnf.execute(RPN_Functions.FUNC_COS);
                break;

            case 18:
                _rpnf.execute(RPN_Functions.FUNC_ARCCOS);
                break;

            case 19:
                _rpnf.execute(RPN_Functions.FUNC_LG);
                break;

            case 20:
                _rpnf.execute(RPN_Functions.FUNC_ROT);
                break;

            // Column 5
            case 21:
                _rpnf.execute(RPN_Functions.FUNC_TG);
                break;

            case 22:
                _rpnf.execute(RPN_Functions.FUNC_ARCTG);
                break;

            case 23:
                _rpnf.execute(RPN_Functions.FUNC_LN);
                break;

            case 24:
                // AUTO is already on
                break;

            // Column 6
            case 25:
                _rpnf.execute(RPN_Functions.FUNC_SQRT);
                break;

            case 26:
                _rpnf.execute(RPN_Functions.FUNC_PI);
                break;

            case 27:
                _rpnf.execute(RPN_Functions.FUNC_POW);
                break;

            case 28:
                return(_rpnf.requestNextReceiver("PROG_N"));

            // Column 7
            case 29:
                _rpnf.execute(RPN_Functions.FUNC_1X);
                break;

            case 30:
                _rpnf.execute(RPN_Functions.FUNC_X2);
                break;

            case 31:
                _rpnf.execute(RPN_Functions.FUNC_BX);
                break;

            case 32:
                // Clear F mode
                break;

            case 33:
                // Shutdown signal
                _rpnf.requestNextReceiver("AUTO_N");
                return(33);

            default:     // all other buttons do nothing, keeping F-mode
                return(0);
            }
            return(_rpnf.requestNextReceiver("AUTO_N"));
        }