void SerialDataManager_Feedback(UartComdEventArgs lowerDataInfo)
        {
            if (lowerDataInfo.LowerDataType == LowerDataType.MachineBasicDataType)
            {
                MachineBasicDataInfo machineBasicDataInfo = lowerDataInfo.LowerDataInfo as MachineBasicDataInfo;
                if (flagData == null)
                {
                    flagData = new BaseDataFormFlagData();
                }

                if (flagData.ServoCodeValue1 != machineBasicDataInfo.ServoCodeValue)
                {
                    flagData.ServoCodeValue1 = machineBasicDataInfo.ServoCodeValue;
                    ReflectToObject(btnUpShowNeedleCodeNumber, flagData.ServoCodeValue1.ToString());
                }
            }
        }
Esempio n. 2
0
 void SerialDataManager_Feedback(UartComdEventArgs lowerDataInfo)
 {
     if (lowerDataInfo.LowerDataType == LowerDataType.MachineBasicDataType)
     {
         MachineBasicDataInfo machineBasicDataInfo = lowerDataInfo.LowerDataInfo as MachineBasicDataInfo;
         if (flagData == null)
         {
             flagData = new EditFormFlagData();
         }
         if (flagData.ClickSewingButton != machineBasicDataInfo.ClickSewingButton)
         {
             flagData.ClickSewingButton = machineBasicDataInfo.ClickSewingButton;
             if (flagData.ClickSewingButton)
             {
                 ShowPromptForm();
             }
         }
     }
 }
        protected void SerialPortEx_DataArrived(byte[] uartDatas, byte comd)  //从串口接收数据的功能函数
        {
            LowerDataInfo lowerDataInfo = null;

            if (uartDatas != null)
            {
                switch (comd)
                {
                case 0x30:
                    lowerDataInfo = new MachineBasicDataInfo();
                    break;

                case 0x31:
                    serialDataHelper.SendComdFlag &= 0xFFFE;
                    ScreenStatueData.ScreenStatueDataEX.SendDesignFlag = false;
                    break;

                case 0x32:
                    serialDataHelper.SendComdFlag &= 0xFFFD;
                    break;

                case 0x33:
                    lowerDataInfo = new TestDataInfo();
                    serialDataHelper.SendComdFlag &= 0xFFFB;
                    break;

                case 0x34:
                    serialDataHelper.SendComdFlag &= 0xFFF7;
                    break;

                case 0x35:
                    serialDataHelper.SendComdFlag &= 0xFFEF;
                    break;

                case 0x36:
                    serialDataHelper.SendComdFlag &= 0xFFDF;
                    break;

                case 0x37:
                    serialDataHelper.SendComdFlag &= 0xFFBF;
                    lowerDataInfo = new ShouldPadPointInfo();
                    SerialDataManager.FlowFlag = false;
                    break;

                case 0x38:
                    serialDataHelper.SendComdFlag &= 0xFF7F;
                    SerialDataManager.ScreenButton = false;
                    ScreenStatueData.ScreenStatueDataEX.ResetBtnFlag   = false;
                    ScreenStatueData.ScreenStatueDataEX.BackwardNeedle = false;
                    ScreenStatueData.ScreenStatueDataEX.ForwardNeedle  = false;
                    break;

                case 0x39:
                    serialDataHelper.SendComdFlag &= 0xFEFF;
                    lowerDataInfo = new EncstaInfo();
                    break;

                case 0x3a:
                    serialDataHelper.SendComdFlag &= 0xFDFF;
                    MenuFormManager.SendUnLockFlag = false;
                    lowerDataInfo = new EncResInfo();
                    break;

                default:
                    break;
                }
                if (haveSendData || comd != 0x30)
                {
                    haveSendData = false;
                    serialDataModelCollect.Add(new SerialDataModel(SerialDataType.ReceiveData, comd, uartDatas));
                }
                if (lowerDataInfo != null)
                {
                    lowerDataInfo.LoadLowerData(uartDatas);
                    OnFeedBack(new UartComdEventArgs(lowerDataInfo));
                }
            }
            serialDataHelper.HaveReceiveData = true;
        }