void Start() { Instance = this; sp.Open(); sp.ReadTimeout = 1; }
public ViewModel(Home home) { m_home = home; m_waitHandle = new AutoResetEvent(false); cpu_done = false; m_scan_cancel = new CancellationTokenSource(); m_arduinoControl = new ArduinoControl(m_waitHandle, m_scan_cancel); m_motors = new Motor[Constants.NUMBER_OF_MOTORS]; for (int i = 0; i < Constants.NUMBER_OF_MOTORS; ++i) { m_motors[i] = new Motor(); } cameraCapture = new CameraCapture(); /**********Added for barcode*********/ m_barcode = new Barcode(); /*********Added for ImageStitching*********/ m_stitcher = new ImageStitching(); m_collabrated = false; m_cpu_scanned = 0; m_y_axis_dividers_count = 0; m_progress = 0; m_cpu_done = false; UpdateLoggerPath(); UsrSettings.PropertyChanged += UpdateLoggerPathEventHandler; DevSettingsProp.SettingChanging += ValidateDevSettings; BindingOperations.EnableCollectionSynchronization(ErrorMessages, m_lock); //This is needed to update the collection BindingOperations.EnableCollectionSynchronization(InfoMessages, m_lock); }