123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- using Aitex.Core.Common.DeviceData;
- using Aitex.Core.Util;
- using Caliburn.Micro;
- using FurnaceUI.Client.Dialog;
- using FurnaceUI.Models;
- using MECF.Framework.Common.DataCenter;
- using System.Collections.Generic;
- namespace FurnaceUI.Views.Operations
- {
- public class PressureDetailViewModel : FurnaceUIViewModelBase
- {
- #region Leak Check
- [Subscription("PM1.LeakCheckPressureSensorName")] public string LeakCheckPressureSensorName { get; set; }
- [Subscription("PM1.LeakCheckTable")] public string LeakCheckTable { get; set; }
- [Subscription("PM1.LeakCheckHightLimitCommand")] public string LeakCheckHightLimitCommand { get; set; }
- [Subscription("PM1.LeakCheckLowLimitCommand")] public string LeakCheckLowLimitCommand { get; set; }
- [Subscription("PM1.LeakCheckBasePressureLimitCommand")] public string LeakCheckBasePressureLimitCommand { get; set; }
- [Subscription("PM1.LeakCheckErrorCommand")] public string LeakCheckErrorCommand { get; set; }
- [Subscription("PM1.LeakCheckRetryOverCommand")] public string LeakCheckRetryOverCommand { get; set; }
- [Subscription("PM1.LeakCheckHighLimit")] public float LeakCheckHighLimit { get; set; }
- [Subscription("PM1.LeakCheckLowLimit")] public float LeakCheckLowLimit { get; set; }
- [Subscription("PM1.LeakCheckBasePressureLimit")] public float LeakCheckBasePressureLimit { get; set; }
- [Subscription("PM1.LeakCheckDelayTime")] public float LeakCheckDelayTime { get; set; }
- [Subscription("PM1.LeakCheckDelayElapseTime")] public float LeakCheckDelayElapseTime { get; set; }
- [Subscription("PM1.LeakCheckCheckTime")] public float LeakCheckCheckTime { get; set; }
- [Subscription("PM1.LeakCheckElapseTime")] public float LeakCheckElapseTime { get; set; }
- [Subscription("PM1.LeakCheckBasePressure")] public float LeakCheckBasePressure { get; set; }
- [Subscription("PM1.LeakCheckLeakLimit")] public float LeakCheckLeakLimit { get; set; }
- [Subscription("PM1.LeakCheckDelayMonitorPressure")] public float LeakCheckDelayMonitorPressure { get; set; }
- [Subscription("PM1.LeakCheckDelayStartPressure")] public float LeakCheckDelayStartPressure { get; set; }
- [Subscription("PM1.LeakCheckMonitorPressure")] public float LeakCheckMonitorPressure { get; set; }
- [Subscription("PM1.LeakCheckStartPressure")] public float LeakCheckStartPressure { get; set; }
- [Subscription("PM1.LeakCheckActualLeak")] public float LeakCheckActualLeak { get; set; }
- [Subscription("PM1.LeakCheckRetryCurrentCount")] public int LeakCheckRetryCurrentCount { get; set; }
- [Subscription("PM1.LeakCheckRetryLimit")] public int LeakCheckRetryLimit { get; set; }
- [Subscription("PM1.LeakCheckStatus")] public string LeakCheckStatus { get; set; }
- private float _leakCheckDelayProGress = 0;
- public float LeakCheckDelayProGress
- {
- get { return _leakCheckDelayProGress; }
- set { _leakCheckDelayProGress = value; this.NotifyOfPropertyChange(nameof(LeakCheckDelayProGress)); }
- }
- private float _leakCheckProGress = 0;
- public float LeakCheckProGress
- {
- get { return _leakCheckProGress; }
- set { _leakCheckProGress = value; this.NotifyOfPropertyChange(nameof(LeakCheckProGress)); }
- }
- #endregion
- [Subscription("PM1.APC.DeviceData")]
- public AITAPCData APCData { get; set; }
- public PressureDetailViewModel()
- {
- DefaultUnit = (string)QueryDataClient.Instance.Service.GetConfig($"PM1.APC.PressureUnit");
- }
- protected override void InvokeAfterUpdateProperty(Dictionary<string, object> data)
- {
- base.InvokeAfterUpdateProperty(data);
- LeakCheckDelayProGress = LeakCheckDelayElapseTime > 0 ? (LeakCheckDelayElapseTime / LeakCheckDelayTime) * 100.0f : 0;
-
- LeakCheckProGress = (LeakCheckElapseTime > 0 && LeakCheckDelayProGress >= 100) ? (LeakCheckElapseTime / LeakCheckCheckTime) * 100.0f : 0;
- }
- protected override void OnActivate()
- {
- base.OnActivate();
- DefaultUnit = (string)QueryDataClient.Instance.Service.GetConfig($"PM1.APC.PressureUnit");
- }
- public string CommandSetValueUnit { get; set; }
- public string CommandSetValue
- {
- get
- {
- if (APCData != null)
- {
- switch (APCData.TextModeSetPoint)
- {
- case "Valve Angle":
- return APCData.PositionSetPoint.ToString();
- case "Press":
- case "Press2":
- return APCData.PressureSetPoint.ToString();
- case "Slow Vac":
- return APCData.SlowRateSetPoint.ToString();
- }
- }
- return "0.0";
- }
- }
- public string DefaultUnit { get; set; }
- public string _defaultUnit
- {
- get
- {
- return DefaultUnit + "/S";
- }
- }
- public void CmdMouseDown(string cmd)
- {
- WindowManager wm = new WindowManager();
- bool? dialogReturn = false;
- switch (cmd)
- {
- case "SensorInfo":
- PressureInfoViewModel selectExistViewModel2 = new PressureInfoViewModel();
- dialogReturn = wm.ShowDialogWithTitle(selectExistViewModel2, null, "Sensor Information");
- if ((bool)dialogReturn)
- {
- }
- break;
- }
- }
- }
- }
|