Example #1
0
        public TSIForm(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;
            EmissionInfo ei = new EmissionInfo();

            _db.GetEmissionInfoFromVIN(_VIN, ei);
            _RatedRPM = ei.RatedRPM;

            _dtRealTime = new DataTable("TSIRealTime");
            _dtRealTime.Columns.Add("VIN");
            _dtRealTime.Columns.Add("StartTime");
            _dtRealTime.Columns.Add("TimeSN");
            _dtRealTime.Columns.Add("Step");
            _dtRealTime.Columns.Add("RPM");
            _dtRealTime.Columns.Add("CurrentStageTime");
            _dtRealTime.Columns.Add("Lambda");
            _dtRealTime.Columns.Add("OilTemp");
            _dtRealTime.Columns.Add("HResult");
            _dtRealTime.Columns.Add("LResult");

            _resultData = new TSIResultData();

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

            f_result = new TSIResultForm();
        }
Example #2
0
        public SelfcheckForm(DynoCmd dynoCmd, MainSetting mainCfg, List <bool> selfChecks, EnvironmentData envData, bool bDiesel)
        {
            InitializeComponent();
            _lastHeight = Height;
            _dynoCmd    = dynoCmd;
            _dicResults = new Dictionary <Form, bool>();
            _dicStops   = new Dictionary <Form, bool>();
            _envData    = envData;
            _selfChecks = selfChecks;

            f_gasBoxSelfcheck     = new GasBoxSelfcheckSubForm(_dynoCmd, mainCfg, _dicResults, _dicStops, bDiesel);
            f_flowmeterSelfcheck  = new FlowmeterSelfcheckSubForm(_dynoCmd, mainCfg, _dicResults, _dicStops);
            f_smokerSelfcheck     = new SmokerSelfcheckSubForm(_dynoCmd, mainCfg, _dicResults, _dicStops);
            f_oilTempSelfcheck    = new OilTempSelfcheckSubForm(_dynoCmd, mainCfg, _dicResults, _dicStops);
            f_tachometerSelfcheck = new TachometerSelfcheckSubForm(_dynoCmd, mainCfg, _dicResults, _dicStops);
            f_weatherSelfcheck    = new WeatherSelfcheckSubForm(_dynoCmd, mainCfg, _dicResults, _dicStops, _envData);

            f_gasBoxSelfcheck.SelfcheckDone     += OnSelfcheckDone;
            f_flowmeterSelfcheck.SelfcheckDone  += OnSelfcheckDone;
            f_smokerSelfcheck.SelfcheckDone     += OnSelfcheckDone;
            f_oilTempSelfcheck.SelfcheckDone    += OnSelfcheckDone;
            f_tachometerSelfcheck.SelfcheckDone += OnSelfcheckDone;
            f_weatherSelfcheck.SelfcheckDone    += OnSelfcheckDone;

            _dicResults.Add(f_gasBoxSelfcheck, !selfChecks[0]);
            _dicResults.Add(f_flowmeterSelfcheck, !selfChecks[1]);
            _dicResults.Add(f_smokerSelfcheck, !selfChecks[2]);
            _dicResults.Add(f_oilTempSelfcheck, !selfChecks[3]);
            _dicResults.Add(f_tachometerSelfcheck, !selfChecks[4]);
            _dicResults.Add(f_weatherSelfcheck, !selfChecks[5]);

            _dicStops.Add(f_gasBoxSelfcheck, false);
            _dicStops.Add(f_flowmeterSelfcheck, false);
            _dicStops.Add(f_smokerSelfcheck, false);
            _dicStops.Add(f_oilTempSelfcheck, false);
            _dicStops.Add(f_tachometerSelfcheck, false);
            _dicStops.Add(f_weatherSelfcheck, false);

            _buttonsOrder = new Button[] { btn1GasBox, btn2Flowmeter, btn3Smoker, btn4OilTemp, btn5Tachometer, btn6Weather };
            for (int i = 0; i < selfChecks.Count; i++)
            {
                if (_buttonsOrder.Length > i)
                {
                    _buttonsOrder[i].Enabled = selfChecks[i];
                }
            }

            _dicSubForms = new Dictionary <Button, Form> {
                { btn1GasBox, f_gasBoxSelfcheck },
                { btn2Flowmeter, f_flowmeterSelfcheck },
                { btn3Smoker, f_smokerSelfcheck },
                { btn4OilTemp, f_oilTempSelfcheck },
                { btn5Tachometer, f_tachometerSelfcheck },
                { btn6Weather, f_weatherSelfcheck }
            };
        }
 public OilTempPreheatingSubForm(DynoCmd dynoCmd, MainSetting mainCfg, Dictionary <Form, bool> dicResults)
 {
     InitializeComponent();
     _lastHeight      = Height;
     _dynoCmd         = dynoCmd;
     _mainCfg         = mainCfg;
     _dicResults      = dicResults;
     _timer           = new System.Timers.Timer(_mainCfg.RealtimeInterval);
     _timer.Elapsed  += OnTimer;
     _timer.AutoReset = true;
 }
 public FlowmeterSelfcheckSubForm(DynoCmd dynoCmd, MainSetting mainCfg, Dictionary <Form, bool> dicResults, Dictionary <Form, bool> dicStops)
 {
     InitializeComponent();
     _lastHeight      = Height;
     _dynoCmd         = dynoCmd;
     _mainCfg         = mainCfg;
     _dicResults      = dicResults;
     _dicStops        = dicStops;
     _strStep         = new string[] { "清零", "清零结果", "氧量程检查", "流量检查", "准备完成" };
     _timer           = new System.Timers.Timer(_mainCfg.RealtimeInterval);
     _timer.Elapsed  += OnTimer;
     _timer.AutoReset = true;
 }
 public GasBoxSelfcheckSubForm(DynoCmd dynoCmd, MainSetting mainCfg, Dictionary <Form, bool> dicResults, Dictionary <Form, bool> dicStops, bool bDiesel)
 {
     InitializeComponent();
     _lastHeight      = Height;
     _dynoCmd         = dynoCmd;
     _mainCfg         = mainCfg;
     _dicResults      = dicResults;
     _dicStops        = dicStops;
     _bDiesel         = bDiesel;
     _timer           = new System.Timers.Timer(_mainCfg.RealtimeInterval);
     _timer.Elapsed  += OnTimer;
     _timer.AutoReset = true;
 }
Example #6
0
 public WeatherSelfcheckSubForm(DynoCmd dynoCmd, MainSetting mainCfg, Dictionary <Form, bool> dicResults, Dictionary <Form, bool> dicStops, EnvironmentData envData)
 {
     InitializeComponent();
     _lastHeight      = Height;
     _dynoCmd         = dynoCmd;
     _mainCfg         = mainCfg;
     _dicResults      = dicResults;
     _dicStops        = dicStops;
     _envData         = envData;
     _timer           = new System.Timers.Timer(_mainCfg.RealtimeInterval);
     _timer.Elapsed  += OnTimer;
     _timer.AutoReset = true;
 }
Example #7
0
 public DynoGlideCheckForm(DynoCmd dynoCmd, MainSetting mainCfg, Logger log, bool bDiesel)
 {
     InitializeComponent();
     _lastHeight      = Height;
     _dynoCmd         = dynoCmd;
     _mainCfg         = mainCfg;
     _log             = log;
     _bDiesel         = bDiesel;
     _dtRTData        = new DataTable("RTData");
     _dtResult        = new DataTable("Result");
     _timer           = new System.Timers.Timer(_mainCfg.RealtimeInterval);
     _timer.Elapsed  += OnTimer;
     _timer.AutoReset = true;
     _dieselIHP       = DieselIHP.IHP30kW;
 }
 public SmokerPreheatingSubForm(DynoCmd dynoCmd, MainSetting mainCfg, Dictionary <Form, bool> dicResults)
 {
     InitializeComponent();
     _lastHeight      = Height;
     _dynoCmd         = dynoCmd;
     _mainCfg         = mainCfg;
     _dicResults      = dicResults;
     _timer           = new System.Timers.Timer(_mainCfg.RealtimeInterval);
     _timer.Elapsed  += OnTimer;
     _timer.AutoReset = true;
     _k50Err          = 0;
     _k50             = 0;
     _k70Err          = 0;
     _k70             = 0;
     _bResults        = new bool[] { false, false };
 }
Example #9
0
        public PreheatingForm(DynoCmd dynoCmd, MainSetting mainCfg)
        {
            InitializeComponent();
            _lastHeight            = Height;
            _dynoCmd               = dynoCmd;
            _dicResults            = new Dictionary <Form, bool>();
            f_dynoPreheating       = new DynoPreheatingSubForm(_dynoCmd, mainCfg, _dicResults);
            f_gasBoxPreheating     = new GasBoxPreheatingSubForm(_dynoCmd, mainCfg, _dicResults);
            f_flowmeterPreheating  = new FlowmeterPreheatingSubForm(_dynoCmd, mainCfg, _dicResults);
            f_smokerPreheating     = new SmokerPreheatingSubForm(_dynoCmd, mainCfg, _dicResults);
            f_weatherPreheating    = new WeatherPreheatingSubForm(_dynoCmd, mainCfg, _dicResults);
            f_tachometerPreheating = new TachometerPreheatingSubForm(_dynoCmd, mainCfg, _dicResults);
            f_oilTempPreheating    = new OilTempPreheatingSubForm(_dynoCmd, mainCfg, _dicResults);

            f_dynoPreheating.PreheatingDone       += OnPreheatingDone;
            f_gasBoxPreheating.PreheatingDone     += OnPreheatingDone;
            f_flowmeterPreheating.PreheatingDone  += OnPreheatingDone;
            f_smokerPreheating.PreheatingDone     += OnPreheatingDone;
            f_weatherPreheating.PreheatingDone    += OnPreheatingDone;
            f_tachometerPreheating.PreheatingDone += OnPreheatingDone;
            f_oilTempPreheating.PreheatingDone    += OnPreheatingDone;

            _dicResults.Add(f_dynoPreheating, false);
            _dicResults.Add(f_gasBoxPreheating, false);
            _dicResults.Add(f_flowmeterPreheating, false);
            _dicResults.Add(f_smokerPreheating, false);
            _dicResults.Add(f_weatherPreheating, false);
            _dicResults.Add(f_tachometerPreheating, false);
            _dicResults.Add(f_oilTempPreheating, false);

            _buttonsOrder = new Button[] { btn1Dyno, btn2GasBox, btn3Flowmeter, btn4Smoker, btn5Weather, btn6Tacho, btn7Oil };

            _dicSubForms = new Dictionary <Button, Form> {
                { btn1Dyno, f_dynoPreheating },
                { btn2GasBox, f_gasBoxPreheating },
                { btn3Flowmeter, f_flowmeterPreheating },
                { btn4Smoker, f_smokerPreheating },
                { btn5Weather, f_weatherPreheating },
                { btn6Tacho, f_tachometerPreheating },
                { btn7Oil, f_oilTempPreheating }
            };
        }
Example #10
0
        public ASMForm(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;

            _dtRealTime = new DataTable("ASMRealTime");
            _dtRealTime.Columns.Add("VIN");
            _dtRealTime.Columns.Add("StartTime");
            _dtRealTime.Columns.Add("TimeSN");
            _dtRealTime.Columns.Add("Step");
            _dtRealTime.Columns.Add("TestTime");
            _dtRealTime.Columns.Add("WorkingTime");
            _dtRealTime.Columns.Add("RPM");
            _dtRealTime.Columns.Add("Speed");
            _dtRealTime.Columns.Add("Power");
            _dtRealTime.Columns.Add("HC");
            _dtRealTime.Columns.Add("CO");
            _dtRealTime.Columns.Add("NO");
            _dtRealTime.Columns.Add("CO2");
            _dtRealTime.Columns.Add("O2");
            _dtRealTime.Columns.Add("lambda");
            _dtRealTime.Columns.Add("KH");
            _dtRealTime.Columns.Add("DF");
            _dtRealTime.Columns.Add("HCNor");
            _dtRealTime.Columns.Add("CONor");
            _dtRealTime.Columns.Add("NONor");

            _resultData = new ASMResultData();

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

            f_result = new ASMResultForm();
        }
Example #11
0
 public VehicleLoginForm(ModelLocal db, DynoCmd dynoCmd, MainSetting mainCfg, Logger log)
 {
     InitializeComponent();
     _lastHeight = Height;
     _db         = db;
     _dynoCmd    = dynoCmd;
     _mainCfg    = mainCfg;
     _log        = log;
     if (_mainCfg.ScannerPort.Length > 0)
     {
         _sp = new SerialPortClass(
             _mainCfg.ScannerPort,
             _mainCfg.ScannerBaud,
             Parity.None,
             8,
             StopBits.One
             );
         try {
             _sp.OpenPort();
             _sp.DataReceived += SerialDataReceived;
         } catch (Exception ex) {
             _log.TraceError("Open serial port error: " + ex.Message);
             MessageBox.Show("打开串口扫码枪出错", "初始化错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     _serialRecvBuf = string.Empty;
     if (_mainCfg.DynoParamIP.Length > 0)
     {
         try {
             _dynoParamRecver = new DynoParamRecv(_mainCfg.DynoParamIP, _mainCfg.DynoParamPort);
             _dynoParamRecver.DynoParamRecvEvent += OnDynoParamRecv;
             _dynoParamRecvFlag = new ManualResetEvent(true);
         } catch (Exception ex) {
             _log.TraceError("Connect to dyno parameter server error: " + ex.Message);
             MessageBox.Show("无法连接到测功机参数服务端软件", "初始化错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     VI     = new VehicleInfo();
     EI     = new EmissionInfo();
     _carID = -1;
 }
Example #12
0
        public LugdownForm(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;
            EmissionInfo ei = new EmissionInfo();

            _db.GetEmissionInfoFromVIN(_VIN, ei);
            _RatedRPM     = ei.RatedRPM;
            _MaxRPM       = -1;
            _canGetMaxRpm = false;

            _dtRealTime = new DataTable("LugdownRealTime");
            _dtRealTime.Columns.Add("VIN");
            _dtRealTime.Columns.Add("StartTime");
            _dtRealTime.Columns.Add("TimeSN");
            _dtRealTime.Columns.Add("RPM");
            _dtRealTime.Columns.Add("Speed");
            _dtRealTime.Columns.Add("Power");
            _dtRealTime.Columns.Add("Torque");
            _dtRealTime.Columns.Add("K");
            _dtRealTime.Columns.Add("CO2");
            _dtRealTime.Columns.Add("NOx");

            _resultData = new LDResultData();

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

            f_result = new LDResultForm();
        }
Example #13
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();
        }