| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.Entity |
| | | { |
| | |
| | | function.SetAttrState(FunctionAttributeKey.Value, value); |
| | | } |
| | | |
| | | List<string> _intervalValue = new List<string>(); |
| | | |
| | | public void SetIntervalValue(List<string> intervalValue) |
| | | { |
| | | _intervalValue = intervalValue; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 每个等级对区间值 |
| | | /// </summary> |
| | | public List<string> GetIntervalValue(Function function) |
| | | public List<string> GetIntervalValue(string spk) |
| | | { |
| | | var _intervalValue = new List<string>(); |
| | | |
| | | |
| | | if (function.attrKeyConfigs.Count > 0) |
| | | if(_intervalValue.Count != 0) |
| | | { |
| | | |
| | | foreach (var attrKey in function.attrKeyConfigs) |
| | | { |
| | | if (function.spk.Replace(".", "").Contains(attrKey.key.Replace(".", ""))) |
| | | { |
| | | foreach (var info in attrKey.configs) |
| | | { |
| | | _intervalValue.Add(info.start + " ~ " + info.end); |
| | | } |
| | | } |
| | | } |
| | | if (_intervalValue.Count > 0) |
| | | return _intervalValue; |
| | | return _intervalValue; |
| | | } |
| | | |
| | | |
| | | string spk = function.spk; |
| | | _intervalValue = new List<string>(); |
| | | switch (spk) |
| | | { |
| | | case SPK.SensorPm25: |
| | |
| | | switch (function.spk) |
| | | { |
| | | case SPK.SensorPm25: |
| | | unit = "ug/m²"; |
| | | unit = "ug/m³"; |
| | | break; |
| | | case SPK.SensorTemperature: |
| | | unit = "°C"; |
| | |
| | | /// <summary> |
| | | /// 每个等级的颜色值 |
| | | /// </summary> |
| | | public List<uint> GetLevelColorList(Function function) |
| | | public List<uint> GetLevelColorList(string spk) |
| | | { |
| | | var _levelColorList = new List<uint>(); |
| | | if (function.attrKeyConfigs.Count > 0) |
| | | { |
| | | |
| | | foreach (var attrKey in function.attrKeyConfigs) |
| | | { |
| | | if (function.spk.Replace(".", "").Contains(attrKey.key.Replace(".", ""))) |
| | | { |
| | | foreach (var info in attrKey.configs) |
| | | { |
| | | _levelColorList.Add(Convert.ToUInt32(info.color, 16)); |
| | | } |
| | | } |
| | | } |
| | | if (_levelColorList.Count > 0) |
| | | return _levelColorList; |
| | | } |
| | | |
| | | string spk = function.spk; |
| | | switch (spk) |
| | | { |
| | | case SPK.SensorPm25: |
| | |
| | | /// <summary> |
| | | /// 每个等级的名称 |
| | | /// </summary> |
| | | public List<string> GetLevelTextList(Function function) |
| | | public List<int> GetLevelTextList(string spk) |
| | | { |
| | | var _levelTextList = new List<string>(); |
| | | |
| | | if (function.attrKeyConfigs.Count > 0) |
| | | { |
| | | |
| | | foreach (var attrKey in function.attrKeyConfigs) |
| | | { |
| | | if (function.spk.Replace(".", "").Contains(attrKey.key.Replace(".", ""))) |
| | | { |
| | | foreach (var info in attrKey.configs) |
| | | { |
| | | _levelTextList.Add(info.desc); |
| | | } |
| | | } |
| | | } |
| | | if (_levelTextList.Count > 0) |
| | | return _levelTextList; |
| | | } |
| | | |
| | | string spk = function.spk; |
| | | var _levelTextList = new List<int>(); |
| | | switch (spk) |
| | | { |
| | | case SPK.SensorPm25: |
| | | _levelTextList.Add(Language.StringByID(StringId.Great)); |
| | | _levelTextList.Add(Language.StringByID(StringId.Good)); |
| | | _levelTextList.Add(Language.StringByID(StringId.MildPollution)); |
| | | _levelTextList.Add(Language.StringByID(StringId.HeavyPollution)); |
| | | _levelTextList.Add(StringId.Great); |
| | | _levelTextList.Add(StringId.Good); |
| | | _levelTextList.Add(StringId.MildPollution); |
| | | _levelTextList.Add(StringId.HeavyPollution); |
| | | break; |
| | | case SPK.SensorCO2: |
| | | _levelTextList.Add(Language.StringByID(StringId.SensorReferenceTipCO2Level1)); |
| | | _levelTextList.Add(Language.StringByID(StringId.SensorReferenceTipCO2Level2)); |
| | | _levelTextList.Add(Language.StringByID(StringId.SensorReferenceTipCO2Level3)); |
| | | _levelTextList.Add(Language.StringByID(StringId.SensorReferenceTipCO2Level4)); |
| | | _levelTextList.Add(StringId.SensorReferenceTipCO2Level1); |
| | | _levelTextList.Add(StringId.SensorReferenceTipCO2Level2); |
| | | _levelTextList.Add(StringId.SensorReferenceTipCO2Level3); |
| | | _levelTextList.Add(StringId.SensorReferenceTipCO2Level4); |
| | | break; |
| | | case SPK.SensorTemperature: |
| | | _levelTextList.Add(Language.StringByID(StringId.ExtremelyCold)); |
| | | _levelTextList.Add(Language.StringByID(StringId.Cold)); |
| | | _levelTextList.Add(Language.StringByID(StringId.SlightlyCold)); |
| | | _levelTextList.Add(Language.StringByID(StringId.Comfortable)); |
| | | _levelTextList.Add(Language.StringByID(StringId.TepidFever)); |
| | | _levelTextList.Add(Language.StringByID(StringId.Heat_SensorTip)); |
| | | _levelTextList.Add(Language.StringByID(StringId.ExtremeHeat)); |
| | | _levelTextList.Add(StringId.ExtremelyCold); |
| | | _levelTextList.Add(StringId.Cold); |
| | | _levelTextList.Add(StringId.SlightlyCold); |
| | | _levelTextList.Add(StringId.Comfortable); |
| | | _levelTextList.Add(StringId.TepidFever); |
| | | _levelTextList.Add(StringId.Heat_SensorTip); |
| | | _levelTextList.Add(StringId.ExtremeHeat); |
| | | break; |
| | | case SPK.SensorTVOC: |
| | | _levelTextList.Add(Language.StringByID(StringId.SensorReferenceTVOCTipLevel1)); |
| | | _levelTextList.Add(Language.StringByID(StringId.SensorReferenceTVOCTipLevel2)); |
| | | _levelTextList.Add(Language.StringByID(StringId.SensorReferenceTVOCTipLevel3)); |
| | | _levelTextList.Add(Language.StringByID(StringId.SensorReferenceTVOCTipLevel4)); |
| | | _levelTextList.Add(StringId.SensorReferenceTVOCTipLevel1); |
| | | _levelTextList.Add(StringId.SensorReferenceTVOCTipLevel2); |
| | | _levelTextList.Add(StringId.SensorReferenceTVOCTipLevel3); |
| | | _levelTextList.Add(StringId.SensorReferenceTVOCTipLevel4); |
| | | break; |
| | | case SPK.SensorHumidity: |
| | | _levelTextList.Add(Language.StringByID(StringId.SensorReferenceHumidityTipLevel1)); |
| | | _levelTextList.Add(Language.StringByID(StringId.SensorReferenceHumidityTipLevel2)); |
| | | _levelTextList.Add(Language.StringByID(StringId.SensorReferenceHumidityTipLevel3)); |
| | | _levelTextList.Add(StringId.SensorReferenceHumidityTipLevel1); |
| | | _levelTextList.Add(StringId.SensorReferenceHumidityTipLevel2); |
| | | _levelTextList.Add(StringId.SensorReferenceHumidityTipLevel3); |
| | | break; |
| | | case SPK.SensorHcho: |
| | | _levelTextList.Add(Language.StringByID(StringId.Class_I_BuildingStandard)); |
| | | _levelTextList.Add(Language.StringByID(StringId.SecondaryBuildingStandard)); |
| | | _levelTextList.Add(Language.StringByID(StringId.ExceedingTheStandard)); |
| | | _levelTextList.Add(StringId.Class_I_BuildingStandard); |
| | | _levelTextList.Add(StringId.SecondaryBuildingStandard); |
| | | _levelTextList.Add(StringId.ExceedingTheStandard); |
| | | break; |
| | | default: |
| | | _levelTextList.Add(""); |
| | | _levelTextList.Add(""); |
| | | _levelTextList.Add(""); |
| | | _levelTextList.Add(99999999); |
| | | _levelTextList.Add(99999999); |
| | | _levelTextList.Add(99999999); |
| | | break; |
| | | } |
| | | return _levelTextList; |