Esempio n. 1
0
    //创建CII标签
    protected CIIChartTag CreateCIITag(XmlNode nodeTag)
    {
        CIIChartTag tag = new CIIChartTag();

        tag.PartInfo.PartName = nodeTag.Attributes["PartName"].Value;
        return(tag);
    }
Esempio n. 2
0
    //统计CII
    protected void StatCII(ServerConnection conn, ProjectInfo projectInfo, CIIChartTag tag, ref string strError)
    {
        if (tag.PartInfo.PartID == 0)
        {
            return;
        }

        float        fCII     = 0;
        List <float> arrSigma = new List <float>();

        CmdStat.StatCII(conn, projectInfo.ProjectID, tag.PartInfo.PartID, GlobalSession.Period, ref strError, ref fCII, ref arrSigma);
        fCII = (float)Math.Round(fCII, 3);

        //更新相关标签信息
        for (int nTagIndex = 0; nTagIndex < projectInfo.Tags.Length; nTagIndex++)
        {
            if (projectInfo.Tags[nTagIndex].TagName == "Label")
            {
                LabelTag label = (LabelTag)projectInfo.Tags[nTagIndex];

                if (label.PartInfo.PartID == tag.PartInfo.PartID)
                {
                    for (int j = 0; j < label.Items.Length; j++)
                    {
                        if (label.Items[j].TagName[0] == "CII指数")
                        {
                            label.Items[j].Value[0] = fCII;
                        }
                    }
                }
            }
            if (projectInfo.Tags[nTagIndex].TagName == "CIIChart")
            {
                CIIChartTag ciiTag = (CIIChartTag)projectInfo.Tags[nTagIndex];
                ciiTag.AxisX    = new string[arrSigma.Count];
                ciiTag.Passrate = new float[arrSigma.Count];
                for (int i = 0; i < arrSigma.Count; i++)
                {
                    ciiTag.AxisX[i]    = (i + 1).ToString();
                    ciiTag.Passrate[i] = arrSigma[i];
                }
            }
        }
    }