| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506 |
- using Aitex.Core.Common.DeviceData;
- using Aitex.Core.UI.ControlDataContext;
- using Aitex.Core.UI.MVVM;
- using Aitex.Core.Util;
- using MECF.Framework.Common.DataCenter;
- using MECF.Framework.Common.OperationCenter;
- using System.Windows.Input;
- using FurnaceUI.Models;
- namespace FurnaceUI.Views.Maintenances
- {
- public class GasPanelViewModel : FurnaceUIViewModelBase
- {
- public bool _ismanagerPermission = false;
- public bool IsManagerPermission
- {
- get
- {
- return _ismanagerPermission;
- }
- set
- {
- _ismanagerPermission = value;
- NotifyOfPropertyChange("IsManagerPermission");
- }
- }
- public ICommand CmdSetMfcFlow { get; set; }
- [Subscription("System.VentValve.DeviceData")]
- public AITValveData VentValveData { get; set; }
- [Subscription("System.PumpValve.DeviceData")]
- public AITValveData PumpValveData { get; set; }
- [Subscription("System.TubePressure.DeviceData")]
- public AITPressureMeterData TubePressureData { get; set; }
- [Subscription("PM1.NX2Valve.DeviceData")]
- public AITValveData NX2Valve { get; set; }
- [Subscription("PM1.NY2Valve.DeviceData")]
- public AITValveData NY2Valve { get; set; }
- [Subscription("PM1.N12Valve.DeviceData")]
- public AITValveData N12Valve { get; set; }
- [Subscription("PM1.N22Valve.DeviceData")]
- public AITValveData N22Valve { get; set; }
- [Subscription("PM1.N32Valve.DeviceData")]
- public AITValveData N32Valve { get; set; }
- [Subscription("PM1.M21Valve.DeviceData")]
- public AITValveData M21Valve { get; set; }
- [Subscription("PM1.M22Valve.DeviceData")]
- public AITValveData M22Valve { get; set; }
- [Subscription("PM1.M23Valve.DeviceData")]
- public AITValveData M23Valve { get; set; }
- [Subscription("PM1.M24Valve.DeviceData")]
- public AITValveData M24Valve { get; set; }
- [Subscription("PM1.D11Valve.DeviceData")]
- public AITValveData D11Valve { get; set; }
- [Subscription("PM1.D12Valve.DeviceData")]
- public AITValveData D12Valve { get; set; }
- [Subscription("PM1.D13Valve.DeviceData")]
- public AITValveData D13Valve { get; set; }
- [Subscription("PM1.D14Valve.DeviceData")]
- public AITValveData D14Valve { get; set; }
- [Subscription("PM1.D15Valve.DeviceData")]
- public AITValveData D15Valve { get; set; }
- [Subscription("PM1.M11Valve.DeviceData")]
- public AITValveData M11Valve { get; set; }
- [Subscription("PM1.M12Valve.DeviceData")]
- public AITValveData M12Valve { get; set; }
- [Subscription("PM1.M13Valve.DeviceData")]
- public AITValveData M13Valve { get; set; }
- [Subscription("PM1.M14Valve.DeviceData")]
- public AITValveData M14Valve { get; set; }
- [Subscription("PM1.J11Valve.DeviceData")]
- public AITValveData J11Valve { get; set; }
- [Subscription("PM1.J12Valve.DeviceData")]
- public AITValveData J12Valve { get; set; }
- [Subscription("PM1.J13Valve.DeviceData")]
- public AITValveData J13Valve { get; set; }
- [Subscription("PM1.J14Valve.DeviceData")]
- public AITValveData J14Valve { get; set; }
- [Subscription("PM1.NR2Valve.DeviceData")]
- public AITValveData NR2Valve { get; set; }
- [Subscription("PM1.NR3Valve.DeviceData")]
- public AITValveData NR3Valve { get; set; }
- [Subscription("PM1.NB1Valve.DeviceData")]
- public AITValveData NB1Valve { get; set; }
- [Subscription("PM1.MVValve.DeviceData")]
- public AITValveData MVValve { get; set; }
- [Subscription("PM1.SVValve.DeviceData")]
- public AITValveData SVValve { get; set; }
- [Subscription("PM1.SSVValve.DeviceData")]
- public AITValveData SSVValve { get; set; }
- [Subscription("PM1.IV1Valve.DeviceData")]
- public AITValveData IV1Valve { get; set; }
- [Subscription("PM1.IV2Valve.DeviceData")]
- public AITValveData IV2Valve { get; set; }
- [Subscription("PM1.VV1Valve.DeviceData")]
- public AITValveData VV1Valve { get; set; }
- [Subscription("PM1.VV2Valve.DeviceData")]
- public AITValveData VV2Valve { get; set; }
- [Subscription("PM1.LV1Valve.DeviceData")]
- public AITValveData LV1Valve { get; set; }
- [Subscription("PM1.SensorPureN2PressureOK.DeviceData")]
- public AITSensorData SensorPureN2PressureOK { get; set; }
- [Subscription("PM1.SensorNH3PressureOK.DeviceData")]
- public AITSensorData SensorNH3PressureOK { get; set; }
- [Subscription("PM1.SensorSiH2CL2PressureOK.DeviceData")]
- public AITSensorData SensorSiH2CL2PressureOK { get; set; }
- [Subscription("PM1.SensorN2OPressureOK.DeviceData")]
- public AITSensorData SensorN2OPressureOK { get; set; }
- [Subscription("PM1.SensorPSW1LOW.DeviceData")]
- public AITSensorData SensorPSW1LOW { get; set; }
- [Subscription("PM1.SensorPSW2LOW.DeviceData")]
- public AITSensorData SensorPSW2LOW { get; set; }
- [Subscription("PM1.SensorGUExhaustOK.DeviceData")]
- public AITSensorData SensorGUExhaustOK { get; set; }
- [Subscription("PM1.SensorTubeATMPressure.DeviceData")]
- public AITSensorData SensorTubeATMPressure { get; set; }
- [Subscription("PM1.MfcNX.DeviceData")]
- public AITMfcData MfcNXData { get; set; }
- [Subscription("PM1.MfcNY.DeviceData")]
- public AITMfcData MfcNYData { get; set; }
- [Subscription("PM1.MfcN1.DeviceData")]
- public AITMfcData MfcN1Data { get; set; }
- [Subscription("PM1.MfcN2.DeviceData")]
- public AITMfcData MfcN2Data { get; set; }
- [Subscription("PM1.MfcM1.DeviceData")]
- public AITMfcData MfcM1Data { get; set; }
- [Subscription("PM1.MfcD1.DeviceData")]
- public AITMfcData MfcD1Data { get; set; }
- [Subscription("PM1.MfcXY1.DeviceData")]
- public AITMfcData MfcXY1Data { get; set; }
- [Subscription("PM1.MfcXF1.DeviceData")]
- public AITMfcData MfcXF1Data { get; set; }
- [Subscription("PM1.MfcV1.DeviceData")]
- public AITMfcData MfcV1Data { get; set; }
- [Subscription("PM1.MfcNN1.DeviceData")]
- public AITMfcData MfcNN1Data { get; set; }
- [Subscription("PM1.MfcNN2.DeviceData")]
- public AITMfcData MfcNN2Data { get; set; }
- [Subscription("PM1.MfcF1.DeviceData")]
- public AITMfcData MfcF1Data { get; set; }
- [Subscription("PM1.MfcNV1.DeviceData")]
- public AITMfcData MfcNV1Data { get; set; }
- [Subscription("PM1.MfcNB.DeviceData")]
- public AITMfcData MfcNBData { get; set; }
- [Subscription("PM1.MfmD1.DeviceData")]
- public AITWaterFlowMeterData MfmD1Flow { get; set; }
- private bool _isMfcNRInstalled;
- public bool IsMfcNRInstalled
- {
- get => _isMfcNRInstalled;
- set
- {
- _isMfcNRInstalled = value;
- NotifyOfPropertyChange(nameof(IsMfcNRInstalled));
- }
- }
- public AnalogDeviceDataItem MfcNX
- {
- get
- {
- return new AnalogDeviceDataItem
- {
- Type = "MFC",
- DeviceName = MfcNXData.UniqueName,
- DeviceId = MfcNXData.DeviceSchematicId,
- DisplayName = MfcNXData.DisplayName,
- Scale = MfcNXData.Scale,
- Unit = MfcNXData.Unit,
- FeedBack = MfcNXData.FeedBack,
- SetPoint = MfcNXData.SetPoint,
- };
- }
- }
- public AnalogDeviceDataItem MfcNY
- {
- get
- {
- return new AnalogDeviceDataItem
- {
- Type = "MFC",
- DeviceName = MfcNYData.UniqueName,
- DeviceId = MfcNYData.DeviceSchematicId,
- DisplayName = MfcNYData.DisplayName,
- Scale = MfcNYData.Scale,
- Unit = MfcNYData.Unit,
- FeedBack = MfcNYData.FeedBack,
- SetPoint = MfcNYData.SetPoint,
- };
- }
- }
- public AnalogDeviceDataItem MfcN1
- {
- get
- {
- return new AnalogDeviceDataItem
- {
- Type = "MFC",
- DeviceName = MfcN1Data.UniqueName,
- DeviceId = MfcN1Data.DeviceSchematicId,
- DisplayName = MfcN1Data.DisplayName,
- Scale = MfcN1Data.Scale,
- Unit = MfcN1Data.Unit,
- FeedBack = MfcN1Data.FeedBack,
- SetPoint = MfcN1Data.SetPoint,
- };
- }
- }
- public AnalogDeviceDataItem MfcN2
- {
- get
- {
- return new AnalogDeviceDataItem
- {
- Type = "MFC",
- DeviceName = MfcN2Data.UniqueName,
- DeviceId = MfcN2Data.DeviceSchematicId,
- DisplayName = MfcN2Data.DisplayName,
- Scale = MfcN2Data.Scale,
- Unit = MfcN2Data.Unit,
- FeedBack = MfcN2Data.FeedBack,
- SetPoint = MfcN2Data.SetPoint,
- };
- }
- }
- public AnalogDeviceDataItem MfcM1
- {
- get
- {
- return new AnalogDeviceDataItem
- {
- Type = "MFC",
- DeviceName = MfcM1Data.UniqueName,
- DeviceId = MfcM1Data.DeviceSchematicId,
- DisplayName = MfcM1Data.DisplayName,
- Scale = MfcM1Data.Scale,
- Unit = MfcM1Data.Unit,
- FeedBack = MfcM1Data.FeedBack,
- SetPoint = MfcM1Data.SetPoint,
- };
- }
- }
- public AnalogDeviceDataItem MfcD1
- {
- get
- {
- return new AnalogDeviceDataItem
- {
- Type = "MFC",
- DeviceName = MfcD1Data.UniqueName,
- DeviceId = MfcD1Data.DeviceSchematicId,
- DisplayName = MfcD1Data.DisplayName,
- Scale = MfcD1Data.Scale,
- Unit = MfcD1Data.Unit,
- FeedBack = MfcD1Data.FeedBack,
- SetPoint = MfcD1Data.SetPoint,
- };
- }
- }
- public AnalogDeviceDataItem MfcXY1
- {
- get
- {
- return new AnalogDeviceDataItem
- {
- Type = "MFC",
- DeviceName = MfcXY1Data.UniqueName,
- DeviceId = MfcXY1Data.DeviceSchematicId,
- DisplayName = MfcXY1Data.DisplayName,
- Scale = MfcXY1Data.Scale,
- Unit = MfcXY1Data.Unit,
- FeedBack = MfcXY1Data.FeedBack,
- SetPoint = MfcXY1Data.SetPoint,
- };
- }
- }
- public AnalogDeviceDataItem MfcXF1
- {
- get
- {
- return new AnalogDeviceDataItem
- {
- Type = "MFC",
- DeviceName = MfcXF1Data.UniqueName,
- DeviceId = MfcXF1Data.DeviceSchematicId,
- DisplayName = MfcXF1Data.DisplayName,
- Scale = MfcXF1Data.Scale,
- Unit = MfcXF1Data.Unit,
- FeedBack = MfcXF1Data.FeedBack,
- SetPoint = MfcXF1Data.SetPoint,
- };
- }
- }
- public AnalogDeviceDataItem MfcV1
- {
- get
- {
- return new AnalogDeviceDataItem
- {
- Type = "MFC",
- DeviceName = MfcV1Data.UniqueName,
- DeviceId = MfcV1Data.DeviceSchematicId,
- DisplayName = MfcV1Data.DisplayName,
- Scale = MfcV1Data.Scale,
- Unit = MfcV1Data.Unit,
- FeedBack = MfcV1Data.FeedBack,
- SetPoint = MfcV1Data.SetPoint,
- };
- }
- }
- public AnalogDeviceDataItem MfcNN1
- {
- get
- {
- return new AnalogDeviceDataItem
- {
- Type = "MFC",
- DeviceName = MfcNN1Data.UniqueName,
- DeviceId = MfcNN1Data.DeviceSchematicId,
- DisplayName = MfcNN1Data.DisplayName,
- Scale = MfcNN1Data.Scale,
- Unit = MfcNN1Data.Unit,
- FeedBack = MfcNN1Data.FeedBack,
- SetPoint = MfcNN1Data.SetPoint,
- };
- }
- }
- public AnalogDeviceDataItem MfcNN2
- {
- get
- {
- return new AnalogDeviceDataItem
- {
- Type = "MFC",
- DeviceName = MfcNN2Data.UniqueName,
- DeviceId = MfcNN2Data.DeviceSchematicId,
- DisplayName = MfcNN2Data.DisplayName,
- Scale = MfcNN2Data.Scale,
- Unit = MfcNN2Data.Unit,
- FeedBack = MfcNN2Data.FeedBack,
- SetPoint = MfcNN2Data.SetPoint,
- };
- }
- }
- public AnalogDeviceDataItem MfcF1
- {
- get
- {
- return new AnalogDeviceDataItem
- {
- Type = "MFC",
- DeviceName = MfcF1Data.UniqueName,
- DeviceId = MfcF1Data.DeviceSchematicId,
- DisplayName = MfcF1Data.DisplayName,
- Scale = MfcF1Data.Scale,
- Unit = MfcF1Data.Unit,
- FeedBack = MfcF1Data.FeedBack,
- SetPoint = MfcF1Data.SetPoint,
- };
- }
- }
- public AnalogDeviceDataItem MfcNV1
- {
- get
- {
- return new AnalogDeviceDataItem
- {
- Type = "MFC",
- DeviceName = MfcNV1Data.UniqueName,
- DeviceId = MfcNV1Data.DeviceSchematicId,
- DisplayName = MfcNV1Data.DisplayName,
- Scale = MfcNV1Data.Scale,
- Unit = MfcNV1Data.Unit,
- FeedBack = MfcNV1Data.FeedBack,
- SetPoint = MfcNV1Data.SetPoint,
- };
- }
- }
- public AnalogDeviceDataItem MfcNB
- {
- get
- {
- return new AnalogDeviceDataItem
- {
- Type = "MFC",
- DeviceName = MfcNBData.UniqueName,
- DeviceId = MfcNBData.DeviceSchematicId,
- DisplayName = MfcNBData.DisplayName,
- Scale = MfcNBData.Scale,
- Unit = MfcNBData.Unit,
- FeedBack = MfcNBData.FeedBack,
- SetPoint = MfcNBData.SetPoint,
- };
- }
- }
- public AnalogDeviceDataItem NBMfCData
- {
- get
- {
- return new AnalogDeviceDataItem
- {
- Type = "MFC",
- DeviceName = MfcNBData.UniqueName,
- DeviceId = MfcNBData.DeviceSchematicId,
- DisplayName = MfcNBData.DisplayName,
- Scale = MfcNBData.Scale,
- Unit = MfcNBData.Unit,
- FeedBack = MfcNBData.FeedBack,
- SetPoint = MfcNBData.SetPoint,
- };
- }
- }
- private bool _manualCheckSelect = false;
- private bool _manualCheck;
- public bool ManualCheck
- {
- get => _manualCheck;
- set
- {
- _manualCheck = value;
- NotifyOfPropertyChange(nameof(ManualCheck));
- }
- }
- private bool _manualCheckHide;
- public bool ManumalCheckHide
- {
- get => _manualCheckHide;
- set
- {
- _manualCheckHide = value;
- NotifyOfPropertyChange(nameof(ManumalCheckHide));
- }
- }
- public bool EnableServiceControl { get; set; }
- public GasPanelViewModel()
- {
- CmdSetMfcFlow = new DelegateCommand<object>(PerformCmdSetMfcFlow);
- }
- protected override void OnActivate()
- {
- base.OnActivate();
- EnableServiceControl = (bool)QueryDataClient.Instance.Service.GetConfig("System.IsServiceControlMode");
- // IsMfcNRInstalled = (bool)QueryDataClient.Instance.Service.GetConfig("PM1.MFC.MfcNR.IsMFCInstalled");
-
- }
- protected override void OnDeactivate(bool close)
- {
- base.OnDeactivate(close);
- //IsManagerPermission = false;
- }
- public void SetManual()
- {
- if (!_manualCheckSelect)
- {
- _manualCheckSelect = !_manualCheckSelect;
- IsManagerPermission = true;
- }
- else
- {
- IsManagerPermission = false;
- ManualCheck = false;
- ManumalCheckHide = true;
- _manualCheckSelect = !_manualCheckSelect;
- }
- }
- public void OpenAll()
- {
- if(!VentValveData.IsOpen)
- InvokeClient.Instance.Service.DoOperation($"{VentValveData.UniqueName}.{AITValveOperation.GVTurnValve}", true);
- if(!PumpValveData.IsOpen)
- InvokeClient.Instance.Service.DoOperation($"{PumpValveData.UniqueName}.{AITValveOperation.GVTurnValve}", true);
- }
- public void CloseAll()
- {
- if(PumpValveData.IsOpen)
- InvokeClient.Instance.Service.DoOperation($"{PumpValveData.UniqueName}.{AITValveOperation.GVTurnValve}", false);
- if (VentValveData.IsOpen)
- InvokeClient.Instance.Service.DoOperation($"{VentValveData.UniqueName}.{AITValveOperation.GVTurnValve}", false);
- }
- private void PerformCmdSetMfcFlow(object param)
- {
- object[] args = (object[])param; //0:devicename, 1:operation, 2:args
- if (args.Length == 3)
- {
- InvokeClient.Instance.Service.DoOperation($"{args[0]}.{args[1]}", args[2]);
- }
- }
- }
- }
|