Beispiel #1
0
 public void Dispose()
 {
     if (_BRIReader != null)
     {
         _BRIReader.Dispose();
         _BRIReader = null;
     }
     if (_SSAPI != null)
     {
         _SSAPI.Dispose();
         _SSAPI = null;
     }
     base.Dispose();
 }
Beispiel #2
0
        /*
         * CENTER  The center trigger button on a portable reader.
         * LEFT    The left scan button on a mobile computer.
         * MIDDLE  The center scan button on a mobile computer.
         * RIGHT   The right scan button on a mobile computer.
         * UNKNOWN Unknown button ID.
         *
         * The registry changes
         * ie BriReaderButonEnable( RFIDButtonID.Left ) changes event2 from "ITC_RFID_TRIGGER_EVENT" to "RFIDDCE_LEFT_DELTA" (HKEY_LOCAL_MACHINE\Drivers\HID\ClientDrivers\ITCKeyboard\Layout\A-Numeric\0001\Events\Delta)
         * MIDDLE changes event1 between "RFIDDCE_MIDDLE_DELTA" and "DeltaLeftScan"
         *
         * ITC_RFID_TRIGGER_EVENT is for general RFID and used by IntermecSettings for RFID, that does not include Button Event Firing, which is only done for "Button Remapping" settings to "BRI" (which is RFIDDCE_ in registry).
         * RFIDDCE_... is for BRI
         * so, the ITC_RFID_TRIGGER_EVENT will trigger a RFID TAG read but this button press will not be reported to BRIReader
         */
        public Form1()
        {
            InitializeComponent();
            _SSAPI = new SSAPI();
            BRIReader.LoggerOptionsAdv logOpts = new BRIReader.LoggerOptionsAdv();
            logOpts.LogEnable             = true;
            logOpts.LogFilePath           = @"\RFIDLog1.txt";
            logOpts.IDEConsoleEnable      = false; //send to debugOut?
            logOpts.TimeStampEnable       = true;
            logOpts.TraceSeverity         = BasicBRIReader.LoggerOptions.TraceSeverityLevels.DEBUG;
            logOpts.ShowNonPrintableChars = true;

            _BRIReader = new BRIReader(this, "tcp://127.0.0.1:2189", logOpts);

            _BRIReader.EventHandlerRFIDButton += new DCE_BUTTON_EventHandlerAdv(_BRIReader_EventHandlerRFIDButton);

            //for reading TAGs
            _BRIReader.EventHandlerTag += new Tag_EventHandlerAdv(_BRIReader_EventHandlerTag);

            //will only be called for Trigger presses on RFID Handle (if any)
            _BRIReader.EventHandlerTriggerAction += new TriggerAction_EventHandler(_BRIReader_EventHandlerTriggerAction);

            textBox1.Text = getButtonSetting().ToString();

            //if (!this._BRIReader.IsRFIDButtonEnabled(BRIReader.RFIDButtonIDs.MIDDLE))
            //    this._BRIReader.RFIDButtonEnable(BRIReader.RFIDButtonIDs.MIDDLE);

            chkLeftLower.CheckStateChanged  += new EventHandler(CheckStateChanged);
            chkLeftUpper.CheckStateChanged  += new EventHandler(CheckStateChanged);
            chkLeftLower.CheckStateChanged  += new EventHandler(CheckStateChanged);
            chkRightLower.CheckStateChanged += new EventHandler(CheckStateChanged);

            chkBoxes.Add(BRIReader.RFIDButtonIDs.CENTER, chkCenterScan);
            chkBoxes.Add(BRIReader.RFIDButtonIDs.LEFT, chkLeftLower);
            chkBoxes.Add(BRIReader.RFIDButtonIDs.MIDDLE, chkButtonMiddle);
            chkBoxes.Add(BRIReader.RFIDButtonIDs.RIGHT, chkRightLower);

            chkRightUpper.Enabled = false;
            chkLeftUpper.Enabled  = false;

            CheckBox ChkBox = null;

            foreach (BRIReader.RFIDButtonIDs id in bIDs)
            {
                if (_BRIReader.IsRFIDButtonEnabled(id))
                {
                    if (chkBoxes.TryGetValue(id, out ChkBox))
                    {
                        ChkBox.Checked = true;
                    }
                }
                else
                {
                    if (chkBoxes.TryGetValue(id, out ChkBox))
                    {
                        ChkBox.Checked = false;
                    }
                }
            }
            updateCheckBoxes();
            doNotUpdate = false;
        }