| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Reflection; |
| | | using HDL_ON.DriverLayer; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | |
| | | /// </summary> |
| | | void LoadSensorDiv(Function sensor,int index) |
| | | { |
| | | var levelColorList = sensorTemp.GetLevelColorList(sensor.spk); |
| | | var levelTextList = sensorTemp.GetLevelTextList(sensor.spk); |
| | | var levelColorList = sensorTemp.GetLevelColorList(sensor); |
| | | var levelTextList = sensorTemp.GetLevelTextList(sensor); |
| | | { |
| | | var sensorTag = sensor.spk + sensor.sid + sensor.deviceId; |
| | | FrameLayout sensorView = new FrameLayout() |
| | |
| | | } |
| | | else |
| | | { |
| | | btnLevel.TextID = levelTextList[sensorTemp.GetCurLevel(sensor) - 1]; |
| | | btnLevel.TextColor = sensorTemp.GetLevelColorList(sensor.spk)[sensorTemp.GetCurLevel(sensor) - 1]; |
| | | btnLevel.Text = levelTextList[sensorTemp.GetCurLevel(sensor) - 1]; |
| | | btnLevel.TextColor = sensorTemp.GetLevelColorList(sensor)[sensorTemp.GetCurLevel(sensor) - 1]; |
| | | btnSensorValues.Text = sensor.GetAttrState(FunctionAttributeKey.Value); |
| | | } |
| | | } |
| | |
| | | void LoadInfo(Function sensor) |
| | | { |
| | | List<uint> levelColorList = new List<uint>(); |
| | | List<int> levelTextList = new List<int>(); |
| | | List<string> levelText = new List<string>(); |
| | | List<string> levelTextList = new List<string>(); |
| | | //List<string> levelText = new List<string>(); |
| | | List<string> intervalList = new List<string>(); |
| | | var configs = sensor.GetAttrKeyConfigs(sensor.SpkClassification); |
| | | |
| | | |
| | | int i = 0; |
| | | foreach(var info in configs) |
| | | //int i = 0; |
| | | //foreach(var info in configs) |
| | | //{ |
| | | // foreach(var config in info.configs) |
| | | // { |
| | | // var color = Convert.ToUInt32(config.color,16); |
| | | // var text = config.desc; |
| | | // levelColorList.Add(color); |
| | | // //levelText.Add(text); |
| | | // levelTextList.Add(i++); |
| | | // intervalList.Add(config.start + " ~ " + config.end); |
| | | // } |
| | | //} |
| | | //if (levelColorList.Count == 0) |
| | | { |
| | | foreach(var config in info.configs) |
| | | { |
| | | var color = Convert.ToUInt32(config.color,16); |
| | | var text = config.desc; |
| | | levelColorList.Add(color); |
| | | levelText.Add(text); |
| | | levelTextList.Add(i++); |
| | | } |
| | | } |
| | | if (levelColorList.Count == 0) |
| | | { |
| | | levelColorList = sensorTemp.GetLevelColorList(sensor.spk); |
| | | levelTextList = sensorTemp.GetLevelTextList(sensor.spk); |
| | | intervalList = sensorTemp.GetIntervalValue(sensor.spk); |
| | | |
| | | foreach (var iii in levelTextList) |
| | | { |
| | | levelText.Add(Language.StringByID(iii)); |
| | | } |
| | | levelColorList = sensorTemp.GetLevelColorList(sensor); |
| | | levelTextList = sensorTemp.GetLevelTextList(sensor); |
| | | intervalList = sensorTemp.GetIntervalValue(sensor); |
| | | //foreach (var iii in levelTextList) |
| | | //{ |
| | | // levelText.Add(Language.StringByID(iii)); |
| | | //} |
| | | } |
| | | Dialog dialog = new Dialog(); |
| | | |
| | |
| | | btnTitle.Text = Language.StringByID(StringId.Temp) + "(°C)"; |
| | | break; |
| | | case SPK.SensorTVOC: |
| | | btnTitle.Text = "TVOC(PPB)"; |
| | | btnTitle.Text = "TVOC(mg/m³)"; |
| | | break; |
| | | case SPK.SensorCO2: |
| | | btnTitle.Text = "CO2(PPM)"; |
| | |
| | | }); |
| | | try |
| | | { |
| | | for (int index = 0; index < levelText.Count; index++) |
| | | for (int index = 0; index < levelTextList.Count; index++) |
| | | { |
| | | //if(sensorTemp.GetIntervalValue(sensor.spk).Count >= index) |
| | | //{ |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | IsBold = true, |
| | | Text = sensorTemp.GetIntervalValue(sensor.spk)[index] |
| | | Text = intervalList[index] |
| | | }); |
| | | |
| | | subInfoView.AddChidren(new Button() |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | IsBold = true, |
| | | Text = levelText[index] |
| | | Text = levelTextList[index] |
| | | }); |
| | | |
| | | subInfoView.AddChidren(new Button() |
| | |
| | | { |
| | | if (updateTemp.spk != SPK.SensorLight) |
| | | { |
| | | (btn as Button).TextID = bodyView.sensorTemp.GetLevelTextList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1]; |
| | | (btn as Button).TextColor = bodyView.sensorTemp.GetLevelColorList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1]; |
| | | (btn as Button).Text = bodyView.sensorTemp.GetLevelTextList(updateTemp)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1]; |
| | | (btn as Button).TextColor = bodyView.sensorTemp.GetLevelColorList(updateTemp)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1]; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else if (btn.GetType() == typeof(ArcSeekBar)) |
| | | { |
| | | (btn as ArcSeekBar).ProgressBarColor = bodyView.sensorTemp.GetLevelColorList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1]; |
| | | (btn as ArcSeekBar).ProgressBarColor = bodyView.sensorTemp.GetLevelColorList(updateTemp)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1]; |
| | | |
| | | (btn as ArcSeekBar).Progress = (96 / bodyView.sensorTemp.GetLevelColorList(updateTemp.spk).Count) * bodyView.sensorTemp.GetCurLevel(updateTemp); |
| | | (btn as ArcSeekBar).Progress = (96 / bodyView.sensorTemp.GetLevelColorList(updateTemp).Count) * bodyView.sensorTemp.GetCurLevel(updateTemp); |
| | | } |
| | | } |
| | | } |