| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 | using Caliburn.Micro;using Caliburn.Micro.Core;using MECF.Framework.Common.DataCenter;using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows;using FurnaceUI.Models;namespace FurnaceUI.Views.Editors{    public class RecipePressureSettingViewModel : FurnaceUIViewModelBase    {        private string _pressureSonsorValue;        private string _defaultUnit = "Pa";        public string DefaultUnit        {            get            {                return _defaultUnit;            }            set            {                _defaultUnit = value;                NotifyOfPropertyChange("DefaultUnit");            }        }        public string PressureSonsorValue        {            get            {                return _pressureSonsorValue;            }            set            {                _pressureSonsorValue = value;                NotifyOfPropertyChange("PressureSonsorValue");            }        }        private string _pressureValveAngleValue;        public string PressureValveAngleValue        {            get            {                return _pressureValveAngleValue;            }            set            {                _pressureValveAngleValue = value;                NotifyOfPropertyChange("PressureValveAngleValue");            }        }        private string _pressureAlarmWatchTable;        public string PressureAlarmWatchTable        {            get            {                return _pressureAlarmWatchTable;            }            set            {                _pressureAlarmWatchTable = value;                NotifyOfPropertyChange("PressureAlarmWatchTable");            }        }        public bool IsEnable => CGlobal.RecipeProcessEditViewEnable;//是否是View模式        public string PressureSettingVG { get; set; }        public bool IsPressureSettingVG1Checked { get; set; }        public bool IsPressureSettingVG2Checked { get; set; }        public bool IsPressureSettingVG3Checked { get; set; }        public void PressureSetSave()        {            ((Window)GetView()).DialogResult = true;        }        public void PressureSetCancel()        {            ((Window)GetView()).DialogResult = false;        }        public void PressureSensorSettingCmd()        {            var windowManager = IoC.Get<IWindowManager>();            RecipePressureSensorSettingViewModel recipePressureSensorSettingViewModel = new RecipePressureSensorSettingViewModel();            recipePressureSensorSettingViewModel.SelectPressureSonsorValue = PressureSonsorValue;            if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipePressureSensorSettingViewModel, null, "Pressure Sensor Setting"))            {                PressureSonsorValue = recipePressureSensorSettingViewModel.SelectPressureSonsorValue;            }        }        public void PressureValveAngleSettingCmd()        {            var windowManager = IoC.Get<IWindowManager>();            RecipePressureValveAngleSettingViewModel recipePressureValveAngleSettingViewModel = new RecipePressureValveAngleSettingViewModel();            recipePressureValveAngleSettingViewModel.SelectValveAngle = PressureValveAngleValue;            if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipePressureValveAngleSettingViewModel, null, "Pressure Valve Angle Setting"))            {                PressureValveAngleValue = recipePressureValveAngleSettingViewModel.SelectValveAngle;            }        }        public void PressureAlarmWatchTableSettingCmd()        {            var windowManager = IoC.Get<IWindowManager>();            RecipePressureAlarmWatchTableSettingViewModel recipePressureAlarmWatchTableSettingViewModel = new RecipePressureAlarmWatchTableSettingViewModel();            if (string.IsNullOrEmpty(PressureAlarmWatchTable))            {                PressureAlarmWatchTable = "None";            }            recipePressureAlarmWatchTableSettingViewModel.SelectAlarmWatchTable = PressureAlarmWatchTable;            if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipePressureAlarmWatchTableSettingViewModel, null, "Pressure Alarm Watch Table Setting"))            {                PressureAlarmWatchTable = recipePressureAlarmWatchTableSettingViewModel.SelectAlarmWatchTable;            }        }        public void RecipeConditionCheckCommand(string value)        {            PressureSettingVG = value;        }        protected override void OnActivate()        {            base.OnActivate();            DefaultUnit = (string)QueryDataClient.Instance.Service.GetConfig("PM1.APC.PressureUnit");            IsPressureSettingVG1Checked = PressureSettingVG == "VG1";            IsPressureSettingVG2Checked = PressureSettingVG == "VG2";            IsPressureSettingVG3Checked = PressureSettingVG == "VG3";            //IsPressureSettingVG2Checked = !IsPressureSettingVG1Checked;        }    }}
 |