public MotorolaDriver() { _reader = new Reader(); _readerData = new Symbol.Barcode.ReaderData(Symbol.Barcode.ReaderDataTypes.Text, Symbol.Barcode.ReaderDataLengths.MaximumLabel); _reader.Actions.Enable(); _reader.Decoders.DisableAll(); _reader.Decoders.UPCA.Enabled = true; _reader.Decoders.UPCA.ReportCheckDigit = true; _reader.Decoders.UPCE0.Enabled = true; _reader.Decoders.UPCE0.ReportCheckDigit = true; _reader.Decoders.CODE39.Enabled = true; _reader.Decoders.CODE39.ReportCheckDigit = true; _reader.Decoders.EAN8.Enabled = true; _reader.Decoders.EAN8.ConvertToEAN13 = true; _reader.Decoders.CODE128.Enabled = true; _reader.Decoders.EAN13.Enabled = true; _reader.Decoders.QRCODE.Enabled = true; _reader.ReadNotify += new EventHandler(_reader_ReadNotify); _reader.Actions.Read(_readerData); }
void myReader_ReadNotify(object sender, EventArgs e) { Symbol.Barcode.ReaderData nextReaderData = myReader.GetNextReaderData(); partID.Text = nextReaderData.Text; getPart(nextReaderData.Text); myReader.Actions.Read(myReaderData); }
private void barcode1_OnRead(object sender, Symbol.Barcode.ReaderData readerData) { if ((OnReadBarCode != null) && enabled) { string s; if (readerData.Type == DecoderTypes.CODE128 || readerData.Type == DecoderTypes.CODE39) { s = readerData.Text; } else { if (readerData.Text.Length == 12) { s = "0" + readerData.Text; } else if (readerData.Text.Length == 14) { s = readerData.Text.Substring(1); } else if (readerData.Text.Length == 13) { s = readerData.Text; } else { s = String.Empty; } } OnReadBarCode(s, readerData.Text); } }
private void PartShow_Load(object sender, EventArgs e) { loadRegVals(); myReader = new Symbol.Barcode.Reader(); myReaderData = new Symbol.Barcode.ReaderData(Symbol.Barcode.ReaderDataTypes.Text, 7905); myReader.Actions.Enable(); myReader.ReadNotify += new EventHandler(myReader_ReadNotify); myReader.Actions.Read(myReaderData); }
/// <summary> /// Read complete or failure notification. /// </summary> private void MyReader_ReadNotify(object sender, EventArgs e) { Symbol.Barcode.ReaderData TheReaderData = this.MyReader.GetNextReaderData(); // If it is a successful read (as opposed to a failed one) if (TheReaderData.Result == Symbol.Results.SUCCESS) { // Handle the data from this read. RFScanEventArgs eRFScan = new RFScanEventArgs(TheReaderData.Text); OnRFScan(eRFScan); // Start the next read this.StartRead(); } }
void _reader_ReadNotify(object sender, EventArgs e) { try { if (Scan != null) { ScanEventArgs args = new ScanEventArgs(); Symbol.Barcode.ReaderData nextReaderData = _reader.GetNextReaderData(); //Get(s)NextReaderData args.Data = nextReaderData.Text; Scan(this, args); } } finally { _reader.Actions.Read(_readerData); //await next scan. } }