public MainWindow()
        {
            InitializeComponent();
            m_SyncContext = SynchronizationContext.Current;
            ins           = this;
            //logger.Info("indo");
            //logger.Error("error");
            ThreadPool.SetMinThreads(1000, 500);
            BaseConfig.ins.init();
            ConfigHelper.init();
            labelRowColumn.Content   = BaseConfig.ins.Rows + "行" + BaseConfig.ins.Columns + "列";
            menuRunOnPower.IsChecked = ConfigHelper.IS_POWER_RUN;
            menuWaitVideo.IsChecked  = ConfigHelper.IS_WAIT_VIDEO;
            //LightBoxHelper.SelectedModel = null;
            LightBoxHelper.modelChanged += LightBoxHelper_modelChanged;

            LightBoxHelper.initModels();
            listBoxModels.ItemsSource = LightBoxHelper.listModel;

            //SmsComm.ins.eventStateChanged += SmsComm_eventStateChanged;
            DataComm.ins.eventStateChanged      += DataVideo_eventStateChanged;
            ECANHelper.ins.eventStateChanged    += DataSms_eventStateChanged;
            ECANHelper.ins.eventBoxStateChanged += Ins_eventBoxStateChanged;

            DataComm.ins.init();
            DataComm.ins.open();
            //SmsComm.ins.init();
            //SmsComm.ins.open();

            string path = AppDomain.CurrentDomain.BaseDirectory;
            string str1 = Process.GetCurrentProcess().MainModule.FileName;

            Console.WriteLine(path + ",," + str1);

            LightBoxHelper.startCheckSysTimeThread();

            NettyHelper.start();

            ECANHelper.ins.openDevice();
        }
 private void btnReloadModels_Click(object sender, RoutedEventArgs e)
 {
     LightBoxHelper.initModels();
     listBoxModels.ItemsSource = LightBoxHelper.listModel;
 }