Ejemplo n.º 1
0
        public String execStr()
        {
            if (ExpressType == LCExpressType.Expression)
            {
                string tempExipression = Exipression;
                //Debug.WriteLine(tempExipression);
                foreach (CParameter node in ListParam)
                {
                    tempExipression = tempExipression.Replace(node.Name, node.Value);
                }
                tempExipression = tempExipression.Replace("==", "=");
                ExpressionParser.ExpressionParse res = new ExpressionParser.ExpressionParse();
                //Debug.WriteLine(tempExipression);
                res.Expression = tempExipression;
                string mes = res.ExecuteToString();

                if (IsShowUnit)
                {
                    return(mes + cVar.Unit);
                }
                else
                {
                    return(mes);
                }
            }
            else if (ExpressType == LCExpressType.Var)
            {
                if (cVar != null)
                {
                    if (IsShowUnit)
                    {
                        return(cVar.GetStringValue(sText) + cVar.Unit);
                    }

                    else
                    {
                        return(cVar.GetStringValue(sText));
                    }
                }
                else
                {
                    return("VarIsNull");
                }
            }
            else if (ExpressType == LCExpressType.StaticText)
            {
                return(sText);
            }
            return("0");
        }
Ejemplo n.º 2
0
        private string[] AddRow(CVar nVar, string StaName)
        {
            string[] str1 = new string[9];
            string   sWR  = "";

            if (nVar == null)
            {
                return(str1);
            }
            if (nVar.Readable > 0)
            {
                sWR += "读";
            }
            if (nVar.Writeable > 0)
            {
                sWR += "写";
            }

            iIndex++;
            str1[0] = iIndex.ToString();
            str1[1] = StaName;
            str1[2] = nVar.Name;
            str1[3] = nVar.GetStringValue(1);
            str1[4] = nVar.Description;
            str1[5] = nVar.Unit;
            str1[6] = nVar.GetTypeName();
            str1[7] = sWR;
            return(str1);
        }
Ejemplo n.º 3
0
        public override void DrawPoints(Graphics g)
        {
            try
            {
                base.DrawPoints(g);
                if (m_RotateAngle > 0)
                {
                    g.TranslateTransform(iOrgX1, iOrgY1);
                    g.RotateTransform(m_RotateAngle);
                    g.TranslateTransform(-iOrgX1, -iOrgY1);
                }
                GraphicsPath path = new GraphicsPath();
                path.AddLines(PTS);
                LinearGradientBrush brush = new LinearGradientBrush(rect, tbruColor, FillColor, (LinearGradientMode)iDir);
                if (Pipefocus < 1)
                {
                    brush.SetBlendTriangularShape(Pipefocus);
                }

                Matrix myMatrix = new Matrix();
                path.Transform(myMatrix);
                if (bShowPie)
                {
                    g.FillPath(brush, path);
                }
                if (IsBorder)
                {
                    g.DrawPath(DrawPen, path);
                }

                if (bShowText)
                {
                    g.DrawString(ShowText, DrawFont, FontBrush, TextRect, TextFormat);
                }
                if (bShowRea)
                {
                    g.FillRectangle(Brushes.DarkGray, ValRect);
                    g.DrawString(LiuVar.GetStringValue(1, 5), ValFont, new SolidBrush(Color.Black), ValRect, ValFormat);
                }
                if (m_RotateAngle > 0)
                {
                    g.ResetTransform();
                }
                //g.ResetTransform();
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.Message);
            }
        }