/// <summary> /// Method for format a scan failure reason /// </summary> /// <returns>The string of the failure of the non start scan</returns> public string tagScanFailureReason() { PbRspGetStatus status = (PbRspGetStatus)getStatus(); if (status == null) { return("Device not responding"); } if ((status.scanStatus & (byte)ScanStatusFlags.SSF_ScanningTagsNow) != 0) { return("Device already scanning tags"); } if ((status.scanStatus & (byte)ScanStatusFlags.SSF_TagScanWasCanceled) != 0) { return("Tag scan canceled"); } if ((status.systemStatus & (byte)SystemStatusFlags.SSF_12VoltsFailure) != 0) { return("12V power failure"); } if ((status.systemStatus & (byte)SystemStatusFlags.SSF_5VoltsFailure) != 0) { return("5V power failure"); } if ((status.systemStatus & (byte)SystemStatusFlags.SSF_AntennaNotConnected) != 0) { return("Antenna disconnected"); } return("Unknown"); }
/// <summary> /// /// </summary> /// <param name="e"></param> protected override void OnLoad(EventArgs e) { loopPeriodTextBox.Text = (string)Application.UserAppDataRegistry.GetValue(GetType().Name + "LoopPeriod", "0.5"); loopCheckBox.Checked = ((int)Application.UserAppDataRegistry.GetValue(GetType().Name + "LoopEnabled", 0) != 0); assumeUnknownCheckBox.Checked = ((int)Application.UserAppDataRegistry.GetValue(GetType().Name + "AssumeUnknownTags", 0) != 0); switch ((int)Application.UserAppDataRegistry.GetValue(GetType().Name + "ReceiveTags", 0)) { case 0: default: receiveTagsAsynchronouslyRadioButton.Checked = true; break; case 1: receiveTagsSynchronouslyAfterScanRadioButton.Checked = true; break; case 2: receiveTagsSynchronouslyDuringScanRadioButton.Checked = true; break; } base.OnLoad(e); // Get the latch status and display it. PbRspGetStatus status = (PbRspGetStatus)device.getStatus(); // Get the device's current correlation threshold. This value is saved in Flash ROM on the // device and may be different per device. byte correlationThreshold = device.getCorrelationThreshold(); Debug.Assert(correlationThreshold > 0); correlationThresholdTextBox.Text = correlationThreshold.ToString(); }
/// <summary> /// /// </summary> /// <param name="deviceBoard"></param> public DoorAndLightDialog(DeviceRfidBoard deviceBoard) { this.deviceBoard = deviceBoard; InitializeComponent(); PbRspGetStatus status = (PbRspGetStatus)deviceBoard.getStatus(); if ((status.doorStatus & (int)DoorStatusFlags.DSF_DoorIsOpen) != 0) { doorStateLabel.Text = "Door Open"; } else { doorStateLabel.Text = "Door Closed"; } }