From c1d681f496f2e1c53f88472d803e3c95fab521af Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期四, 29 七月 2021 09:46:16 +0800
Subject: [PATCH] 萤石测试通过
---
HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs | 104 +++++++++++++---------------------------------------
1 files changed, 26 insertions(+), 78 deletions(-)
diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs b/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
index ebe9a20..27ce249 100644
--- a/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
+++ b/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
@@ -61,6 +61,8 @@
}
LoadDiv();
+ btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/{function.IconName}.png";
+
if (function.Spk_Prefix == FunctionCategory.Curtain//绐楀笜娌℃湁寮�鍏虫寜閽�
|| function.Spk_Prefix == FunctionCategory.Music//闊充箰娌℃湁寮�鍏虫寜閽�
|| function.Spk_Prefix == FunctionCategory.Sensor//浼犳劅鍣ㄦ病鏈夊紑鍏虫寜閽�
@@ -69,43 +71,13 @@
switch (function.Spk_Prefix)
{
case FunctionCategory.Curtain:
- switch (function.spk)
- {
- case SPK.CurtainSwitch:
- btnIcon.UnSelectedImagePath = "FunctionIcon/Curtain/CurtainThinIcon.png";
- break;
- case SPK.CurtainTrietex:
- btnIcon.UnSelectedImagePath = "FunctionIcon/Curtain/MotorCurtainIcon.png";
- break;
- case SPK.CurtainRoller:
- btnIcon.UnSelectedImagePath = "FunctionIcon/Curtain/RollingShutterIcon.png";
- break;
- }
CurtainFragment();
break;
case FunctionCategory.Sensor:
- switch (function.spk)
- {
- case SPK.SensorPir:
- btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/ArmSensorPirIcon.png";
- break;
- case SPK.SensorWater:
- btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/ArmSensorWaterImmersionIcon.png";
- break;
- case SPK.SensorSmoke:
- btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/ArmSensorSmokeIcon.png";
- break;
- case SPK.SensorDoorWindow:
- btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/ArmSensorDoorIcon.png";
- break;
- default:
-
- break;
- }
- var powerLowTipAttr = function.status.Find((obj) => obj.key == FunctionAttributeKey.BatteryState);
+ var powerLowTipAttr = function.attributes.Find((obj) => obj.key == FunctionAttributeKey.BatteryState);
if (powerLowTipAttr != null)
{
- if (powerLowTipAttr.value.ToLower() == "low")
+ if (powerLowTipAttr.state.ToLower() == "low")
{
Button btnTipPowerLow = new Button()
{
@@ -122,7 +94,6 @@
break;
case FunctionCategory.Music:
- btnIcon.UnSelectedImagePath = "FunctionIcon/Music/MusicThinIcon.png";
MusicFragment();
break;
@@ -132,7 +103,6 @@
{
if (function.spk == SPK.ClothesHanger)//鏅捐。鏋�
{
- btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/ClothesHanger/ClothesHangerGrayIcon.png";
ClothesHangerFragment();
}
else
@@ -181,51 +151,19 @@
switch (function.Spk_Prefix)
{
case FunctionCategory.AC:
- switch (function.spk)
- {
- case SPK.AcStandard:
- btnIcon.UnSelectedImagePath = "FunctionIcon/AC/AcThinIcon1.png";
- LoadLastStatesButton();
- break;
- }
+ LoadLastStatesButton();
+ break;
+ case FunctionCategory.IR:
+ LoadLastStatesButton();
break;
case FunctionCategory.FloorHeat:
- switch (function.spk)
- {
- case SPK.FloorHeatStandard:
- btnIcon.UnSelectedImagePath = "FunctionIcon/FloorHeating/FloorHeatingThinIcon.png";
- LoadLastStatesButton();
- break;
- }
+ LoadLastStatesButton();
break;
case FunctionCategory.Light:
- btnIcon.UnSelectedImagePath = "FunctionIcon/Light/LightThinIcon.png";
btnSwitch.IsSelected = function.trait_on_off.curValue.ToString() == "on";
LoadLightControl();
break;
case FunctionCategory.Electric:
- switch (function.spk)
- {
- case SPK.ElectricSocket:
- btnIcon.UnSelectedImagePath = "FunctionIcon/Socket/SocketThinIcon.png";
- break;
- case SPK.ElectricFan:
- case SPK.ElectricTuyaFan:
- btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/FanThinIcon.png";
- break;
- case SPK.ElectricTV:
- btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/TVThinIcon.png";
- break;
- case SPK.ElectricTuyaAirCleaner:
- btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/AirCleanerThiinIcon.png";
- break;
- case SPK.ElectricTuyaWeepRobot:
- btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WeepRobotThinIcon.png";
- break;
- case SPK.ElectricTuyaWaterValve:
- btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WaterValve/WaterValveIcon.png";
- break;
- }
btnSwitch.IsSelected = function.trait_on_off.curValue.ToString() == "on";
break;
}
@@ -289,7 +227,7 @@
};
//bodyDiv.AddChidren(btnCollectionIcon);
//2020-12-16 濡傛灉鏄垚鍛橀殣钘忔敹钘忓姛鑳�
- if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare && function.Spk_Prefix != FunctionCategory.Sensor)
+ if ( function.Spk_Prefix != FunctionCategory.Sensor)//!DB_ResidenceData.Instance.CurrentRegion.isOtherShare &&
{
bodyDiv.AddChidren(btnCollectionIcon);
}
@@ -331,7 +269,7 @@
ProgressTextColor = CSS_Color.FirstLevelTitleColor,
ProgressTextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
MaxValue = 100,
- Progress = (function as Light).brightness,
+ Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness)),
Tag = function.sid + "_DimmerBar",
SeekBarPadding = Application.GetRealWidth(20),
};
@@ -370,10 +308,15 @@
Height = Application.GetMinRealAverage(32),
UnSelectedImagePath = "FunctionIcon/Curtain/CurtainCloseIcon.png",
SelectedImagePath = "FunctionIcon/Curtain/CurtainCloseOnIcon.png",
- IsSelected = function.GetAttrState(FunctionAttributeKey.Percent) == "0",
+ IsSelected = function.GetAttrState(FunctionAttributeKey.OnOff) == "off",
Tag = function.sid + "_off"
};
bodyDiv.AddChidren(btnCurtainClose);
+ if(function.spk == SPK.CurtainRoller)
+ {
+ btnCurtainClose.UnSelectedImagePath = "FunctionIcon/Curtain/CurtainDownIcon.png";
+ btnCurtainClose.SelectedImagePath = "FunctionIcon/Curtain/CurtainDownIconOn.png";
+ }
var btnCurtainStop = new Button()
{
@@ -396,10 +339,15 @@
UnSelectedImagePath = "FunctionIcon/Curtain/CurtainOpenIcon.png",
SelectedImagePath = "FunctionIcon/Curtain/CurtainOpenOnIcon.png",
Tag = function.sid + "_on",
- IsSelected = function.GetAttrState(FunctionAttributeKey.Percent) != "0"
+ IsSelected = function.GetAttrState(FunctionAttributeKey.OnOff) == "on",
};
bodyDiv.AddChidren(btnCurtainOpen);
- LoadEvent_ControlCurtain(btnCurtainStop, btnCurtainOpen, btnCurtainClose, function as Curtain);
+ if (function.spk == SPK.CurtainRoller)
+ {
+ btnCurtainOpen.UnSelectedImagePath = "FunctionIcon/Curtain/CurtainUpIcon.png";
+ btnCurtainOpen.SelectedImagePath = "FunctionIcon/Curtain/CurtainUpIconOn.png";
+ }
+ LoadEvent_ControlCurtain(btnCurtainStop, btnCurtainOpen, btnCurtainClose, function);
#endregion
}
/// <summary>
@@ -429,7 +377,7 @@
SelectedImagePath = "FunctionIcon/Electrical/ClothesHanger/ClothesHangerDownIcon1On.png",
};
bodyDiv.AddChidren(btnClothesHangerDown);
- LoadEvent_ControlClothesHanger(function, btnClothesHangerDown, btnClothesHangerUp);
+ LoadEvent_ControlClothesHanger(function, btnClothesHangerUp, btnClothesHangerDown);
#endregion
@@ -460,7 +408,7 @@
Height = Application.GetMinRealAverage(32),
UnSelectedImagePath = "MusicIcon/pause.png",
SelectedImagePath = "MusicIcon/play.png",
- IsSelected = (function as A31MusicModel).A31PlayStatus.status == "play" ,
+ //IsSelected = (function as A31MusicModel).A31PlayStatus.status == "play" ,
Tag = function.spk + "_State_" + function.sid
};
bodyDiv.AddChidren(btnPlay);
--
Gitblit v1.8.0