Beispiel #1
0
        public CurveGroup(IniDocument docIni, int index)
        {
            this.Name = docIni.GetString("记录曲线类型", (index + 1).ToString());
            if (string.IsNullOrEmpty(Name))
            {
                return;
            }

            this.Type = docIni.GetInt(this.Name, "类型", 0);
            if (this.Type <= 0)
            {
                return;
            }
            this.TimeInterval = docIni.GetFloat(this.Name, "时间间隔", 0);

            float limit = docIni.GetFloat(this.Name, "AD最小", float.NaN);

            if (float.IsNaN(limit) == false)
            {
                this.ADMin = limit;
            }
            limit = docIni.GetFloat(this.Name, "AD最大", float.NaN);
            if (float.IsNaN(limit) == false)
            {
                this.ADMax = limit;
            }
            int curveNum = docIni.GetInt(this.Name, "数目", 0);

            for (int i = 0; i < curveNum; i++)
            {
                DevCurve curve = new DevCurve(docIni, this, i);
                if (curve.IsValid)
                {
                    if (dicCurve.ContainsKey(curve.Name) == false)
                    {
                        List <DevCurve> listCurve = new List <DevCurve>();
                        listCurve.Add(curve);
                        dicCurve.Add(curve.Name, listCurve);
                    }
                    else
                    {
                        dicCurve[curve.Name].Add(curve);
                    }
                }
            }
            if (dicCurve.Count <= 0)
            {
                return;
            }

            this.IsValid = true;
        }
Beispiel #2
0
        public CurveGroup(IniDocument docIni, int index)
        {
            this.Name = docIni.GetString("记录曲线类型", (index + 1).ToString());
            if (string.IsNullOrEmpty(Name)) return;

            this.Type = docIni.GetInt(this.Name, "类型", 0);
            if (this.Type <= 0) return;
            this.TimeInterval = docIni.GetFloat(this.Name, "时间间隔", 0);

            float limit = docIni.GetFloat(this.Name, "AD最小", float.NaN);
            if (float.IsNaN(limit) == false)
            {
                this.ADMin = limit;
            }
            limit = docIni.GetFloat(this.Name, "AD最大", float.NaN);
            if (float.IsNaN(limit) == false)
            {
                this.ADMax = limit;
            }
            int curveNum = docIni.GetInt(this.Name, "数目", 0);
            for (int i = 0; i < curveNum; i++)
            {
                DevCurve curve = new DevCurve(docIni, this, i);
                if (curve.IsValid)
                {
                    if (dicCurve.ContainsKey(curve.Name) == false)
                    {
                        List<DevCurve> listCurve = new List<DevCurve>();
                        listCurve.Add(curve);
                        dicCurve.Add(curve.Name, listCurve);
                    }
                    else
                    {
                        dicCurve[curve.Name].Add(curve);
                    }
                }
            }
            if (dicCurve.Count <= 0) return;

            this.IsValid = true;
        }