| | |
| | | List<Dt_DeviceInfo> deviceInfos = await Db.Queryable<Dt_DeviceInfo>().Where(x => x.DeviceStatus == ((int)DeviceStatusEnum.Enable).ToString()).Includes(x => x.ProtocolList).ToListAsync(); |
| | | return _mapper.Map<List<DeviceInfoDTO>>(deviceInfos); |
| | | } |
| | | |
| | | public WebResponseContent ControlConveyorLine(int num) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | CommonConveyorLine? conveyorLine = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "1001") as CommonConveyorLine; |
| | | if (conveyorLine != null) |
| | | { |
| | | conveyorLine.Communicator.WriteNoRead("DB100.0", num); |
| | | return content.OK("鎴愬姛"); |
| | | } |
| | | return content.Error("澶辫触"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return content.Error(ex.Message); |
| | | } |
| | | } |
| | | } |
| | | } |