Ejemplo n.º 1
0
        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;
            }
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
        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";
            }
        }
Ejemplo n.º 8
0
        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;
            }
        }
Ejemplo n.º 10
0
        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();
            }
        }
Ejemplo n.º 12
0
        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);
                    }
                }
            }
        }
Ejemplo n.º 13
0
 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);
            }
        }
Ejemplo n.º 15
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);
                    }
                }
            }
        }
Ejemplo n.º 16
0
        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);
                    }
                }
            }
        }
Ejemplo n.º 17
0
        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();
        }
Ejemplo n.º 18
0
        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);
        }