Пример #1
0
        private void setLineConfigData(DeviceInfo pCurDev, int lineID)
        {
            string         text              = this.labDevModel.Text;
            string         value             = lineID.ToString();
            LineInfo       lineInfoByID      = DeviceOperation.GetLineInfoByID(lineID);
            DevModelConfig deviceModelConfig = DevAccessCfg.GetInstance().getDeviceModelConfig(text, pCurDev.FWVersion);
            int            selNo             = System.Convert.ToInt32(lineInfoByID.LineNumber);

            this.labLineNo.Text = selNo.ToString();
            System.Collections.Generic.List <LineInfo> lineInfo = pCurDev.GetLineInfo();
            for (int i = 1; i <= lineInfo.Count; i++)
            {
                Control[] array = this.gbLineConfig.Controls.Find("butLine" + i, false);
                if (array.Length > 0)
                {
                    string text2 = ((Button)array[0]).Tag.ToString();
                    if (!text2.Equals(value))
                    {
                        ((Button)array[0]).BackColor = Color.PaleTurquoise;
                    }
                    else
                    {
                        ((Button)array[0]).BackColor = Color.DarkCyan;
                    }
                }
            }
            int num = devcfgUtil.UIThresholdEditFlg(deviceModelConfig, "line");

            this.labMaxCurrentBound.Text = ((!this.tbLMinCurrent.ReadOnly || !this.tbLMaxCurrent.ReadOnly) ? devcfgUtil.RangeCurrent(deviceModelConfig, "line", selNo, "F1") : "");
            ThresholdUtil.SetUIEdit(this.tbLMinCurrent, (num & 1) == 0, lineInfoByID.Min_current, 0, "F1");
            ThresholdUtil.SetUIEdit(this.tbLMaxCurrent, (num & 2) == 0, lineInfoByID.Max_current, 0, "F1");
            ThresholdUtil.SetUIEdit(this.tbLMinVoltage, (num & 4) == 0, lineInfoByID.Min_voltage, 0, "F1");
            ThresholdUtil.SetUIEdit(this.tbLMaxVoltage, (num & 8) == 0, lineInfoByID.Max_voltage, 0, "F1");
            ThresholdUtil.SetUIEdit(this.tbLMinPower, (num & 16) == 0, lineInfoByID.Min_power, 0, "F1");
            ThresholdUtil.SetUIEdit(this.tbLMaxPower, (num & 32) == 0, lineInfoByID.Max_power, 0, "F1");
            this.labMaxVoltageBound.Text  = ((!this.tbLMinVoltage.ReadOnly || !this.tbLMaxVoltage.ReadOnly) ? devcfgUtil.RangeVoltage(deviceModelConfig, "line", selNo) : "");
            this.labMaxPowerBound.Text    = ((!this.tbLMinPower.ReadOnly || !this.tbLMaxPower.ReadOnly) ? devcfgUtil.RangePower(deviceModelConfig, "line", selNo, 1.0) : "");
            this.labMaxPowerDisBound.Text = ((!this.tbLMinPowerDiss.ReadOnly || !this.tbLMaxPowerDiss.ReadOnly) ? devcfgUtil.RangePowerDiss(deviceModelConfig, "line", selNo) : "");
        }