| | |
| | | |
| | | |
| | | private string _url = "ws://192.168.201.17:40001"; |
| | | private async Task<List<RealScadaData>> Get(string inputJson) |
| | | private async Task<List<ZyModel.RealScadaData>> Get(string inputJson) |
| | | { |
| | | if (string.IsNullOrEmpty(inputJson)) |
| | | return default; |
| | |
| | | return default; |
| | | } |
| | | IStation.LogHelper.Info("ws.ConnectAsync"); |
| | | var realScadaDataList = new List<RealScadaData>(); |
| | | var realScadaDataList = new List<ZyModel.RealScadaData>(); |
| | | var inputBytes = Encoding.UTF8.GetBytes(inputJson); |
| | | await ws.SendAsync(new ArraySegment<byte>(inputBytes), WebSocketMessageType.Text, true, CancellationToken.None); |
| | | try |
| | |
| | | { |
| | | foreach (var dict in scadaDict) |
| | | { |
| | | var data = new RealScadaData(); |
| | | var data = new ZyModel.RealScadaData(); |
| | | data.TagName = dict.Key; |
| | | data.MonitorRecords = new List<IStation.ZyDto.MonitorRecord>(); |
| | | data.MonitorRecords = new List<IStation.ZyModel.MonitorRecord>(); |
| | | foreach (var item in dict.Value) |
| | | { |
| | | var record = new IStation.ZyDto.MonitorRecord(); |
| | | var record = new IStation.ZyModel.MonitorRecord(); |
| | | record.Time = item.Key; |
| | | if (double.TryParse(item.Value, out double value)) |
| | | { |