|
@@ -0,0 +1,88 @@
|
|
|
+using Shaker.Model;
|
|
|
+using Shaker.Models;
|
|
|
+using System;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.Linq;
|
|
|
+using System.Text;
|
|
|
+using System.Threading.Tasks;
|
|
|
+
|
|
|
+namespace ShakerService.ViewModel
|
|
|
+{
|
|
|
+ internal sealed class ShakerChannelConfigViewModel:ViewModelBase<Shaker.Models.ShakerChannelConfigModel>
|
|
|
+ {
|
|
|
+ private ShakerChannelConfigViewModel():base()
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ static ShakerChannelConfigViewModel()
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 位移通道
|
|
|
+ /// </summary>
|
|
|
+ public IReadOnlyList<AIConfigModel> Displacement =>CurrentModel.Displacement;
|
|
|
+ /// <summary>
|
|
|
+ /// 加速度通道
|
|
|
+ /// </summary>
|
|
|
+ public IReadOnlyList<AIConfigModel> Acceleration =>CurrentModel.Acceleration;
|
|
|
+ /// <summary>
|
|
|
+ /// 外部输入通道
|
|
|
+ /// </summary>
|
|
|
+ public IReadOnlyList<AIConfigModel> OutSignal =>CurrentModel.OutSignal;
|
|
|
+ /// <summary>
|
|
|
+ /// 压差通道
|
|
|
+ /// </summary>
|
|
|
+ public IReadOnlyList<AIConfigModel> DifferentialPressure =>CurrentModel.DifferentialPressure;
|
|
|
+ /// <summary>
|
|
|
+ /// 支撑压力通道
|
|
|
+ /// </summary>
|
|
|
+ public IReadOnlyList<AIConfigModel> Pressure =>CurrentModel.Pressure;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 水平缸通道
|
|
|
+ /// </summary>
|
|
|
+ public IReadOnlyList<AOConfigModel> Horizontal =>CurrentModel.Horizontal;
|
|
|
+ /// <summary>
|
|
|
+ /// 垂直缸通道
|
|
|
+ /// </summary>
|
|
|
+ public IReadOnlyList<AOConfigModel> Vertical =>CurrentModel.Vertical;
|
|
|
+ /// <summary>
|
|
|
+ /// 平衡缸通道
|
|
|
+ /// </summary>
|
|
|
+ public IReadOnlyList<AOChannel> Balancing =>CurrentModel.Balancing;
|
|
|
+ public override void SetFpga()
|
|
|
+ {
|
|
|
+ base.SetFpga();
|
|
|
+ ShakerFpga.ShakerFpga.Instance.位移通道.Values = [.. Displacement.Select(x => (byte)x.Channel)];
|
|
|
+ ShakerFpga.ShakerFpga.Instance.位移灵敏度.Value = [.. Displacement.Select(x => x.Sensitivity)];
|
|
|
+ ShakerFpga.ShakerFpga.Instance.位移直偏.Value = [.. Displacement.Select(x => x.Bias)];
|
|
|
+
|
|
|
+ ShakerFpga.ShakerFpga.Instance.加速度通道.Values = [.. Acceleration.Select(x => (byte)x.Channel)];
|
|
|
+ ShakerFpga.ShakerFpga.Instance.加速度灵敏度.Value = [.. Acceleration.Select(x => x.Sensitivity)];
|
|
|
+
|
|
|
+ ShakerFpga.ShakerFpga.Instance.外部输入通道.Values = [.. OutSignal.Select(x => (byte)x.Channel)];
|
|
|
+ ShakerFpga.ShakerFpga.Instance.外部输入增益.Value = [.. OutSignal.Select(x => x.Sensitivity)];
|
|
|
+
|
|
|
+ ShakerFpga.ShakerFpga.Instance.压差通道.Values = [.. DifferentialPressure.Select(x => (byte)x.Channel)];
|
|
|
+ ShakerFpga.ShakerFpga.Instance.压差直偏.Value = [.. DifferentialPressure.Select(x => x.Bias)];
|
|
|
+ ShakerFpga.ShakerFpga.Instance.压差灵敏度.Value = [.. DifferentialPressure.Select(x => x.Sensitivity)];
|
|
|
+
|
|
|
+
|
|
|
+ ShakerFpga.ShakerFpga.Instance.支撑压力通道.Values = [.. Pressure.Select(x => (byte)x.Channel)];
|
|
|
+ ShakerFpga.ShakerFpga.Instance.支撑压力直偏.Value = [.. Pressure.Select(x => x.Bias)];
|
|
|
+ ShakerFpga.ShakerFpga.Instance.支撑压力灵敏度.Value = [.. Pressure.Select(x => x.Sensitivity)];
|
|
|
+
|
|
|
+
|
|
|
+ ShakerFpga.ShakerFpga.Instance.平衡缸通道.Values = [.. Balancing.Select(x => (byte)x)];
|
|
|
+
|
|
|
+ ShakerFpga.ShakerFpga.Instance.水平缸通道.Values = [.. Horizontal.Select(x => (byte)x.Channel)];
|
|
|
+ ShakerFpga.ShakerFpga.Instance.垂直缸通道.Values = [.. Vertical.Select(x => (byte)x.Channel)];
|
|
|
+ ShakerFpga.ShakerFpga.Instance.伺服驱动直偏.Value = [.. Horizontal.Select(x => x.Bias),..Vertical.Select(x => x.Bias)];
|
|
|
+ ShakerFpga.ShakerFpga.Instance.伺服缸极性.Values = [.. Horizontal.Select(x => x.Polarity == Shaker.Model.Polarity.Positive), ..Vertical.Select(x => x.Polarity == Shaker.Model.Polarity.Positive)];
|
|
|
+ ShakerFpga.ShakerFpga.Instance.伺服开环.Values = [.. Horizontal.Select(x => x.OpenLoop), .. Vertical.Select(x => x.OpenLoop)];
|
|
|
+ ShakerFpga.ShakerFpga.Instance.伺服阀开环驱动.Value = [.. Horizontal.Select(x => x.OpenLoopDriver), .. Vertical.Select(x => x.OpenLoopDriver)];
|
|
|
+ }
|
|
|
+ public static ShakerChannelConfigViewModel Instance { get; } = new ShakerChannelConfigViewModel();
|
|
|
+ }
|
|
|
+}
|