/// <summary> /// Status notification handler. /// </summary> private void myReader_StatusNotify(object Sender, EventArgs e) { // Checks if the Invoke method is required because the StatusNotify delegate is called by a different thread if (this.InvokeRequired) { // Executes the StatusNotify delegate on the main thread this.Invoke(myStatusNotifyHandler, new object[] { Sender, e }); } else { // Get ReaderData Symbol.Barcode.BarcodeStatus TheStatusData = this.myScanSampleAPI.Reader.GetNextStatus(); switch (TheStatusData.State) { case Symbol.Barcode.States.IDLE: //if (currentListView == SCAN) // statusBar.Text = "Press trigger to scan"; break; case Symbol.Barcode.States.READY: //if ((currentListView == SCAN)) // statusBar.Text = "Aim at barcode to scan"; break; default: //statusBar.Text = TheStatusData.Text; break; } prevState = TheStatusData.State; } }
private void OnAPIStatusNotify(object Sender, EventArgs e) { // Get ReaderData try { Symbol.Barcode.BarcodeStatus barcodeStatus = this.mScanAPI.Reader.GetNextStatus(); switch (barcodeStatus.State) { case Symbol.Barcode.States.WAITING: break; case Symbol.Barcode.States.IDLE: this.sbMain.Text = "Press trigger to scan"; break; case Symbol.Barcode.States.READY: this.sbMain.Text = "Aim at barcode to scan"; break; default: this.sbMain.Text = barcodeStatus.Text; break; } } catch (Exception ex) { App.ReportError(ex); } }
/// <summary> /// Status notification handler. /// </summary> private void myReader_StatusNotify(object Sender, EventArgs e) { // Checks if the Invoke method is required because the StatusNotify delegate is called by a different thread if (this.InvokeRequired) { // Executes the StatusNotify delegate on the main thread this.Invoke(myStatusNotifyHandler, new object[] { Sender, e }); } else { // Get ReaderData Symbol.Barcode.BarcodeStatus TheStatusData = this.barcodeScanner.Reader.GetNextStatus(); } }
void _reader_OnStatus(object sender, Symbol.Barcode.BarcodeStatus barcodeStatus) { //Log.Write(new LogEntry("SymbolReader: _reader_OnStatus")); ReaderState state = new ReaderState(); switch (barcodeStatus.State) { case Symbol.Barcode.States.WAITING: state.ScannerState = ScannerState.Waiting; break; case Symbol.Barcode.States.IDLE: state.ScannerState = ScannerState.Idle; break; case Symbol.Barcode.States.READY: state.ScannerState = ScannerState.Ready; break; } NotifyStatus(state); }
public override ReaderState GetState() { //Log.Write(new LogEntry("SymbolReader: GetState")); ReaderState state = new ReaderState(); Symbol.Barcode.BarcodeStatus statusData = _reader.Reader.GetNextStatus(); switch (statusData.State) { case Symbol.Barcode.States.WAITING: state.ScannerState = ScannerState.Waiting; break; case Symbol.Barcode.States.IDLE: state.ScannerState = ScannerState.Idle; break; case Symbol.Barcode.States.READY: state.ScannerState = ScannerState.Ready; break; } return(state); }