Пример #1
0
        private void ChannelDisplayWrite(string strText)
        {
            if ((strText ?? "") == CLEAR)
            {
                ChannelDisplay.Clear();
                return;
            }
            else if (string.IsNullOrEmpty(strText))
            {
                // Do nothing
                return;
            }

            var objColor = ColorSelection(strText);

            strText = strText.Substring(1);
            try
            {
                ChannelDisplay.SelectionColor = objColor;
                ChannelDisplay.SelectionStart = ChannelDisplay.Text.Length;
                ChannelDisplay.AppendText(strText + CRLF);
                ChannelDisplay.SelectionLength = strText.Length;
                ChannelDisplay.Select();
                ChannelDisplay.SelectionLength = 0;
                ChannelDisplay.Refresh();
            }
            catch
            {
                // Do nothing...
            }

            switch (objColor)
            {
            case var @case when @case == Color.Red:
            case var case1 when case1 == Color.Green:
            {
                _log.Debug(strText);
                break;
            }

            case var case2 when case2 == Color.Purple:
            {
                _log.Debug(strText);
                break;
            }

            case var case3 when case3 == Color.Black:
            {
                _log.Debug("> " + strText);
                break;
            }

            case var case4 when case4 == Color.Blue:
            {
                _log.Debug("< " + strText);
                break;
            }
            }
        }
Пример #2
0
        private void addChannel(Channel channel)
        {
            flow.Add(channelDisplay = new ChannelDisplay(channel)
            {
                Size = new Vector2(1, 0.3f)
            });

            careChannels.Add(channel);
        }
        public int DefineDisplayOutput(ChannelIndexs chl, ChannelDisplay display)
        {
            if (session == null)
                return -1;

            int status = 0;
            int iChl = chl.GetHashCode();
            int iDisplay = display.GetHashCode();
            int k = 0;
            try
            {
                session.Write($"ddef {iChl},{iDisplay},{k}\n");
            }
            catch (Exception ex)
            {
                status = -1;
            }
            return status;
        }
Пример #4
0
 private void addChannel(Channel channel)
 {
     Add(channelDisplay = new ChannelDisplay(channel));
     careChannels.Add(channel);
 }