| | |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.TaskNum, taskCommand.TaskNum, childDeviceCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, taskCommand.TargetAddress, childDeviceCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName.Weight, taskCommand.Weight, childDeviceCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName.Width, taskCommand.Width, childDeviceCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName.Height, taskCommand.Height, childDeviceCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName.Barcode, taskCommand.Barcode, childDeviceCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName.ResponState, 86, childDeviceCode); |
| | | |
| | | for (int i = 0; i < 6; i++) |
| | | { |
| | | ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(childDeviceCode); |
| | | if (command != null) |
| | | { |
| | | if (command.TaskNum == taskCommand.TaskNum && command.TargetAddress == taskCommand.TargetAddress && command.Weight == taskCommand.Weight && command.Barcode == taskCommand.Barcode) |
| | | { |
| | | WriteInfo(conveyorLine.DeviceName, $"æ¶é´ï¼ã{DateTime.Now}ãåå
¥ä»»å¡æååå
¥æ¬¡æ°{i}åå
¥ä»»å¡ã{JsonConvert.SerializeObject(taskCommand)}ã"); |
| | | return true; |
| | | } |
| | | if (command.TaskNum != taskCommand.TaskNum) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.TaskNum, taskCommand.TaskNum, childDeviceCode); |
| | | Thread.Sleep(100); |
| | | } |
| | | if (command.Barcode != taskCommand.Barcode) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.Barcode, taskCommand.Barcode, childDeviceCode); |
| | | Thread.Sleep(100); |
| | | } |
| | | if (command.TaskNum != taskCommand.TaskNum) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.TaskNum, taskCommand.TaskNum, childDeviceCode); |
| | | Thread.Sleep(100); |
| | | } |
| | | if (command.TargetAddress != taskCommand.TargetAddress) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, taskCommand.TargetAddress, childDeviceCode); |
| | | Thread.Sleep(100); |
| | | } |
| | | } |
| | | conveyorLine.SetValue(ConveyorLineDBName.ResponState, 86, childDeviceCode); |
| | | } |
| | | WriteInfo(conveyorLine.DeviceName, $"æ¶é´ï¼ã{DateTime.Now}ãåå
¥ä»»å¡æåä»»å¡å·ã{taskCommand.TaskNum}ãæçå·ã{taskCommand.Barcode}ãç®æ å°åã{taskCommand.TargetAddress}ãå½åèç¹ã{childDeviceCode}ã"); |
| | | return false; |
| | | return true; |
| | | |
| | | #region éè¦æ ¡éªèªå·±åæ¶æ³¨é |
| | | //for (int i = 0; i < 6; i++) |
| | | //{ |
| | | // ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(childDeviceCode); |
| | | // if (command != null) |
| | | // { |
| | | // if (command.TaskNum == taskCommand.TaskNum && command.TargetAddress == taskCommand.TargetAddress && command.Height == taskCommand.Height && command.Width == taskCommand.Width && command.Barcode == taskCommand.Barcode) |
| | | // { |
| | | // WriteInfo(conveyorLine.DeviceName, $"æ¶é´ï¼ã{DateTime.Now}ãåå
¥ä»»å¡æååå
¥æ¬¡æ°{i}åå
¥ä»»å¡ã{JsonConvert.SerializeObject(taskCommand)}ã"); |
| | | // return true; |
| | | // } |
| | | // if (command.TaskNum != taskCommand.TaskNum) |
| | | // { |
| | | // conveyorLine.SetValue(ConveyorLineDBName.TaskNum, taskCommand.TaskNum, childDeviceCode); |
| | | // Thread.Sleep(100); |
| | | // } |
| | | // if (command.Barcode != taskCommand.Barcode) |
| | | // { |
| | | // conveyorLine.SetValue(ConveyorLineDBName.Barcode, taskCommand.Barcode, childDeviceCode); |
| | | // Thread.Sleep(100); |
| | | // } |
| | | // if (command.Height != taskCommand.Height) |
| | | // { |
| | | // conveyorLine.SetValue(ConveyorLineDBName.Height, taskCommand.Height, childDeviceCode); |
| | | // Thread.Sleep(100); |
| | | // } |
| | | // if (command.Width != taskCommand.Width) |
| | | // { |
| | | // conveyorLine.SetValue(ConveyorLineDBName.Width, taskCommand.Width, childDeviceCode); |
| | | // Thread.Sleep(100); |
| | | // } |
| | | // if (command.TargetAddress != taskCommand.TargetAddress) |
| | | // { |
| | | // conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, taskCommand.TargetAddress, childDeviceCode); |
| | | // Thread.Sleep(100); |
| | | // } |
| | | // } |
| | | // conveyorLine.SetValue(ConveyorLineDBName.ResponState, 86, childDeviceCode); |
| | | //} |
| | | //WriteInfo(conveyorLine.DeviceName, $"æ¶é´ï¼ã{DateTime.Now}ãåå
¥ä»»å¡æåä»»å¡å·ã{taskCommand.TaskNum}ãæçå·ã{taskCommand.Barcode}ãç®æ å°åã{taskCommand.TargetAddress}ãå½åèç¹ã{childDeviceCode}ã"); |
| | | //return false; |
| | | #endregion |
| | | } |
| | | } |
| | | } |