Exemple #1
0
        public void OperateStart()
        {
            this.openSerialPort();
            this.bInventoryStoped = false;
            ActionIndex           = 0;
            if (actionList.Count > 0)
            {
                operateAction action = actionList[ActionIndex];

                if (!action.bLoop)
                {
                    ActionIndex++;
                }
                _RFIDHelper.SendCommand(action.nextCommand, action.nextCommandType);
            }
        }
Exemple #2
0
        void _RFIDHelper_evtCardState(RFIDEventType eventType, object o)
        {
            if ((this.ActionIndex + 1) <= actionList.Count)
            {
                operateAction action = actionList[ActionIndex];
                if (!action.bLoop)
                {
                    ActionIndex++;
                }
                if (eventType == action.invokeEvent)
                {
                    string value = null;
                    value = action.getProcessedData(o);
                    if (value != null)
                    {
                        if (null != this.callback)
                        {
                            this.callback(new operateMessage("success", value));
                        }
                    }
                    if (action.nextCommandType != RFIDEventType.RMU_Unknown)
                    {
                        _RFIDHelper.SendCommand(action.nextCommand, action.nextCommandType, false);
                    }

                    //如果已经是最后一个action,选择是否自动关闭数据解析回调
                    if ((ActionIndex > (actionList.Count - 1)) && this.bAutoRemoveParser)
                    {
                        this.closeSerialPort();
                    }
                }
                else
                {
                    //异常出现
                    this.clearException(eventType, o);
                }
            }
        }