20220510_191_upperpc/AutomaticApp/ViewModels/ConboxStationModel.cs

109 lines
4.1 KiB
C#
Raw Permalink Normal View History

2023-07-27 02:57:34 +00:00
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
}
}
}