| | |
| | | WriteError("CommonConveyorLineJob", "test", ex); |
| | | //Console.WriteLine(nameof(CommonStackerCraneJob) + ":" + ex.ToString()); |
| | | } |
| | | WriteDebug("CommonConveyorLineJob", "test"); |
| | | //WriteDebug("CommonConveyorLineJob", "test"); |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | |
| | | { |
| | | if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5) |
| | | { |
| | | Console.Out.WriteLine("TaskCompleted" + e.TaskNum); |
| | | //Console.Out.WriteLine("TaskCompleted" + e.TaskNum); |
| | | ConsoleHelper.WriteColorLine($"【{commonStackerCrane.DeviceName}】任务完成,任务号:【{e.TaskNum}】", ConsoleColor.Blue); |
| | | _taskService.StackCraneTaskCompleted(e.TaskNum); |
| | | commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5); |
| | | } |
| | |
| | | if (device != null) |
| | | { |
| | | CommonConveyorLine_GW conveyorLine = (CommonConveyorLine_GW)device; |
| | | if (conveyorLine.IsOccupied(task.TargetAddress))//出库站台未被占用 |
| | | if (conveyorLine.IsOccupied(task.NextAddress))//出库站台未被占用 |
| | | { |
| | | return task; |
| | | } |
| | |
| | | /// 设备心跳 |
| | | /// </summary> |
| | | /// <param name="commonStackerCrane"></param> |
| | | public async void EqptAlive(CommonStackerCrane commonStackerCrane) |
| | | { |
| | | if (commonStackerCrane.StackerOnline) |
| | | { |
| | | BasicDto dto = new BasicDto |
| | | { |
| | | EmployeeNo = "T00001", |
| | | EquipmentCode = commonStackerCrane.DeviceCode, |
| | | RequestTime = DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss.fffZ"), |
| | | SessionId = Guid.NewGuid().ToString(), |
| | | Software = commonStackerCrane.DeviceName, |
| | | }; |
| | | var respone = await HttpHelper.PostAsync("http://ts-momapp01:12020/api/MachineIntegration/EqptAlive", dto.ToJsonString()); |
| | | if (respone != null) |
| | | { |
| | | var result = JsonConvert.DeserializeObject<ResponseEqptAliveDto>(respone); |
| | | if (result != null && result.Success) |
| | | { |
| | | if (result.KeyFlag == "99") |
| | | commonStackerCrane.StackerOnline = true; |
| | | else if (result.KeyFlag == "98") |
| | | commonStackerCrane.StackerOnline = false; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //public async void EqptAlive(CommonStackerCrane commonStackerCrane) |
| | | //{ |
| | | // if (commonStackerCrane.StackerOnline) |
| | | // { |
| | | // BasicDto dto = new BasicDto |
| | | // { |
| | | // EmployeeNo = "T00001", |
| | | // EquipmentCode = commonStackerCrane.DeviceCode, |
| | | // RequestTime = DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss.fffZ"), |
| | | // SessionId = Guid.NewGuid().ToString(), |
| | | // Software = commonStackerCrane.DeviceName, |
| | | // }; |
| | | // var respone = await HttpHelper.PostAsync("http://ts-momapp01:12020/api/MachineIntegration/EqptAlive", dto.ToJsonString()); |
| | | // if (respone != null) |
| | | // { |
| | | // var result = JsonConvert.DeserializeObject<ResponseEqptAliveDto>(respone); |
| | | // if (result != null && result.Success) |
| | | // { |
| | | // if (result.KeyFlag == "99") |
| | | // commonStackerCrane.StackerOnline = true; |
| | | // else if (result.KeyFlag == "98") |
| | | // commonStackerCrane.StackerOnline = false; |
| | | // } |
| | | // } |
| | | // } |
| | | //} |
| | | |
| | | } |
| | | } |