70 lines
1.6 KiB
C#
70 lines
1.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Text.Json.Serialization;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace YunDa.Server.ISMSTcp.Models
|
|
{
|
|
// YC数据类
|
|
public class YCData
|
|
{
|
|
[JsonPropertyName("YC_ID")]
|
|
public string YC_ID { get; set; } = string.Empty;
|
|
|
|
[JsonPropertyName("V")]
|
|
public decimal V { get; set; }
|
|
|
|
[JsonPropertyName("T")]
|
|
public string T { get; set; } = string.Empty;
|
|
}
|
|
|
|
|
|
public class CallYCByDataIdRequest
|
|
{
|
|
public List<string> Id { get; set; }
|
|
public int Times { get; set; }
|
|
}
|
|
|
|
public class YCResultValue
|
|
{
|
|
[JsonPropertyName("Value")]
|
|
public decimal Value { get; set; }
|
|
|
|
[JsonPropertyName("TimeStamp")]
|
|
public string TimeStamp { get; set; } = string.Empty;
|
|
}
|
|
|
|
public class YCResultData
|
|
{
|
|
[JsonPropertyName("Id")]
|
|
public string Id { get; set; } = string.Empty;
|
|
|
|
|
|
[JsonPropertyName("Name")]
|
|
public string Name { get; set; } = string.Empty;
|
|
|
|
[JsonPropertyName("DispatcherAddress")]
|
|
public int? DispatcherAddress { get; set; } = null;
|
|
|
|
|
|
[JsonPropertyName("Data")]
|
|
public List<YCResultValue> Data { get; set; } = new List<YCResultValue>();
|
|
|
|
|
|
public void ParseValue(List<YCData> datas)
|
|
{
|
|
Data.Clear();
|
|
|
|
foreach (var data in datas)
|
|
{
|
|
Data.Add(new YCResultValue() { Value = data.V, TimeStamp = data.T });
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|