Ejemplo n.º 1
0
 public AdvancedWindow(OBDIfEx _obdIfEx, OBDTest _obdTest)
 {
     InitializeComponent();
     Title           += " Ver(Main/Dll): " + MainFileVersion.AssemblyVersion + "/" + DllVersion <SH_OBD_Dll> .AssemblyVersion;
     tabView.Content  = new DataViewUC(_obdIfEx, _obdTest);
     tabCheck.Content = new CheckUC(_obdTest.DbLocal, _obdIfEx.Log);
 }
Ejemplo n.º 2
0
        public MainWindow()
        {
            InitializeComponent();
            Title         += " Ver(Main/Dll): " + MainFileVersion.AssemblyVersion + "/" + DllVersion <SH_OBD_Dll> .AssemblyVersion;
            _serialRecvBuf = "";
            _bCanOBDTest   = true;
            _lastHeight    = Height;
            _obdIfEx       = new OBDIfEx();
            if (_obdIfEx.StrLoadConfigResult.Length > 0)
            {
                _obdIfEx.StrLoadConfigResult += "是否要以默认配置运行程序?点击\"否\":将会退出程序。";
                MessageBoxResult result = HandyControl.Controls.MessageBox.Ask(_obdIfEx.StrLoadConfigResult, "加载配置文件出错");
                if (result == MessageBoxResult.No)
                {
                    Environment.Exit(0);
                }
            }
            _obdTest = new OBDTest(_obdIfEx);
            if (_obdIfEx.ScannerPortOpened)
            {
                _obdIfEx.ScannerSP.DataReceived += new SerialPortClass.SerialPortDataReceiveEventArgs(SerialDataReceived);
            }
            _obdTest.OBDTestStart     += new Action(OnOBDTestStart);
            _obdTest.SetupColumnsDone += new Action(OnSetupColumnsDone);
            _obdTest.WriteDbStart     += new Action(OnWriteDbStart);
            _obdTest.WriteDbDone      += new Action(OnWriteDbDone);

            // 测试本地数据库连接是否正常
            Task.Factory.StartNew(TestNativeDatabase);
        }
Ejemplo n.º 3
0
 public DataViewUC(OBDIfEx obdIfEx, OBDTest obdTest)
 {
     InitializeComponent();
     _obdIfEx = obdIfEx;
     _obdTest = obdTest;
 }