public HHDeviceGrp(IniDocument ini, int index) { string name = ini.GetString("设备", (index + 1).ToString()); if (string.IsNullOrEmpty(name)) return; this.DevType = ini.GetInt(name, "设备类型", 0); if (this.DevType <= 0) return; this.Name = name; int propNum = ini.GetInt(name, "属性数目", 0); if (propNum <= 0) return; int devNum = ini.GetInt(name, "设备数目", 0); if (devNum <= 0) return; for (int i = 0; i < propNum; i++) { HHDeviceProperty prop = new HHDeviceProperty(ini, this, i); if (prop.IsValid) { listProperty.Add(prop); if (prop.Type == "模拟量") { listAnalogProperty.Add(prop); } else if (prop.Type == "曲线") { listCurveProperty.Add(prop); } } } if (this.DevType != 4 && this.DevType != 8) { if (listProperty.Count <= 0) return; } if (listAnalogProperty.Count > 0) { SelectProperty(0, true); } for (int i = 0; i < devNum; i++) { HHDevice device = new HHDevice(ini, i, this); if (device.IsValid) { listDevice.Add(device); } } this.BuildGroup(); this.Level = 1; this.IsValid = true; }
private void comboBoxEdit2_SelectedIndexChanged(object sender, EventArgs e) { if (comboBoxEdit1.SelectedIndex >= 0 && comboBoxEdit2.SelectedIndex>=0) { selectDev = comboBoxEdit2.SelectedItem as HHDevice; DrawCurve(); } }
private void wizardPage1_PageCommit(object sender, EventArgs e) { wizardPage2.AllowBack = false; wizardPage2.AllowNext = false; selectDevice = comboBoxEdit2.SelectedItem as HHDevice; if (selectDevice != null) { Thread threadExport = new Thread(new ThreadStart(ExportProc)); threadExport.IsBackground = true; threadExport.Start(); timer1.Start(); } }
public HHDeviceGrp(IniDocument ini, int index) { string name = ini.GetString("设备", (index + 1).ToString()); if (string.IsNullOrEmpty(name)) { return; } this.DevType = ini.GetInt(name, "设备类型", 0); if (this.DevType <= 0) { return; } this.Name = name; int propNum = ini.GetInt(name, "属性数目", 0); if (propNum <= 0) { return; } int devNum = ini.GetInt(name, "设备数目", 0); if (devNum <= 0) { return; } for (int i = 0; i < propNum; i++) { HHDeviceProperty prop = new HHDeviceProperty(ini, this, i); if (prop.IsValid) { listProperty.Add(prop); if (prop.Type == "模拟量") { listAnalogProperty.Add(prop); } else if (prop.Type == "曲线") { listCurveProperty.Add(prop); } } } if (this.DevType != 4 && this.DevType != 8) { if (listProperty.Count <= 0) { return; } } if (listAnalogProperty.Count > 0) { SelectProperty(0, true); } for (int i = 0; i < devNum; i++) { HHDevice device = new HHDevice(ini, i, this); if (device.IsValid) { listDevice.Add(device); } } this.BuildGroup(); this.Level = 1; this.IsValid = true; }