109 lines
4.1 KiB
C#
109 lines
4.1 KiB
C#
using AutomaticApp.Common;
|
|
using AutomaticApp.Model;
|
|
using AutomaticApp.Models;
|
|
using LiveCharts;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics.Metrics;
|
|
using System.Linq;
|
|
using System.Reflection.Emit;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
namespace AutomaticApp.ViewModels
|
|
{
|
|
/// <summary>
|
|
/// 接驳盒地震仪数据交互站点
|
|
/// </summary>
|
|
public class ConboxStationModel : NotifyBase
|
|
{
|
|
public ConboxEnvironmentModel conboxEnvironmentModel { get; set; } = new ConboxEnvironmentModel();
|
|
public AdcpSensorModel adcpSensorModelData { get; set; } = new AdcpSensorModel();
|
|
public List<AdcpSensorModel> adcpSensorModel { get; set; }
|
|
|
|
|
|
#region 实体类初始化
|
|
|
|
/// <summary>
|
|
/// 环境状态列表数据1
|
|
/// </summary>
|
|
private List<KeypaiValueModel> _conboxEvironment1 = new List<KeypaiValueModel>
|
|
{
|
|
new KeypaiValueModel { Header = "接驳盒输入电压(V)" },
|
|
new KeypaiValueModel { Header = "接驳盒输入电流(A)" },
|
|
new KeypaiValueModel { Header = "接驳盒姿态X轴(°)" },
|
|
new KeypaiValueModel { Header = "接驳盒姿态Y轴(°)" },
|
|
new KeypaiValueModel { Header = "接驳盒姿态Z轴(°)" }
|
|
};
|
|
public List<KeypaiValueModel> ConboxEvironment1
|
|
{
|
|
get { return _conboxEvironment1; }
|
|
set { _conboxEvironment1 = value; this.DoNotify(); }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 环境状态列表数据2
|
|
/// </summary>
|
|
private List<KeypaiValueModel> _conboxEvironment2 = new List<KeypaiValueModel>
|
|
{
|
|
new KeypaiValueModel { Header = "接驳盒电力载波电流" },
|
|
new KeypaiValueModel { Header = "接驳盒漏水" },
|
|
new KeypaiValueModel { Header = "舱门状态" },
|
|
new KeypaiValueModel { Header = "12V预留1电压" },
|
|
new KeypaiValueModel { Header = "12V预留2电压" }
|
|
};
|
|
|
|
public List<KeypaiValueModel> ConboxEvironment2
|
|
{
|
|
get { return _conboxEvironment2; }
|
|
set { _conboxEvironment2 = value; this.DoNotify(); }
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
public ConboxStationModel()
|
|
{
|
|
DoFresh();
|
|
}
|
|
|
|
public void DoFresh()
|
|
{
|
|
#region 初始化接驳盒端 #1 环境数据1
|
|
|
|
//赋值
|
|
ConboxEvironment1[0].Value = conboxEnvironmentModel.In_Vol.ToString("0.00");
|
|
ConboxEvironment1[1].Value = conboxEnvironmentModel.In_Cur.ToString("0.00");
|
|
ConboxEvironment1[2].Value = conboxEnvironmentModel.JBH_Attitude_x.ToString("0.00");
|
|
ConboxEvironment1[3].Value = conboxEnvironmentModel.JBH_Attitude_y.ToString("0.00");
|
|
ConboxEvironment1[4].Value = conboxEnvironmentModel.JBH_Attitude_z.ToString("0.00");
|
|
#endregion
|
|
|
|
#region 初始化接驳盒端 #2 环境数据2
|
|
|
|
//赋值
|
|
ConboxEvironment2[0].Value = conboxEnvironmentModel.JBH_PowerCarrier_Cur.ToString("0.00");
|
|
ConboxEvironment2[1].Value = Convert.ToBoolean(conboxEnvironmentModel.JBH_Leak) ? "是" : "否";
|
|
ConboxEvironment2[2].Value = Convert.ToBoolean(conboxEnvironmentModel.Hatch_Status) ? "打开" : "关闭";
|
|
ConboxEvironment2[3].Value = conboxEnvironmentModel.JBH_Reserve1.ToString("0.00");
|
|
ConboxEvironment2[4].Value = conboxEnvironmentModel.JBH_Reserve2.ToString("0.00");
|
|
|
|
#endregion
|
|
|
|
#region 海流计左详情列表
|
|
adcpSensorModel = new List<AdcpSensorModel>();
|
|
adcpSensorModel.Add(new AdcpSensorModel { Name = "海流计传感器", Depth = adcpSensorModelData.Depth, Layers = adcpSensorModelData.Layers, ADPC_Speed1 = adcpSensorModelData.ADPC_Speed1 });
|
|
#endregion
|
|
|
|
#region 海流计右详情列表
|
|
adcpSensorModel = new List<AdcpSensorModel>();
|
|
adcpSensorModel.Add(new AdcpSensorModel { Name = "海流计传感器", Depth = adcpSensorModelData.Depth, Layers = adcpSensorModelData.Layers, ADCP_Dir1 = adcpSensorModelData.ADCP_Dir1 });
|
|
#endregion
|
|
|
|
|
|
}
|
|
}
|
|
}
|