From 3f45dd0172305bef0008e4e5a8725dedec2340c9 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 21 四月 2022 10:28:21 +0800 Subject: [PATCH] 紧急求助按钮备份 --- HDL-ON_Android/Properties/AndroidManifest.xml | 2 HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs | 5 + HDL_ON/UI/UI2/1-HomePage/HomePage.cs | 14 ++ HDL-ON_iOS/HDL-ON_iOS.csproj | 3 HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs | 75 +++++++++----- HDL-ON_Android/Assets/Phone/FunctionIcon/Panel/PanelHelpNormalBgIcon.png | 0 HDL_ON/DAL/Mqtt/MqttClient.cs | 1 HDL_ON/HDL_ON.projitems | 1 HDL-ON_iOS/Resources/Phone/FunctionIcon/Panel/PanelHelpNormalBgIcon.png | 0 HDL-ON_Android/HDL-ON_Android.csproj | 3 HDL-ON_iOS/Info.plist | 4 HDL_ON/Entity/Function/Function.cs | 1 HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs | 44 ++++++++ HDL_ON/UI/UI2/2-Classification/FunctionPage.cs | 1 HDL-ON_Android/Assets/Phone/FunctionIcon/Panel/PanelHelpAlarmBgIcon.png | 0 HDL-ON_iOS/Resources/Phone/FunctionIcon/Panel/PanelHelpAlarmBgIcon.png | 0 HDL_ON/UI/UI2/FuntionControlView/Panel/PanelHelpPage.cs | 142 ++++++++++++++++++++++++++++ HDL_ON/DAL/DriverLayer/Control.cs | 1 HDL-ON_Android/Other/JPush/JPushReceiver.cs | 3 19 files changed, 263 insertions(+), 37 deletions(-) diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/Panel/PanelHelpAlarmBgIcon.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/Panel/PanelHelpAlarmBgIcon.png new file mode 100644 index 0000000..72ece8b --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/Panel/PanelHelpAlarmBgIcon.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/Panel/PanelHelpNormalBgIcon.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/Panel/PanelHelpNormalBgIcon.png new file mode 100644 index 0000000..a55c35e --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/Panel/PanelHelpNormalBgIcon.png Binary files differ diff --git a/HDL-ON_Android/HDL-ON_Android.csproj b/HDL-ON_Android/HDL-ON_Android.csproj index cb54ebd..4b195b8 100644 --- a/HDL-ON_Android/HDL-ON_Android.csproj +++ b/HDL-ON_Android/HDL-ON_Android.csproj @@ -239,6 +239,8 @@ <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\sensorhelp.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\HomeIcon\sensorhelp_blue.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\HomeIcon\sensorhelp_white.png" /> + <AndroidAsset Include="Assets\Phone\FunctionIcon\Panel\PanelHelpAlarmBgIcon.png" /> + <AndroidAsset Include="Assets\Phone\FunctionIcon\Panel\PanelHelpNormalBgIcon.png" /> </ItemGroup> <ItemGroup> <AndroidResource Include="Resources\values\colors.xml" /> @@ -1446,6 +1448,7 @@ <Folder Include="libs\arm64-v8a\" /> <Folder Include="Zxing\" /> <Folder Include="Assets\Phone\FunctionIcon\CAC\" /> + <Folder Include="Assets\Phone\FunctionIcon\Panel\" /> </ItemGroup> <Import Project="..\HDL_ON\HDL_ON.projitems" Label="Shared" Condition="Exists('..\HDL_ON\HDL_ON.projitems')" /> <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" /> diff --git a/HDL-ON_Android/Other/JPush/JPushReceiver.cs b/HDL-ON_Android/Other/JPush/JPushReceiver.cs index 4566b62..1d60659 100644 --- a/HDL-ON_Android/Other/JPush/JPushReceiver.cs +++ b/HDL-ON_Android/Other/JPush/JPushReceiver.cs @@ -80,7 +80,8 @@ //UserInfo.Current.pushMesExpantContent = pushMes.expantContent; //UserInfo.Current.PushMesHomeId = pushMes.HomeId; UserInfo.Current.pushMessageInfo = pushMes; - UserInfo.Current.inCall = DateTime.Now; + if (!string.IsNullOrEmpty(pushMes.spk))//鑷爺鍙瀵硅闇�瑕佽褰曟椂闂村弽鍛� + UserInfo.Current.inCall = DateTime.Now; Shared.Application.RunOnMainThread(() => { diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml index cf1b3bd..b10b477 100644 --- a/HDL-ON_Android/Properties/AndroidManifest.xml +++ b/HDL-ON_Android/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@ 锘�<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202204081" android:versionName="1.5.6" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools"> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.5.6" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202204201"> <uses-sdk android:minSdkVersion="28" android:targetSdkVersion="30" /> <!--鍙嬬洘--> <!--<uses-sdk android:minSdkVersion="8"></uses-sdk>--> diff --git a/HDL-ON_iOS/HDL-ON_iOS.csproj b/HDL-ON_iOS/HDL-ON_iOS.csproj index e63fc9c..b96a294 100644 --- a/HDL-ON_iOS/HDL-ON_iOS.csproj +++ b/HDL-ON_iOS/HDL-ON_iOS.csproj @@ -486,6 +486,7 @@ <Folder Include="Resources\Phone\FunctionIcon\Electrical\AirSwitch\" /> <Folder Include="Base.lproj\" /> <Folder Include="Resources\Phone\FunctionIcon\CAC\" /> + <Folder Include="Resources\Phone\FunctionIcon\Panel\" /> </ItemGroup> <ItemGroup> <InterfaceDefinition Include="LaunchScreen.storyboard" /> @@ -1399,6 +1400,8 @@ <BundleResource Include="Resources\Phone\FunctionIcon\Icon\sensorhelp.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\sensorhelp_blue.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\sensorhelp_white.png" /> + <BundleResource Include="Resources\Phone\FunctionIcon\Panel\PanelHelpAlarmBgIcon.png" /> + <BundleResource Include="Resources\Phone\FunctionIcon\Panel\PanelHelpNormalBgIcon.png" /> </ItemGroup> <ItemGroup> <ITunesArtwork Include="iTunesArtwork" /> diff --git a/HDL-ON_iOS/Info.plist b/HDL-ON_iOS/Info.plist index 5e9bc21..e5b4b8e 100644 --- a/HDL-ON_iOS/Info.plist +++ b/HDL-ON_iOS/Info.plist @@ -100,9 +100,9 @@ <key>UIStatusBarStyle</key> <string>UIStatusBarStyleLightContent</string> <key>CFBundleShortVersionString</key> - <string>1.5.502204081</string> + <string>1.5.502204201</string> <key>CFBundleVersion</key> - <string>1.5.504081</string> + <string>1.5.504201</string> <key>NSLocationWhenInUseUsageDescription</key> <string>Use geographic location to provide services such as weather</string> <key>NSAppleMusicUsageDescription</key> diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/Panel/PanelHelpAlarmBgIcon.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Panel/PanelHelpAlarmBgIcon.png new file mode 100644 index 0000000..72ece8b --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Panel/PanelHelpAlarmBgIcon.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/Panel/PanelHelpNormalBgIcon.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Panel/PanelHelpNormalBgIcon.png new file mode 100644 index 0000000..a55c35e --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Panel/PanelHelpNormalBgIcon.png Binary files differ diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs index 5f9b849..66e423f 100644 --- a/HDL_ON/DAL/DriverLayer/Control.cs +++ b/HDL_ON/DAL/DriverLayer/Control.cs @@ -951,6 +951,7 @@ /// <summary> /// 鏇存柊璁惧鐘舵�� /// A鍗忚鏁版嵁 + /// Tag Link鐘舵�佸鐞� /// </summary> /// <param name="updateBytes"></param> public void UpdataFunctionStatus(string revString, byte[] usefulBytes,bool isCloudData = false) diff --git a/HDL_ON/DAL/Mqtt/MqttClient.cs b/HDL_ON/DAL/Mqtt/MqttClient.cs index 01d44d8..60f8d2a 100644 --- a/HDL_ON/DAL/Mqtt/MqttClient.cs +++ b/HDL_ON/DAL/Mqtt/MqttClient.cs @@ -511,6 +511,7 @@ } #endregion //A缃戝叧璁惧鐘舵��-鍖呭惈娑傞甫璁惧 + //Tag 缃戠粶鐘舵�佽В鏋� else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/thing/property/send") { var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, tuyaEncryptKey); diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs index 6fdb8d9..82876da 100644 --- a/HDL_ON/Entity/Function/Function.cs +++ b/HDL_ON/Entity/Function/Function.cs @@ -1465,7 +1465,6 @@ spkList.Add(SensorDryContact2); spkList.Add(SenesorMegahealth); spkList.Add(SenesorMegahealth2); - spkList.Add(SensorHelp); return spkList; } diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems index 84c78f2..408da4e 100644 --- a/HDL_ON/HDL_ON.projitems +++ b/HDL_ON/HDL_ON.projitems @@ -493,6 +493,7 @@ <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\1ContorlPage\CacDayHistoryPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\1ContorlPage\CacHistoryChoosePage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicMethod.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Panel\PanelHelpPage.cs" /> </ItemGroup> <ItemGroup> <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" /> diff --git a/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs b/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs index b4a926d..d94d5a1 100644 --- a/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs +++ b/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs @@ -204,6 +204,11 @@ var doorLockPage = new DoorLockPage(); doorLockPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); break; + case SPK.SensorHelp: + var panelHelpPage = new HDL_ON.UI.UI2.FuntionControlView.Panel.PanelHelpPage(); + panelHelpPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); + break; + } }; return eventHandler; diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs index 0bb4e7c..b5f8992 100644 --- a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs +++ b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs @@ -633,9 +633,10 @@ attributes = new List<FunctionAttributes>() { new FunctionAttributes(){ key = "status",curValue= "on",state = "on" }, - new FunctionAttributes(){ key = "battery_value",curValue= "2000",state = "2000" }, - new FunctionAttributes(){ key = "battery_percentage",curValue= "80",state = "80" }, - new FunctionAttributes(){ key = "battery_state",curValue= "high",state = "high" }, + new FunctionAttributes(){ key = "alarm_status",curValue= "alarm",state = "alarm" }, + new FunctionAttributes(){ key = "battery_value",curValue= "200",state = "200" }, + new FunctionAttributes(){ key = "battery_percentage",curValue= "10",state = "10" }, + new FunctionAttributes(){ key = "battery_state",curValue= "low",state = "low" }, }, }); @@ -884,6 +885,7 @@ /// <summary> /// 鍔犺浇璁惧鍔熻兘鏄剧ず鍖哄煙 + /// Tag 鏀惰棌鍗$墖 /// </summary> void LoadDeviceFunctionControlZone() { @@ -1097,6 +1099,7 @@ /// <summary> /// 鍔犺浇鍔熻兘鎺у埗鍗$墖 + /// Tag 鍗$墖鑷畾涔� /// </summary> void LoadDeviceFunctionDiv(FrameLayout view, Function function) { @@ -1311,6 +1314,11 @@ LoadEvent_ControlClothesHanger(function, btnUp, btnDown); } + //绱ф�ユ眰鍔� + else if (function.spk == SPK.SensorHelp) + { + + } else { diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs index c049ebd..b269c83 100644 --- a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs +++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs @@ -647,6 +647,7 @@ var functionCategoryCount = 0; + //Tag 鍒嗙被鍗$墖鏄剧ず foreach (var item in DB_ResidenceData.Instance.functionTypeList) { int functionCount = 0; @@ -709,8 +710,7 @@ #endif break; case ShowFunction.Panel: - - + functionCount = FunctionList.List.GetPanelList().Count; break; case ShowFunction.SecurityMonitoring: if (!MainPage.NoLoginMode) @@ -790,37 +790,56 @@ }; functionView.AddChidren(btnName); + //Tag 鏁伴噺鏄剧ず if (item != ShowFunction.Environmental && item != ShowFunction.Sensor && item != ShowFunction.VideoIntercom && item != ShowFunction.SecurityMonitoring && item != ShowFunction.FreshAir && item != ShowFunction.Music && item != ShowFunction.EnergyMonitoring && item != ShowFunction.SecurityCenter && functionCount != 0) { - Button btnFunctionCount = new Button() + if (item == ShowFunction.Panel) { - X = Application.GetRealWidth(17) + Application.GetRealWidth(7 * functionCount.ToString().Length), - Y = btnName.Bottom, - Width = Application.GetRealWidth(120), - Height = Application.GetRealHeight(24), - TextColor = CSS_Color.PromptingColor1, - TextSize = CSS_FontSize.PromptFontSize_FirstLevel, - TextAlignment = TextAlignment.CenterLeft, - Text = "/" + functionCount, - }; - functionView.AddChidren(btnFunctionCount); - Button btnOpenCount = new Button() + Button btnFunctionCount = new Button() + { + X = Application.GetRealWidth(16), + Y = btnName.Bottom, + Width = Application.GetRealWidth(120), + Height = Application.GetRealHeight(24), + TextColor = CSS_Color.PromptingColor1, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + TextAlignment = TextAlignment.CenterLeft, + Text = functionCount.ToString(), + }; + functionView.AddChidren(btnFunctionCount); + } + else { - X = Application.GetRealWidth(16), - Y = btnName.Bottom, - Width = Application.GetRealWidth(14 * functionCount.ToString().Length), - Height = Application.GetRealHeight(24), - TextColor = CSS_Color.MainColor, - TextSize = CSS_FontSize.PromptFontSize_FirstLevel, - TextAlignment = TextAlignment.CenterLeft, - Text = functionOnCount.ToString(), - Tag = item + "_onCount", - BorderWidth = 0, - }; - functionView.AddChidren(btnOpenCount); + Button btnFunctionCount = new Button() + { + X = Application.GetRealWidth(17) + Application.GetRealWidth(7 * functionCount.ToString().Length), + Y = btnName.Bottom, + Width = Application.GetRealWidth(120), + Height = Application.GetRealHeight(24), + TextColor = CSS_Color.PromptingColor1, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + TextAlignment = TextAlignment.CenterLeft, + Text = "/" + functionCount, + }; + functionView.AddChidren(btnFunctionCount); + Button btnOpenCount = new Button() + { + X = Application.GetRealWidth(16), + Y = btnName.Bottom, + Width = Application.GetRealWidth(14 * functionCount.ToString().Length), + Height = Application.GetRealHeight(24), + TextColor = CSS_Color.MainColor, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + TextAlignment = TextAlignment.CenterLeft, + Text = functionOnCount.ToString(), + Tag = item + "_onCount", + BorderWidth = 0, + }; + functionView.AddChidren(btnOpenCount); + } } @@ -832,6 +851,7 @@ }; functionView.AddChidren(btnFunctionViewBg); + //Tag 璋冭瘯浜嬩欢鍒ゆ柇 int functionPageTitleId = 0; switch (item) { @@ -1024,7 +1044,8 @@ }; break; case ShowFunction.Panel: - btnName.TextID = StringId.Panel; + btnName.TextID = StringId.SmartPanel; + functionPageTitleId = StringId.SmartPanel; break; case ShowFunction.SecurityMonitoring: btnName.TextID = StringId.SecurityMonitoring; diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs b/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs index aa40d9a..de866dd 100644 --- a/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs +++ b/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs @@ -54,6 +54,7 @@ /// <summary> /// 鍔犺浇鍔熻兘绫诲瀷鎺у埗鍗$墖 + /// Tag 鍔熻兘灞炴�ф樉绀� /// </summary> public void LoadFunctionDiv() { @@ -76,8 +77,7 @@ {//闊充箰娌℃湁寮�鍏虫寜閽� MusicFragment(); } - else if (SPK.EvironmentSensorList().Contains(function.spk) || SPK.ArmSensorSpkList().Contains(function.spk) - || SPK.PanelSpkList().Contains(function.spk)) //浼犳劅鍣ㄦ病鏈夊紑鍏虫寜閽�) + else if (SPK.EvironmentSensorList().Contains(function.spk) || SPK.ArmSensorSpkList().Contains(function.spk)) //浼犳劅鍣ㄦ病鏈夊紑鍏虫寜閽�) { var powerLowTipAttr = function.attributes.Find((obj) => obj.key == FunctionAttributeKey.BatteryState); if (powerLowTipAttr != null) @@ -101,6 +101,46 @@ { btnIcon.UnSelectedImagePath = "FunctionIcon/DoorLock/DoorLock.png"; } + else if(SPK.PanelSpkList().Contains(function.spk))//鏅鸿兘闈㈡澘璁惧 + { + var powerLowTipAttr = function.attributes.Find((obj) => obj.key == FunctionAttributeKey.BatteryState); + if (powerLowTipAttr != null) + { + if (powerLowTipAttr.state.ToLower() == "low") + { + Button btnTipPowerLow = new Button() + { + X = Application.GetRealWidth(307), + Y = Application.GetRealHeight(70), + Width = Application.GetRealWidth(24), + Height = Application.GetRealWidth(24), + UnSelectedImagePath = "FunctionIcon/ArmSensor/PowerLowIcon.png", + SelectedImagePath = "FunctionIcon/ArmSensor/PowerLowIcon.png", + }; + this.AddChidren(btnTipPowerLow); + } + } + var alarmStatusAttr = function.GetAttribute("alarm_status"); + if(alarmStatusAttr !=null) + { + var btnAlarmStatus = new Button() + { + X = Application.GetRealWidth(8 + 10 + 32), + Y = Application.GetRealHeight(53), + Width = Application.GetRealWidth(200), + Height = Application.GetRealHeight(24), + TextAlignment = TextAlignment.CenterLeft, + TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, + Tag = "AlarmStatus" + }; + if(alarmStatusAttr.state == "alarm") + { + btnAlarmStatus.TextID = StringId.InAlarm; + btnAlarmStatus.TextColor = CSS_Color.WarningColor; + } + bodyDiv.AddChidren(btnAlarmStatus); + } + } else { if (function.spk == SPK.ClothesHanger)//鏅捐。鏋� diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs b/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs index 9418e78..624ea5d 100644 --- a/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs +++ b/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs @@ -114,6 +114,7 @@ }; bodyView.AddChidren(functionListView); + //Tag 鏄剧ず鍒楄〃 if (titleId == StringId.Lights) { functionList.AddRange(FunctionList.List.GetLightList()); diff --git a/HDL_ON/UI/UI2/FuntionControlView/Panel/PanelHelpPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Panel/PanelHelpPage.cs new file mode 100644 index 0000000..d844ac2 --- /dev/null +++ b/HDL_ON/UI/UI2/FuntionControlView/Panel/PanelHelpPage.cs @@ -0,0 +1,142 @@ +锘縰sing System; +using HDL_ON.Entity; +using HDL_ON.Stan; +using HDL_ON.UI.CSS; +using Shared; + +namespace HDL_ON.UI.UI2.FuntionControlView.Panel +{ + public class PanelHelpPage : DeviceFunctionCardCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 鍥炬爣 + /// </summary> + private IconViewControl btnIcon = null; + /// <summary> + /// 鏂囨湰鎺т欢 + /// </summary> + private NormalViewControl btnSuctionView = null; + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鍒濆鍖栫櫧鑹插尯鍩熺殑鍐呭 + /// </summary> + public override void InitFrameWhiteContent() + { + base.ShowColltionButton = false; + base.SetTitleText(Language.StringByID(StringId.SmartPanel)); + + //娣诲姞绗簩绱㈠紩椤� + this.AddSecondPage(); + //鍒濆鍖栫涓�涓储寮曢〉鐨勫唴瀹� + this.InitFrameWhiteContent1(); + //鍒濆鍖栫浜屼釜绱㈠紩椤电殑鍐呭 + this.InitFrameWhiteContent2(); + //鍒锋柊鐣岄潰鐘舵�� + this.RefreshFormStatu(); + //璇诲彇鐘舵�� + new System.Threading.Thread(() => + { + DriverLayer.Control.Ins.SendReadCommand(device); + }) + { IsBackground = true }.Start(); + } + + /// <summary> + /// 鍒濆鍖栫涓�涓储寮曢〉鐨勫唴瀹� + /// </summary> + private void InitFrameWhiteContent1() + { + btnIcon = new IconViewControl(198) + { + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealWidth(146), + UnSelectedImagePath = "FunctionIcon/Panel/PanelHelpNormalBgIcon.png", + SelectedImagePath = "FunctionIcon/Panel/PanelHelpAlarmBgIcon.png", + }; + FrameWhiteCentet1.AddChidren(btnIcon); + + btnSuctionView = new NormalViewControl(300, 84, true) + { + Gravity = Gravity.CenterHorizontal, + Y = btnIcon.Bottom, + TextAlignment = TextAlignment.Center, + TextSize = CSS_FontSize.TextFontSize, + TextColor = CSS_Color.MainColor, + SelectedTextColor = CSS_Color.AuxiliaryColor2, + //BackgroundColor = 0xFFFF0000 + }; + FrameWhiteCentet1.AddChidren(btnSuctionView); + } + + /// <summary> + /// 鍒濆鍖栫浜屼釜绱㈠紩椤电殑鍐呭 + /// </summary> + private void InitFrameWhiteContent2() + { + var paging = new ArmSensorHistroyPaging(device); + paging.InitFrame(FrameWhiteCentet2); + } + + #endregion + + #region 鈻� 璁惧鐘舵�佸弽棣坃______________________ + + /// <summary> + /// 璁惧鐘舵�佸弽棣� + /// </summary> + /// <param name="i_LocalDevice"></param> + public override void DeviceStatuPush(Function i_LocalDevice) + { + //涓嶆槸鍚屼竴涓笢瑗� + if (this.device.sid != i_LocalDevice.sid) { return; } + + //鍒锋柊鐣岄潰鐘舵�� + this.RefreshFormStatu(); + } + + #endregion + + #region 鈻� 鍙戦�佸悇绉嶅懡浠______________________ + + #endregion + + #region 鈻� 鍒锋柊鐣岄潰鐘舵�乢______________________ + + /// <summary> + /// 鍒锋柊鐣岄潰鐘舵�� + /// </summary> + private void RefreshFormStatu() + { + Application.RunOnMainThread(() => { + var temp = device.attributes.Find((sta) => sta.key == "alarm_status"); + if (temp != null) + { + if (temp.state == "alarm") + { + btnIcon.IsSelected = true; + btnSuctionView.TextID = StringId.InAlarm; + btnSuctionView.IsSelected = true; + } + else + { + btnIcon.IsSelected = false; + btnSuctionView.TextID = StringId.SensorNormalState; + btnSuctionView.IsSelected = false; + } + } + }); + } + + #endregion + + #region 鈻� 涓�鑸柟娉昣__________________________ + + #endregion + } +} -- Gitblit v1.8.0