| | |
| | | if (flag && value != null) |
| | | { |
| | | OtherDevice device = (OtherDevice)value; |
| | | List<string> deviceStations = device.DeviceProDTOs.Select(x => x.DeviceChildCode).Distinct().ToList(); |
| | | List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StationDeviceCode == device.DeviceCode); |
| | | List<string> deviceStations = device.DeviceProDTOs.Select(x => x.DeviceChildCode).Distinct().ToList();//è·å设å¤ä¸çç«å° |
| | | List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StationDeviceCode == device.DeviceCode); //è·å设å¤ä¸çç«å° |
| | | try |
| | | { |
| | | foreach (var item in stationMangers.Where(x => deviceStations.Contains(x.StationCode))) |
| | | foreach (var item in stationMangers.Where(x => deviceStations.Contains(x.StationCode))) //循ç¯è®¾å¤ä¸çç«å° |
| | | { |
| | | DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(R_ConveyorLineDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); //读å |
| | | DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(R_ConveyorLineDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); //è¾é线读åçå
¨é¨åè®® |
| | | |
| | | DeviceProDTO? deviceProWrite = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(W_ConveyorLineDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); //åå
¥ |
| | | DeviceProDTO? deviceProWrite = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(W_ConveyorLineDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); //è¾é线åå
¥çå
¨é¨åè®® |
| | | |
| | | if (deviceProRead != null && deviceProWrite != null) //读ååå
¥ |
| | | if (deviceProRead != null && deviceProWrite != null) //读ååå
¥çåè®®å¤ææ¯å¦ä¸ºnull |
| | | { |
| | | R_ConveyorLineInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineInfo>(deviceProRead.DeviceProAddress); |
| | | R_ConveyorLineInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineInfo>(deviceProRead.DeviceProAddress); //读ååè®® |
| | | |
| | | W_ConveyorLineInfo conveyorLineInfoWrite = device.Communicator.ReadCustomer<W_ConveyorLineInfo>(deviceProWrite.DeviceProAddress); |
| | | W_ConveyorLineInfo conveyorLineInfoWrite = device.Communicator.ReadCustomer<W_ConveyorLineInfo>(deviceProWrite.DeviceProAddress); //åå
¥åè®® |
| | | if (conveyorLineInfoRead == null || conveyorLineInfoWrite == null) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | R_ConveyorLineStatus conveyorLineStatus = conveyorLineInfoRead.Status.ByteToBoolObject<R_ConveyorLineStatus>(); |
| | | R_ConveyorLineStatus conveyorLineStatus = conveyorLineInfoRead.Status.ByteToBoolObject<R_ConveyorLineStatus>(); //è·å设å¤ç¶æ |
| | | |
| | | ConveyorLineSignal conveyorLineSignalRead = conveyorLineInfoRead.Signal.ByteToBoolObject<ConveyorLineSignal>(); |
| | | bool ACK = device.GetValue<W_ConveyorLineDB, bool>(W_ConveyorLineDB.ACK, item.StationCode); |
| | | ConveyorLineSignal conveyorLineSignalRead = conveyorLineInfoRead.Signal.ByteToBoolObject<ConveyorLineSignal>(); //è·å设å¤ä¿¡å· |
| | | bool ACK = device.GetValue<W_ConveyorLineDB, bool>(W_ConveyorLineDB.ACK, item.StationCode); //è·åACKç¡®è®¤ä¿¡æ¯ |
| | | |
| | | bool STB = device.GetValue<W_ConveyorLineDB, bool>(W_ConveyorLineDB.STB, item.StationCode); |
| | | bool STB = device.GetValue<W_ConveyorLineDB, bool>(W_ConveyorLineDB.STB, item.StationCode); //è·åSTB请æ±ä¿¡æ¯ |
| | | //ConveyorLineSignal conveyorLineSignalWrite = conveyorLineInfoWrite.Signal.ByteToBoolObject<ConveyorLineSignal>(); |
| | | //åºåºç«å° |
| | | if (item.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt()) |
| | | if (item.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt()) //2007交äºå£è¿å
¥ |
| | | { |
| | | // åºåº |
| | | if (conveyorLineSignalRead.STB && !conveyorLineSignalRead.ACK && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !STB && !ACK)//åºåº |
| | | if (conveyorLineSignalRead.STB && !conveyorLineSignalRead.ACK && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !STB && !ACK)//2楼åºåº |
| | | { |
| | | if (!string.IsNullOrEmpty(conveyorLineInfoRead.Barcode)) |
| | | { |
| | |
| | | Dt_Task dt_Ta = _taskService.GetOutTaskInfo2(conveyorLineInfoRead.Barcode); |
| | | if (dt_Ta != null) |
| | | { |
| | | device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.EndPos, dt_Ta.OutboundPlatform, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.TaskNo, dt_Ta.TaskNum, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); |
| | | |
| | | |
| | | //å é¤ä»»å¡ |
| | | _taskRepository.DeleteData(dt_Ta); |
| | |
| | | //åºå
¥åºç«å° |
| | | else if (item.StationType == StationTypeEnum.StationType_InboundAndOutbound.ObjToInt()) |
| | | { |
| | | //å
¥åºçæå åæºå
¥åºä»»å¡ |
| | | //è¾éçº¿å®æä¿®æ¹æè¾éçº¿å®æç¶æå¾
å åæºæ§è¡ä»»å¡ |
| | | if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !ACK) |
| | | { |
| | | if (!string.IsNullOrEmpty(conveyorLineInfoRead.Barcode))//éè´å
¥åº |
| | | if (!string.IsNullOrEmpty(conveyorLineInfoRead.Barcode)) |
| | | { |
| | | WebResponseContent contentweb = _taskService.UpdateTaskIninfo(conveyorLineInfoRead.Barcode,item.StationCode); |
| | | WebResponseContent contentweb = _taskService.UpdateTaskIninfo(conveyorLineInfoRead.Barcode,item.StationCode); //æ ¹æ®æ¡ç è·è®¾å¤ç¼å·å»æ¥è¯¢å¹¶ä¿®æ¹ä»»å¡ |
| | | if (contentweb.Status) |
| | | { |
| | | device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); |
| | |
| | | } |
| | | } |
| | | }*/ |
| | | else if (!conveyorLineSignalRead.STB && !conveyorLineSignalRead.ACK && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !STB && !ACK)//åºåº |
| | | else if (!conveyorLineSignalRead.STB && !conveyorLineSignalRead.ACK && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !STB && !ACK)//å
¶ä»æ¥¼å±åºåº |
| | | { |
| | | |
| | | Dt_Task dt_Ta = _taskService.GetOutTaskInfo(item.StationCode); |
| | | Dt_Task dt_Ta = _taskService.GetOutTaskInfo(item.StationCode); //è·ååºåºä»»å¡ |
| | | |
| | | if (dt_Ta != null) |
| | | {.1111 |
| | | { |
| | | device.SetValue(W_ConveyorLineDB.TaskNo, dt_Ta.TaskNum, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.EndPos, dt_Ta.OutboundPlatform, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode); |
| | |
| | | else if (!conveyorLineSignalRead.STB && conveyorLineSignalRead.ACK && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && STB && !ACK) |
| | | { |
| | | device.SetValue(W_ConveyorLineDB.STB, false, item.StationCode); |
| | | } |
| | | }//æ¸
æ¥ç¡®è®¤ä¿¡å· |
| | | |
| | | } |
| | | //å
¥åºç«å° |
| | | else if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt()) |
| | | else if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt()) //2014交äºå£ |
| | | { |
| | | if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !ACK) |
| | | { |
| | | if (conveyorLineInfoRead.TaskNo == 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.Barcode))//éè´å
¥åº |
| | | { |
| | | Dt_Task dt_Ta = _taskService.GetTaskIninfo(conveyorLineInfoRead.Barcode); |
| | | Dt_Task dt_Ta = _taskService.GetTaskIninfo(conveyorLineInfoRead.Barcode); //éè¿æ¡ç 廿¥è¯¢ä»»å¡ |
| | | if(dt_Ta != null) |
| | | { |
| | | |
| | | device.SetValue(W_ConveyorLineDB.EndPos, dt_Ta.SourceAddress, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.TaskNo, dt_Ta.TaskNum, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); |