| | |
| | | ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task); |
| | | //conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | |
| | | SendCommand(taskCommand, conveyorLine, childDeviceCode); |
| | | |
| | | bool sendFlag = SendCommand(taskCommand, conveyorLine, childDeviceCode); |
| | | if (sendFlag) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode); |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(newTask); |
| | | //conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | |
| | | SendCommand(taskCommand, conveyorLine, childDeviceCode); |
| | | |
| | | bool sendFlag = SendCommand(taskCommand, conveyorLine, childDeviceCode); |
| | | if (sendFlag) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode); |
| | | _taskService.UpdateData(newTask); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task); |
| | | //conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | |
| | | SendCommand(taskCommand, conveyorLine, childDeviceCode); |
| | | |
| | | bool sendFlag = SendCommand(taskCommand, conveyorLine, childDeviceCode); |
| | | if (sendFlag) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode); |
| | | |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | if (task.TaskType == (int)TaskOutboundTypeEnum.OutTray) |
| | | { |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(newTask); |
| | | //conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | |
| | | SendCommand(taskCommand, conveyorLine, childDeviceCode); |
| | | |
| | | bool sendFlag = SendCommand(taskCommand, conveyorLine, childDeviceCode); |
| | | if (sendFlag) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode); |
| | | _taskService.UpdateData(newTask); |
| | | } |
| | | } |
| | | } |
| | | else |
| | |
| | | taskCommand.ConveyorLineTargetAddress = Convert.ToInt16(stationManager.stationNGChildCode); |
| | | //conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | |
| | | SendCommand(taskCommand, conveyorLine, childDeviceCode); |
| | | |
| | | bool sendFlag = SendCommand(taskCommand, conveyorLine, childDeviceCode); |
| | | if (sendFlag) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode); |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | //conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | SendCommand(taskCommand, conveyorLine, childDeviceCode); |
| | | bool sendFlag = SendCommand(taskCommand, conveyorLine, childDeviceCode); |
| | | if (sendFlag) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode); |
| | | content = _taskService.UpdateTaskStatusToNext(task); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | |
| | | //conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | SendCommand(taskCommand, conveyorLine, childDeviceCode); |
| | | |
| | | bool sendFlag = SendCommand(taskCommand, conveyorLine, childDeviceCode); |
| | | if (sendFlag) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode); |
| | | |
| | | taskNext.ExceptionMessage = log; |
| | | content = _taskService.UpdateTaskStatusToNext(taskNext); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | return content; |
| | | } |
| | | |
| | | public void SendCommand(ConveyorLineTaskCommand_After taskCommand, CommonConveyorLine_GW conveyorLine, string childDeviceCode) |
| | | public bool SendCommand(ConveyorLineTaskCommand_After taskCommand, CommonConveyorLine_GW conveyorLine, string childDeviceCode) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, taskCommand.ConveyorLineTargetAddress, childDeviceCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, Convert.ToInt16(taskCommand.ConveyorLineTargetAddress), childDeviceCode); |
| | | Thread.Sleep(100); |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, taskCommand.ConveyorLineBarcode, childDeviceCode); |
| | | Thread.Sleep(100); |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, taskCommand.ConveyorLineTaskNum, childDeviceCode); |
| | | for (int i = 0; i < 6; i++) |
| | | { |
| | | ConveyorLineTaskCommand_After command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand_After>(childDeviceCode); |
| | | if (command != null) |
| | | { |
| | | if (command.ConveyorLineBarcode == taskCommand.ConveyorLineBarcode && command.ConveyorLineTaskNum == taskCommand.ConveyorLineTaskNum && command.ConveyorLineTargetAddress == taskCommand.ConveyorLineTargetAddress) |
| | | { |
| | | return true; |
| | | } |
| | | if (command.ConveyorLineTargetAddress != taskCommand.ConveyorLineTargetAddress) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, Convert.ToInt16(taskCommand.ConveyorLineTargetAddress), childDeviceCode); |
| | | Thread.Sleep(100); |
| | | } |
| | | if (command.ConveyorLineBarcode != taskCommand.ConveyorLineBarcode) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, taskCommand.ConveyorLineBarcode, childDeviceCode); |
| | | Thread.Sleep(100); |
| | | } |
| | | if (command.ConveyorLineTaskNum != taskCommand.ConveyorLineTaskNum) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, taskCommand.ConveyorLineTaskNum, childDeviceCode); Thread.Sleep(100); |
| | | } |
| | | |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | #endregion |