コード例 #1
0
        public override void activate(string prevReceiver)
        {
            base.activate(prevReceiver);
            if (prevReceiver.StartsWith("PROG"))
            {
                tick(0);
                return;
            }
            LCD_Manager    lm = _parent._m_Hardware_LCD;
            Program_Memory pm = _parent._m_Program_Memory;

            lm.clearScreen();
            lm.outputStatus(
                pm.getCounter(),
                _parent._m_Extended_Memory.getCounter(),
                pm.getEModeName(),
                "   ");
            int display_PC = (int)pm.getCounter();

            string[] _displayLines = pm.getPreviousLines(LCD_Manager.SCREEN_ROWS - 1);
            for (int i = 10, j = 0, k = display_PC; i >= 0; i--, j++, k--)
            {
                if (k < 0)
                {
                    lm.eraseTerminalLine((uint)i);
                    continue;
                }
                string s = k.ToString("0000");
                s += (k == display_PC) ? "> " : "  ";
                lm.outputTerminalLine((uint)i, s + _displayLines[j]);
            }
            lm.forcePaint();
        }
コード例 #2
0
        protected virtual void updateDisplay(string value)
        {
            LCD_Manager lm = _parent.getLCD();
            int         ln = value.Length - LCD_Manager.SCREEN_COLS + 1;

            lm.updateTerminalLine(LCD_Manager.SCREEN_ROWS - 2,
                                  (ln <= 0)? value: value.Substring(ln));
            switch (_mode)
            {
            case _Text:
                lm.updateStatusFMODE("TXT");
                lm.updateTerminalLine(LCD_Manager.SCREEN_ROWS - 3, _Question);
                break;

            case _Number:
                lm.updateStatusFMODE("NUM");
                lm.updateTerminalLine(LCD_Manager.SCREEN_ROWS - 3, _Question);
                break;

            default:
                lm.updateStatusFMODE("   ");
                lm.updateTerminalLine(LCD_Manager.SCREEN_ROWS - 3, _Confirmation);
                break;
            }
            lm.requestUpdate();
        }
コード例 #3
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);
        }
コード例 #4
0
        public override void activate(string prevReceiver)
        {
            base.activate(prevReceiver);
            if (prevReceiver.StartsWith("DATA"))
            {
                tick(0);
                return;
            }
            LCD_Manager     lm = _parent._m_Hardware_LCD;
            Extended_Memory em = _parent._m_Extended_Memory;

            lm.clearScreen();
            lm.outputStatus(
                _parent._m_Program_Memory.getCounter(),
                em.getCounter(),
                "MEM",
                "   ");
            int cnt = (int)em.getCounter();

            for (int i = 10, j = cnt; i >= 0; i--, j--)
            {
                string s = em.toString("", j);
                lm.outputTerminalLine((uint)i, s);
            }
            lm.forcePaint();
        }
コード例 #5
0
        public override void activate(string prevReceiver)
        {
            base.activate(prevReceiver);
            if (prevReceiver.StartsWith("FILE"))
            {
                tick(0);
                return;
            }
            LCD_Manager lm = _parent._m_Hardware_LCD;

            lm.clearScreen();
            lm.outputStatus(
                _parent._m_Program_Memory.getCounter(),
                _parent._m_Extended_Memory.getCounter(),
                "   ",
                "   ");

            string[] Lines = _parent._m_RPN_Functions.getOutputLines();
            _parent._m_Hardware_SD.getFolderListing(Lines, _nLinesShown, LCD_Manager.SCREEN_COLS - 1);
            for (int i = 0; i < _nLinesShown; i++)
            {
                lm.outputTerminalLine((uint)i, Lines[i]);
            }
            lm.forcePaint();
        }
コード例 #6
0
        protected override void updateDisplay(string value)
        {
            LCD_Manager lm = _parent.getLCD();

            lm.updateStatusMC(toString());
            lm.requestUpdate();
        }
コード例 #7
0
        protected virtual void updateDisplay(string value)
        {
            LCD_Manager   lm = _parent.getLCD();
            StringBuilder sb = new StringBuilder();

            sb.Append(_parent._m_Program_Memory.toCounterString());
            string tmp = toString();
            int    ln  = tmp.Length - LCD_Manager.SCREEN_COLS + 7;

            if (ln <= 0)
            {
                sb.Append(tmp);
            }
            else
            {
                sb.Append(tmp.Substring(ln));
            }
            lm.updateTerminalLine(10, sb.ToString());
            switch (_mode)
            {
            case _Text:
                lm.updateStatusFMODE("TXT");
                break;

            case _Number:
                lm.updateStatusFMODE("NUM");
                break;

            default:
                lm.updateStatusFMODE("   ");
                break;
            }
            lm.requestUpdate();
        }
コード例 #8
0
ファイル: MK52_Host.cs プロジェクト: myak555/MK-52_Resurrect
 public MK52_Host(KBD_Manager kbd, LCD_Manager lcd)
 {
     _m_Hardware_KBD = kbd;
     _m_Hardware_LCD = lcd;
     addReceivers();
     _stateFile = AppDomain.CurrentDomain.BaseDirectory + "_RPN_State_New.txt";
 }
コード例 #9
0
        protected virtual void updateDisplay(string value)
        {
            LCD_Manager lm = _parent.getLCD();

            lm.updateCalcRegister(0, toString());
            lm.requestUpdate();
        }
コード例 #10
0
        public override void activate(string prevReceiver)
        {
            base.activate(prevReceiver);
            if (prevReceiver.StartsWith("AUTO"))
            {
                tick(0);
                return;
            }
            LCD_Manager lm = _parent.getLCD();
            RPN_Stack   st = _parent._m_RPN_Stack;

            lm.clearScreen();
            lm.outputStatus(
                _parent._m_Program_Memory.getCounter(),
                _parent._m_Extended_Memory.getCounter(),
                _parent._m_RPN_Stack.getDModeName(),
                "   ");
            lm.outputCalcRegister(0, st.X.toString());
            lm.outputCalcLabel(0, st.X_Label);
            lm.outputCalcRegister(1, st.Y.toString());
            lm.outputCalcLabel(1, st.Y_Label);
            lm.outputCalcRegister(2, st.Z.toString());
            lm.outputCalcLabel(2, st.Z_Label);
            lm.outputCalcRegister(3, st.T.toString());
            lm.outputCalcLabel(3, st.T_Label);
            lm.forcePaint();
        }
コード例 #11
0
        public override byte tick(byte scancode)
        {
            LCD_Manager    lm = _parent._m_Hardware_LCD;
            Program_Memory pm = _parent._m_Program_Memory;

            lm.updateStatusPC(pm.getCounter());
            lm.updateStatusMC(_parent._m_Extended_Memory.getCounter());
            lm.updateStatusDMODE(pm.getEModeName());
            int display_PC = (int)pm.getCounter();

            string[] _displayLines = pm.getPreviousLines(LCD_Manager.SCREEN_ROWS - 1);
            for (int i = 10, j = 0, k = display_PC; i >= 0; i--, j++, k--)
            {
                if (k < 0)
                {
                    lm.eraseTerminalLine((uint)i);
                    continue;
                }
                string s = k.ToString("0000");
                s += (k == display_PC) ? "> " : "  ";
                lm.updateTerminalLine((uint)i, s + _displayLines[j]);
            }
            lm.requestUpdate();
            return(0);
        }
コード例 #12
0
        public override void activate(string prevReceiver)
        {
            base.activate(prevReceiver);
            LCD_Manager lm = _parent.getLCD();

            lm.updateStatusFMODE(" K ");
            lm.forcePaint();
        }
コード例 #13
0
        public override void activate(string prevReceiver)
        {
            base.activate(prevReceiver);
            LCD_Manager lm = _parent._m_Hardware_LCD;

            lm.outputTerminalLine(LCD_Manager.SCREEN_ROWS - 2, _Question);
            lm.forcePaint();
        }
コード例 #14
0
        public override void activate(string prevReceiver)
        {
            _nLinesShown = LCD_Manager.SCREEN_ROWS - 1;
            base.activate(prevReceiver);
            LCD_Manager lm = _parent.getLCD();

            lm.updateStatusFMODE("   ");
            lm.forcePaint();
        }
コード例 #15
0
        public override void activate(string prevReceiver)
        {
            base.activate(prevReceiver);
            LCD_Manager lm = _parent.getLCD();

            lm.updateStatusFMODE("ADR");
            lm.forcePaint();
            _text = new StringBuilder();
            _text.Append("    ");
        }
コード例 #16
0
        protected virtual void updateDisplay(string value)
        {
            LCD_Manager   lm = _parent.getLCD();
            StringBuilder sb = new StringBuilder();

            sb.Append(_parent._m_Program_Memory.toString());
            sb.Append(toTrimmedString());
            lm.updateTerminalLine(10, sb.ToString());
            lm.requestUpdate();
        }
コード例 #17
0
        public override void activate(string prevReceiver)
        {
            base.activate(prevReceiver);
            LCD_Manager lm = _parent._m_Hardware_LCD;

            lm.clearScreen();
            lm.showSplash();
            lm.forcePaint();
            _splashed = DateTime.Now;
        }
コード例 #18
0
        protected override void updateDisplay(string value)
        {
            LCD_Manager    lm = _parent.getLCD();
            Program_Memory pm = _parent._m_Program_Memory;
            StringBuilder  sb = new StringBuilder();

            sb.Append(pm.toCounterString());
            sb.Append(value.Trim());
            lm.updateTerminalLine(LCD_Manager.SCREEN_ROWS - 2, sb.ToString());
            lm.requestUpdate();
        }
コード例 #19
0
        public override void activate(string prevReceiver)
        {
            base.activate(prevReceiver);
            LCD_Manager lm = _parent.getLCD();

            lm.updateStatusFMODE("NUM");
            lm.forcePaint();
            _stackInput            = _parent._m_RPN_Stack;
            _stackInput._DataEntry = new StringBuilder();
            _stackInput._DataEntry.Append(' ');
            _mode = _Whole;
        }
コード例 #20
0
        public override void activate(string prevReceiver)
        {
            base.activate(prevReceiver);
            LCD_Manager lm = _parent.getLCD();

            if (prevReceiver.StartsWith("PROG"))
            {
                lm.updateTerminalLine(10, _parent._m_Program_Memory.toString());
            }
            lm.updateStatusFMODE("MEM");
            lm.forcePaint();
            _text = new StringBuilder();
        }
コード例 #21
0
        public override void activate(string prevReceiver)
        {
            base.activate(prevReceiver);
            LCD_Manager lm = _parent._m_Hardware_LCD;

            lm.clearScreen();
            for (int i = 0; i < 256; i++)
            {
                int x = (i % 29) * 11;
                int y = (i / 29) * 20;
                lm.outputChar(x, y, (byte)i, System.Drawing.Color.Orange, System.Drawing.Color.Black);
            }
            lm.forcePaint();
        }
コード例 #22
0
        public override byte tick(byte scancode)
        {
            LCD_Manager lm = _parent._m_Hardware_LCD;

            lm.updateStatusPC(_parent._m_Program_Memory.getCounter());
            lm.updateStatusMC(_parent._m_Extended_Memory.getCounter());
            string[] Lines = _parent._m_RPN_Functions.getOutputLines();
            _parent._m_Hardware_SD.getFolderListing(Lines, _nLinesShown, LCD_Manager.SCREEN_COLS - 1);
            for (int i = 0; i < _nLinesShown; i++)
            {
                lm.updateTerminalLine((uint)i, Lines[i]);
            }
            lm.requestUpdate();
            return(0);
        }
コード例 #23
0
        public override byte tick(byte scancode)
        {
            LCD_Manager     lm = _parent._m_Hardware_LCD;
            Extended_Memory em = _parent._m_Extended_Memory;

            lm.updateStatusPC(_parent._m_Program_Memory.getCounter());
            lm.updateStatusMC(em.getCounter());
            //lm.updateStatusDMODE(_parent._m_RPN_Stack.getDModeName());
            int cnt = (int)em.getCounter();

            for (int i = 10, j = cnt; i >= 0; i--, j--)
            {
                string s = em.toString("", j);
                lm.updateTerminalLine((uint)i, s);
            }
            lm.requestUpdate();
            return(0);
        }
コード例 #24
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();
 }
コード例 #25
0
        public override void activate(string prevReceiver)
        {
            _parent.getFunctions().clearStopCondition();
            _lastUIUpdate = DateTime.Now;
            if (_parent._m_backgroundWorker.IsBusy)
            {
                _parent._m_backgroundWorker.CancelAsync();
            }
            else
            {
                _parent._m_backgroundWorker.RunWorkerAsync();
            }
            base.activate("AUTO_N");
            LCD_Manager lm = _parent.getLCD();

            lm.updateStatusFMODE("RUN");
            lm.forcePaint();
        }
コード例 #26
0
        public override byte tick(byte scancode)
        {
            LCD_Manager lm = _parent.getLCD();
            RPN_Stack   st = _parent._m_RPN_Stack;

            lm.updateStatusPC(_parent._m_Program_Memory.getCounter());
            lm.updateStatusMC(_parent._m_Extended_Memory.getCounter());
            lm.updateStatusDMODE(st.getDModeName());
            lm.updateCalcRegister(0, st.X.toString());
            lm.updateCalcLabel(0, st.X_Label);
            lm.updateCalcRegister(1, st.Y.toString());
            lm.updateCalcLabel(1, st.Y_Label);
            lm.updateCalcRegister(2, st.Z.toString());
            lm.updateCalcLabel(2, st.Z_Label);
            lm.updateCalcRegister(3, st.T.toString());
            lm.updateCalcLabel(3, st.T_Label);
            lm.requestUpdate();
            return(0);
        }