|
@@ -499,12 +499,12 @@ public static class AppUtil
|
|
|
List<DataItem> list = JsonUtil.DeserializeObject<List<DataItem>>(str);
|
|
List<DataItem> list = JsonUtil.DeserializeObject<List<DataItem>>(str);
|
|
|
foreach (var item in list)
|
|
foreach (var item in list)
|
|
|
{
|
|
{
|
|
|
- if (item.TagAddress.EndsWith(".F_CV"))
|
|
|
|
|
|
|
+ if (item.TagAddress.ToUpper().EndsWith(".F_CV"))
|
|
|
{
|
|
{
|
|
|
DataItem dataItem = null;
|
|
DataItem dataItem = null;
|
|
|
if (AppUtil.DataItemQueue.TryGetValue(item.TagAddress, out dataItem))
|
|
if (AppUtil.DataItemQueue.TryGetValue(item.TagAddress, out dataItem))
|
|
|
{
|
|
{
|
|
|
- if (float.Parse(item.Value.ToString()) == (float)dataItem.Value)
|
|
|
|
|
|
|
+ if (Convert.ToDouble(item.Value.ToString()) == Convert.ToDouble(dataItem.Value.ToString()))
|
|
|
{
|
|
{
|
|
|
result.Add(true);
|
|
result.Add(true);
|
|
|
dataItem.IsSetSuccessful = true;
|
|
dataItem.IsSetSuccessful = true;
|
|
@@ -518,11 +518,15 @@ public static class AppUtil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- else if (item.TagAddress.EndsWith(".A_CV"))
|
|
|
|
|
|
|
+ else if (item.TagAddress.ToUpper().EndsWith(".A_CV"))
|
|
|
{
|
|
{
|
|
|
DataItem dataItem = null;
|
|
DataItem dataItem = null;
|
|
|
if (AppUtil.DataItemQueue.TryGetValue(item.TagAddress, out dataItem))
|
|
if (AppUtil.DataItemQueue.TryGetValue(item.TagAddress, out dataItem))
|
|
|
{
|
|
{
|
|
|
|
|
+ if (item.Value == null)
|
|
|
|
|
+ {
|
|
|
|
|
+ item.Value = "";
|
|
|
|
|
+ }
|
|
|
if (item.Value.ToString() == dataItem.Value.ToString())
|
|
if (item.Value.ToString() == dataItem.Value.ToString())
|
|
|
{
|
|
{
|
|
|
result.Add(true);
|
|
result.Add(true);
|
|
@@ -539,7 +543,6 @@ public static class AppUtil
|
|
|
}
|
|
}
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
public static List<DataItem> ReadList(string str) //读取多个标签
|
|
public static List<DataItem> ReadList(string str) //读取多个标签
|
|
|
{
|
|
{
|
|
|
//List<string> tags = JsonUtil.DeserializeObject<List<string>>(str);
|
|
//List<string> tags = JsonUtil.DeserializeObject<List<string>>(str);
|
|
@@ -547,22 +550,49 @@ public static class AppUtil
|
|
|
List<DataItem> rlt = new List<DataItem>();
|
|
List<DataItem> rlt = new List<DataItem>();
|
|
|
foreach (var item in list)
|
|
foreach (var item in list)
|
|
|
{
|
|
{
|
|
|
- if (item.TagAddress.EndsWith(".F_CV"))
|
|
|
|
|
|
|
+ if (item.TagAddress.ToUpper().EndsWith(".F_CV"))
|
|
|
{
|
|
{
|
|
|
|
|
+ var itemvalue = Convert.ToDouble(Read<float>(item.TagAddress));
|
|
|
|
|
+ bool results = false;
|
|
|
|
|
+ if (true)
|
|
|
|
|
+ {
|
|
|
|
|
+ var r = list.FirstOrDefault(a => a.TagAddress.ToUpper() == item.TagAddress.ToUpper());
|
|
|
|
|
+ if (r != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (Convert.ToDouble(r.Value) == itemvalue)
|
|
|
|
|
+ {
|
|
|
|
|
+ results = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
rlt.Add(new DataItem()
|
|
rlt.Add(new DataItem()
|
|
|
{
|
|
{
|
|
|
TagAddress = item.TagAddress,
|
|
TagAddress = item.TagAddress,
|
|
|
- Value = Read<float>(item.TagAddress),
|
|
|
|
|
-
|
|
|
|
|
|
|
+ Value = itemvalue,
|
|
|
|
|
+ IsSetSuccessful = results
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
- else if (item.TagAddress.EndsWith(".A_CV"))
|
|
|
|
|
|
|
+ else if (item.TagAddress.ToUpper().EndsWith(".A_CV"))
|
|
|
{
|
|
{
|
|
|
|
|
+
|
|
|
|
|
+ var itemvalue = Read<string>(item.TagAddress);
|
|
|
|
|
+ bool results = false;
|
|
|
|
|
+ if (true)
|
|
|
|
|
+ {
|
|
|
|
|
+ var r = list.FirstOrDefault(a => a.TagAddress.ToUpper() == item.TagAddress.ToUpper());
|
|
|
|
|
+ if (r != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (r.Value.ToString() == itemvalue)
|
|
|
|
|
+ {
|
|
|
|
|
+ results = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
rlt.Add(new DataItem()
|
|
rlt.Add(new DataItem()
|
|
|
{
|
|
{
|
|
|
TagAddress = item.TagAddress,
|
|
TagAddress = item.TagAddress,
|
|
|
Value = Read<string>(item.TagAddress),
|
|
Value = Read<string>(item.TagAddress),
|
|
|
-
|
|
|
|
|
|
|
+ IsSetSuccessful = results
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
}
|
|
}
|