Example #1
0
        static void ProcessNavGraphicsMessage(Message m) // used for emulator
        {
            var ae = ScreenCleared;                      // This is the only usage? - no, for emulator

            if (ae != null && m.Data.Compare(MessageClearScreen.Data))
            {
                ae();
                //m.ReceiverDescription = "Clear screen";
                return;
            }

            ae = ScreenRefreshed; // This is the only usage? - no, for emulator
            if (ae != null && m.Data.Compare(MessageRefreshScreen.Data))
            {
                ae();
                //m.ReceiverDescription = "Refresh screen";
                OnScreenUpdated();
                return;
            }

            var e = TextReceived; // This is the only usage? - no, for emulator

            if (e != null || ReplyToScreenUpdates)
            {
                if (m.Data.StartsWith(DataDrawIndexMk2) || m.Data.StartsWith(DataDrawIndexMk34))
                {
                    var a = new BordmonitorText(BordmonitorFields.Item, m.Data);
                    if (e != null)
                    {
                        e(a);
                    }
                    //#if NETMF
                    //m.ReceiverDescription = "BM fill items";
                    //#else
                    //var s = "BM fill items";
                    //var items = a.ParseItems();
                    //foreach (var i in items)
                    //{
                    //    s += " | " + i.Index.ToHex() + "." + i.Text;
                    //}
                    //m.ReceiverDescription = s;
                    //#endif
                    OnScreenUpdated(true);
                }
                else if (m.Data.StartsWith(DataUpdateScreen))
                {
                    if (m.Data.StartsWith(DataShowHeader))
                    {
                        var headerIndex = m.Data[DataShowHeader.Length];
                        var field       = EnumConverter.GetBordmonitorFieldFromIndex(headerIndex);
                        var a           = new BordmonitorText(field, m.Data);
                        if (e != null)
                        {
                            e(a);
                        }
                        //#if NETMF
                        //m.ReceiverDescription = "BM show status";
                        //#else
                        //m.ReceiverDescription = "BM show status: " + a.Text;
                        //#endif
                    }
                    OnScreenUpdated(false);
                }
                else if (m.Data.StartsWith(DataShowTitle))
                {
                    var a = new BordmonitorText(BordmonitorFields.Title, m.Data);
                    if (e != null)
                    {
                        e(a);
                    }
                    //#if NETMF
                    //m.ReceiverDescription = "BM show title";
                    //#else
                    //m.ReceiverDescription = "BM show title: " + a.Text;
                    //#endif
                    OnScreenUpdated();
                }
            }
        }
Example #2
0
        static void ProcessNavGraphicsMessage(Message m)
        {
            var ae = ScreenCleared;
            if (ae != null && m.Data.Compare(MessageClearScreen.Data))
            {
                ae();
                m.ReceiverDescription = "Clear screen";
                return;
            }

            ae = ScreenRefreshed;
            if (ae != null && m.Data.Compare(MessageRefreshScreen.Data))
            {
                ae();
                m.ReceiverDescription = "Refresh screen";
                OnScreenUpdated();
                return;
            }

            var e = TextReceived;
            if (e != null || ReplyToScreenUpdates)
            {
                if (m.Data.StartsWith(0xA5, 0x62, 0x00) || m.Data.StartsWith(0x21, 0x60, 0x00))
                {
                    var a = new BordmonitorText(BordmonitorFields.Item, m.Data);
                    if (e != null)
                    {
                        e(a);
                    }
                    #if NETMF
                    m.ReceiverDescription = "BM fill items";
                    #else
                    var s = "BM fill items";
                    var items = a.ParseItems();
                    foreach (var i in items)
                    {
                        s += " | " + i.Index.ToHex() + "." + i.Text;
                    }
                    m.ReceiverDescription = s;
                    #endif
                    OnScreenUpdated(true);
                }
                else if (m.Data.StartsWith(DataUpdateScreen))
                {
                    if (m.Data.StartsWith(DataShowStatus))
                    {
                        var a = new BordmonitorText(BordmonitorFields.Status, m.Data);
                        if (e != null)
                        {
                            e(a);
                        }
                        #if NETMF
                        m.ReceiverDescription = "BM show status";
                        #else
                        m.ReceiverDescription = "BM show status: " + a.Text;
                        #endif
                    }
                    OnScreenUpdated(false);
                }
                else if (m.Data.StartsWith(DataShowTitle))
                {
                    var a = new BordmonitorText(BordmonitorFields.Title, m.Data);
                    if (e != null)
                    {
                        e(a);
                    }
                    #if NETMF
                    m.ReceiverDescription = "BM show title";
                    #else
                    m.ReceiverDescription = "BM show title: " + a.Text;
                    #endif
                    OnScreenUpdated();
                }
            }
        }
Example #3
0
        static void ProcessNavGraphicsMessage(Message m)
        {
            var ae = ScreenCleared;

            if (ae != null && m.Data.Compare(MessageClearScreen.Data))
            {
                ae();
                m.ReceiverDescription = "Clear screen";
                return;
            }

            ae = ScreenRefreshed;
            if (ae != null && m.Data.Compare(MessageRefreshScreen.Data))
            {
                ae();
                m.ReceiverDescription = "Refresh screen";
                OnScreenUpdated();
                return;
            }

            var e = TextReceived;

            if (e != null || ReplyToScreenUpdates)
            {
                if (m.Data.StartsWith(0xA5, 0x62, 0x00) || m.Data.StartsWith(0x21, 0x60, 0x00))
                {
                    var a = new BordmonitorText(BordmonitorFields.Item, m.Data);
                    if (e != null)
                    {
                        e(a);
                    }
                    #if NETMF
                    m.ReceiverDescription = "BM fill items";
                    #else
                    var s     = "BM fill items";
                    var items = a.ParseItems();
                    foreach (var i in items)
                    {
                        s += " | " + i.Index.ToHex() + "." + i.Text;
                    }
                    m.ReceiverDescription = s;
                    #endif
                    OnScreenUpdated(true);
                }
                else if (m.Data.StartsWith(DataUpdateScreen))
                {
                    if (m.Data.StartsWith(DataShowStatus))
                    {
                        var a = new BordmonitorText(BordmonitorFields.Status, m.Data);
                        if (e != null)
                        {
                            e(a);
                        }
                        #if NETMF
                        m.ReceiverDescription = "BM show status";
                        #else
                        m.ReceiverDescription = "BM show status: " + a.Text;
                        #endif
                    }
                    OnScreenUpdated(false);
                }
                else if (m.Data.StartsWith(DataShowTitle))
                {
                    var a = new BordmonitorText(BordmonitorFields.Title, m.Data);
                    if (e != null)
                    {
                        e(a);
                    }
                    #if NETMF
                    m.ReceiverDescription = "BM show title";
                    #else
                    m.ReceiverDescription = "BM show title: " + a.Text;
                    #endif
                    OnScreenUpdated();
                }
            }
        }