设备驱动修改
This commit is contained in:
71
Model/Model/EnovaChannelData.cs
Normal file
71
Model/Model/EnovaChannelData.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using System.Text.Json.Serialization;
|
||||
namespace Model.Model
|
||||
{
|
||||
public class EnovaChannelData
|
||||
{
|
||||
public string Laboratory { get; set; }
|
||||
public string Manufacture { get; set; }
|
||||
public string TaskId { get; set; }
|
||||
|
||||
// 针对文档命名不一致的字段进行别名特性处理(优先匹配真实JSON示例)
|
||||
[JsonPropertyName("deviceCode")]
|
||||
public string DeviceCode { get; set; }
|
||||
[JsonPropertyName("devCode")] // 兼容参数表
|
||||
public string DevCodeAlternate { set => DeviceCode = value; }
|
||||
|
||||
[JsonPropertyName("channelCode")]
|
||||
public string ChannelCode { get; set; }
|
||||
[JsonPropertyName("chnCode")]
|
||||
public string ChnCodeAlternate { set => ChannelCode = value; }
|
||||
|
||||
[JsonPropertyName("channelIP")]
|
||||
public string ChannelIP { get; set; }
|
||||
[JsonPropertyName("chnlP")]
|
||||
public string ChnlPAlternate { set => ChannelIP = value; }
|
||||
|
||||
[JsonPropertyName("pcIP")]
|
||||
public string PcIP { get; set; }
|
||||
[JsonPropertyName("pclP")]
|
||||
public string PclPAlternate { set => PcIP = value; }
|
||||
|
||||
public string PcName { get; set; }
|
||||
public string BarCode { get; set; }
|
||||
public string ProjectName { get; set; }
|
||||
public string StepId { get; set; }
|
||||
public string CycleDepth { get; set; }
|
||||
public string Cycles { get; set; }
|
||||
public string StepTime { get; set; }
|
||||
public string TotalTime { get; set; }
|
||||
public string PowerState { get; set; }
|
||||
public string ChannelState { get; set; }
|
||||
public string Voltage { get; set; }
|
||||
public string Current { get; set; }
|
||||
public string Power { get; set; }
|
||||
public string GivenVoltage { get; set; }
|
||||
public string GivenCurrent { get; set; }
|
||||
public string GivenPower { get; set; }
|
||||
public string Cap { get; set; }
|
||||
public string ChgCap { get; set; }
|
||||
public string DchgCap { get; set; }
|
||||
public string CapDiff { get; set; }
|
||||
public string Energy { get; set; }
|
||||
public string ChgEnergy { get; set; }
|
||||
public string DchgEnergy { get; set; }
|
||||
public string EnergyDiff { get; set; }
|
||||
|
||||
[JsonPropertyName("timestamp")]
|
||||
public string Timestamp { get; set; }
|
||||
[JsonPropertyName("timeStamp")]
|
||||
public string TimestampAlternate { set => Timestamp = value; }
|
||||
|
||||
// 对应 elements 里的 dict 动态解析
|
||||
public Dictionary<string, string> OtherSignals { get; set; }
|
||||
}
|
||||
|
||||
// 严格按照文档 Page 6 要求返回的响应结构
|
||||
public class ApiResponse
|
||||
{
|
||||
public bool Success { get; set; }
|
||||
public string ErrorInfo { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Model.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Enova3 通道状态上报实体(单条通道数据)
|
||||
/// </summary>
|
||||
public class EnovaChannelReportData
|
||||
{
|
||||
public string laboratory { get; set; } = string.Empty; // 实验室名称
|
||||
public string manufacture { get; set; } = string.Empty; // 供应商名称
|
||||
public string taskId { get; set; } = string.Empty; // 任务ID
|
||||
public string devCode { get; set; } = string.Empty; // 台架编码(注:表格里是devCode,示例里是deviceCode,建议互补或以表格为准)
|
||||
public string deviceCode { get; set; } = string.Empty; // 兼容示例中的 deviceCode
|
||||
public string chnCode { get; set; } = string.Empty; // 通道编码
|
||||
public string channelCode { get; set; } = string.Empty; // 兼容示例中的 channelCode
|
||||
public string chnlP { get; set; } = string.Empty; // 通道IP
|
||||
public string channelIP { get; set; } = string.Empty; // 兼容示例中的 channelIP
|
||||
public string pclP { get; set; } = string.Empty; // 上位机IP
|
||||
public string pcIP { get; set; } = string.Empty; // 兼容示例中的 pcIP
|
||||
public string pcName { get; set; } = string.Empty; // 上位机名称
|
||||
public string barCode { get; set; } = string.Empty; // 样品条码
|
||||
public string projectName { get; set; } = string.Empty; // 项目名称
|
||||
public string stepId { get; set; } = string.Empty; // 工步行
|
||||
public string cycleDepth { get; set; } = string.Empty; // 循环层
|
||||
public string cycles { get; set; } = string.Empty; // 循环次数
|
||||
public string stepTime { get; set; } = string.Empty; // 工步时间
|
||||
public string totalTime { get; set; } = string.Empty; // 运行时间
|
||||
public string powerState { get; set; } = string.Empty; // 电源状态
|
||||
public string channelState { get; set; } = string.Empty; // 通道状态
|
||||
public string voltage { get; set; } = string.Empty; // 电压
|
||||
public string current { get; set; } = string.Empty; // 电流
|
||||
public string power { get; set; } = string.Empty; // 功率
|
||||
public string givenVoltage { get; set; } = string.Empty; // 给定电压
|
||||
public string givenCurrent { get; set; } = string.Empty; // 给定电流
|
||||
public string givenPower { get; set; } = string.Empty; // 给定功率
|
||||
public string cap { get; set; } = string.Empty; // 容量
|
||||
public string chgCap { get; set; } = string.Empty; // 充电容量
|
||||
public string dchgCap { get; set; } = string.Empty; // 放电容量
|
||||
public string capDiff { get; set; } = string.Empty; // 容量差
|
||||
public string energy { get; set; } = string.Empty; // 能量
|
||||
public string chgEnergy { get; set; } = string.Empty; // 充电能量
|
||||
public string dchgEnergy { get; set; } = string.Empty; // 放电能量
|
||||
public string energyDiff { get; set; } = string.Empty; // 能量差
|
||||
public string timeStamp { get; set; } = string.Empty; // 采集时间(如:2024-07-11 13:03:03)
|
||||
public string timestamp { get; set; } = string.Empty; // 兼容小写格式
|
||||
|
||||
// 强类型:其他信号集合(支持动态 KV 对)
|
||||
public Dictionary<string, string> otherSignals { get; set; } = new();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 客户平台统一返回接收格式
|
||||
/// </summary>
|
||||
public class EnovaReportResponse
|
||||
{
|
||||
public bool Success { get; set; }
|
||||
public string ErrorInfo { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user