From b2f2494386c4629cf0e0f0a3740e7672919d53a2 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期三, 06 一月 2021 17:09:55 +0800
Subject: [PATCH] 修改了彩灯的百分比计算
---
ZigbeeApp/Shared/Phone/UserCenter/Device/PirSensor/PirSensorDimmingModeForm.cs | 13
ZigbeeApp/GateWay.Droid/Assets/Language.ini | 18
ZigbeeApp/GateWay.Droid/Assets/Phone/ZigeeLogic/airqualityselected.png | 0
ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs | 63 ++
ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorTemperatureLightDetailCardForm.cs | 20
ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml | 2
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs | 2
ZigbeeApp/Shared/Phone/Device/Logic/PublicInterface.cs | 241 +++++++----
ZigbeeApp/GateWay.Droid/Assets/Phone/ZigeeLogic/airquality.png | 0
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs | 4
ZigbeeApp/Shared/Phone/Device/Logic/Method.cs | 25
ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorLightDetailCardForm.cs | 18
ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj | 6
ZigbeeApp/Shared/Phone/Device/Logic/LogicDveiceStatus.cs | 240 +++++++++--
ZigbeeApp/Shared/R.cs | 17
ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorTemperatureRowControl.cs | 2
ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs | 2
ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs | 2
ZigbeeApp/Shared/Common/CommonPage.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectLightForm.cs | 16
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCommonLogic.cs | 25 +
ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorTemperatureCardControl.cs | 2
ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs | 417 +++++++++++++++++++-
ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs | 20
24 files changed, 911 insertions(+), 246 deletions(-)
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Language.ini b/ZigbeeApp/GateWay.Droid/Assets/Language.ini
index 60f105c..47b6b87 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Language.ini
+++ b/ZigbeeApp/GateWay.Droid/Assets/Language.ini
@@ -700,6 +700,24 @@
5415=鏍�
5416=鍗曞厓
5417=瀹ゅ鏈�
+5418=绌烘皵璐ㄩ噺浼犳劅鍣�
+5419=PM2.5娴撳害
+5420=娓╁害
+5421=婀垮害
+5422=CO虏
+5423=浼�
+5424=鑹�
+5425=宸�
+5426=浼橈紙0~35ug/m鲁锛�
+5427=鑹紙36~75ug/m鲁锛�
+5428=杞诲害姹℃煋锛�76~115ug/m鲁锛�
+5429=閲嶅害姹℃煋锛堬紴115ug/m鲁锛�
+5430=绌烘皵娓呮柊锛�0~1000ppm锛�
+5431=绌烘皵娴戞祳锛�1000~2000ppm锛�
+5432=绌烘皵缂烘哀锛�2000~5000ppm锛�
+5433=涓ラ噸缂烘哀锛堬紴5000ppm锛�
+5434=绌烘皵璐ㄩ噺
+
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/ZigeeLogic/airquality.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/ZigeeLogic/airquality.png
new file mode 100644
index 0000000..59ec7d5
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/ZigeeLogic/airquality.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/ZigeeLogic/airqualityselected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/ZigeeLogic/airqualityselected.png
new file mode 100644
index 0000000..f14fce0
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/ZigeeLogic/airqualityselected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj b/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj
index 69a4cd3..fefe533 100644
--- a/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj
+++ b/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj
@@ -2685,6 +2685,12 @@
<ItemGroup>
<AndroidAsset Include="Assets\Phone\AirQualitySensor\lightOn.png" />
</ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\ZigeeLogic\airquality.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\ZigeeLogic\airqualityselected.png" />
+ </ItemGroup>
<Import Project="..\Shared\Shared.projitems" Label="Shared" Condition="Exists('..\Shared\Shared.projitems')" />
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<Import Project="..\packages\Xamarin.Android.Support.Annotations.26.0.2\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Annotations.26.0.2\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets')" />
diff --git a/ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml b/ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml
index b7bdfe8..cbb3ead 100644
--- a/ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml
+++ b/ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@
锘�<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.evoyo.home" android:versionCode="0120123101" android:installLocation="auto" android:versionName="1.1.0120123101">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.evoyo.home" android:versionCode="0121010601" android:installLocation="auto" android:versionName="1.1.0121010601">
<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="26" />
<permission android:name="com.evoyo.home.permission.JPUSH_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
diff --git a/ZigbeeApp/Shared/Common/CommonPage.cs b/ZigbeeApp/Shared/Common/CommonPage.cs
index d9cde27..cdf96e9 100755
--- a/ZigbeeApp/Shared/Common/CommonPage.cs
+++ b/ZigbeeApp/Shared/Common/CommonPage.cs
@@ -45,7 +45,7 @@
/// <summary>
/// 鐗堟湰鍙�
/// </summary>
- public static string CodeIDString = "1.1.0120123101";
+ public static string CodeIDString = "1.1.0121010601";
/// <summary>
/// 娉ㄥ唽鏉ユ簮(0:HDL On 1:Zigbee)
/// </summary>
diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs
index 43bd5cb..0caf09c 100755
--- a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs
+++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs
@@ -56,7 +56,7 @@
if (level == 0)
{
//濡傛灉褰撳墠鏄墦寮�鐘舵��,骞朵笖浜害涓�0鐨勮瘽,鍒欓渶瑕佸彉鎴�100%浜害
- i_device.GetType().InvokeMember("SetLevel", System.Reflection.BindingFlags.InvokeMethod, null, i_device, new object[] { 254 });
+ i_device.GetType().InvokeMember("SetLevel", System.Reflection.BindingFlags.InvokeMethod, null, i_device, new object[] { 255 });
}
else
{
diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorTemperatureRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorTemperatureRowControl.cs
index 5f148d0..29544a6 100755
--- a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorTemperatureRowControl.cs
+++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorTemperatureRowControl.cs
@@ -56,7 +56,7 @@
if (level == 0)
{
//濡傛灉褰撳墠鏄墦寮�鐘舵��,骞朵笖浜害涓�0鐨勮瘽,鍒欓渶瑕佸彉鎴�100%浜害
- i_device.GetType().InvokeMember("SetLevel", System.Reflection.BindingFlags.InvokeMethod, null, i_device, new object[] { 254 });
+ i_device.GetType().InvokeMember("SetLevel", System.Reflection.BindingFlags.InvokeMethod, null, i_device, new object[] { 255 });
}
else
{
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs b/ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs
index 51f2bcd..f3e6269 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs
@@ -277,7 +277,7 @@
}
}
-
+
}
break;
case DeviceType.IASZone:
@@ -559,37 +559,53 @@
break;
case DeviceType.TemperatureSensor:
{
- //缂栬緫鏃剁殑鐘舵�佸��
- string str1 = "";
- string str2 = "";
- if (edit && devices != null)
- {
- //娓╁害鍊�
- str1 = devices["AttriButeData1"];
- //姣旇緝鍏崇郴鍊�
- str2 = devices["Range"];
- }
- var temperatureSensor = common as TemperatureSensor;
- if (temperatureSensor.SensorDiv == 1)
+ //鑾峰彇璁惧绫诲瀷
+ var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { common });
+
+ //绌烘皵璐ㄩ噺浼犳劅鍣�
+ if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
{
- Send.dictionary(deviceConditionsInfo, "Cluster_ID", "1026");
+ AirSonser(flMain, SelectedDeviceStatus, edit, common, devices);
}
else
{
- Send.dictionary(deviceConditionsInfo, "Cluster_ID", "1029");
- }
- Send.dictionary(deviceConditionsInfo, "AttriButeId", "0");
- Send.dictionary(deviceConditionsInfo, "AttriButeData2", "0");
- completeView.Show(4);
- PublicInterface publicInterface = new PublicInterface();
- publicInterface.TemperatureShow(completeView.fraView, common, str2, str1, (relationValueStr, tempValueStr) =>
- {
- SelectedDeviceStatus = "TemperatureSensor";
- Send.dictionary(deviceConditionsInfo, "AttriButeData1", tempValueStr);
- Send.dictionary(deviceConditionsInfo, "Range", relationValueStr);
- });
+
+ //缂栬緫鏃剁殑鐘舵�佸��
+ string str1 = "";
+ string str2 = "";
+ string str3 = "";
+ if (edit && devices != null)
+ {
+ //娓╁害鍊�
+ str1 = devices["AttriButeData1"];
+ //姣旇緝鍏崇郴鍊�
+ str2 = devices["Range"];
+
+ }
+ var temperatureSensor = common as TemperatureSensor;
+ if (temperatureSensor.SensorDiv == 1)
+ {
+ str3 = "鈩�";
+ Send.dictionary(deviceConditionsInfo, "Cluster_ID", "1026");
+ }
+ else
+ {
+ str3 = "%";
+ Send.dictionary(deviceConditionsInfo, "Cluster_ID", "1029");
+ }
+ Send.dictionary(deviceConditionsInfo, "AttriButeId", "0");
+ Send.dictionary(deviceConditionsInfo, "AttriButeData2", "0");
+ completeView.Show(4);
+ PublicInterface publicInterface = new PublicInterface();
+ publicInterface.TemperatureShow(completeView.fraView, str3, str2, str1, (relationValueStr, tempValueStr) =>
+ {
+ SelectedDeviceStatus = "TemperatureSensor";
+ Send.dictionary(deviceConditionsInfo, "AttriButeData1", tempValueStr);
+ Send.dictionary(deviceConditionsInfo, "Range", relationValueStr);
+ });
+ }
}
break;
///璋冨厜鐏厜
@@ -643,7 +659,6 @@
var lightbrightnessvalue = (254 * horizontalSeekBarVol.Progress) / 100;
Send.dictionary(switchdictionary, "Data1", lightbrightnessvalue.ToString());
};
-
///鍙栨秷浜嬩欢
closeView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
{
@@ -656,7 +671,6 @@
Send.dictionary(switchdictionary, "TaskType", "1");
Send.dictionary(switchdictionary, "Data1", "0");//榛樿鍊�
};
-
//鍙栧弽
takebackView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
{
@@ -1177,6 +1191,8 @@
}
break;
+
+
}
completeView.Btncomplete.MouseUpEventHandler += (sender, e) =>
{
@@ -1246,9 +1262,7 @@
};
}
-
-
- /// <summary>
+ /// <summary>
/// 绌鸿皟妯″紡鐨勭姸鎬�
/// </summary>
/// <param name="modestring"></param>
@@ -1314,5 +1328,346 @@
}
}
+ /// <summary>
+ /// 绌烘皵璐ㄩ噺浼犳劅鍣╒iew(鐗规畩澶勭悊)
+ /// </summary>
+ /// <param name="flMain"></param>
+ /// <param name="SelectedDeviceStatus"></param>
+ /// <param name="edit"></param>
+ /// <param name="common"></param>
+ /// <param name="dic"></param>
+ private static void AirSonser(FrameLayout flMain,string SelectedDeviceStatus,bool edit,CommonDevice common, Dictionary<string, string> dic=null) {
+ flMain.RemoveAll();
+ if (edit&&dic!=null) {
+ AirProperty(flMain, dic, common,"", edit, SelectedDeviceStatus);
+ }
+ else
+ {
+ PublicInterface publicInterface = new PublicInterface();
+ var list0 = publicInterface.GetViewList("绌烘皵璐ㄩ噺浼犳劅鍣�");
+ publicInterface.SingleSelectionShow(flMain, list0, MyInternationalizationString.airqualitysensor, "", (tagText) =>
+ {
+ flMain.RemoveAll();
+ SelectedDeviceStatus = "TemperatureSensor";
+ AirProperty(flMain, dic, common,tagText, edit, SelectedDeviceStatus);
+ }, () => { flMain.RemoveFromParent(); });
+ }
+ }
+ /// <summary>
+ /// 绌烘皵璐ㄩ噺浼犳劅鍣ㄥ睘鎬у��(鐗规畩澶勭悊)
+ /// </summary>
+ /// <param name="flMain"></param>
+ /// <param name="dic"></param>
+ /// <param name="common"></param>
+ /// <param name="tagText"></param>
+ /// <param name="edit"></param>
+ /// <param name="SelectedDeviceStatus"></param>
+ private static void AirProperty(FrameLayout flMain, Dictionary<string, string> dic,CommonDevice common,string tagText,bool edit, string SelectedDeviceStatus) {
+ PublicInterface publicInterface = new PublicInterface();
+ string range = "";
+ string stateText = "";
+ if (edit&& dic!=null)
+ {
+ range = dic["Range"];
+ switch (dic["Cluster_ID"])
+ {
+ case "1066":
+ {
+ if (dic["AttriButeId"] == "57344")
+ {
+ tagText = Language.StringByID(MyInternationalizationString.kongqizhiliang);
+ switch (dic["AttriButeData1"])
+ {
+
+ case "1":
+ {
+ stateText = Language.StringByID(MyInternationalizationString.you);
+ }
+ break;
+ case "2":
+ {
+ stateText = Language.StringByID(MyInternationalizationString.liang);
+ }
+ break;
+ case "3":
+ {
+ stateText = Language.StringByID(MyInternationalizationString.cha);
+ }
+ break;
+ }
+ }
+ else
+ {
+ tagText = Language.StringByID(MyInternationalizationString.pm25);
+ ///Pm2.5
+ int intValue = int.Parse(dic["AttriButeData1"]);
+ if (0 < intValue && intValue < 30)
+ {
+ stateText = Language.StringByID(MyInternationalizationString.pmyou);
+ }
+ else if (36 < intValue && intValue < 75)
+ {
+ stateText = Language.StringByID(MyInternationalizationString.pmliang);
+ }
+ else if (76 < intValue && intValue < 115)
+ {
+ stateText = Language.StringByID(MyInternationalizationString.pmqingdu);
+ }
+ else if (intValue > 115)
+ {
+ stateText = Language.StringByID(MyInternationalizationString.pmzhongdu);
+ }
+
+ }
+ }
+ break;
+ case "1037":
+ {
+ tagText = Language.StringByID(MyInternationalizationString.co2);
+ ///co2
+ int intValue = int.Parse(dic["AttriButeData1"]);
+ if (0 < intValue && intValue < 1000)
+ {
+ stateText = Language.StringByID(MyInternationalizationString.co2qingxin);
+ }
+ else if (1000 < intValue && intValue < 2000)
+ {
+ stateText = Language.StringByID(MyInternationalizationString.co2huizhuo);
+ }
+ else if (2000 < intValue && intValue < 5000)
+ {
+ stateText = Language.StringByID(MyInternationalizationString.co2queyang);
+ }
+ else if (intValue > 5000)
+ {
+ stateText = Language.StringByID(MyInternationalizationString.co2yanzhongqueyang);
+ }
+ }
+ break;
+ case "1026":
+ {
+ tagText = Language.StringByID(MyInternationalizationString.sensortemperature);
+ stateText = dic["AttriButeData1"];
+ }
+ break;
+ case "1029":
+ {
+ tagText = Language.StringByID(MyInternationalizationString.sensorhumidity);
+ stateText = dic["AttriButeData1"];
+ }
+ break;
+ }
+ }
+ Dictionary<string, string> airqualitysensorDic = new Dictionary<string, string>();
+ Send.dictionary(airqualitysensorDic, "Type", "1");
+ Send.dictionary(airqualitysensorDic, "IsValid", "1");
+ Send.dictionary(airqualitysensorDic, "MacAddr", common.DeviceAddr);
+ Send.dictionary(airqualitysensorDic, "Epoint", common.DeviceEpoint.ToString());
+ if (tagText == Language.StringByID(MyInternationalizationString.kongqizhiliang))
+ {
+
+ var list1 = publicInterface.GetViewList("绌烘皵璐ㄩ噺");
+ publicInterface.SingleSelectionShow(flMain, list1, MyInternationalizationString.airqualitysensor, stateText, (strText) =>
+ {
+ SelectedDeviceStatus = "TemperatureSensor";
+ string valuaStr = "";
+ if (strText == Language.StringByID(MyInternationalizationString.you))
+ {
+ valuaStr = "1";
+ }
+ else if (strText == Language.StringByID(MyInternationalizationString.liang))
+ {
+ valuaStr = "2";
+ }
+ else if (strText == Language.StringByID(MyInternationalizationString.cha))
+ {
+ valuaStr = "3";
+ }
+ Send.dictionary(airqualitysensorDic, "Cluster_ID", "1066");
+ Send.dictionary(airqualitysensorDic, "AttriButeId", "57344");
+ Send.dictionary(airqualitysensorDic, "AttriButeData1", valuaStr);
+ Send.dictionary(airqualitysensorDic, "AttriButeData2", "0");
+ Send.dictionary(airqualitysensorDic, "Range", "1");
+ AddDic(flMain, SelectedDeviceStatus, edit, common, airqualitysensorDic);
+
+
+ }, () => {
+ if (edit) { flMain.RemoveFromParent(); }
+ else
+ {
+ AirSonser(flMain, SelectedDeviceStatus, edit, common);
+ } });
+
+ }
+ else if (tagText == Language.StringByID(MyInternationalizationString.pm25))
+ {
+ var list2 = publicInterface.GetViewList("pm2.5");
+ publicInterface.SingleSelectionShow(flMain, list2, MyInternationalizationString.pm25, stateText, (strText) =>
+ {
+ SelectedDeviceStatus = "TemperatureSensor";
+ string valuaStr = "";
+ if (strText == Language.StringByID(MyInternationalizationString.pmyou))
+ {
+ valuaStr = "18";
+ }
+ else if (strText == Language.StringByID(MyInternationalizationString.pmliang))
+ {
+ valuaStr = "54";
+ }
+ else if (strText == Language.StringByID(MyInternationalizationString.pmqingdu))
+ {
+ valuaStr = "105";
+ }
+ else if (strText == Language.StringByID(MyInternationalizationString.pmzhongdu))
+ {
+ valuaStr = "130";
+ }
+ Send.dictionary(airqualitysensorDic, "Cluster_ID", "1066");
+ Send.dictionary(airqualitysensorDic, "AttriButeId", "0");
+ Send.dictionary(airqualitysensorDic, "AttriButeData1", valuaStr);
+ Send.dictionary(airqualitysensorDic, "AttriButeData2", "0");
+ Send.dictionary(airqualitysensorDic, "Range", "1");
+ AddDic(flMain, SelectedDeviceStatus, edit, common, airqualitysensorDic);
+
+
+ }, () => {
+ if (edit) { flMain.RemoveFromParent(); }
+ else
+ {
+ AirSonser(flMain, SelectedDeviceStatus, edit, common);
+ }
+ });
+
+ }
+ else if (tagText == Language.StringByID(MyInternationalizationString.co2))
+ {
+
+ var list2 = publicInterface.GetViewList("co2");
+ publicInterface.SingleSelectionShow(flMain, list2, MyInternationalizationString.co2, stateText, (strText) =>
+ {
+ SelectedDeviceStatus = "TemperatureSensor";
+ string valuaStr = "";
+ if (strText == Language.StringByID(MyInternationalizationString.co2qingxin))
+ {
+ valuaStr = "500";
+ }
+ else if (strText == Language.StringByID(MyInternationalizationString.co2huizhuo))
+ {
+ valuaStr = "1500";
+ }
+ else if (strText == Language.StringByID(MyInternationalizationString.co2queyang))
+ {
+ valuaStr = "2500";
+ }
+ else if (strText == Language.StringByID(MyInternationalizationString.co2yanzhongqueyang))
+ {
+ valuaStr = "5500";
+ }
+ Send.dictionary(airqualitysensorDic, "Cluster_ID", "1037");
+ Send.dictionary(airqualitysensorDic, "AttriButeId", "0");
+ Send.dictionary(airqualitysensorDic, "AttriButeData1", valuaStr);
+ Send.dictionary(airqualitysensorDic, "AttriButeData2", "0");
+ Send.dictionary(airqualitysensorDic, "Range", "1");
+ AddDic(flMain, SelectedDeviceStatus, edit, common, airqualitysensorDic);
+
+
+ }, () => {
+ if (edit) { flMain.RemoveFromParent(); }
+ else
+ {
+ AirSonser(flMain, SelectedDeviceStatus, edit, common);
+ }
+ });
+
+
+
+ }
+ else if (tagText == Language.StringByID(MyInternationalizationString.sensortemperature))
+ {
+ //缂栬緫鏃剁殑鐘舵�佸��
+ string str1 = range;
+ string str2 = stateText;
+ publicInterface.TemperatureShow1(flMain, tagText, "鈩�", str1, str2, (relationValueStr, tempValueStr) =>
+ {
+
+ SelectedDeviceStatus = "TemperatureSensor";
+ Send.dictionary(airqualitysensorDic, "Cluster_ID", "1026");
+ Send.dictionary(airqualitysensorDic, "AttriButeId", "0");
+ Send.dictionary(airqualitysensorDic, "AttriButeData1", tempValueStr);
+ Send.dictionary(airqualitysensorDic, "AttriButeData2", "0");
+ Send.dictionary(airqualitysensorDic, "Range", relationValueStr);
+ AddDic(flMain, SelectedDeviceStatus, edit, common, airqualitysensorDic);
+
+
+ }, () =>
+ {
+ if (edit) { flMain.RemoveFromParent(); }
+ else
+ {
+ AirSonser(flMain, SelectedDeviceStatus, edit, common);
+ }
+
+ });
+ }
+ else if (tagText == Language.StringByID(MyInternationalizationString.sensorhumidity))
+ {
+ //缂栬緫鏃剁殑鐘舵�佸��
+ string str1 = range;
+ string str2 = stateText;
+ publicInterface.TemperatureShow1(flMain, tagText, "%", str1, str2, (relationValueStr, tempValueStr) =>
+ {
+ SelectedDeviceStatus = "TemperatureSensor";
+ Send.dictionary(airqualitysensorDic, "Cluster_ID", "1029");
+ Send.dictionary(airqualitysensorDic, "AttriButeId", "0");
+ Send.dictionary(airqualitysensorDic, "AttriButeData1", tempValueStr);
+ Send.dictionary(airqualitysensorDic, "AttriButeData2", "0");
+ Send.dictionary(airqualitysensorDic, "Range", relationValueStr);
+ AddDic(flMain, SelectedDeviceStatus, edit, common, airqualitysensorDic);
+ }, () => {
+ if (edit) { flMain.RemoveFromParent(); }
+ else
+ {
+ AirSonser(flMain, SelectedDeviceStatus, edit, common);
+ }
+ });
+ }
+
+ }
+ /// <summary>
+ /// 绌烘皵璐ㄩ噺浼犳劅鍣�(鐗规畩澶勭悊)
+ /// </summary>
+ /// <param name="flMain"></param>
+ /// <param name="SelectedDeviceStatus"></param>
+ /// <param name="edit"></param>
+ /// <param name="common"></param>
+ /// <param name="dic"></param>
+ private static void AddDic(FrameLayout flMain, string SelectedDeviceStatus, bool edit, CommonDevice common, Dictionary<string, string> dic )
+ {
+ UserView.HomePage.Instance.ScrollEnabled = true;
+ if (SelectedDeviceStatus != "")
+ {
+ //娣诲姞鏉′欢
+ LogicIfon.AddDeviceconditions(common, dic);
+ }
+ else
+ {
+ if (!edit)
+ {
+ var alert = new UserCenter.ShowMsgControl(ShowMsgType.Normal,
+ Language.StringByID(MyInternationalizationString.selectdevicestatuscondition),
+ Language.StringByID(MyInternationalizationString.confrim));
+ alert.Show();
+ return;
+ }
+
+ }
+ flMain.RemoveFromParent();
+ //鑷姩鍖�
+ var logicCommunalPage = new LogicCommunalPage();
+ UserView.HomePage.Instance.AddChidren(logicCommunalPage);
+ UserView.HomePage.Instance.PageIndex += 1;
+ logicCommunalPage.Show(() => { });
+ }
+
}
}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicDveiceStatus.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicDveiceStatus.cs
index 91c65a7..ca0c158 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicDveiceStatus.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicDveiceStatus.cs
@@ -339,56 +339,166 @@
break;
case DeviceType.TemperatureSensor:
{
- // conditionIcon.UnSelectedImagePath = "ZigeeLogic/temperature.png";
- var dev = deviceinof as TemperatureSensor;
- if (conditions["Cluster_ID"] == "1026")
+ //鑾峰彇璁惧绫诲瀷
+ var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { deviceinof });
+ if (deviceEnumInfo==null) {
+ continue;
+ }
+ //绌烘皵璐ㄩ噺浼犳劅鍣�
+ if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
{
- dev.SensorDiv = 1;
+ icon = "ZigeeLogic/airquality.png";
+ string s = "";
+ switch (conditions["Range"])
+ {
+ case "0":
+ {
+ s = ">";
+ }
+ break;
+ case "1":
+ {
+ s = "=";
+ }
+ break;
+ case "2":
+ {
+ s = "<";
+ }
+ break;
+ case "6":
+ {
+ s = "鈮�";
+ }
+ break;
+ case "7":
+ {
+ s = "鈮�";
+ }
+ break;
+ }
+ switch (conditions["Cluster_ID"]) {
+ case "1066": {
+ if (conditions["AttriButeId"] =="57344") {
+ if (conditions["AttriButeData1"] == "1")
+ {
+ state = Language.StringByID(MyInternationalizationString.you);
+ }
+ else if (conditions["AttriButeData1"] == "2")
+ {
+ state = Language.StringByID(MyInternationalizationString.liang);
+ }
+ else {
+ state = Language.StringByID(MyInternationalizationString.cha);
+ }
+ state = Language.StringByID(MyInternationalizationString.kongqizhiliang) + state;
+ } else {
+ ///Pm2.5
+ int intValue = int.Parse(conditions["AttriButeData1"]);
+ if (0< intValue&& intValue<30) {
+ state = Language.StringByID(MyInternationalizationString.pmyou);
+ }
+ else if (36 < intValue && intValue < 75) {
+ state = Language.StringByID(MyInternationalizationString.pmliang);
+ }
+ else if (76 < intValue && intValue < 115) {
+ state = Language.StringByID(MyInternationalizationString.pmqingdu);
+ }
+ else if (intValue >115) {
+ state = Language.StringByID(MyInternationalizationString.pmzhongdu);
+ }
+ state = Language.StringByID(MyInternationalizationString.pm25) + state;
+ }
+ }break;
+ case "1037":
+ {
+ ///co2
+ int intValue = int.Parse(conditions["AttriButeData1"]);
+ if (0 < intValue && intValue < 1000)
+ {
+ state = Language.StringByID(MyInternationalizationString.co2qingxin);
+ }
+ else if (1000 < intValue && intValue < 2000)
+ {
+ state = Language.StringByID(MyInternationalizationString.co2huizhuo);
+ }
+ else if (2000 < intValue && intValue < 5000)
+ {
+ state = Language.StringByID(MyInternationalizationString.co2queyang);
+ }
+ else if (intValue > 5000)
+ {
+ state = Language.StringByID(MyInternationalizationString.co2yanzhongqueyang);
+ }
+ state = Language.StringByID(MyInternationalizationString.co2) + state;
+ }
+ break;
+ case "1026": {
+ ///杞崲娓╁害鍊�/100
+ string srtValue = (int.Parse(conditions["AttriButeData1"]) / 100).ToString();
+ state = s + srtValue + "鈩�";
+ } break;
+ case "1029": {
+ ///杞崲娓╁害鍊�/100
+ string srtValue = (int.Parse(conditions["AttriButeData1"]) / 100).ToString();
+ state = s + srtValue + "%";
+ } break;
+ }
+
}
else
{
- dev.SensorDiv = 2;
- }
- string s = "";
- switch (conditions["Range"])
- {
- case "0":
- {
- s = ">";
- }
- break;
- case "1":
- {
- s = "=";
- }
- break;
- case "2":
- {
- s = "<";
- }
- break;
- case "6":
- {
- s = "鈮�";
- }
- break;
- case "7":
- {
- s = "鈮�";
- }
- break;
- }
- ///杞崲娓╁害鍊�/100
- string srtValue = (int.Parse(conditions["AttriButeData1"]) / 100).ToString();
- if (conditions["Cluster_ID"] == "1026")
- {
- icon = "ZigeeLogic/temperature.png";
- state = s + srtValue + "鈩�";
- }
- else
- {
- icon = "ZigeeLogic/humidity.png";
- state = s + srtValue + "%";
+
+ var dev = deviceinof as TemperatureSensor;
+ if (conditions["Cluster_ID"] == "1026")
+ {
+ dev.SensorDiv = 1;
+ }
+ else
+ {
+ dev.SensorDiv = 2;
+ }
+ string s = "";
+ switch (conditions["Range"])
+ {
+ case "0":
+ {
+ s = ">";
+ }
+ break;
+ case "1":
+ {
+ s = "=";
+ }
+ break;
+ case "2":
+ {
+ s = "<";
+ }
+ break;
+ case "6":
+ {
+ s = "鈮�";
+ }
+ break;
+ case "7":
+ {
+ s = "鈮�";
+ }
+ break;
+ }
+ ///杞崲娓╁害鍊�/100
+ string srtValue = (int.Parse(conditions["AttriButeData1"]) / 100).ToString();
+ if (conditions["Cluster_ID"] == "1026")
+ {
+ icon = "ZigeeLogic/temperature.png";
+ state = s + srtValue + "鈩�";
+ }
+ else
+ {
+ icon = "ZigeeLogic/humidity.png";
+ state = s + srtValue + "%";
+ }
}
break;
@@ -468,9 +578,17 @@
selecteddevice.selecetddevicestateBtn.Text = state;
}
///缂栬緫
- selecteddevice.edit.Tag = i.ToString();
+ selecteddevice.edit.Tag = conditions;
selecteddevice.edit.MouseUpEventHandler += (sender, e) =>
{
+ var dic = selecteddevice.edit.Tag as Dictionary<string, string>;
+ int isInt = 0;
+ if (dic != null)
+ {
+ //涔嬪墠鏍囪绱㈠紩鍊硷紝涓�鏃﹀垹闄ゆ暟鎹储寮曞�间細鍙戠敓鏀瑰彉锛�
+ //鎵惧埌鏁版嵁鍦ㄥ垪琛ㄩ噷鏈�鏂扮储寮曪紝骞朵笖鏇存柊绱㈠紩鍊�
+ isInt = Common.Logic.CurrentLogic.Conditions.IndexOf(dic);
+ }
switch (Type)
{
@@ -481,7 +599,7 @@
UserView.HomePage.Instance.AddChidren(timePoint);
UserView.HomePage.Instance.PageIndex += 1;
timePoint.IsEditor = true;
- timePoint.Show(conditions);
+ timePoint.Show(dic);
}
break;
case 5:
@@ -501,7 +619,7 @@
{
var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
frameLayout.AddChidren(flMain);
- CurrentDeviceState.CurrentDeviceView(flMain, deviceinof, true, "condition_logic",int.Parse(selecteddevice.edit.Tag.ToString()));
+ CurrentDeviceState.CurrentDeviceView(flMain, deviceinof, true, "condition_logic", isInt);
}
else
{
@@ -509,7 +627,7 @@
UserView.HomePage.Instance.AddChidren(memberList);
UserView.HomePage.Instance.PageIndex += 1;
MemberList.edit = true;
- memberList.Show(deviceinof, conditions);
+ memberList.Show(deviceinof, dic);
}
}
break;
@@ -1026,8 +1144,7 @@
{
state = seconds.ToString() + Language.StringByID(MyInternationalizationString.second);
}
- //璁板綍寤舵椂锛�
- actiondevice.edit.Tag = i;
+
};
break;
}
@@ -1054,9 +1171,18 @@
actiondevice.selecetddevicestateBtn.Text = state;
}
///缂栬緫
- actiondevice.edit.Tag = i.ToString();
+ //璁板綍锛�
+ actiondevice.edit.Tag = actions;
actiondevice.edit.MouseUpEventHandler += (sender, e) =>
{
+ var dic = actiondevice.edit.Tag as Dictionary<string, object>;
+ int isInt = 0;
+ if (dic != null)
+ {
+ //涔嬪墠鏍囪绱㈠紩鍊硷紝涓�鏃﹀垹闄ゆ暟鎹储寮曞�间細鍙戠敓鏀瑰彉锛�
+ //鎵惧埌鏁版嵁鍦ㄥ垪琛ㄩ噷鏈�鏂扮储寮曪紝骞朵笖鏇存柊绱㈠紩鍊�
+ isInt = Common.Logic.CurrentLogic.Actions.IndexOf(dic);
+ }
switch (linkType)
{
case 8:
@@ -1065,7 +1191,7 @@
var deviceinof = Method.GetCommonDevice(actions["DeviceAddr"].ToString(), actions["Epoint"].ToString());
var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
frameLayout.AddChidren(flMain);
- CurrentDeviceState.CurrentDeviceView(flMain, deviceinof, true, "action_logic", int.Parse(actiondevice.edit.Tag.ToString()));
+ CurrentDeviceState.CurrentDeviceView(flMain, deviceinof, true, "action_logic", isInt);
}
break;
case 6:
@@ -1079,10 +1205,11 @@
break;
case 7:
{
+
var delayTime = new DelayTime();
UserView.HomePage.Instance.AddChidren(delayTime);
UserView.HomePage.Instance.PageIndex += 1;
- delayTime.Show(int.Parse(actiondevice.edit.Tag.ToString()), true);
+ delayTime.Show(isInt, true);
}
break;
@@ -1185,5 +1312,8 @@
}
+
+
+
}
}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs
index 9725229..4ae3a2a 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs
@@ -13,7 +13,7 @@
/// </summary>
/// <param name="common">Common.</param>
/// <param name="objecttype">Objecttype.</param>
- public static void AddDeviceconditions(CommonDevice common, Dictionary<string, string> objecttype)
+ public static void AddDeviceconditions(CommonDevice common, Dictionary<string, string> objecttype)
{
for (int i = 0; i < Common.Logic.CurrentLogic.Conditions.Count; i++)
{
@@ -21,25 +21,55 @@
{
if ((Common.Logic.CurrentLogic.Conditions[i]["MacAddr"] == common.DeviceAddr) && (Common.Logic.CurrentLogic.Conditions[i]["Epoint"] == common.DeviceEpoint.ToString()))
{
- if (common.Type == DeviceType.TemperatureSensor)//璁惧娓╁害浼犳劅鍣ㄦ湁鐐圭壒鍒�
+ if (common.Type == DeviceType.TemperatureSensor)
{
- var dev = common as TemperatureSensor;
- string str = "";
- if (dev.SensorDiv == 1)
+
+ //鑾峰彇璁惧绫诲瀷
+ var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { common });
+
+ //绌烘皵璐ㄩ噺浼犳劅鍣�
+ if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
{
- str = "1026";
+ var cluster_ID1 = Common.Logic.CurrentLogic.Conditions[i]["Cluster_ID"];
+ var attriButeId1 = Common.Logic.CurrentLogic.Conditions[i]["AttriButeId"];
+ var cluster_ID2 = objecttype["Cluster_ID"];
+ var attriButeId2 = objecttype["AttriButeId"];
+
+ bool cluster_ID = false;
+ if (cluster_ID1 == cluster_ID2 && attriButeId1 == attriButeId2)
+ {
+ cluster_ID = true;
+ }
+
+ if (cluster_ID)
+ {
+ //宸茬粡瀛樺湪绉婚櫎鍐嶉噸鏂版坊鍔�
+ Common.Logic.CurrentLogic.Conditions.RemoveAt(i);
+ Common.Logic.CurrentLogic.Conditions.Insert(i, objecttype);
+ return;
+ }
}
else
{
- str = "1029";
- }
- if (Common.Logic.CurrentLogic.Conditions[i]["Cluster_ID"] == str)
- {
- Common.Logic.CurrentLogic.Conditions.RemoveAt(i);
- Common.Logic.CurrentLogic.Conditions.Insert(i, objecttype);
- return;
- }
+ //璁惧娓╁害浼犳劅鍣�
+ var dev = common as TemperatureSensor;
+ string str = "";
+ if (dev.SensorDiv == 1)
+ {
+ str = "1026";
+ }
+ else
+ {
+ str = "1029";
+ }
+ if (Common.Logic.CurrentLogic.Conditions[i]["Cluster_ID"] == str)
+ {
+ Common.Logic.CurrentLogic.Conditions.RemoveAt(i);
+ Common.Logic.CurrentLogic.Conditions.Insert(i, objecttype);
+ return;
+ }
+ }
}
else if (common.Type == DeviceType.IASZone)
{
@@ -75,7 +105,7 @@
/// <summary>
/// 娣诲姞Logic鏉′欢鐨勬柟娉�
/// </summary>
- /// <param name="common">Common.</param>
+ /// <param name="logic">Common.</param>
/// <param name="objecttype">Objecttype.</param>
public static void AddLogicconditions(Common.Logic logic, Dictionary<string, string> objecttype)
{
@@ -264,6 +294,9 @@
Common.Logic.CurrentLogic.Accounts.Add(accountsInfo);
}
#endregion
+
+
+
}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs b/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs
index 0fc25d1..a4606e0 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs
@@ -293,16 +293,29 @@
break;
case DeviceType.TemperatureSensor:
{
- var temperatureSensor = device as TemperatureSensor;
- if (temperatureSensor.SensorDiv == 1)
+
+
+ //鑾峰彇璁惧绫诲瀷
+ var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device });
+ //绌烘皵璐ㄩ噺浼犳劅鍣�
+ if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
{
- patm = $"ZigeeLogic/temperature.png";
- selectedpatm = $"ZigeeLogic/selectedtemperature.png";
+ patm = $"ZigeeLogic/airquality.png";
+ selectedpatm = $"ZigeeLogic/airqualityselected.png";
}
else
{
- patm = "ZigeeLogic/humidity.png";
- selectedpatm = "ZigeeLogic/selectedhumidity.png";
+ var temperatureSensor = device as TemperatureSensor;
+ if (temperatureSensor.SensorDiv == 1)
+ {
+ patm = $"ZigeeLogic/temperature.png";
+ selectedpatm = $"ZigeeLogic/selectedtemperature.png";
+ }
+ else
+ {
+ patm = "ZigeeLogic/humidity.png";
+ selectedpatm = "ZigeeLogic/selectedhumidity.png";
+ }
}
}
break;
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/PublicInterface.cs b/ZigbeeApp/Shared/Phone/Device/Logic/PublicInterface.cs
index 05d8740..a92ebfc 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/PublicInterface.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/PublicInterface.cs
@@ -9,6 +9,7 @@
public class PublicInterface
{
+
/// <summary>
/// 鍗曢�夋嫨
/// </summary>
@@ -100,32 +101,130 @@
}
+ /// <summary>
+ /// 鍗曢�夋嫨
+ /// </summary>
+ /// <param name="frame">鏄剧ず鍦ㄥ摢涓晫闈㈢殑鐖舵帶浠�</param>
+ /// <param name="list">鏄剧ず鏁版嵁婧�</param>
+ /// <param name="titleText">鏍囬鏂囨湰</param>
+ /// <param name="stateText">涔嬪墠鐘舵�佹枃鏈�</param>
+ /// <param name="completeAction">瀹屾垚杩斿洖鍊�</param>
+ /// <param name="cancelAction">鍙栨秷杩斿洖鍊�</param>
+ public void SingleSelectionShow(FrameLayout frame, List<string> list, int titleText, string stateText, Action<string> completeAction, Action cancelAction)
+ {
+ FrameLayout frameLayout = new FrameLayout
+ {
+ BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor,
+ };
+ frame.AddChidren(frameLayout);
+ CompleteView view = new CompleteView();
+ view.Btntitle.TextID = titleText;
+ frameLayout.AddChidren(view.Show(list.Count));
+ UserView.HomePage.Instance.ScrollEnabled = false;
+ EventHandler<MouseEventArgs> cancelClick= (sender, e) =>
+ {
+ UserView.HomePage.Instance.ScrollEnabled = true;
+ //绉婚櫎fLayout鐣岄潰
+ frameLayout.RemoveFromParent();
+ cancelAction();
+ };
+ view.Btncancel.MouseUpEventHandler += cancelClick;
+ frameLayout.MouseUpEventHandler += cancelClick;
+ ///瀹氫箟涓�涓狟tn璁板綍閫変腑鐘舵��
+ Button checkIconBtn = new Button
+ {
+ Tag = "unknown",
+ };
+ Button checkTextBtn = new Button
+ {
+ Tag = "unknown",
+ };
+ for (int i = 0; i < list.Count; i++)
+ {
+ string str = list[i];
+ mFunView mFun = new mFunView();
+ mFun.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+ mFun.titleBtn.SelectedTextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+ mFun.frameLayout.Y = Application.GetRealHeight(140 + 20 + 160 * i);
+ view.fraView.AddChidren(mFun.Show());
+ mFun.titleBtn.Text = str;
+ mFun.clickviewBtn.Tag = str;//鏍囪
+ if (list.Count - 1 == i)
+ {
+ //鏀瑰彉鏈�鍚庝竴鏉$殑棰滆壊
+ mFun.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
+ }
+ if (stateText == str)
+ {
+ //鍥炬爣鏀瑰彉
+ checkIconBtn.Visible = false;
+ mFun.selectedIconBtn.Visible = true;
+ checkIconBtn = mFun.selectedIconBtn;
+ checkIconBtn.Tag = mFun.clickviewBtn.Tag.ToString();
+ //瀛椾綋鏀瑰彉
+ checkTextBtn.IsSelected = false;
+ mFun.titleBtn.IsSelected = true;
+ checkTextBtn = mFun.titleBtn;
+
+ }
+ //鐐瑰嚮浜嬩欢
+ mFun.clickviewBtn.MouseUpEventHandler += (sender1, e1) =>
+ {
+ //鍥炬爣鏀瑰彉
+ checkIconBtn.Visible = false;
+ mFun.selectedIconBtn.Visible = true;
+ checkIconBtn = mFun.selectedIconBtn;
+ checkIconBtn.Tag = mFun.clickviewBtn.Tag.ToString();
+ //瀛椾綋鏀瑰彉
+ checkTextBtn.IsSelected = false;
+ mFun.titleBtn.IsSelected = true;
+ checkTextBtn = mFun.titleBtn;
+ };
+
+ }
+ view.Btncomplete.MouseUpEventHandler += (sender1, e1) =>
+ {
+ if (checkIconBtn.Tag.ToString() == "unknown")
+ {
+ return;
+ }
+ completeAction(checkIconBtn.Tag.ToString());
+ UserView.HomePage.Instance.ScrollEnabled = true;
+ //绉婚櫎fLayout鐣岄潰
+ frameLayout.RemoveFromParent();
+ };
+
+ }
/// <summary>
/// 娓╂箍搴︽柟娉�
/// </summary>
/// <param name="frame">鏄剧ず鍦ㄥ摢涓晫闈㈢殑鐖舵帶浠�</param>
- /// <param name="common">褰撳墠璁惧</param>
- /// <param name="state1">涔嬪墠鐘舵��</param>
+ /// <param name="symbol">绗﹀彿锛�%锛屸剝锛�</param>
+ /// <param name="state1">涔嬪墠鐘舵��(姣旇緝绗﹀彿)</param>
/// <param name="state2">涔嬪墠鐘舵��</param>
/// <param name="action">杩斿洖鍊�</param>
- public void TemperatureShow1(FrameLayout frameLayout, CommonDevice common, string state1, string state2, Action<string, string> action)
+ public void TemperatureShow1(FrameLayout frame, string tlite,string symbol, string state1, string state2, Action<string, string> action, Action cancelAction)
{
- //FrameLayout frameLayout = new FrameLayout
- //{
- // BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor,
- //};
- //frame.AddChidren(frameLayout);
+ FrameLayout frameLayout = new FrameLayout
+ {
+ BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor,
+ };
+ frame.AddChidren(frameLayout);
CompleteView view = new CompleteView();
- view.Btntitle.Text= LocalDevice.Current.GetDeviceEpointName(common);
+ view.Btntitle.Text= tlite;
frameLayout.AddChidren(view.Show(4));
UserView.HomePage.Instance.ScrollEnabled = false;
- view.Btncancel.MouseUpEventHandler += (sender, e) =>
+
+ EventHandler<MouseEventArgs> cancelClick = (sender, e) =>
{
UserView.HomePage.Instance.ScrollEnabled = true;
//绉婚櫎fLayout鐣岄潰
frameLayout.RemoveFromParent();
+ cancelAction();
};
+ view.Btncancel.MouseUpEventHandler += cancelClick;
+ frameLayout.MouseUpEventHandler += cancelClick;
#region 甯冨眬View
var PickerViewfra = new FrameLayout
@@ -142,28 +241,12 @@
var mList1 = new List<string> { ">", "<", "=", "鈮�", "鈮�" };
var mList2 = new List<string>();
- var mList3 = new List<string>();
+ var mList3 = new List<string>() { symbol };
for (int i = 1; i <= 100; i++)
{
mList2.Add(i.ToString());
}
- switch (common.Type)
- {
- case DeviceType.TemperatureSensor:
- {
- var temperatureSensor = common as TemperatureSensor;
- if (temperatureSensor.SensorDiv == 1)
- {
- mList3.Add("鈩�");
- }
- else
- {
- mList3.Add("%");
-
- }
- }
- break;
- }
+
mUIPickerView.setNPicker(mList1, mList2, mList3);
@@ -214,43 +297,6 @@
//杩斿洖绱㈠紩鍊�
index1 = s1;
index2 = s2;
-
- string relationValueStr = "";
- switch (mList1[index1])
- {
- case ">":
- {
- relationValueStr = "0";
- }
- break;
- case "<":
- {
- relationValueStr = "2";
-
- }
- break;
- case "=":
- {
- relationValueStr = "1";
-
- }
- break;
- case "鈮�":
- {
-
- relationValueStr = "6";
-
- }
- break;
- case "鈮�":
- {
- relationValueStr = "7";
- }
- break;
- }
- ///娓╁害杩涚巼杞崲*100
- string tempValueStr = (int.Parse(mList2[index2]) * 100).ToString();
- action(relationValueStr, tempValueStr);
};
view.Btncomplete.MouseUpEventHandler += (sender1, e1) =>
{
@@ -296,7 +342,7 @@
};
}
- public void TemperatureShow(FrameLayout frameLayout, CommonDevice common, string state1, string state2, Action<string, string> action)
+ public void TemperatureShow(FrameLayout frameLayout, string symbol, string state1, string state2, Action<string, string> action)
{
#region 甯冨眬View
var PickerViewfra = new FrameLayout
@@ -313,27 +359,10 @@
var mList1 = new List<string> { ">", "<", "=", "鈮�", "鈮�" };
var mList2 = new List<string>();
- var mList3 = new List<string>();
+ var mList3 = new List<string>() { symbol };
for (int i = 1; i <= 100; i++)
{
mList2.Add(i.ToString());
- }
- switch (common.Type)
- {
- case DeviceType.TemperatureSensor:
- {
- var temperatureSensor = common as TemperatureSensor;
- if (temperatureSensor.SensorDiv == 1)
- {
- mList3.Add("鈩�");
- }
- else
- {
- mList3.Add("%");
-
- }
- }
- break;
}
mUIPickerView.setNPicker(mList1, mList2, mList3);
@@ -446,7 +475,8 @@
};
}
break;
- case "鏃堕棿": {
+ case "鏃堕棿":
+ {
list = new List<string> {
Language.StringByID(MyInternationalizationString.immediateexecution),
Language.StringByID(MyInternationalizationString.timeframe),
@@ -486,7 +516,46 @@
};
}
break;
-
+ case "绌烘皵璐ㄩ噺浼犳劅鍣�":
+ {
+ list = new List<string> {
+ Language.StringByID(MyInternationalizationString.kongqizhiliang),
+ Language.StringByID(MyInternationalizationString.pm25),
+ Language.StringByID(MyInternationalizationString.co2),
+ Language.StringByID(MyInternationalizationString.sensortemperature),
+ Language.StringByID(MyInternationalizationString.sensorhumidity),
+ };
+ }
+ break;
+ case "绌烘皵璐ㄩ噺":
+ {
+ list = new List<string> {
+ Language.StringByID(MyInternationalizationString.you),
+ Language.StringByID(MyInternationalizationString.liang),
+ Language.StringByID(MyInternationalizationString.cha),
+ };
+ }
+ break;
+ case "pm2.5":
+ {
+ list = new List<string> {
+ Language.StringByID(MyInternationalizationString.pmyou),
+ Language.StringByID(MyInternationalizationString.pmliang),
+ Language.StringByID(MyInternationalizationString.pmqingdu),
+ Language.StringByID(MyInternationalizationString.pmzhongdu),
+ };
+ }
+ break;
+ case "co2":
+ {
+ list = new List<string> {
+ Language.StringByID(MyInternationalizationString.co2qingxin),
+ Language.StringByID(MyInternationalizationString.co2huizhuo),
+ Language.StringByID(MyInternationalizationString.co2queyang),
+ Language.StringByID(MyInternationalizationString.co2yanzhongqueyang),
+ };
+ }
+ break;
}
return list;
diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorLightDetailCardForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorLightDetailCardForm.cs
index c5167cc..37874aa 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorLightDetailCardForm.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorLightDetailCardForm.cs
@@ -19,10 +19,6 @@
/// </summary>
private List<ButtonBase> listControl = new List<ButtonBase>();
/// <summary>
- /// MaxLevel
- /// </summary>
- private const int MaxLevel = 254;
- /// <summary>
/// 褰╃伅鎺т欢
/// </summary>
private WaveSeekBar waveSeekBar = null;
@@ -75,7 +71,7 @@
waveSeekBar.Gravity = Gravity.CenterHorizontal;
waveSeekBar.WavePadding = Application.GetRealWidth(8);
waveSeekBar.MaxValue = 100;
- waveSeekBar.Progress = (int)(((DimmableLight)this.device).Level * 1.0 / MaxLevel * 100);
+ waveSeekBar.Progress = HdlDeviceCommonLogic.Current.CalculateLightLevelPersent(((DimmableLight)this.device).Level);
waveSeekBar.CornerRadius = Application.GetRealHeight(58);
if (this.IsLightOpen == true)
{
@@ -153,7 +149,7 @@
else
{
//濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鐩存帴鏀圭紦瀛�
- ((DimmableLight)this.device).Level = value * MaxLevel / 100;
+ ((DimmableLight)this.device).Level = HdlDeviceCommonLogic.Current.CalculateLightLevel(value);
//浜害 XX
this.SetStatuText(Language.StringByID(R.MyInternationalizationString.uBrightness) + " " + HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device));
}
@@ -185,7 +181,7 @@
}
oldProgressValue = nowProgressValue;
//鍙戦�佽繘搴﹀��
- ((DimmableLight)this.device).SetLevel((int)(oldProgressValue * MaxLevel / 100.0));
+ ((DimmableLight)this.device).SetLevel(HdlDeviceCommonLogic.Current.CalculateLightLevel(oldProgressValue));
}
});
}
@@ -238,7 +234,7 @@
if (level == 0)
{
//濡傛灉褰撳墠鏄墦寮�鐘舵��,骞朵笖浜害涓�0鐨勮瘽,鍒欓渶瑕佸彉鎴�100%浜害
- this.device.GetType().InvokeMember("SetLevel", System.Reflection.BindingFlags.InvokeMethod, null, this.device, new object[] { 254 });
+ this.device.GetType().InvokeMember("SetLevel", System.Reflection.BindingFlags.InvokeMethod, null, this.device, new object[] { 255 });
}
else
{
@@ -300,7 +296,11 @@
if (this.isProgressing == false)
{
//褰撹繘搴﹀�煎湪鎵嬪姩鍙樻洿涓椂,涓嶆帴鏀舵帹閫�
- waveSeekBar.Progress = (int)(((DimmableLight)this.device).Level * 1.0 / MaxLevel * 100);
+ int progress = HdlDeviceCommonLogic.Current.CalculateLightLevelPersent(((DimmableLight)this.device).Level);
+ if (waveSeekBar.Progress != progress)
+ {
+ waveSeekBar.Progress = progress;
+ }
}
if (listControl[0].IsSelected != isOpen)
diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorTemperatureLightDetailCardForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorTemperatureLightDetailCardForm.cs
index f0464ee..89c017a 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorTemperatureLightDetailCardForm.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorTemperatureLightDetailCardForm.cs
@@ -19,10 +19,6 @@
/// </summary>
private List<ButtonBase> listControl = new List<ButtonBase>();
/// <summary>
- /// MaxLevel
- /// </summary>
- private const int MaxLevel = 254;
- /// <summary>
/// 褰╃伅鎺т欢
/// </summary>
private WaveSeekBar waveSeekBar = null;
@@ -77,7 +73,7 @@
waveSeekBar.Gravity = Gravity.CenterHorizontal;
waveSeekBar.WavePadding = Application.GetRealWidth(8);
waveSeekBar.MaxValue = 100;
- waveSeekBar.Progress = (int)(((ColorTemperatureLight)this.device).Level * 1.0 / MaxLevel * 100);
+ waveSeekBar.Progress = HdlDeviceCommonLogic.Current.CalculateLightLevelPersent(((ColorTemperatureLight)this.device).Level);
waveSeekBar.CornerRadius = Application.GetRealHeight(58);
if (this.IsLightOpen == true)
{
@@ -155,7 +151,7 @@
else
{
//濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鐩存帴鏀圭紦瀛�
- ((ColorTemperatureLight)this.device).Level = value * MaxLevel / 100;
+ ((ColorTemperatureLight)this.device).Level = HdlDeviceCommonLogic.Current.CalculateLightLevel(value);
//浜害 XX
this.SetStatuText(Language.StringByID(R.MyInternationalizationString.uBrightness) + " " + HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device));
}
@@ -216,7 +212,7 @@
if (nowProgressValue != oldProgressValue)
{
oldProgressValue = nowProgressValue;
- ((ColorTemperatureLight)this.device).SetLevel((int)(oldProgressValue * MaxLevel / 100.0));
+ ((ColorTemperatureLight)this.device).SetLevel(HdlDeviceCommonLogic.Current.CalculateLightLevel(oldProgressValue));
}
//鍙戦�佽壊娓╁��
if (nowColorValue != oldColorValue)
@@ -230,7 +226,7 @@
if (nowProgressValue != oldProgressValue)
{
//鍙戦�佷寒搴﹀��
- ((ColorTemperatureLight)this.device).SetLevel((int)(nowProgressValue * MaxLevel / 100.0));
+ ((ColorTemperatureLight)this.device).SetLevel(HdlDeviceCommonLogic.Current.CalculateLightLevel(nowProgressValue));
}
if (nowColorValue != oldColorValue)
{
@@ -292,7 +288,7 @@
if (level == 0)
{
//濡傛灉褰撳墠鏄墦寮�鐘舵��,骞朵笖浜害涓�0鐨勮瘽,鍒欓渶瑕佸彉鎴�100%浜害
- this.device.GetType().InvokeMember("SetLevel", System.Reflection.BindingFlags.InvokeMethod, null, this.device, new object[] { 254 });
+ this.device.GetType().InvokeMember("SetLevel", System.Reflection.BindingFlags.InvokeMethod, null, this.device, new object[] { 255 });
}
else
{
@@ -366,7 +362,11 @@
if (this.isProgressing == false)
{
//褰撹繘搴﹀�煎湪鎵嬪姩鍙樻洿涓椂,涓嶆帴鏀舵帹閫�
- waveSeekBar.Progress = (int)(((ColorTemperatureLight)this.device).Level * 1.0 / MaxLevel * 100);
+ int progress = HdlDeviceCommonLogic.Current.CalculateLightLevelPersent(((ColorTemperatureLight)this.device).Level);
+ if (waveSeekBar.Progress != progress)
+ {
+ waveSeekBar.Progress = progress;
+ }
}
this.IsLightOpen = isOpen;
diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs
index c30c0e5..4c219f0 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs
@@ -31,10 +31,6 @@
/// </summary>
private SeekBarControl seekBarColor = null;
/// <summary>
- /// MaxLevel
- /// </summary>
- private const int MaxLevel = 254;
- /// <summary>
/// 浜害杩涘害鍊兼槸鍚﹀湪鏀瑰彉涓�
/// </summary>
private bool isLightProgressing = false;
@@ -98,7 +94,7 @@
seekBarLight.ProgressTextSize = 14;
seekBarLight.ProgressTextColor = UserCenterColor.Current.TextGrayColor2;
seekBarLight.Gravity = Gravity.Frame;
- seekBarLight.Progress = (int)(((ColorTemperatureLight)this.device).Level * 1.0 / MaxLevel * 100);
+ seekBarLight.Progress = HdlDeviceCommonLogic.Current.CalculateLightLevelPersent(((ColorTemperatureLight)this.device).Level);
frameWhiteBack.AddChidren(seekBarLight);
//鑹叉俯
@@ -226,7 +222,7 @@
else
{
//濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鐩存帴鏀圭紦瀛�
- ((ColorTemperatureLight)this.device).Level = value * MaxLevel / 100;
+ ((ColorTemperatureLight)this.device).Level = HdlDeviceCommonLogic.Current.CalculateLightLevel(value);
//浜害 XX
this.SetStatuText(Language.StringByID(R.MyInternationalizationString.uBrightness) + " " + HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device));
}
@@ -281,7 +277,7 @@
if (nowLightValue != oldLightValue)
{
oldLightValue = nowLightValue;
- ((ColorTemperatureLight)this.device).SetLevel((int)(oldLightValue * MaxLevel / 100.0));
+ ((ColorTemperatureLight)this.device).SetLevel(HdlDeviceCommonLogic.Current.CalculateLightLevel(oldLightValue));
}
//鍙戦�佽壊娓╁��
if (nowColorValue != oldColorValue)
@@ -295,7 +291,7 @@
if (nowLightValue != oldLightValue)
{
//鍙戦�佷寒搴﹀��
- ((ColorTemperatureLight)this.device).SetLevel((int)(nowLightValue * MaxLevel / 100.0));
+ ((ColorTemperatureLight)this.device).SetLevel(HdlDeviceCommonLogic.Current.CalculateLightLevel(nowLightValue));
}
if (nowColorValue != oldColorValue)
{
@@ -354,7 +350,7 @@
if (level == 0)
{
//濡傛灉褰撳墠鏄墦寮�鐘舵��,骞朵笖浜害涓�0鐨勮瘽,鍒欓渶瑕佸彉鎴�100%浜害
- this.device.GetType().InvokeMember("SetLevel", System.Reflection.BindingFlags.InvokeMethod, null, this.device, new object[] { 254 });
+ this.device.GetType().InvokeMember("SetLevel", System.Reflection.BindingFlags.InvokeMethod, null, this.device, new object[] { 255 });
}
else
{
@@ -493,7 +489,11 @@
if (this.isLightProgressing == false)
{
//褰撹繘搴﹀�煎湪鎵嬪姩鍙樻洿涓椂,涓嶆帴鏀舵帹閫�
- seekBarLight.Progress = (int)(((ColorTemperatureLight)this.device).Level * 1.0 / MaxLevel * 100);
+ int progress = HdlDeviceCommonLogic.Current.CalculateLightLevelPersent(((ColorTemperatureLight)this.device).Level);
+ if (seekBarLight.Progress != progress)
+ {
+ seekBarLight.Progress = progress;
+ }
}
if (this.isColorProgressing == false)
{
diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs
index f62b952..ab2ae45 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs
@@ -56,7 +56,7 @@
if (level == 0)
{
//濡傛灉褰撳墠鏄墦寮�鐘舵��,骞朵笖浜害涓�0鐨勮瘽,鍒欓渶瑕佸彉鎴�100%浜害
- i_device.GetType().InvokeMember("SetLevel", System.Reflection.BindingFlags.InvokeMethod, null, i_device, new object[] { 254 });
+ i_device.GetType().InvokeMember("SetLevel", System.Reflection.BindingFlags.InvokeMethod, null, i_device, new object[] { 255 });
}
else
{
diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorTemperatureCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorTemperatureCardControl.cs
index a3bbe14..6315365 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorTemperatureCardControl.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorTemperatureCardControl.cs
@@ -56,7 +56,7 @@
if (level == 0)
{
//濡傛灉褰撳墠鏄墦寮�鐘舵��,骞朵笖浜害涓�0鐨勮瘽,鍒欓渶瑕佸彉鎴�100%浜害
- i_device.GetType().InvokeMember("SetLevel", System.Reflection.BindingFlags.InvokeMethod, null, i_device, new object[] { 254 });
+ i_device.GetType().InvokeMember("SetLevel", System.Reflection.BindingFlags.InvokeMethod, null, i_device, new object[] { 255 });
}
else
{
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCommonLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCommonLogic.cs
index 86a4531..68de7b7 100644
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCommonLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCommonLogic.cs
@@ -307,5 +307,30 @@
}
#endregion
+
+ #region 鈻� 涓�鑸柟娉昣__________________________
+
+ /// <summary>
+ /// 璁$畻鐏殑浜害鍊兼墍鍗犵殑鐧惧垎姣�(渚嬪:杩斿洖35,浠h〃鏄�35%)
+ /// </summary>
+ /// <param name="i_Level">鐏殑浜害鍊�</param>
+ /// <returns></returns>
+ public int CalculateLightLevelPersent(decimal i_Level)
+ {
+ return (int)((i_Level / 255) * 100);
+ }
+
+ /// <summary>
+ /// 璁$畻鎸囧畾鐧惧垎姣斿搴旂伅鐨勪寒搴﹀��
+ /// </summary>
+ /// <param name="i_Persent">鐧惧垎姣斿��(姣斿35,浠h〃35%)</param>
+ /// <returns></returns>
+ public int CalculateLightLevel(decimal i_Persent)
+ {
+ //闇�瑕佸悜涓婂彇鏁�,鎵嶈兘寰楀嚭
+ return (int)Math.Ceiling((i_Persent / 100) * 255);
+ }
+
+ #endregion
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs
index 109732b..d654786 100644
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs
@@ -97,7 +97,7 @@
{
return Language.StringByID(R.MyInternationalizationString.Close);
}
- return $"{(int)((device as DimmableLight).Level * 1.0 / 254 * 100)}%";
+ return HdlDeviceCommonLogic.Current.CalculateLightLevelPersent((device as DimmableLight).Level) + "%";
}
else if (device.Type == DeviceType.ColorTemperatureLight)
{
@@ -110,7 +110,7 @@
{
return Language.StringByID(R.MyInternationalizationString.Close);
}
- return $"{(int)((device as ColorTemperatureLight).Level * 1.0 / 254 * 100)}%";
+ return HdlDeviceCommonLogic.Current.CalculateLightLevelPersent((device as ColorTemperatureLight).Level) + "%";
}
else if (device.Type == DeviceType.WindowCoveringDevice)
{
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs
index 68f332f..03bcd7a 100644
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs
@@ -2051,7 +2051,7 @@
}
else
{
- dicSort[persentNo] = $"{(int)(info.Data1 * 1.0 / 254 * 100)}%";
+ dicSort[persentNo] = HdlDeviceCommonLogic.Current.CalculateLightLevelPersent(info.Data1) + "%";
}
}
#endregion
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/PirSensor/PirSensorDimmingModeForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/PirSensor/PirSensorDimmingModeForm.cs
index 494845e..5746615 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/PirSensor/PirSensorDimmingModeForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/PirSensor/PirSensorDimmingModeForm.cs
@@ -92,9 +92,9 @@
{
listSelect.Add(i + "%");
}
- //璁╁畠澶勪簬10鐨勬暣鍊嶆暟
- this.pirConfigure.dimmerLevel = (this.pirConfigure.dimmerLevel / 10) * 10;
- int index = listSelect.IndexOf(this.pirConfigure.dimmerLevel + "%");
+ //杩欎釜鐧惧垎姣旂殑鍊�,鐩存帴绠�
+ int persentValue = HdlDeviceCommonLogic.Current.CalculateLightLevelPersent(this.pirConfigure.dimmerLevel);
+ int index = listSelect.IndexOf(persentValue + "%");
//寮�鐏寒搴�
var row1 = new FrameRowControl(listView.rowSpace / 2);
@@ -102,14 +102,17 @@
var btnCaption1 = row1.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uTurnOnBrightness), 400);
btnCaption1.TextSize = 15;
row1.AddRightArrow();
- var btnStatu = row1.AddMostRightView(pirConfigure.dimmerLevel + "%", 400);
+ var btnStatu = row1.AddMostRightView(persentValue + "%", 400);
row1.AddBottomLine();
row1.ButtonClickEvent += (sender, e) =>
{
PickerView.Show(listSelect, (value) =>
{
btnStatu.Text = listSelect[value];
- pirConfigure.dimmerLevel = Convert.ToInt32(listSelect[value].Replace("%", string.Empty));
+
+ string myValue = listSelect[value].Replace("%", string.Empty);
+ pirConfigure.dimmerLevel = HdlDeviceCommonLogic.Current.CalculateLightLevel(Convert.ToDecimal(myValue));
+ index = value;
}, index == -1 ? 0 : index, Language.StringByID(R.MyInternationalizationString.uBrightness),
Language.StringByID(R.MyInternationalizationString.uFinish),
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectLightForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectLightForm.cs
index 996445d..4d2d467 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectLightForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectLightForm.cs
@@ -20,10 +20,6 @@
/// 鍔ㄤ綔淇℃伅 1 寮�鍏�/ 3浜害璋冭妭
/// </summary>
private Dictionary<int, Safeguard.TaskListInfo> dicTaskinfo = new Dictionary<int, Safeguard.TaskListInfo>();
- /// <summary>
- /// 杩涘害鏉℃渶澶у��
- /// </summary>
- private int MaxValue = 254;
#endregion
@@ -135,24 +131,24 @@
detailBackFrame.AddChidren(btnPersent);
if (dicTaskinfo.ContainsKey(3) == true)
{
- btnPersent.Text = ((int)(dicTaskinfo[3].Data1 * 1.0 / MaxValue * 100)) + "%";
+ btnPersent.Text = HdlDeviceCommonLogic.Current.CalculateLightLevelPersent(dicTaskinfo[3].Data1) + "%";
}
//杩涘害鏉�
var seekBar = new SeekBarControl(919);
seekBar.Y = Application.GetRealHeight(268);
seekBar.ProgressBarColor = 0xfffdb500;
- seekBar.MaxValue = this.MaxValue;
+ seekBar.MaxValue = 100;
seekBar.Enable = false;
if (dicTaskinfo.ContainsKey(3) == true)
{
//3:浜害璋冭妭
- seekBar.Progress = dicTaskinfo[3].Data1;
+ seekBar.Progress = HdlDeviceCommonLogic.Current.CalculateLightLevelPersent(dicTaskinfo[3].Data1);
}
detailBackFrame.AddChidren(seekBar);
seekBar.ProgressChangedEvent += (div, value) =>
{
- btnPersent.Text = ((int)(value * 1.0 / MaxValue * 100)) + "%";
+ btnPersent.Text = value + "%";
};
//绾�
@@ -209,7 +205,7 @@
seekBar.Enable = true;
if (seekBar.Progress == 0)
{
- seekBar.Progress = MaxValue;
+ seekBar.Progress = 100;
btnPersent.Text = "100%";
}
@@ -275,7 +271,7 @@
//鐧惧垎姣旇皟鑺�
dicTaskinfo[3] = new Safeguard.TaskListInfo();
dicTaskinfo[3].TaskType = 3;
- dicTaskinfo[3].Data1 = seekBar.Progress;
+ dicTaskinfo[3].Data1 = HdlDeviceCommonLogic.Current.CalculateLightLevel(seekBar.Progress);
}
var listData = new List<Safeguard.TaskListInfo>();
diff --git a/ZigbeeApp/Shared/R.cs b/ZigbeeApp/Shared/R.cs
index 1f348e8..23895c5 100755
--- a/ZigbeeApp/Shared/R.cs
+++ b/ZigbeeApp/Shared/R.cs
@@ -1198,6 +1198,23 @@
public readonly static int dong = 5415;
public readonly static int unit = 5416;
public readonly static int theOutdoorUnit = 5417;
+ public const int airqualitysensor = 5418;
+ public const int pm25 = 5419;
+ public const int sensortemperature= 5420;
+ public const int sensorhumidity = 5421;
+ public const int co2 = 5422;
+ public const int you = 5423;
+ public const int liang = 5424;
+ public const int cha = 5425;
+ public const int pmyou = 5426;
+ public const int pmliang = 5427;
+ public const int pmqingdu = 5428;
+ public const int pmzhongdu = 5429;
+ public const int co2qingxin = 5430;
+ public const int co2huizhuo = 5431;
+ public const int co2queyang = 5432;
+ public const int co2yanzhongqueyang= 5433;
+ public const int kongqizhiliang = 5434;
--
Gitblit v1.8.0