123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086 |
- using Aitex.Core.RT.DataCenter;
- using Aitex.Core.RT.Device;
- using Aitex.Core.RT.Log;
- using Aitex.Core.RT.OperationCenter;
- using Aitex.Core.RT.SCCore;
- using Aitex.Core.Util;
- using MECF.Framework.Common.Alarm;
- using MECF.Framework.Common.Beckhoff.ModuleIO;
- using MECF.Framework.Common.CommonData;
- using MECF.Framework.Common.IOCore;
- using MECF.Framework.Common.TwinCat;
- using System;
- using System.Collections.Generic;
- namespace CyberX8_RT.Devices.Facilities
- {
- public class SystemFacilities : BaseDevice, IDevice
- {
- #region 常量
- private const string FACILITIES = "Facilities";
- private const string FACILITIES_DATA = "Facilities_Data";
- private const string CDA_1_PRESSURE = "CDA_1_Pressure";
- private const string CDA_2_PRESSURE = "CDA_2_Pressure";
- private const string N2_1A_PRESSURE = "N2_1A_Pressure";
- private const string N2_1B_PRESSURE = "N2_1B_Pressure";
- private const string N2_2A_PRESSURE = "N2_2A_Pressure";
- private const string N2_2B_PRESSURE = "N2_2B_Pressure";
- private const string DI_WATER_PRESSURE = "DIWater_Pressure";
- private const string HOUSE_CHILLED_WATER_FLOW = "HouseChilledWater_Flow";
- private const string CDA_EXTERNAL_PRESSURE = "CDA_External_Pressure";
- private const string VACUUM_PRESSURE = "Vacuum_Pressure";
- private const string EXHAUST_PRESSURE = "Exhaust_Pressure";
- private const string ERROR_MAX = "Error_Max";
- private const string ERROR_MIN = "Error_Min";
- private const string WARNING_MAX = "Warning_Max";
- private const string WARNING_MIN = "Warning_Min";
- private const string N2_ENABLE = "N2Enable";
- private const string CDA_ENABLE = "CDAEnable";
- private const string EXTERNAL_CDA_ENABLE = "ExternalCDAEnable";
- private const string DI_WATER_ENABLE = "DiWaterEnable";
- private const string HOUSE_CHILLED_WATER_ENABLE = "HouseChilledWaterEnable";
- private const string DI_REPLEN_ENABLE = "DiReplenEnable";
- private const string DI_FILL_ENABLE = "DiFillEnable";
- private const string LOADER_DI_ENABLE = "LoaderDiEnable";
- private const string FILTER_PURGE_ENABLE = "FilterPurgeEnable";
- private const string N2_1A_PRESSURE_VALUE = "Nitrogen1APressure";
- private const string N2_1B_PRESSURE_VALUE = "Nitrogen1BPressure";
- private const string N2_2A_PRESSURE_VALUE = "Nitrogen2APressure";
- private const string N2_2B_PRESSURE_VALUE = "Nitrogen2BPressure";
- private const string CDA_1_PRESSURE_VALUE = "CDA1Pressure";
- private const string CDA_2_PRESSURE_VALUE = "CDA2Pressure";
- private const string CDA_EXTERNAL_PRESSURE_VALUE = "ExternalCDAPressure";
- private const string DI_WATER_PRESSURE_VALUE = "DiWaterPressure";
- private const string HOUSE_CHILLED_WATER_PRESSURE_VALUE = "HouseChilledWaterPressure";
- private const string EXHAUST_PRESSURE_VALUE = "ExhaustPressure";
- private const string VACUUM_PRESSURE_VALUE = "VacuumPressure";
- private const string N2_BLANKET_PRESSURE_VALUE = "N2BlanketPressure";
- private const string SAMPLE_ENABLE = "SampleEnable";
- private const string SAMPLE_FLOW_1_ENABLE = "SampleFlow1Enable";
- private const string SAMPLE_FLOW_2_ENABLE = "SampleFlow2Enable";
- private const string SAMPLE_FLOW_3_ENABLE = "SampleFlow3Enable";
- private const string SAMPLE_FLOW_4_ENABLE = "SampleFlow4Enable";
- private const string FFU_LOADER_ERROR = "FFULoaderError";
- private const string FFU_PROCESS_ERROR = "FFUProcessError";
- private const string FFU_LOADER_PRESSURE = "FFULoaderPressure";
- private const string FFU_PROCESS_PRESSURE = "FFUProcessPressure";
- private const string ARS_FLUID_DETECT = "ArsFluidDetect";
- private const string PROCESS_FLUID_DETECT = "ProcessFluidDetect";
- private const string SAMPLE_FLUID_DETECT = "SampleFluidDetect";
- #endregion
- #region 内部常量
- /// </summary>
- /// 定时器Job
- /// </summary>
- PeriodicJob _periodicJob = null;
- /// <summary>
- /// 数据集合
- /// </summary>
- private List<CommonLimitData> _facilitiesDataList = new List<CommonLimitData>();
- /// <summary>
- /// 数据字典
- /// </summary>
- private Dictionary<string, CommonLimitData> _facilitiesDataDic = new Dictionary<string, CommonLimitData>();
- /// <summary>
- /// N2可用性
- /// </summary>
- private bool _n2Enabled = false;
- /// <summary>
- /// CDA可用性
- /// </summary>
- private bool _cdaEnable = false;
- /// <summary>
- /// External CDA可用性
- /// </summary>
- private bool _externalCDAEnable = false;
- /// <summary>
- /// DI Water 可用性
- /// </summary>
- private bool _diWaterEnable = false;
- /// <summary>
- /// House Chilled Water可用性
- /// </summary>
- private bool _houseChilledWaterEnable = false;
- /// <summary>
- /// DI Replen可用性
- /// </summary>
- private bool _diReplenEnable = false;
- /// <summary>
- /// DI Fill可用性
- /// </summary>
- private bool _diFillEnable = false;
- /// <summary>
- /// Loader Di可用性
- /// </summary>
- private bool _loaderDiEnable = false;
- /// <summary>
- /// Filter Purge可用性
- /// </summary>
- private bool _filterPurgeEnable = false;
- /// <summary>
- /// N2 Blanket 压力
- /// </summary>
- private double _n2BlaketPressure = 0;
- /// <summary>
- /// 变量是否初始化字典
- /// </summary>
- private Dictionary<string, bool> _variableInitializeDic = new Dictionary<string, bool>();
- #region Sample
- /// <summary>
- /// Sample Enable
- /// </summary>
- private bool _sampleEnable = false;
- /// <summary>
- /// Sample Flow 1 Enable
- /// </summary>
- private bool _sampleFlow1Enable = false;
- /// <summary>
- /// Sample Flow 2 Enable
- /// </summary>
- private bool _sampleFlow2Enable = false;
- /// <summary>
- /// Sample Flow 3 Enable
- /// </summary>
- private bool _sampleFlow3Enable = false;
- /// <summary>
- /// Sample Flow 4 Enable
- /// </summary>
- private bool _sampleFlow4Enable = false;
- /// <summary>
- /// 开始采样时间
- /// </summary>
- private DateTime _sampleStartime;
- /// <summary>
- /// 是否正在采样
- /// </summary>
- private bool _isSammpleing = false;
- #endregion
- #region FFU
- /// <summary>
- /// Loader FFU Error
- /// </summary>
- private bool _ffuLoaderError = false;
- /// <summary>
- /// Process FFU Error
- /// </summary>
- private bool _ffuProcessError = false;
- /// <summary>
- /// Loader FFU Pressure
- /// </summary>
- private double _ffuLoaderPressure;
- /// <summary>
- /// Process FFU Pressure
- /// </summary>
- private double _ffuProcessPressure;
- #endregion
- #region Fluid
- /// <summary>
- /// ARS Fluid Detect
- /// </summary>
- private bool _arsFluidDetect;
- /// <summary>
- /// Process Fluid Detect
- /// </summary>
- private bool _processFluidDetect;
- /// <summary>
- /// Sample Fluid Detect
- /// </summary>
- private bool _sampleFluidDetect;
- #endregion
- #region Counter
- /// <summary>
- ///
- /// </summary>
- private CounterFlowData _diReplenFlowCounterData = new CounterFlowData();
- #endregion
- #endregion
- #region 属性
- /// <summary>
- /// 冰却水可用性
- /// </summary>
- public bool HouseChilledWaterEnable { get { return _houseChilledWaterEnable; } }
- /// <summary>
- /// N2可用性
- /// </summary>
- public bool N2Enable { get { return _n2Enabled; } }
- /// <summary>
- /// CDA可用性
- /// </summary>
- public bool CDAEnable { get { return _cdaEnable; } }
- /// <summary>
- /// Loader DI 可用性
- /// </summary>
- public bool LoaderDiEnable { get { return _loaderDiEnable; } }
- /// <summary>
- /// DI Replen Enable
- /// </summary>
- public bool DIReplenEnable { get { return _diReplenEnable; } }
- /// <summary>
- /// 所有io变量是否初始化
- /// </summary>
- public bool IOInitialized { get { return AllIoVariableInitialized(); } }
- /// <summary>
- /// SampleFluidDetect
- /// </summary>
- public bool SampleFluidDetect { get { return _sampleFluidDetect; } }
- /// <summary>
- /// Di Fill Enable
- /// </summary>
- public bool DIFillEnable { get { return _diFillEnable; } }
- #endregion
- /// <summary>
- /// 构造函数
- /// </summary>
- public SystemFacilities() : base("System", FACILITIES, FACILITIES, FACILITIES)
- {
- }
- /// <summary>
- /// 定时器
- /// </summary>
- /// <returns></returns>
- private bool OnTimer()
- {
- //if (_isSammpleing)
- //{
- // int sampleAutoDisableTime = SC.GetValue<int>("Facilities.SampleAutoDisableTime");
- // if ((DateTime.Now - _sampleStartime).TotalSeconds >= sampleAutoDisableTime)
- // {
- // SampleDisableOperation("", null);
- // }
- //}
- return true;
- }
- /// <summary>
- /// 初始化
- /// </summary>
- /// <returns></returns>
- public bool Initialize()
- {
- InitialData();
- SubscribeValueAction();
- InitializeOperation();
- //_periodicJob = new PeriodicJob(200, OnTimer, $"{Module}.OnTimer", true);
- return true;
- }
- /// <summary>
- /// 初始化数据
- /// </summary>
- private void InitialData()
- {
- _facilitiesDataList.Add(InitialFacilitiesData(CDA_1_PRESSURE));
- _facilitiesDataDic[CDA_1_PRESSURE_VALUE] = _facilitiesDataList[0];
- _facilitiesDataList.Add(InitialFacilitiesData(CDA_2_PRESSURE));
- _facilitiesDataDic[CDA_2_PRESSURE_VALUE] = _facilitiesDataList[1];
- _facilitiesDataList.Add(InitialFacilitiesData(N2_1A_PRESSURE));
- _facilitiesDataDic[N2_1A_PRESSURE_VALUE] = _facilitiesDataList[2];
- _facilitiesDataList.Add(InitialFacilitiesData(N2_1B_PRESSURE));
- _facilitiesDataDic[N2_1B_PRESSURE_VALUE] = _facilitiesDataList[3];
- _facilitiesDataList.Add(InitialFacilitiesData(N2_2A_PRESSURE));
- _facilitiesDataDic[N2_2A_PRESSURE_VALUE] = _facilitiesDataList[4];
- _facilitiesDataList.Add(InitialFacilitiesData(N2_2B_PRESSURE));
- _facilitiesDataDic[N2_2B_PRESSURE_VALUE] = _facilitiesDataList[5];
- _facilitiesDataList.Add(InitialFacilitiesData(DI_WATER_PRESSURE));
- _facilitiesDataDic[DI_WATER_PRESSURE_VALUE] = _facilitiesDataList[6];
- _facilitiesDataList.Add(InitialFacilitiesData(HOUSE_CHILLED_WATER_FLOW));
- _facilitiesDataDic[HOUSE_CHILLED_WATER_PRESSURE_VALUE] = _facilitiesDataList[7];
- _facilitiesDataList.Add(InitialFacilitiesData(CDA_EXTERNAL_PRESSURE));
- _facilitiesDataDic[CDA_EXTERNAL_PRESSURE_VALUE] = _facilitiesDataList[8];
- _facilitiesDataList.Add(InitialFacilitiesData(VACUUM_PRESSURE));
- _facilitiesDataDic[VACUUM_PRESSURE_VALUE] = _facilitiesDataList[9];
- _facilitiesDataList.Add(InitialFacilitiesData(EXHAUST_PRESSURE));
- _facilitiesDataDic[EXHAUST_PRESSURE_VALUE] = _facilitiesDataList[10];
- DATA.Subscribe($"{Module}.{Name}.{FACILITIES_DATA}", () => _facilitiesDataList, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{N2_ENABLE}", () => _n2Enabled, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{CDA_ENABLE}", () => _cdaEnable, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{EXTERNAL_CDA_ENABLE}", () => _externalCDAEnable, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{DI_WATER_ENABLE}", () => _diWaterEnable, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{HOUSE_CHILLED_WATER_ENABLE}", () => _houseChilledWaterEnable, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{DI_FILL_ENABLE}", () => _diFillEnable, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{DI_REPLEN_ENABLE}", () => _diReplenEnable, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{LOADER_DI_ENABLE}", () => _loaderDiEnable, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{FILTER_PURGE_ENABLE}", () => _filterPurgeEnable, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{N2_BLANKET_PRESSURE_VALUE}", () => _n2BlaketPressure, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{SAMPLE_ENABLE}", () => _sampleEnable, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{SAMPLE_FLOW_1_ENABLE}", () => _sampleFlow1Enable, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{SAMPLE_FLOW_2_ENABLE}", () => _sampleFlow2Enable, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{SAMPLE_FLOW_3_ENABLE}", () => _sampleFlow3Enable, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{SAMPLE_FLOW_4_ENABLE}", () => _sampleFlow4Enable, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{FFU_LOADER_ERROR}", () => _ffuLoaderError, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{FFU_PROCESS_ERROR}", () => _ffuProcessError, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{FFU_LOADER_PRESSURE}", () => _ffuLoaderPressure, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{FFU_PROCESS_PRESSURE}", () => _ffuProcessPressure, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{ARS_FLUID_DETECT}", () => _arsFluidDetect, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{PROCESS_FLUID_DETECT}", () => _processFluidDetect, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{SAMPLE_FLUID_DETECT}", () => _sampleFluidDetect, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{CDA_1_PRESSURE_VALUE}", () => _facilitiesDataDic[CDA_1_PRESSURE_VALUE].Value, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{CDA_2_PRESSURE_VALUE}", () => _facilitiesDataDic[CDA_2_PRESSURE_VALUE].Value, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{N2_1A_PRESSURE_VALUE}", () => _facilitiesDataDic[N2_1A_PRESSURE_VALUE].Value, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{N2_1B_PRESSURE_VALUE}", () => _facilitiesDataDic[N2_1B_PRESSURE_VALUE].Value, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{N2_2A_PRESSURE_VALUE}", () => _facilitiesDataDic[N2_2A_PRESSURE_VALUE].Value, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{N2_2B_PRESSURE_VALUE}", () => _facilitiesDataDic[N2_2B_PRESSURE_VALUE].Value, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{DI_WATER_PRESSURE_VALUE}", () => _facilitiesDataDic[DI_WATER_PRESSURE_VALUE].Value, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{HOUSE_CHILLED_WATER_PRESSURE_VALUE}", () => _facilitiesDataDic[HOUSE_CHILLED_WATER_PRESSURE_VALUE].Value, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{CDA_EXTERNAL_PRESSURE_VALUE}", () => _facilitiesDataDic[CDA_EXTERNAL_PRESSURE_VALUE].Value, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{VACUUM_PRESSURE_VALUE}", () => _facilitiesDataDic[VACUUM_PRESSURE_VALUE].Value, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- DATA.Subscribe($"{Module}.{Name}.{EXHAUST_PRESSURE_VALUE}", () => _facilitiesDataDic[EXHAUST_PRESSURE_VALUE].Value, SubscriptionAttribute.FLAG.IgnoreSaveDB);
- }
- /// <summary>
- /// 初始化Facilities数据对象
- /// </summary>
- /// <param name="name"></param>
- /// <returns></returns>
- private CommonLimitData InitialFacilitiesData(string name)
- {
- CommonLimitData facilitiesData = new CommonLimitData();
- facilitiesData.MaxError = SC.GetValue<double>($"{FACILITIES}.{name}.{ERROR_MAX}");
- facilitiesData.MinError = SC.GetValue<double>($"{FACILITIES}.{name}.{ERROR_MIN}");
- facilitiesData.MaxWarning = SC.GetValue<double>($"{FACILITIES}.{name}.{WARNING_MAX}");
- facilitiesData.MinWarning = SC.GetValue<double>($"{FACILITIES}.{name}.{WARNING_MIN}");
- return facilitiesData;
- }
- /// <summary>
- /// 订阅变量数值发生变化
- /// </summary>
- private void SubscribeValueAction()
- {
- BeckhoffIoSubscribeUpdateVariable(N2_ENABLE);
- BeckhoffIoSubscribeUpdateVariable(CDA_ENABLE);
- BeckhoffIoSubscribeUpdateVariable(EXTERNAL_CDA_ENABLE);
- BeckhoffIoSubscribeUpdateVariable(DI_WATER_ENABLE);
- BeckhoffIoSubscribeUpdateVariable(HOUSE_CHILLED_WATER_ENABLE);
- BeckhoffIoSubscribeUpdateVariable(DI_REPLEN_ENABLE);
- BeckhoffIoSubscribeUpdateVariable(DI_FILL_ENABLE);
- BeckhoffIoSubscribeUpdateVariable(LOADER_DI_ENABLE);
- BeckhoffIoSubscribeUpdateVariable(FILTER_PURGE_ENABLE);
- BeckhoffIoSubscribeUpdateVariable(N2_1A_PRESSURE_VALUE);
- BeckhoffIoSubscribeUpdateVariable(N2_1B_PRESSURE_VALUE);
- BeckhoffIoSubscribeUpdateVariable(N2_2A_PRESSURE_VALUE);
- BeckhoffIoSubscribeUpdateVariable(N2_2B_PRESSURE_VALUE);
- BeckhoffIoSubscribeUpdateVariable(CDA_1_PRESSURE_VALUE);
- BeckhoffIoSubscribeUpdateVariable(CDA_2_PRESSURE_VALUE);
- BeckhoffIoSubscribeUpdateVariable(CDA_EXTERNAL_PRESSURE_VALUE);
- BeckhoffIoSubscribeUpdateVariable(DI_WATER_PRESSURE_VALUE);
- BeckhoffIoSubscribeUpdateVariable(HOUSE_CHILLED_WATER_PRESSURE_VALUE);
- BeckhoffIoSubscribeUpdateVariable(EXHAUST_PRESSURE_VALUE);
- BeckhoffIoSubscribeUpdateVariable(VACUUM_PRESSURE_VALUE);
- BeckhoffIoSubscribeUpdateVariable(N2_BLANKET_PRESSURE_VALUE);
- BeckhoffIoSubscribeUpdateVariable(SAMPLE_ENABLE);
- BeckhoffIoSubscribeUpdateVariable(SAMPLE_FLOW_1_ENABLE);
- BeckhoffIoSubscribeUpdateVariable(SAMPLE_FLOW_2_ENABLE);
- BeckhoffIoSubscribeUpdateVariable(SAMPLE_FLOW_3_ENABLE);
- BeckhoffIoSubscribeUpdateVariable(SAMPLE_FLOW_4_ENABLE);
- BeckhoffIoSubscribeUpdateVariable(FFU_LOADER_ERROR);
- BeckhoffIoSubscribeUpdateVariable(FFU_PROCESS_ERROR);
- BeckhoffIoSubscribeUpdateVariable(FFU_LOADER_PRESSURE);
- BeckhoffIoSubscribeUpdateVariable(FFU_PROCESS_PRESSURE);
- BeckhoffIoSubscribeUpdateVariable(ARS_FLUID_DETECT);
- BeckhoffIoSubscribeUpdateVariable(PROCESS_FLUID_DETECT);
- BeckhoffIoSubscribeUpdateVariable(SAMPLE_FLUID_DETECT);
- }
- /// <summary>
- /// 订阅IO变量
- /// </summary>
- /// <param name="variable"></param>
- private void BeckhoffIoSubscribeUpdateVariable(string variable)
- {
- _variableInitializeDic[variable] = false;
- IOModuleManager.Instance.SubscribeModuleVariable(Name, variable, UpdateVariableValue);
- }
- /// <summary>
- /// 初始化操作
- /// </summary>
- private void InitializeOperation()
- {
- OP.Subscribe($"{Module}.{Name}.N2Enable", N2EnableOperation);
- OP.Subscribe($"{Module}.{Name}.N2Disable", N2DisableOperation);
- OP.Subscribe($"{Module}.{Name}.CDAEnable", CDAEnableOperation);
- OP.Subscribe($"{Module}.{Name}.CDADisable", CDADisableOperation);
- OP.Subscribe($"{Module}.{Name}.ExternalCDAEnable", ExternalCDAEnableOperation);
- OP.Subscribe($"{Module}.{Name}.ExternalCDADisable", ExternalCDADisableOperation);
- OP.Subscribe($"{Module}.{Name}.DiWaterEnable", DiWaterEnableOperation);
- OP.Subscribe($"{Module}.{Name}.DiWaterDisable", DiWaterDisableOperation);
- OP.Subscribe($"{Module}.{Name}.HouseChilledWaterEnable", HouseChilledWaterEnableOperation);
- OP.Subscribe($"{Module}.{Name}.HouseChilledWaterDisable", HouseChilledWaterDisableOperation);
- OP.Subscribe($"{Module}.{Name}.DiFillEnable", DiFillEnableOperation);
- OP.Subscribe($"{Module}.{Name}.DiFillDisable", DiFillDisableOperation);
- OP.Subscribe($"{Module}.{Name}.DiReplenEnable", DiReplenEnableOperation);
- OP.Subscribe($"{Module}.{Name}.DiReplenDisable", DiReplenDisableOperation);
- OP.Subscribe($"{Module}.{Name}.LoaderDiEnable", LoaderDiEnableOperation);
- OP.Subscribe($"{Module}.{Name}.LoaderDiDisable", LoaderDiDisableOperation);
- OP.Subscribe($"{Module}.{Name}.FilterPurgeEnable", FilterPurgeEnableOperation);
- OP.Subscribe($"{Module}.{Name}.FilterPurgeDisable", FilterPurgeDisableOperation);
- OP.Subscribe($"{Module}.{Name}.SampleEnable", SampleEnableOperation);
- OP.Subscribe($"{Module}.{Name}.SampleDisable", SampleDisableOperation);
- }
- /// 更新变量数值
- /// </summary>
- /// <param name="variable"></param>
- /// <param name="value"></param>
- private void UpdateVariableValue(string variable, object value)
- {
- if (_variableInitializeDic.ContainsKey(variable) && !_variableInitializeDic[variable])
- {
- _variableInitializeDic[variable] = true;
- }
- switch (variable)
- {
- case N2_ENABLE:
- _n2Enabled = (bool)value;
- break;
- case CDA_ENABLE:
- _cdaEnable = (bool)value;
- break;
- case EXTERNAL_CDA_ENABLE:
- _externalCDAEnable = (bool)value;
- break;
- case DI_WATER_ENABLE:
- _diWaterEnable = (bool)value;
- break;
- case HOUSE_CHILLED_WATER_ENABLE:
- _houseChilledWaterEnable = (bool)value;
- break;
- case DI_FILL_ENABLE:
- _diFillEnable = (bool)value;
- break;
- case DI_REPLEN_ENABLE:
- _diReplenEnable = (bool)value;
- break;
- case LOADER_DI_ENABLE:
- _loaderDiEnable = (bool)value;
- break;
- case FILTER_PURGE_ENABLE:
- _filterPurgeEnable = (bool)value;
- break;
- case N2_1A_PRESSURE_VALUE:
- case N2_2A_PRESSURE_VALUE:
- case N2_1B_PRESSURE_VALUE:
- case N2_2B_PRESSURE_VALUE:
- case CDA_1_PRESSURE_VALUE:
- case CDA_2_PRESSURE_VALUE:
- case CDA_EXTERNAL_PRESSURE_VALUE:
- case DI_WATER_PRESSURE_VALUE:
- case HOUSE_CHILLED_WATER_PRESSURE_VALUE:
- case EXHAUST_PRESSURE_VALUE:
- case VACUUM_PRESSURE_VALUE:
- _facilitiesDataDic[variable].Value = (double)value;
- break;
- case N2_BLANKET_PRESSURE_VALUE:
- _n2BlaketPressure = (double)value;
- break;
- case SAMPLE_ENABLE:
- _sampleEnable = (bool)value;
- break;
- case SAMPLE_FLOW_1_ENABLE:
- _sampleFlow1Enable = (bool)value;
- break;
- case SAMPLE_FLOW_2_ENABLE:
- _sampleFlow2Enable = (bool)value;
- break;
- case SAMPLE_FLOW_3_ENABLE:
- _sampleFlow3Enable = (bool)value;
- break;
- case SAMPLE_FLOW_4_ENABLE:
- _sampleFlow4Enable = (bool)value;
- break;
- case FFU_LOADER_ERROR:
- _ffuLoaderError = (bool)value;
- break;
- case FFU_PROCESS_ERROR:
- _ffuProcessError = (bool)value;
- break;
- case FFU_LOADER_PRESSURE:
- _ffuLoaderPressure = (double)value;
- break;
- case FFU_PROCESS_PRESSURE:
- _ffuProcessPressure = (double)value;
- break;
- case ARS_FLUID_DETECT:
- _arsFluidDetect = (bool)value;
- break;
- case SAMPLE_FLUID_DETECT:
- _sampleFluidDetect = (bool)value;
- if (!_sampleFluidDetect)
- {
- LOG.WriteLog(eEvent.WARN_Sensor, Module, "SampleFluidDetect is Activate");
- if (_sampleEnable) SampleDisableOperation("", null);
- if (_filterPurgeEnable) FilterPurgeDisableOperation("", null);
- }
- break;
- case PROCESS_FLUID_DETECT:
- _processFluidDetect = (bool)value;
- if (!_processFluidDetect)
- {
- LOG.WriteLog(eEvent.WARN_Sensor, Module, "ProcessFluidDetect is Activate");
- AlarmListManager.Instance.AddWarn(Module, "ProcessFluidDetect", $"ProcessFluidDetect is Activate");
- }
- break;
- }
- }
- /// <summary>
- /// 是否所有IO变量初始化完成
- /// </summary>
- /// <returns></returns>
- private bool AllIoVariableInitialized()
- {
- foreach (string item in _variableInitializeDic.Keys)
- {
- if (!_variableInitializeDic[item])
- {
- //LOG.WriteLog(eEvent.ERR_DRYER, Module, $"{item} is not initialized");
- return false;
- }
- }
- return true;
- }
- #region 指令
- /// <summary>
- /// N2 Enable
- /// </summary>
- /// <param name="cmd"></param>
- /// <param name="param"></param>
- /// <returns></returns>
- public bool N2EnableOperation(string cmd, object param)
- {
- string ioName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Name}.{N2_ENABLE}");
- if (!string.IsNullOrEmpty(ioName))
- {
- IOModuleManager.Instance.WriteIoValue(ioName, true);
- }
- return true;
- }
- /// <summary>
- /// N2 Disable
- /// </summary>
- /// <param name="cmd"></param>
- /// <param name="param"></param>
- /// <returns></returns>
- private bool N2DisableOperation(string cmd, object param)
- {
- string ioName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Name}.{N2_ENABLE}");
- if (!string.IsNullOrEmpty(ioName))
- {
- IOModuleManager.Instance.WriteIoValue(ioName, false);
- }
- return true;
- }
- /// <summary>
- /// CDA Enable
- /// </summary>
- /// <param name="cmd"></param>
- /// <param name="param"></param>
- /// <returns></returns>
- public bool CDAEnableOperation(string cmd, object param)
- {
- string ioName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Name}.{CDA_ENABLE}");
- if (!string.IsNullOrEmpty(ioName))
- {
- IOModuleManager.Instance.WriteIoValue(ioName, true);
- }
- return true;
- }
- /// <summary>
- /// CDA Disable
- /// </summary>
- /// <param name="cmd"></param>
- /// <param name="param"></param>
- /// <returns></returns>
- private bool CDADisableOperation(string cmd, object param)
- {
- string ioName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Name}.{CDA_ENABLE}");
- if (!string.IsNullOrEmpty(ioName))
- {
- IOModuleManager.Instance.WriteIoValue(ioName, false);
- }
- return true;
- }
- /// <summary>
- /// External CDA Enable
- /// </summary>
- /// <param name="cmd"></param>
- /// <param name="param"></param>
- /// <returns></returns>
- private bool ExternalCDAEnableOperation(string cmd, object param)
- {
- string ioName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Name}.{EXTERNAL_CDA_ENABLE}");
- if (!string.IsNullOrEmpty(ioName))
- {
- IOModuleManager.Instance.WriteIoValue(ioName, true);
- }
- return true;
- }
- /// <summary>
- /// External CDA Disable
- /// </summary>
- /// <param name="cmd"></param>
- /// <param name="param"></param>
- /// <returns></returns>
- private bool ExternalCDADisableOperation(string cmd, object param)
- {
- string ioName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Name}.{EXTERNAL_CDA_ENABLE}");
- if (!string.IsNullOrEmpty(ioName))
- {
- IOModuleManager.Instance.WriteIoValue(ioName, false);
- }
- return true;
- }
- /// <summary>
- /// DI Water Enable
- /// </summary>
- /// <param name="cmd"></param>
- /// <param name="param"></param>
- /// <returns></returns>
- private bool DiWaterEnableOperation(string cmd, object param)
- {
- string ioName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Name}.{DI_WATER_ENABLE}");
- if (!string.IsNullOrEmpty(ioName))
- {
- IOModuleManager.Instance.WriteIoValue(ioName, true);
- }
- return true;
- }
- /// <summary>
- /// DI Water Disable
- /// </summary>
- /// <param name="cmd"></param>
- /// <param name="param"></param>
- /// <returns></returns>
- private bool DiWaterDisableOperation(string cmd, object param)
- {
- string ioName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Name}.{DI_WATER_ENABLE}");
- if (!string.IsNullOrEmpty(ioName))
- {
- IOModuleManager.Instance.WriteIoValue(ioName, false);
- }
- return true;
- }
- /// <summary>
- /// House Chilled Water Enable
- /// </summary>
- /// <param name="cmd"></param>
- /// <param name="param"></param>
- /// <returns></returns>
- private bool HouseChilledWaterEnableOperation(string cmd, object param)
- {
- string ioName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Name}.{HOUSE_CHILLED_WATER_ENABLE}");
- if (!string.IsNullOrEmpty(ioName))
- {
- IOModuleManager.Instance.WriteIoValue(ioName, true);
- }
- return true;
- }
- /// <summary>
- /// House Chilled Water Disable
- /// </summary>
- /// <param name="cmd"></param>
- /// <param name="param"></param>
- /// <returns></returns>
- private bool HouseChilledWaterDisableOperation(string cmd, object param)
- {
- string ioName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Name}.{HOUSE_CHILLED_WATER_ENABLE}");
- if (!string.IsNullOrEmpty(ioName))
- {
- IOModuleManager.Instance.WriteIoValue(ioName, false);
- }
- return true;
- }
- /// <summary>
- /// DI Fill Enable
- /// </summary>
- /// <param name="cmd"></param>
- /// <param name="param"></param>
- /// <returns></returns>
- private bool DiFillEnableOperation(string cmd, object param)
- {
- string ioName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Name}.{DI_FILL_ENABLE}");
- if (!string.IsNullOrEmpty(ioName))
- {
- IOModuleManager.Instance.WriteIoValue(ioName, true);
- }
- return true;
- }
- /// <summary>
- /// Di Fill Disable
- /// </summary>
- /// <param name="cmd"></param>
- /// <param name="param"></param>
- /// <returns></returns>
- public bool DiFillDisableOperation(string cmd, object param)
- {
- string ioName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Name}.{DI_FILL_ENABLE}");
- if (!string.IsNullOrEmpty(ioName))
- {
- IOModuleManager.Instance.WriteIoValue(ioName, false);
- }
- return true;
- }
- /// <summary>
- /// DI Replen Enable
- /// </summary>
- /// <param name="cmd"></param>
- /// <param name="param"></param>
- /// <returns></returns>
- private bool DiReplenEnableOperation(string cmd, object param)
- {
- string ioName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Name}.{DI_REPLEN_ENABLE}");
- if (!string.IsNullOrEmpty(ioName))
- {
- IOModuleManager.Instance.WriteIoValue(ioName, true);
- }
- return true;
- }
- /// <summary>
- /// DI Replen Disable
- /// </summary>
- /// <param name="cmd"></param>
- /// <param name="param"></param>
- /// <returns></returns>
- public bool DiReplenDisableOperation(string cmd, object param)
- {
- string ioName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Name}.{DI_REPLEN_ENABLE}");
- if (!string.IsNullOrEmpty(ioName))
- {
- IOModuleManager.Instance.WriteIoValue(ioName, false);
- }
- return true;
- }
- /// <summary>
- /// Loader DI Enable
- /// </summary>
- /// <param name="cmd"></param>
- /// <param name="param"></param>
- /// <returns></returns>
- private bool LoaderDiEnableOperation(string cmd, object param)
- {
- string ioName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Name}.{LOADER_DI_ENABLE}");
- if (!string.IsNullOrEmpty(ioName))
- {
- IOModuleManager.Instance.WriteIoValue(ioName, true);
- }
- return true;
- }
- /// <summary>
- /// Loader DI Disable
- /// </summary>
- /// <param name="cmd"></param>
- /// <param name="param"></param>
- /// <returns></returns>
- private bool LoaderDiDisableOperation(string cmd, object param)
- {
- string ioName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Name}.{LOADER_DI_ENABLE}");
- if (!string.IsNullOrEmpty(ioName))
- {
- IOModuleManager.Instance.WriteIoValue(ioName, false);
- }
- return true;
- }
- /// <summary>
- /// Filter Purge Enable
- /// </summary>
- /// <param name="cmd"></param>
- /// <param name="param"></param>
- /// <returns></returns>
- private bool FilterPurgeEnableOperation(string cmd, object param)
- {
- string ioName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Name}.{FILTER_PURGE_ENABLE}");
- if (!string.IsNullOrEmpty(ioName))
- {
- IOModuleManager.Instance.WriteIoValue(ioName, true);
- }
- return true;
- }
- /// <summary>
- /// Filter Purge Disable
- /// </summary>
- /// <param name="cmd"></param>
- /// <param name="param"></param>
- /// <returns></returns>
- private bool FilterPurgeDisableOperation(string cmd, object param)
- {
- string ioName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Name}.{FILTER_PURGE_ENABLE}");
- if (!string.IsNullOrEmpty(ioName))
- {
- IOModuleManager.Instance.WriteIoValue(ioName, false);
- }
- return true;
- }
- /// <summary>
- /// Sample Enable
- /// </summary>
- /// <param name="cmd"></param>
- /// <param name="param"></param>
- /// <returns></returns>
- private bool SampleEnableOperation(string cmd, object param)
- {
- _isSammpleing = true;
- _sampleStartime = DateTime.Now;
- SampeOperation(true);
- return true;
- }
- /// <summary>
- /// Sample Disable
- /// </summary>
- /// <param name="cmd"></param>
- /// <param name="param"></param>
- /// <returns></returns>
- public bool SampleDisableOperation(string cmd, object param)
- {
- _isSammpleing = false;
- SampeOperation(false);
- return true;
- }
- /// <summary>
- /// Sample操作
- /// </summary>
- /// <param name="enable"></param>
- private void SampeOperation(bool enable)
- {
- string ioName = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Name}.{SAMPLE_ENABLE}");
- if (!string.IsNullOrEmpty(ioName))
- {
- IOModuleManager.Instance.WriteIoValue(ioName, enable);
- }
- string sampleFlow1Name = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Name}.{SAMPLE_FLOW_1_ENABLE}");
- if (!string.IsNullOrEmpty(sampleFlow1Name))
- {
- IOModuleManager.Instance.WriteIoValue(sampleFlow1Name, enable);
- }
- string sampleFlow2Name = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Name}.{SAMPLE_FLOW_2_ENABLE}");
- if (!string.IsNullOrEmpty(sampleFlow2Name))
- {
- IOModuleManager.Instance.WriteIoValue(sampleFlow2Name, enable);
- }
- string sampleFlow3Name = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Name}.{SAMPLE_FLOW_3_ENABLE}");
- if (!string.IsNullOrEmpty(sampleFlow3Name))
- {
- IOModuleManager.Instance.WriteIoValue(sampleFlow3Name, enable);
- }
- string sampleFlow4Name = BeckhoffModuleIOManager.Instance.GetIoNameByInnerModuleName($"{Name}.{SAMPLE_FLOW_4_ENABLE}");
- if (!string.IsNullOrEmpty(sampleFlow4Name))
- {
- IOModuleManager.Instance.WriteIoValue(sampleFlow4Name, enable);
- }
- }
- #endregion
- /// <summary>
- /// 检验Exhaust
- /// </summary>
- /// <returns></returns>
- public (bool result, string reason) CheckExhaustResult()
- {
- return CheckPressureData(EXHAUST_PRESSURE_VALUE);
- }
- /// <summary>
- /// 检验Exhaust
- /// </summary>
- /// <returns></returns>
- public (bool result, string reason) CheckHouseChilledWaterResult()
- {
- return CheckPressureData(HOUSE_CHILLED_WATER_PRESSURE_VALUE);
- }
- /// <summary>
- /// 检验CDA
- /// </summary>
- /// <returns></returns>
- public (bool result, string reason) CheckCDA()
- {
- if (!CDAEnable)
- {
- return (false, "CDA is disable");
- }
- else
- {
- var cda1Result = CheckPressureData(CDA_1_PRESSURE_VALUE);
- if (!cda1Result.result)
- {
- return cda1Result;
- }
- var cda2Result = CheckPressureData(CDA_2_PRESSURE_VALUE);
- if (!cda2Result.result)
- {
- return cda2Result;
- }
- }
- return (true, "");
- }
- /// <summary>
- /// 检验CDA和N2
- /// </summary>
- /// <returns></returns>
- public (bool result, string reason) CheckCDAN2()
- {
- if (!CDAEnable)
- {
- return (false, "CDA is disable");
- }
- else
- {
- var cda1Result = CheckPressureData(CDA_1_PRESSURE_VALUE);
- if (!cda1Result.result)
- {
- return cda1Result;
- }
- var cda2Result = CheckPressureData(CDA_2_PRESSURE_VALUE);
- if (!cda2Result.result)
- {
- return cda2Result;
- }
- }
- if (!N2Enable)
- {
- return (false, "N2 is disable");
- }
- else
- {
- var n21AResult = CheckPressureData(N2_1A_PRESSURE_VALUE);
- if (!n21AResult.result)
- {
- return n21AResult;
- }
- var n21BResult = CheckPressureData(N2_1B_PRESSURE_VALUE);
- if (!n21BResult.result)
- {
- return n21BResult;
- }
- var n22AResult = CheckPressureData(N2_2A_PRESSURE_VALUE);
- if (!n22AResult.result)
- {
- return n22AResult;
- }
- var n22BResult = CheckPressureData(N2_2B_PRESSURE_VALUE);
- if (!n22BResult.result)
- {
- return n22BResult;
- }
- }
- return (true, "");
- }
- /// <summary>
- /// 检验CDA N2以及Vacuum状态
- /// </summary>
- /// <returns></returns>
- public (bool result, string reason) CheckCDAN2AndVacuum()
- {
- if (!CDAEnable)
- {
- return (false, "CDA is disable");
- }
- else
- {
- var cda1Result = CheckPressureData(CDA_1_PRESSURE_VALUE);
- if (!cda1Result.result)
- {
- return cda1Result;
- }
- var cda2Result = CheckPressureData(CDA_2_PRESSURE_VALUE);
- if (!cda2Result.result)
- {
- return cda2Result;
- }
- }
- if (!N2Enable)
- {
- return (false, "N2 is disable");
- }
- else
- {
- var n21AResult = CheckPressureData(N2_1A_PRESSURE_VALUE);
- if (!n21AResult.result)
- {
- return n21AResult;
- }
- var n21BResult = CheckPressureData(N2_1B_PRESSURE_VALUE);
- if (!n21BResult.result)
- {
- return n21BResult;
- }
- var n22AResult = CheckPressureData(N2_2A_PRESSURE_VALUE);
- if (!n22AResult.result)
- {
- return n22AResult;
- }
- var n22BResult = CheckPressureData(N2_2B_PRESSURE_VALUE);
- if (!n22BResult.result)
- {
- return n22BResult;
- }
- var vacuumResult = CheckPressureData(VACUUM_PRESSURE_VALUE);
- if (!vacuumResult.result)
- {
- return vacuumResult;
- }
- }
- return (true, "");
- }
- /// <summary>
- /// 检验压力
- /// </summary>
- /// <param name="pressureName"></param>
- /// <returns></returns>
- private (bool result, string reason) CheckPressureData(string pressureName)
- {
- if (_facilitiesDataDic.ContainsKey(pressureName))
- {
- CommonLimitData facilitiesData = _facilitiesDataDic[(pressureName)];
- if (facilitiesData.IsError)
- {
- return (false, $"{pressureName} data {facilitiesData.Value} is error value");
- }
- else if (facilitiesData.IsWarning)
- {
- return (true, $"{pressureName} data {facilitiesData.Value} is warning");
- }
- else
- {
- return (true, "");
- }
- }
- else
- {
- return (false, $"{pressureName} not in dictionary");
- }
- }
- /// <summary>
- /// 获取Common Limit 数据
- /// </summary>
- /// <param name="name"></param>
- /// <returns></returns>
- public CommonLimitData GetCommonLimitDataByName(string name)
- {
- return _facilitiesDataDic.ContainsKey(name) ? _facilitiesDataDic[name] : null;
- }
- #region IDevice接口
- public void Monitor()
- {
- }
- public void Reset()
- {
- }
- public void Terminate()
- {
- }
- #endregion
- }
- }
|