Example #1
0
        /// <summary>
        /// 注册消息监听
        /// </summary>
        private void SetupReceivers()
        {
            MsgCenter.RegisterReceiver(this, Constants.MSG_LOAD_PROGRAM, MachineMsg.SETUP_INFO, MachineMsg.INIT_VISION, MsgConstants.SWITCH_USER, MsgConstants.MODIFY_ACCESS, Domain.MsgType.MSG_FIND_MARK_FIALED, Domain.MsgType.MSG_BLOBS_FIALED, LngMsg.SWITCH_LNG, Domain.MsgType.MSG_FIND_BARCODE_FIALED);
            MsgCenter.RegisterReceiver(this.ProgramCtl, Constants.MSG_ADD_PATTERN, Constants.MSG_FINISH_ADDING_CMD_LINE, Constants.MSG_FINISH_ADDING_CMD_LINES, Constants.MSG_FINISH_INSERTING_CMD_LINE, Constants.MSG_FINISH_DELETING_CMD_LINE, Constants.MSG_FINISH_EDITING_CMD_LINE, Constants.MSG_SYS_POSITIONS_DEFS_CHANGED, Constants.MSG_NEW_PROGRAM, Constants.MSG_LOAD_PROGRAM, Constants.MSG_FINISH_EDITING_PATTREN_ORIGIN, Constants.MSG_SAVE_PROGRAM, Domain.MsgType.MSG_LINEEDITLOOK_SHOW, MsgConstants.SWITCH_USER, MsgConstants.MODIFY_ACCESS, LngMsg.SWITCH_LNG, Constants.MSG_TEACH_CONVEYOR2_ORIGIN, MachineMsg.SETUP_VALVE,
                                       Domain.MsgType.MSG_SINGLE_DOT_SETTING,
                                       Constants.MSG_PATTERN_EDITED);
            MsgCenter.RegisterReceiver(this.MainNav, MsgType.IDLE, MsgType.BUSY, MsgType.RUNNING, MsgType.PAUSED, MsgConstants.SWITCH_USER, MsgConstants.MODIFY_ACCESS, LngMsg.SWITCH_LNG);
            MsgCenter.RegisterReceiver(this.ProgramNav, MsgType.IDLE, MsgType.BUSY, MsgType.RUNNING, MsgType.PAUSED, MsgConstants.SWITCH_USER, MsgConstants.MODIFY_ACCESS, LngMsg.SWITCH_LNG);
            MsgCenter.RegisterReceiver(this.RunNav, MsgType.IDLE, MsgType.BUSY);
            MsgCenter.RegisterReceiver(this.RunInfoCtl, MsgType.IDLE, MsgType.BUSY, MsgType.RUNNING, MsgType.PAUSED, Constants.MSG_NEW_PROGRAM, MsgConstants.SWITCH_USER, MsgConstants.MODIFY_ACCESS, LngMsg.SWITCH_LNG);
            MsgCenter.RegisterReceiver(this.RunInfoCtl2, MachineMsg.SINGLEDROPWEIGHT_UPDATE, Domain.MsgType.MSG_CURRENT_BARCODE, Domain.MsgType.MSG_CURRENT_HEIGHT, LngMsg.SWITCH_LNG);
            MsgCenter.RegisterReceiver(this.ManualCtl, MsgType.IDLE, MsgType.BUSY, MsgType.RUNNING, MsgType.PAUSED, MsgConstants.SWITCH_USER, MsgConstants.MODIFY_ACCESS);
            //MsgCenter.RegisterReceiver(this.ConveyorCtl, MsgType.IDLE, MsgType.RUNNING);

            //Rtv
            MsgCenter.RegisterReceiver(this.ctlRtvInfo, LngMsg.MSG_Barcode_Info, LngMsg.MSG_WidthAndHeight_Info, LngMsg.MSG_Clear_RtvInfo);

            MsgCenter.Broadcast(MsgType.IDLE, this, null);
        }