Pārlūkot izejas kodu

erere

样式分支
fyf pirms 2 gadiem
vecāks
revīzija
182630c9af
1 mainītis faili ar 9 papildinājumiem un 4 dzēšanām
  1. +9
    -4
      BPASmartClient.Device/DeviceStatus.cs

+ 9
- 4
BPASmartClient.Device/DeviceStatus.cs Parādīt failu

@@ -60,12 +60,13 @@ namespace BPASmartClient.Device
List<DevStatus> StatusALL = new List<DevStatus>();
foreach (var item in status)
{
string sta = string.Empty;
string name = item.Key;
string Ms = string.Empty;
string id = string.Empty;
if (item.Key.Contains("."))
{
string sta = item.Key.Split('.')[0];
sta = item.Key.Split('.')[0];
string sop = item.Key.Split('.')[item.Key.Split('.').Length - 1]; name = sop;
string value = item.Value.ToString();
if (keyValues.ContainsKey(sta)) sta = keyValues[sta];
@@ -75,8 +76,9 @@ namespace BPASmartClient.Device
Ms = $"[{sta}]-[{sop}]-[{value}]";
id = $"[{sta}]-[{sop}]";
}
StatusALL.Add(new DevStatus { id = id, Name = name, Status = item.Value.ToString(), Ms = Ms });
StatusALL.Add(new DevStatus { id = id, Name = name, type = sta, Status = item.Value.ToString(), Ms = Ms });
}
StatusALL = StatusALL?.OrderBy(x => x.type).ToList();
return new { data = StatusALL };
}

@@ -88,9 +90,10 @@ namespace BPASmartClient.Device
string name = item.Key;
string Ms = string.Empty;
string id=string.Empty;
string sta=string.Empty;
if (item.Key.Contains("."))
{
string sta = item.Key.Split('.')[0];
sta = item.Key.Split('.')[0];
string sop = item.Key.Split('.')[item.Key.Split('.').Length - 1]; name = sop;
string value = item.Value.ToString();
if (keyValues.ContainsKey(sta)) sta = keyValues[sta];
@@ -100,14 +103,16 @@ namespace BPASmartClient.Device
Ms = $"[{sta}]-[{sop}]-[{value}]";
id= $"[{sta}]-[{sop}]";
}
StatusALL.Add(new DevStatus {id= id, Name = name, Status = item.Value.ToString(), Ms = Ms });
StatusALL.Add(new DevStatus {id= id, Name = name,type=sta, Status = item.Value.ToString(), Ms = Ms });
}
StatusALL = StatusALL?.OrderBy(x => x.type).ToList();
return StatusALL;
}
}

public class DevStatus
{
public string type { get; set; }
public string id { get; set; }
public string Name { get; set; }
private string _status { get; set; }


Notiek ielāde…
Atcelt
Saglabāt