| | |
| | | public static WebResponseContent AGVRequestinProductionLine(ConveyorLineDTO conveyor) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | OtherDevice? ProductionLine = Storage.Devices.FirstOrDefault(x => x.DeviceCode == conveyor.Station) as OtherDevice; |
| | | try |
| | | { |
| | | OtherDevice? ProductionLine = Storage.Devices.FirstOrDefault(x => x.DeviceCode == conveyor.Station) as OtherDevice; |
| | | if (ProductionLine == null) throw new Exception("æªæ¾å°äº§çº¿è®¾å¤ä¿¡æ¯"); |
| | | if (!ProductionLine.IsConnected) throw new Exception($"产线设å¤é讯å¼å¸¸"); |
| | | content.Status = ProductionLine.SetValue(ProductionLineDBName.WagvState, conveyor.Type); |
| | |
| | | switch (conveyor.Type) |
| | | { |
| | | case 1: |
| | | if (agvState != conveyor.Type) throw new Exception("产线ä¸å
许è¿å
¥ä½ä¸"); |
| | | if (agvState != conveyor.Type) throw new Exception($"AGVç³è¯·è¿å
¥ï¼äº§çº¿ä¸å
许è¿å
¥ä½ä¸ï¼äº§çº¿ä¿¡å·ã{agvState}ã"); |
| | | ProductionLine?.Communicator.LogNet.WriteDebug($"AGVç³è¯·è¿å
¥ï¼äº§çº¿å
许è¿å
¥ä½ä¸ï¼äº§çº¿ä¿¡å·ã{agvState}ã"); |
| | | content.OK(); |
| | | break; |
| | | case 2: |
| | |
| | | break; |
| | | case 3: |
| | | content.Status = ProductionLine.SetValue(ProductionLineDBName.Wrequest, 2); |
| | | //if (content.Status) content.Status = ProductionLine.SetValue(ProductionLineDBName.WagvState, 3); |
| | | ProductionLine?.Communicator.LogNet.WriteDebug($"AGV已离å¼ï¼ä»»å¡å®æ"); |
| | | break; |
| | | } |
| | | content = content.Status ? content.OK() : content.Error("åå
¥å¤±è´¥"); |
| | |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | ProductionLine?.Communicator.LogNet.WriteDebug(ex.Message); |
| | | } |
| | | return content; |
| | | } |