Пример #1
0
        private void SetDrawPen(string PenColor)
        {
            Color col = VirtualPanelForm.String2Color(PenColor);

            if (!col.IsEmpty)
            {
                DrawColor = col;               //
            }
            if (PenColor == "$1PX")
            {
                DrawPenSize = 1;
            }
            if (PenColor == "$2PX")
            {
                DrawPenSize = 2;
            }
            if (PenColor == "$3PX")
            {
                DrawPenSize = 3;
            }
            if (PenColor == "$4PX")
            {
                DrawPenSize = 4;
            }
        }
Пример #2
0
        private void SetDrawPointPen(string PenColor)
        {
            Color col = VirtualPanelForm.String2Color(PenColor);

            if (!col.IsEmpty)
            {
                DrawPointColor = col;               //
            }
        }
Пример #3
0
        private void SetLabelAppearance(Label control, MessageEventArgs <object> mse)
        {
            PictureBox p = null;

            control.Visible = true;

            if (control == graphLabel1)
            {
                p = PenColor1;
            }
            if (control == graphLabel2)
            {
                p = PenColor2;
            }
            if (control == graphLabel3)
            {
                p = PenColor3;
            }
            if (control == graphLabel4)
            {
                p = PenColor4;
            }
            if (control == graphLabel5)
            {
                p = PenColor5;
            }

            if (mse.Type == vp_type.vp_boolean)
            {
                if (!(bool)mse.Data)
                {
                    control.Visible = false;
                }
            }
            else if (mse.Type == vp_type.vp_string)
            {
                Color col = VirtualPanelForm.String2Color((string)mse.Data);
                if (!col.IsEmpty)
                {
                    p.BackColor = col; p.Visible = true;
                }
                else if ((string)mse.Data == "$OFF")
                {
                    p.Visible = false;
                }
                else
                {
                    control.Text = (string)mse.Data;
                }
            }
            else
            {
                control.Text = mse.Data.ToString();
            }
        }
Пример #4
0
        private void Drawtext(string data)
        {
            Color col = VirtualPanelForm.String2Color(data);

            if (!col.IsEmpty)
            {
                DrawTextColor = col; //
            }
            else
            {
                if (DrawTextColor == Color.Black)
                {
                    PersistentDrawing.Delete(new Text(DrawtextPoint, data, DrawTextColor, 8));
                }
                else
                {
                    PersistentDrawing.Add(new Text(DrawtextPoint, data, DrawTextColor, 8));
                }
                GraphPictureBox1.Invalidate();
            }
        }
Пример #5
0
        private void SetGraphAttr(string data, Graph GraphPlot)
        {
            Color col = VirtualPanelForm.String2Color(data);

            if (!col.IsEmpty)
            {
                GraphPlot.Color = col; //
            }
            else
            {
                if (data == "$CLEAR")
                {
                    GraphPlot.ClearData();
                }
                if (data == "$ROLLING")
                {
                    GraphPlot.Type = GraphType.Rolling;
                }
                if (data == "$STATIC")
                {
                    GraphPlot.Type = GraphType.Static;
                }
                if (data == "$1PX")
                {
                    GraphPlot.PlotWidth = 1;
                }
                if (data == "$2PX")
                {
                    GraphPlot.PlotWidth = 2;
                }
                if (data == "$3PX")
                {
                    GraphPlot.PlotWidth = 3;
                }
                if (data == "$4PX")
                {
                    GraphPlot.PlotWidth = 4;
                }
            }
        }