예제 #1
0
 public void ShowResult(VMASResultData result)
 {
     lblHCLimit.Text = result.HCLimit;
     lblCOLimit.Text = result.COLimit;
     lblNOLimit.Text = result.NOLimit;
     lblHC.Text      = result.HC;
     lblCO.Text      = result.CO;
     lblNO.Text      = result.NO;
     lblHCEvl.Text   = result.HCEvl;
     if (result.HCEvl != "合格")
     {
         lblHCEvl.BackColor = Color.Red;
     }
     lblCOEvl.Text = result.COEvl;
     if (result.COEvl != "合格")
     {
         lblCOEvl.BackColor = Color.Red;
     }
     lblNOEvl.Text = result.NOEvl;
     if (result.NOEvl != "合格")
     {
         lblNOEvl.BackColor = Color.Red;
     }
     lblHCNO.Text   = result.HCNO;
     lblResult.Text = result.Result;
     if (result.Result != "合格")
     {
         lblResult.BackColor = Color.Red;
     }
 }
예제 #2
0
        public void SaveVMASResult(string strVIN, DateTime startTime, double runningTime, EnvironmentData envData, VMASResultData resultData)
        {
            DataTable dt = new DataTable("SH_VMASResult");

            dt.Columns.Add("VIN");
            dt.Columns.Add("Temperature");
            dt.Columns.Add("Humidity");
            dt.Columns.Add("Pressure");
            dt.Columns.Add("StartTime");
            dt.Columns.Add("RunningTime");
            dt.Columns.Add("HCLimit");
            dt.Columns.Add("COLimit");
            dt.Columns.Add("NOLimit");
            dt.Columns.Add("HC");
            dt.Columns.Add("CO");
            dt.Columns.Add("NO");
            dt.Columns.Add("HCNO");
            dt.Columns.Add("HCEvl");
            dt.Columns.Add("COEvl");
            dt.Columns.Add("NOEvl");
            dt.Columns.Add("Result");
            DataRow dr = dt.NewRow();

            dr["VIN"]         = strVIN;
            dr["Temperature"] = envData.Temperature;
            dr["Humidity"]    = envData.Humidity;
            dr["Pressure"]    = envData.Pressure;
            dr["StartTime"]   = startTime;
            dr["RunningTime"] = runningTime;
            dr["HCLimit"]     = resultData.HCLimit;
            dr["COLimit"]     = resultData.COLimit;
            dr["NOLimit"]     = resultData.NOLimit;
            dr["HC"]          = resultData.HC;
            dr["CO"]          = resultData.CO;
            dr["NO"]          = resultData.NO;
            dr["HCNO"]        = resultData.HCNO;
            dr["HCEvl"]       = resultData.HCEvl == "合格" ? 1 : 0;
            dr["COEvl"]       = resultData.COEvl == "合格" ? 1 : 0;
            dr["NOEvl"]       = resultData.NOEvl == "合格" ? 1 : 0;
            dr["Result"]      = resultData.Result == "合格" ? 1 : 0;
            dt.Rows.Add(dr);
            InsertRecords(dt);
        }
예제 #3
0
        public VMASForm(string VIN, DynoCmd dynoCmd, MainSetting mainCfg, ModelLocal db, EnvironmentData envData, Logger log)
        {
            InitializeComponent();
            _lastHeight = Height;
            _VIN        = VIN;
            _dynoCmd    = dynoCmd;
            _mainCfg    = mainCfg;
            _db         = db;
            _envData    = envData;
            _log        = log;
            _rangeScale = 3;
            _speedRange = 3;
            _speedMax   = 0 + _speedRange * _rangeScale;
            _speedMin   = 0 + _speedRange * _rangeScale;
            _speedStart = 0 + _speedRange;
            _speedEnd   = 0 - _speedRange;
            _XPosition  = 0;

            _dtRealTime = new DataTable("VMASRealTime");
            _dtRealTime.Columns.Add("VIN");
            _dtRealTime.Columns.Add("StartTime");
            _dtRealTime.Columns.Add("TimeSN");
            _dtRealTime.Columns.Add("Speed");
            _dtRealTime.Columns.Add("RPM");
            _dtRealTime.Columns.Add("SpeedOverTime");
            _dtRealTime.Columns.Add("Power");
            _dtRealTime.Columns.Add("HC");
            _dtRealTime.Columns.Add("NO");
            _dtRealTime.Columns.Add("CO");
            _dtRealTime.Columns.Add("CO2");
            _dtRealTime.Columns.Add("O2");
            _dtRealTime.Columns.Add("DilutionO2");
            _dtRealTime.Columns.Add("EnvO2");
            _dtRealTime.Columns.Add("DilutionRatio");
            _dtRealTime.Columns.Add("Flow");

            _dtSpeeds = new DataTable();
            _dtSpeeds.Columns.Add(_mainCfg.VMASSpeed.Columns[0].ToString());
            _dtSpeeds.Columns.Add(_mainCfg.VMASSpeed.Columns[1].ToString());
            _dtSpeeds.Columns.Add(_mainCfg.VMASSpeed.Columns[2].ToString());
            _dtSpeeds.Columns.Add(_mainCfg.VMASSpeed.Columns[3].ToString());
            _dtSpeeds.Columns.Add("Speed");

            for (int i = 0; i < _mainCfg.VMASSpeed.Rows.Count; i++)
            {
                DataRow dr = _dtSpeeds.NewRow();
                if (_mainCfg.VMASSpeed.Rows[i][1].ToString().Length > 0)
                {
                    dr[0] = _mainCfg.VMASSpeed.Rows[i][0];
                    dr[1] = _mainCfg.VMASSpeed.Rows[i][1];
                    dr[2] = _mainCfg.VMASSpeed.Rows[i][2];
                    dr[3] = _mainCfg.VMASSpeed.Rows[i][3];
                }
                _dtSpeeds.Rows.Add(dr);
            }

            _resultData = new VMASResultData();

            _timer           = new System.Timers.Timer(_mainCfg.RealtimeInterval);
            _timer.Elapsed  += OnTimer;
            _timer.AutoReset = true;

            f_result = new VMASResultForm();
        }