private void LoadStepInfo() { string path = Application.StartupPath + "\\TestInfo"; string json = JsonOperate.GetJson(path, "TestStep.json"); testInfo = JsonConvert.DeserializeObject <List <TestStep> >(json); }
private void LoadValue(string type) { this.combValue.DataSource = null; switch (type) { case "CAN": string path = Application.StartupPath + "\\SysConfig"; string json = JsonOperate.GetJson(path, "CAN.json"); List <CAN> temp = JsonConvert.DeserializeObject <List <CAN> >(json); this.combValue.DataSource = temp; this.combValue.DisplayMember = "channel"; break; case "COM": string path2 = Application.StartupPath + "\\SysConfig"; string json2 = JsonOperate.GetJson(path2, "COM.json"); List <COM> temp2 = JsonConvert.DeserializeObject <List <COM> >(json2); this.combValue.DataSource = temp2; this.combValue.DisplayMember = "portName"; break; default: break; } }
private List <CAN> LoadCANInfo() { List <CAN> listCAN = new List <CAN>(); string path = Application.StartupPath + "\\SysConfig"; string json = JsonOperate.GetJson(path, "CAN.json"); listCAN = JsonConvert.DeserializeObject <List <CAN> >(json); return(listCAN); }
private List <PowerMeter> LoadPowerInfo() { List <PowerMeter> temp = new List <PowerMeter>(); string path = Application.StartupPath + "\\SysConfig"; string json = JsonOperate.GetJson(path, "PowerMeter.json"); temp = JsonConvert.DeserializeObject <List <PowerMeter> >(json); return(temp); }
private List <InstrumentClusterConfiguration> LoadICInfo() { List <InstrumentClusterConfiguration> temp = new List <InstrumentClusterConfiguration>(); string path = Application.StartupPath + "\\SysConfig"; string json = JsonOperate.GetJson(path, "InstrumentClusterConfiguration.json"); temp = JsonConvert.DeserializeObject <List <InstrumentClusterConfiguration> >(json); return(temp); }
private List <TypeList> LoadTypeList() { List <TypeList> temp = new List <TypeList>(); string path = Application.StartupPath + "\\TestInfo";; string json = JsonOperate.GetJson(path, "TypeList.json"); temp = JsonConvert.DeserializeObject <List <TypeList> >(json); return(temp); }
private void LoadTypeInfo() { string path = Application.StartupPath + "\\TestInfo"; string json = JsonOperate.GetJson(path, "TypeList.json"); List <TypeList> temp = JsonConvert.DeserializeObject <List <TypeList> >(json); if (temp != null) { this.combtypename.DataSource = temp.Where(t => t.parentname == "").ToList(); this.combtypename.DisplayMember = "typename"; } }
private void LoadEquipmentTestInfo() { string path = Application.StartupPath + "\\TestInfo"; string json = JsonOperate.GetJson(path, "InstrumentClusterTestInfo.json"); List <EquipmentTestInfo> temp = JsonConvert.DeserializeObject <List <EquipmentTestInfo> >(json); if (temp != null) { list = temp; this.dataGridView1.DataSource = list; } }
private void LoadInfo() { string path = Application.StartupPath + "\\SysConfig"; string json = JsonOperate.GetJson(path, "InstrumentClusterConfiguration.json"); List <AutoTestDLL.Model.InstrumentClusterConfiguration> temp = JsonConvert.DeserializeObject <List <AutoTestDLL.Model.InstrumentClusterConfiguration> >(json); if (temp != null) { list = temp; this.dataGridView1.DataSource = list; } }
private void LoadInfo() { string path = Application.StartupPath + "\\SysConfig"; string json = JsonOperate.GetJson(path, "CAN.json"); List <CAN> temp = JsonConvert.DeserializeObject <List <CAN> >(json); if (temp != null) { list = temp; this.dataGridView1.DataSource = list; } }
private void LoadStepInfo(string typename) { string path = Application.StartupPath + "\\TestInfo"; string json = JsonOperate.GetJson(path, "TestStep.json"); List <TestStep> temp = JsonConvert.DeserializeObject <List <TestStep> >(json); List <TestStep> list = temp.Where(x => x.typename == typename).ToList(); if (temp != null) { stepList = temp; this.dataGridView1.DataSource = list.OrderBy(x => Convert.ToInt32(x.stepname.Replace("Step", ""))).ToList(); } }
private void LoadInfo() { string path = Application.StartupPath + "\\SysConfig"; string json = JsonOperate.GetJson(path, "InstrumentClusterConfiguration.json"); List <InstrumentClusterConfiguration> temp = JsonConvert.DeserializeObject <List <InstrumentClusterConfiguration> >(json); if (temp != null) { foreach (InstrumentClusterConfiguration equipment in temp) { if (!this.listBox1.Items.Contains(equipment.InstrumentCluster)) { this.listBox1.Items.Add(equipment.InstrumentCluster); } } } }
private void frmSelectTestType_Load(object sender, EventArgs e) { try { string path = Application.StartupPath + "\\TestInfo";; string json = JsonOperate.GetJson(path, "TypeList.json"); List <TypeList> temp = JsonConvert.DeserializeObject <List <TypeList> >(json); if (temp != null) { list = temp; InitTree(); } } catch (Exception ex) { logger.Error(ex, ex.Message); } }
private void Init() { string path = Application.StartupPath + "\\TestInfo"; string json = JsonOperate.GetJson(path, "TypeList.json"); List <TypeList> temp = JsonConvert.DeserializeObject <List <TypeList> >(json); if (temp != null) { //filter parentname is empty for (int i = 0; i < temp.Count; i++) { string parentname = temp[i].parentname; if (parentname == "") { temp.RemoveAt(i); } } List <TypeList> list = temp.Where(x => x.parentname == temp[0].parentname).ToList(); FitComboAndLabel(list, 0); } }
private void LoadTemperatureInfo() { string path = Application.StartupPath + "\\SysConfig"; string json = JsonOperate.GetJson(path, "TempSensorConfiguration.json"); List <TempSensorConfiguration> temp = JsonConvert.DeserializeObject <List <TempSensorConfiguration> >(json); if (temp != null) { foreach (TempSensorConfiguration t in temp) { string sensorName = t.SensorName; TemperatureControl temperature = new TemperatureControl(); temperature.Name = sensorName; temperature.Tag = sensorName; if (!DicTemperatureInfo.ContainsKey(sensorName)) { DicTemperatureInfo.Add(sensorName, temperature); } } } }
private void LoadEquipmentInfo() { string path = Application.StartupPath + "\\SysConfig"; string json = JsonOperate.GetJson(path, "InstrumentClusterConfiguration.json"); List <InstrumentClusterConfiguration> temp = JsonConvert.DeserializeObject <List <InstrumentClusterConfiguration> >(json); if (temp != null) { foreach (InstrumentClusterConfiguration equipment in temp) { string eq = equipment.InstrumentCluster; TestUnit testUnit = new TestUnit(); testUnit.Name = eq; testUnit.Tag = eq; if (!DicEquipmentInfo.ContainsKey(eq)) { DicEquipmentInfo.Add(eq, testUnit); } } } }
private void InitAmmeterConfigurationInfo() { System.Timers.Timer ammeterTimer = new System.Timers.Timer(); ammeterTimer.Interval = 1000; ammeterTimer.Elapsed += ammeter_Tick; string path = Application.StartupPath + "\\SysConfig"; string json = JsonOperate.GetJson(path, "AmmeterConfiguration.json"); ammeterList = JsonConvert.DeserializeObject <List <AmmeterConfiguration> >(json); if (ammeterList != null) { this.panel1.Controls.Clear(); foreach (AmmeterConfiguration ammeter in ammeterList) { string ammeterName = ammeter.ammeterName; LoadAmmeterConfigurationInfo(ammeterName); } } ammeterTimer.Start(); }
private List <TypeList> LoadEquipmentTestInfo() { List <TypeList> result = new List <TypeList>(); string path = Application.StartupPath + "\\TestInfo"; string json = JsonOperate.GetJson(path, "InstrumentClusterTestInfo.json"); List <EquipmentTestInfo> temp = JsonConvert.DeserializeObject <List <EquipmentTestInfo> >(json); string json2 = JsonOperate.GetJson(path, "TypeList.json"); List <TypeList> temp2 = JsonConvert.DeserializeObject <List <TypeList> >(json2); if (temp != null && temp2 != null) { List <EquipmentTestInfo> list = temp.Where(t => t.InstrumentCluster == this.Tag.ToString()).ToList(); foreach (EquipmentTestInfo info in list) { result.AddRange(temp2.Where(t => t.typename == info.TypeName || t.parentname == info.TypeName).ToList()); } } return(result); }