From bb4bcd1b320502b36d19aacec52ed886a975249a Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期二, 19 七月 2022 11:04:00 +0800 Subject: [PATCH] 1.5.9打包 --- HDL-ON_Android/Properties/AndroidManifest.xml | 2 HDL_ON/DAL/DriverLayer/UdpSocket.cs | 8 HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs | 1 HDL-ON_Android/Assets/Language.ini | 76 ++ HDL-ON_Android/Assets/Phone/FunctionIcon/ArmSensor/SomeoneRunBgIcon.png | 0 HDL-ON_iOS/HDL-ON_iOS.csproj | 3 HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs | 2 HDL_ON/HDL_ON.projitems | 1 HDL-ON_Android/HDL-ON_Android.csproj | 3 HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs | 518 ++++++++++++++++ HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmSensor/SomeoneSitBgIcon.png | 0 HDL-ON_iOS/Info.plist | 4 HDL-ON_iOS/Resources/Language.ini | 77 ++ HDL_ON/DAL/Server/NewApiRes.cs | 12 HDL-ON_Android/Assets/Phone/FunctionIcon/ArmSensor/SomeoneSitBgIcon.png | 0 HDL_ON/DAL/DriverLayer/Packet.cs | 38 HDL_ON/DAL/DriverLayer/Control.cs | 17 HDL_ON/UI/UI1-Login/LoginPage.cs | 5 HDL_ON/UI/UI0-Stan/Logic/HdlDeviceStatuPushLogic.cs | 13 SiriIntents/Server/HttpUtil.cs | 4 HDL-ON_Android/Assets/Phone/FunctionIcon/ArmSensor/SomeoneStandBgIcon.png | 0 HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs | 299 ++++++++ HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs | 17 HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs | 38 HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmSensor/SomeoneRunBgIcon.png | 0 HDL_ON/DAL/DriverLayer/Control_Udp.cs | 135 +++ HDL_ON/UI/UI2/FuntionControlView/Video/ObjectClass.cs | 5 HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs | 9 HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacWeekHistoryPage.cs | 3 HDL_ON/DAL/Server/NewAPI.cs | 12 HDL_ON/Entity/Function/Function.cs | 43 + HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmSensor/SomeoneStandBgIcon.png | 0 HDL_ON/DAL/Server/HttpUtil.cs | 4 HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorMegahealth_AlarmDataStatisticsPage.cs | 270 ++++++++ HDL_ON/Common/R.cs | 52 + HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SenesorMegahealthPage.cs | 150 ++++ HDL_ON/DAL/Server/HttpServerRequest.cs | 46 + 37 files changed, 1,765 insertions(+), 102 deletions(-) diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini index a22d7c5..bb99937 100644 --- a/HDL-ON_Android/Assets/Language.ini +++ b/HDL-ON_Android/Assets/Language.ini @@ -531,6 +531,20 @@ 543=Get more 544=Angle 545=Alarm data statistics +546=Laboratory mode +547=Alarm function +548=Indoor +549=Surface temperature +550=Temperature calibration +551=Humidity calibration +552=Capillary valve +553=Floor heating valve +554=In order to ensure the best delay effect, it is recommended that the number of people be less than 4. +555=Exit lab mode +556=Someone is running +557=Someone is standing +558=Someone is sitting + 2532=Visitor Invitation Record 2533=Visitor management @@ -1719,6 +1733,20 @@ 543=鑾峰彇鏇村 544=瑙掑害 545=鎶ヨ鏁版嵁缁熻 +546=瀹為獙瀹ゆā寮� +547=鎶ヨ鍔熻兘 +548=瀹ゅ唴 +549=琛ㄩ潰娓╁害 +550=娓╁害鏍″噯 +551=婀垮害鏍″噯 +552=姣涚粏闃� +553=鍦版殩闃� +554=*涓轰繚闅滄渶浣冲欢鏃舵晥鏋滐紝寤鸿浜烘暟鍦�4浜轰竴涓嬨�� +555=閫�鍑哄疄楠屽妯″紡 +556=鏈変汉鍦ㄨ窇 +557=鏈変汉绔欑潃 +558=鏈変汉鍧愮潃 + 2532=璁垮閭�璇疯褰� @@ -2887,6 +2915,20 @@ 543=Get more 544=Angle 545=Alarm data statistics +546=Laboratory mode +547=Alarm function +548=Indoor +549=Surface temperature +550=Temperature calibration +551=Humidity calibration +552=Capillary valve +553=Floor heating valve +554=In order to ensure the best delay effect, it is recommended that the number of people be less than 4. +555=Exit lab mode +556=Someone is running +557=Someone is standing +558=Someone is sitting + 2532=Visitor Invitation Record 2533=Visitor management @@ -4066,6 +4108,40 @@ 543=Get more 544=Angle 545=Alarm data statistics +546=Laboratory mode +547=Alarm function +548=Indoor +549=Surface temperature +550=Temperature calibration +551=Humidity calibration +552=Capillary valve +553=Floor heating valve +554=In order to ensure the best delay effect, it is recommended that the number of people be less than 4. +555=Exit lab mode +556=Someone is running +557=Someone is standing +558=Someone is sitting + +2532=Visitor Invitation Record +2533=Visitor management +2534=Visitor Invitation +2535=Record +2536=*After you initiate the visitor certificate, you can unlock the door by password or swipe the code freely within the validity period you set. Please share the certificate carefully. +2537=Input phone number of the visitor +2538=Input 6-digits temporary password +2539=Random Generation +2540=After confirmation, the visitor QR code will be generated, and the 6-digit dynamic digital password SMS will also be sent to the visitor mobile phone. +2541=Are you sure to delete visitor credentials? +2542=Long press the QR code to save the QR code to the album +2543=QR code is invalid +2544=Generate Visitor Credentials +2545=Cancle Visitor Credentials +2546=Visitor QR Code +2547=Phone Number +2548=Please enter a correct phone number +2549=Please select a effective time +2550=Please select a expire time +2551=Temporary password is invalid 1000=Humedad de ambiente 1001=V-chip diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/ArmSensor/SomeoneRunBgIcon.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/ArmSensor/SomeoneRunBgIcon.png new file mode 100644 index 0000000..f2cf359 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/ArmSensor/SomeoneRunBgIcon.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/ArmSensor/SomeoneSitBgIcon.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/ArmSensor/SomeoneSitBgIcon.png new file mode 100644 index 0000000..7fe11e4 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/ArmSensor/SomeoneSitBgIcon.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/ArmSensor/SomeoneStandBgIcon.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/ArmSensor/SomeoneStandBgIcon.png new file mode 100644 index 0000000..a12fd5b --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/ArmSensor/SomeoneStandBgIcon.png Binary files differ diff --git a/HDL-ON_Android/HDL-ON_Android.csproj b/HDL-ON_Android/HDL-ON_Android.csproj index 7614a45..09a30a1 100644 --- a/HDL-ON_Android/HDL-ON_Android.csproj +++ b/HDL-ON_Android/HDL-ON_Android.csproj @@ -253,6 +253,9 @@ <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\curtaindream.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\CAC\HvacCacHumidityIcon.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\CAC\HvacCacTempIcon.png" /> + <AndroidAsset Include="Assets\Phone\FunctionIcon\ArmSensor\SomeoneRunBgIcon.png" /> + <AndroidAsset Include="Assets\Phone\FunctionIcon\ArmSensor\SomeoneSitBgIcon.png" /> + <AndroidAsset Include="Assets\Phone\FunctionIcon\ArmSensor\SomeoneStandBgIcon.png" /> </ItemGroup> <ItemGroup> <AndroidResource Include="Resources\values\colors.xml" /> diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml index 09ee412..103dbbb 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:versionName="1.5.9" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202207081"> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.5.9" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202207181"> <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" /> <!--鍙嬬洘--> <!--<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 92730c7..b8e078d 100644 --- a/HDL-ON_iOS/HDL-ON_iOS.csproj +++ b/HDL-ON_iOS/HDL-ON_iOS.csproj @@ -1415,6 +1415,9 @@ <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\curtaindream_white.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\CAC\HvacCacHumidityIcon.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\CAC\HvacCacTempIcon.png" /> + <BundleResource Include="Resources\Phone\FunctionIcon\ArmSensor\SomeoneRunBgIcon.png" /> + <BundleResource Include="Resources\Phone\FunctionIcon\ArmSensor\SomeoneSitBgIcon.png" /> + <BundleResource Include="Resources\Phone\FunctionIcon\ArmSensor\SomeoneStandBgIcon.png" /> </ItemGroup> <ItemGroup> <ITunesArtwork Include="iTunesArtwork" /> diff --git a/HDL-ON_iOS/Info.plist b/HDL-ON_iOS/Info.plist index 294a70a..941eb51 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.502206301</string> + <string>1.5.902207181</string> <key>CFBundleVersion</key> - <string>1.5.506301</string> + <string>1.5.907181</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/Language.ini b/HDL-ON_iOS/Resources/Language.ini index a22d7c5..4fb7ae2 100644 --- a/HDL-ON_iOS/Resources/Language.ini +++ b/HDL-ON_iOS/Resources/Language.ini @@ -531,6 +531,21 @@ 543=Get more 544=Angle 545=Alarm data statistics +546=Laboratory mode +547=Alarm function +548=Indoor +549=Surface temperature +550=Temperature calibration +551=Humidity calibration +552=Capillary valve +553=Floor heating valve +554=In order to ensure the best delay effect, it is recommended that the number of people be less than 4. +555=Exit lab mode +556=Someone is running +557=Someone is standing +558=Someone is sitting + + 2532=Visitor Invitation Record 2533=Visitor management @@ -1719,6 +1734,20 @@ 543=鑾峰彇鏇村 544=瑙掑害 545=鎶ヨ鏁版嵁缁熻 +546=瀹為獙瀹ゆā寮� +547=鎶ヨ鍔熻兘 +548=瀹ゅ唴 +549=琛ㄩ潰娓╁害 +550=娓╁害鏍″噯 +551=婀垮害鏍″噯 +552=姣涚粏闃� +553=鍦版殩闃� +554=*涓轰繚闅滄渶浣冲欢鏃舵晥鏋滐紝寤鸿浜烘暟鍦�4浜轰竴涓嬨�� +555=閫�鍑哄疄楠屽妯″紡 +556=鏈変汉鍦ㄨ窇 +557=鏈変汉绔欑潃 +558=鏈変汉鍧愮潃 + 2532=璁垮閭�璇疯褰� @@ -2887,6 +2916,20 @@ 543=Get more 544=Angle 545=Alarm data statistics +546=Laboratory mode +547=Alarm function +548=Indoor +549=Surface temperature +550=Temperature calibration +551=Humidity calibration +552=Capillary valve +553=Floor heating valve +554=In order to ensure the best delay effect, it is recommended that the number of people be less than 4. +555=Exit lab mode +556=Someone is running +557=Someone is standing +558=Someone is sitting + 2532=Visitor Invitation Record 2533=Visitor management @@ -4066,6 +4109,40 @@ 543=Get more 544=Angle 545=Alarm data statistics +546=Laboratory mode +547=Alarm function +548=Indoor +549=Surface temperature +550=Temperature calibration +551=Humidity calibration +552=Capillary valve +553=Floor heating valve +554=In order to ensure the best delay effect, it is recommended that the number of people be less than 4. +555=Exit lab mode +556=Someone is running +557=Someone is standing +558=Someone is sitting + +2532=Visitor Invitation Record +2533=Visitor management +2534=Visitor Invitation +2535=Record +2536=*After you initiate the visitor certificate, you can unlock the door by password or swipe the code freely within the validity period you set. Please share the certificate carefully. +2537=Input phone number of the visitor +2538=Input 6-digits temporary password +2539=Random Generation +2540=After confirmation, the visitor QR code will be generated, and the 6-digit dynamic digital password SMS will also be sent to the visitor mobile phone. +2541=Are you sure to delete visitor credentials? +2542=Long press the QR code to save the QR code to the album +2543=QR code is invalid +2544=Generate Visitor Credentials +2545=Cancle Visitor Credentials +2546=Visitor QR Code +2547=Phone Number +2548=Please enter a correct phone number +2549=Please select a effective time +2550=Please select a expire time +2551=Temporary password is invalid 1000=Humedad de ambiente 1001=V-chip diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmSensor/SomeoneRunBgIcon.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmSensor/SomeoneRunBgIcon.png new file mode 100644 index 0000000..f2cf359 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmSensor/SomeoneRunBgIcon.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmSensor/SomeoneSitBgIcon.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmSensor/SomeoneSitBgIcon.png new file mode 100644 index 0000000..7fe11e4 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmSensor/SomeoneSitBgIcon.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmSensor/SomeoneStandBgIcon.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmSensor/SomeoneStandBgIcon.png new file mode 100644 index 0000000..a12fd5b --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmSensor/SomeoneStandBgIcon.png Binary files differ diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs index c2551df..115ea7f 100644 --- a/HDL_ON/Common/R.cs +++ b/HDL_ON/Common/R.cs @@ -5,6 +5,58 @@ public static class StringId { /// <summary> + /// 鏈変汉鍧愮潃 + /// </summary> + public const int SomeoneSitting = 558; + /// <summary> + /// 鏈変汉绔欑潃 + /// </summary> + public const int SomeoneStanding = 557; + /// <summary> + /// 鏈変汉鍦ㄨ窇 + /// </summary> + public const int SomeoneRunning = 556; + /// <summary> + /// 閫�鍑哄疄楠屽妯″紡 + /// </summary> + public const int ExitLabModel = 555; + /// <summary> + /// 姣背娉㈠疄楠屽妯″紡鎻愮ず鏂囨湰 + /// </summary> + public const int LabTipText = 554; + /// <summary> + /// 鍦版殩闃�闂� + /// </summary> + public const int FloorHeatingValve = 553; + /// <summary> + /// 姣涚粏闃�闂� + /// </summary> + public const int CapillaryValve = 552; + /// <summary> + /// 婀垮害鏍″噯 + /// </summary> + public const int HumidityCalibration = 551; + /// <summary> + /// 娓╁害鏍″噯 + /// </summary> + public const int TemperatureCalibration = 550; + /// <summary> + /// 琛ㄩ潰娓╁害 + /// </summary> + public const int SurfaceTemperature = 549; + /// <summary> + /// 瀹ゅ唴 + /// </summary> + public const int Indoor = 548; + /// <summary> + /// 鎶ヨ鍔熻兘 + /// </summary> + public const int AlarmFunction = 547; + /// <summary> + /// 瀹為獙瀹ゆā寮� + /// </summary> + public const int LaboratoryMode = 546; + /// <summary> /// 鎶ヨ鏁版嵁缁熻 /// </summary> public const int AlarmDataStatistics = 545; diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs index ad0df71..e008c9e 100644 --- a/HDL_ON/DAL/DriverLayer/Control.cs +++ b/HDL_ON/DAL/DriverLayer/Control.cs @@ -917,13 +917,16 @@ byte[] bodyBytes = new byte[receiveObj.Length]; Array.Copy(originalReceiveBytes, topicBytes.Length + 4, bodyBytes, 0, receiveObj.Length); byte[] receiveBytes = Securitys.EncryptionService.AesDecryptPayload(bodyBytes, DB_ResidenceData.Instance.CurrentRegion.localSecret); - var revString = Encoding.UTF8.GetString(receiveBytes); - receiveObj.BodyDataString = revString; - MainPage.Log($"灞�鍩熺綉淇℃伅: 瑙e瘑鍚庯細" + receiveObj.BodyDataString); - //if (receiveObj.Topic.EndsWith("/thing/property/up")) - //{ - // MsgInfoList.Add(revString + "\r\n"); - //} + if (receiveBytes != null) + { + var revString = Encoding.UTF8.GetString(receiveBytes); + receiveObj.BodyDataString = revString; + MainPage.Log($"灞�鍩熺綉淇℃伅: 瑙e瘑鍚庯細" + receiveObj.BodyDataString); + //if (receiveObj.Topic.EndsWith("/thing/property/up")) + //{ + // MsgInfoList.Add(revString + "\r\n"); + //} + } } else { diff --git a/HDL_ON/DAL/DriverLayer/Control_Udp.cs b/HDL_ON/DAL/DriverLayer/Control_Udp.cs index e6eba3b..ce7be67 100644 --- a/HDL_ON/DAL/DriverLayer/Control_Udp.cs +++ b/HDL_ON/DAL/DriverLayer/Control_Udp.cs @@ -262,12 +262,17 @@ break; } break; + case FunctionAttributeKey.SetTemp: + ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] { + modeKey, Convert.ToByte(attr.value), f.localFunction.bus.LoopId }); + break; } ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] { 3, onoff, f.localFunction.bus.LoopId }); ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] { 6, mode, f.localFunction.bus.LoopId }); ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] { 5, fan, f.localFunction.bus.LoopId }); ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] { modeKey, modeKey, f.localFunction.bus.LoopId }); - } + + } break; case SPK.LightSwitch: case SPK.LightDimming: @@ -554,47 +559,129 @@ case SPK.AcStandard: case SPK.HvacAC: var ac = new AC(); + + byte onoff = 0; + onoff = function.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0; + byte mode = 0; + mode = ac.GetModeIndex(function); + byte fan = 0; + fan = ac.GetFanIndex(function); + byte sanfan = 0; + byte temp = 16; + temp = Convert.ToByte(function.GetAttrState(FunctionAttributeKey.SetTemp)); foreach (var dic in commandDictionary) { switch (dic.Key) { case FunctionAttributeKey.OnOff: - ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 3, function.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0, function.bus.LoopId }); + onoff = dic.Value == "on" ? (byte)1 : (byte)0; + //ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, + // new byte[] { 3, onoff, function.bus.LoopId }); break; case "mode": - ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 6, ac.GetModeIndex(function), function.bus.LoopId }); - break; - case "fan": - ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 5, ac.GetFanIndex(function), function.bus.LoopId }); - break; - case FunctionAttributeKey.SetTemp: - byte modeKey = 4; - switch (ac.GetModeIndex(function)) + switch (dic.Value) { - case 3: - modeKey = 8; + case "auto": + mode = 3; break; - case 0: - modeKey = 4; + case "cool": + mode = 0; break; - case 1: - modeKey = 7; + case "heat": + mode = 1; break; - case 4: - modeKey = 19; + case "dry": + mode = 4; break; - case 2: - modeKey = 2; + case "fan": + mode = 2; + break; + default: + mode = 0; break; } - ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { - modeKey, Convert.ToByte(function.GetAttrState(FunctionAttributeKey.SetTemp)), function.bus.LoopId }); + //ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, + // new byte[] { 6, mode, function.bus.LoopId }); + break; + case "fan": + switch (dic.Value) + { + case "high": + fan = 1; + break; + case "medium": + fan = 2; + break; + case "low": + fan = 3; + break; + case "auto": + fan = 0; + break; + default: + fan = 0; + break; + } + //ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, + // new byte[] { 5, fan, function.bus.LoopId }); + break; + case FunctionAttributeKey.SetTemp: + try + { + temp = Convert.ToByte(dic.Value); + } + catch + { + temp = 16; + } + //byte modeKey = 4; + //switch (ac.GetModeIndex(function)) + //{ + // case 3: + // modeKey = 8; + // break; + // case 0: + // modeKey = 4; + // break; + // case 1: + // modeKey = 7; + // break; + // case 4: + // modeKey = 19; + // break; + // case 2: + // modeKey = 2; + // break; + //} + + //ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { + // modeKey, temp, function.bus.LoopId }); + break; + case FunctionAttributeKey.Swing: + //sanfan break; default: MainPage.Log($"鍔熻兘鏈敮鎸� : {dic.Key}"); break; } } + /// 璁剧疆绌鸿皟妯″潡鍛戒护 + /// 1绌鸿皟鍙�(1-128) + ///2娓╁害妯″紡(鎽勬皬Celsius:0锛屽崕姘廎ahrenheit:1) + ///3鐜娓╁害 (鎽勬皬0-40锛屽崕姘�32-99) + ///4鍒跺喎鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) + ///5鍒剁儹鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) + ///6鑷姩鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) + ///7闄ゆ箍鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) + ///8妞掔饥鍋堝浣裤伔楂? 楂�4bit妯″紡(0 鍒跺喎锛�1鍒剁儹锛�2閫氶) 浣�4bit椋庨��(0 鑷姩锛�1楂橀?椋庯紝3浣庨) + ///9绌鸿皟寮�鍏� (1寮�0鍏�) + ///10璁剧疆妯″紡 0 鍒跺喎1鍒剁儹锛�2閫氶锛�3鑷姩锛�4闄ゆ箍 + ///11璁剧疆椋庨�� 0 鑷姩锛�1楂橀2涓锛�3浣庨 + ///12宸ヤ綔妯℃帶鍒舵俯鑲氭幃鎽勬皬0-30锛屽崕姘�32-86) + ///13鎵妯″紡锛氶珮4bit(瀹為檯鎵鐘舵�侊細0涓嶆壂椋庯紝1鎵)锛屼綆4bit(璁剧疆鎵妯″紡锛�0涓嶆壂椋庯紝1鎵) + ControlBytesSend(Command.SetACMode, function.bus.SubnetID, function.bus.DeviceID, new byte[] { function.bus.LoopId, + 0,0,0,0,0,0,0,onoff,mode,fan,temp,sanfan}); + break; case SPK.HvacFloorHeat:case SPK.FloorHeatStandard: var fhTemp = new FloorHeating(); @@ -656,8 +743,8 @@ var dicTempString = ""; commandDictionary.TryGetValue("set_temp", out dicTempString); var dicTemp = Convert.ToByte(dicTempString); - var mode = function.GetAttrState(FunctionAttributeKey.Mode); - switch (mode) + var mode22 = function.GetAttrState(FunctionAttributeKey.Mode); + switch (mode22) { case "day": function.Fh_Mode_Temp["day"] = dicTemp; diff --git a/HDL_ON/DAL/DriverLayer/Packet.cs b/HDL_ON/DAL/DriverLayer/Packet.cs index 19e93d7..167dcd0 100644 --- a/HDL_ON/DAL/DriverLayer/Packet.cs +++ b/HDL_ON/DAL/DriverLayer/Packet.cs @@ -53,8 +53,11 @@ /// </summary> public virtual void Manager() { +#if DEBUG +#else try - { + { +#endif //瀵逛簬鎿嶄綔鏁版嵁搴撶殑鏃堕棿姣旇緝闀跨殑锛屽彲浠ュ垱寤哄彟涓�涓嚎绋嬪鐞� if (!"HDLMIRACLE".Equals(Encoding.ASCII.GetString(Bytes, 4, 10))) { @@ -102,11 +105,15 @@ #endif //澶勭悊鏄惁瑕侀噸鍙戞暟鎹� ManagerReceive(subnetID, deviceID, command, usefulBytes); - } + +#if DEBUG +#else + } catch (Exception ex) { MainPage.Log($"packet {ex.Message} "); } +#endif } /// <summary> @@ -118,8 +125,11 @@ /// <param name="receiveBytes"></param> void UdpPacket_DataProcessing(byte subnetID, byte deviceID, Command command, byte[] receiveBytes) { +#if DEBUG +#else try { +#endif switch (command) { case Command.SetSingleLightACK: @@ -329,11 +339,18 @@ break; case Command.SetACModeACK: case Command.ReadACModeACK: - foreach (var function in FunctionList.List.GetAcList()) + foreach (var function in FunctionList.List.Functions) { + if (function.bus == null || function.spk != SPK.AcStandard) + { + continue; + } var acFunction = new AC(); - if (function.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0]) + if (function.bus.SubnetID == subnetID && + function.bus.DeviceID == deviceID && + function.bus.LoopId == receiveBytes[0]) { + Console.WriteLine(function.GetBusId()); function.SetAttrState(FunctionAttributeKey.TempType, receiveBytes[1].ToString()); function.SetAttrState(FunctionAttributeKey.RoomTemp, receiveBytes[2].ToString()); function.SetAttrState(FunctionAttributeKey.OnOff, receiveBytes[8] == 1 ? "on" : "off"); @@ -379,7 +396,7 @@ FunctionPage.UpdataStates(function); HomePage.UpdataFunctionStates(function); ClassificationPage.UpdataInfo(function); - Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(function.sid, function.status); + Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(function); } } @@ -652,7 +669,9 @@ } function.lastState = ""; - function.lastState += " " + function.GetAttrState(FunctionAttributeKey.SetTemp) + acFunction.GetTempUnitString(function); + function.lastState += acFunction.GetModeAttrText(function.GetAttrState(FunctionAttributeKey.Mode)) + + acFunction.GetModeAttrText(function.GetAttrState(FunctionAttributeKey.FanSpeed)) + + " " + function.GetAttrState(FunctionAttributeKey.SetTemp) + acFunction.GetTempUnitString(function); RoomPage.UpdataStates(function); FunctionPage.UpdataStates(function); HomePage.UpdataFunctionStates(function); @@ -726,11 +745,16 @@ } break; } - } + +#if DEBUG +#else + } catch (Exception ex) { MainPage.Log($"Bus Rev Erorr : {ex.Message}"); } +#endif + } /// <summary> /// byte杞�16杩涘埗瀛楃涓� diff --git a/HDL_ON/DAL/DriverLayer/UdpSocket.cs b/HDL_ON/DAL/DriverLayer/UdpSocket.cs index 4f78319..e358428 100644 --- a/HDL_ON/DAL/DriverLayer/UdpSocket.cs +++ b/HDL_ON/DAL/DriverLayer/UdpSocket.cs @@ -120,9 +120,12 @@ { return; } - try { + if (busSocket == null) + { + return; + } asyncBeginReceive(); Packet packet = (Packet)iar.AsyncState; int len = busSocket.EndReceiveFrom(iar, ref packet.RemoteEndPoint); @@ -137,10 +140,11 @@ { Control.Ins.ConvertReceiveData(bytes, ((IPEndPoint)packet.RemoteEndPoint).Address.ToString()); } - else if(((IPEndPoint)packet.RemoteEndPoint).Port == 6000)//澶勭悊bus 6000绔彛鐨勬暟鎹� + else if (((IPEndPoint)packet.RemoteEndPoint).Port == 6000)//澶勭悊bus 6000绔彛鐨勬暟鎹� { packet.Manager(); } + } catch (Exception ex) { diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs index bf89109..242ae06 100644 --- a/HDL_ON/DAL/Server/HttpServerRequest.cs +++ b/HDL_ON/DAL/Server/HttpServerRequest.cs @@ -44,6 +44,7 @@ /// <param name="qType">鏃堕棿鏌ヨ绫诲瀷锛歨our=杩�24灏忔椂銆亀eek=杩戜竴鍛ㄣ�乵onth = 杩戜竴鏈� </param> /// <param name="deviceId">璁惧ID</param> /// <param name="deviceKey">鍔熻兘鏌ヨ绫诲瀷锛歱m25</param> + /// <param name="time">鍏蜂綋鏌ヨ鐨勬棩鏈燂紝閲戣寕娓╂帶鍣ㄤ娇鐢�</param> /// <returns></returns> public ResponsePackNew GetSensorHistory(string qType, string deviceId, string deviceKey, string time = "") { @@ -2183,6 +2184,51 @@ var requestJson = HttpUtil.GetSignRequestJson(d); return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CancelCollectDevice, requestJson); } + /// <summary> + /// 璁惧鎵╁睍閰嶇疆 + /// </summary> + public ResponsePackNew DeviceExtSet(string deviceId,ExtSet extSet) + { + Dictionary<string, object> d = new Dictionary<string, object>(); + d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); + d.Add("deviceId", deviceId ); + d.Add("extSet", extSet); + + var requestJson = HttpUtil.GetSignRequestJson(d); + return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeviceExtSet, requestJson); + } + /// <summary> + /// 鑾峰彇璁惧娑堟伅瑙勫垯閰嶇疆 + /// </summary> + /// <returns></returns> + public ResponsePackNew GetDeviceMessageRulesSet(string deviceId) + { + Dictionary<string, object> d = new Dictionary<string, object>(); + d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); + d.Add("deviceId", deviceId); + + var requestJson = HttpUtil.GetSignRequestJson(d); + return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetDeviceMessageRulesSet, requestJson); + } + /// <summary> + /// 璁惧娑堟伅瑙勫垯閰嶇疆 + /// </summary> + /// <param name="deviceId"></param> + /// <param name="conditionIdentify"></param> + /// <param name="push"></param> + /// <returns></returns> + public ResponsePackNew DeviceMessageRulesSet(string deviceId,string conditionIdentify,bool push) + { + Dictionary<string, object> d = new Dictionary<string, object>(); + d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); + d.Add("deviceId", deviceId); + d.Add("conditionIdentify", conditionIdentify); + d.Add("push", push); + + var requestJson = HttpUtil.GetSignRequestJson(d); + return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeviceMessageRulesSet, requestJson); + } + #endregion diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs index 4917487..72fa068 100644 --- a/HDL_ON/DAL/Server/HttpUtil.cs +++ b/HDL_ON/DAL/Server/HttpUtil.cs @@ -17,8 +17,8 @@ /// 鍥哄畾鍩熷悕,姝e紡鐜 /// 鍏叡鍩熷悕灏辫繎瑙f瀽 /// </summary> - public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; - //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm + //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; + public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm /// <summary> /// RegionMark /// </summary> diff --git a/HDL_ON/DAL/Server/NewAPI.cs b/HDL_ON/DAL/Server/NewAPI.cs index 875b8b8..c74fae2 100644 --- a/HDL_ON/DAL/Server/NewAPI.cs +++ b/HDL_ON/DAL/Server/NewAPI.cs @@ -431,6 +431,18 @@ /// 璇诲彇鏈�杩戜竴涓湀鐨勬暟鎹� /// </summary> public const string Api_Post_SensorLastMonthHistoricalData = "/home-wisdom/app/statistics/device/monthDiff"; + /// <summary> + /// 璁惧鎵╁睍閰嶇疆 + /// </summary> + public const string Api_Post_DeviceExtSet = "/home-wisdom/app/device/deviceExtSet"; + /// <summary> + /// 鑾峰彇璁惧娑堟伅瑙勫垯閰嶇疆 + /// </summary> + public const string Api_Post_GetDeviceMessageRulesSet = "/home-wisdom/app/device/getDeviceMessageRulesSet"; + /// <summary> + /// 璁惧娑堟伅瑙勫垯閰嶇疆 + /// </summary> + public const string Api_Post_DeviceMessageRulesSet = "/home-wisdom/app/device/deviceMessageRulesSet"; #endregion #region Kaede -- 鍦烘櫙鎺ュ彛____________________________ diff --git a/HDL_ON/DAL/Server/NewApiRes.cs b/HDL_ON/DAL/Server/NewApiRes.cs index 177a663..1f2c5b9 100644 --- a/HDL_ON/DAL/Server/NewApiRes.cs +++ b/HDL_ON/DAL/Server/NewApiRes.cs @@ -1121,6 +1121,18 @@ } /// <summary> + /// 璁惧鎺ㄩ�佹秷鎭鍒� + /// </summary> + [Serializable] + public class DeviceMessageRules + { + public string homeId; + public string deviceId; + public string conditionIdentify; + public bool push; + } + + /// <summary> /// /// </summary> [System.Serializable] diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs index b173aa1..38b98be 100644 --- a/HDL_ON/Entity/Function/Function.cs +++ b/HDL_ON/Entity/Function/Function.cs @@ -403,7 +403,17 @@ /// </summary> public string modifyTime = ""; + /// <summary> + /// 鎵╁睍淇℃伅 + /// </summary> + public ExtSet extSet = new ExtSet(); + #endregion + + + //public void + + /// <summary> /// 寤舵椂 /// </summary> @@ -1029,6 +1039,27 @@ /// </summary> public const string dew_point_temp = "dew_point_temp"; /// <summary> + /// 琛ㄩ潰娓╁害 + /// </summary> + public const string surface_temp = "surface_temp"; + /// <summary> + /// 瀹ゅ唴婀垮害琛ュ伩鍊� + /// </summary> + public const string room_humidity_cc = "room_humidity_cc"; + /// <summary> + /// 瀹ゅ唴娓╁害琛ュ伩鍊� + /// </summary> + public const string room_temp_cc = "room_temp_cc"; + /// <summary> + /// 姣涚粏闃�闂� + /// </summary> + public const string cac_valve = "cac_valve"; + /// <summary> + /// 鍦版殩闃�闂� + /// </summary> + public const string fh_valve = "fh_valve"; + + /// <summary> /// value /// </summary> public const string Value = "value"; @@ -1133,6 +1164,7 @@ /// 鎵撳紑绛夌骇(椋庢墖) /// </summary> public const string OpenLevel = "openLevel"; + public const string fan_speed_percent = "fan_speed_percent"; /// <summary> /// 绾㈠鎸夐敭 /// </summary> @@ -1952,4 +1984,15 @@ /// </summary> public string desc = string.Empty; } + + /// <summary> + /// 鎵╁睍淇℃伅璁剧疆 + /// </summary> + public class ExtSet + { + /// <summary> + /// 鏄惁寮�鍚疄楠屽妯″紡 + /// </summary> + public bool labModel = false; + } } diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems index 7aedb1d..f2da282 100644 --- a/HDL_ON/HDL_ON.projitems +++ b/HDL_ON/HDL_ON.projitems @@ -506,6 +506,7 @@ <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\Visitor\TempPasswordInfo.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\Visitor\LpTimeDialogCallBak.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\Visitor\LpTipDialogCallBack.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ArmSensor\SensorMegahealth_AlarmDataStatisticsPage.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 87c90f9..0567578 100644 --- a/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs +++ b/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs @@ -166,7 +166,6 @@ case SPK.SenesorMegahealth: case SPK.SenesorMegahealth2: var smPage = new SenesorMegahealthPage(); - smPage.ShowColltionButton = false; smPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); break; case SPK.SensorGas: diff --git a/HDL_ON/UI/UI0-Stan/Logic/HdlDeviceStatuPushLogic.cs b/HDL_ON/UI/UI0-Stan/Logic/HdlDeviceStatuPushLogic.cs index 8ae3705..2264c3f 100644 --- a/HDL_ON/UI/UI0-Stan/Logic/HdlDeviceStatuPushLogic.cs +++ b/HDL_ON/UI/UI0-Stan/Logic/HdlDeviceStatuPushLogic.cs @@ -40,7 +40,7 @@ /// <param name="updateData">浜戠鎺ㄩ�佺殑鏇存柊鏁版嵁</param> public Function UpdateDeviceStatu(string sId ,List<AttributesStatus> updateData) { - var localDevice = FunctionList.List.GetDeviceFunctionList().Find((obj) => obj.sid == sId); + var localDevice = FunctionList.List.Functions.Find((obj) => obj.sid == sId); if (localDevice != null) { foreach (var attr in updateData) @@ -51,8 +51,19 @@ HdlFormLogic.Current.DeviceStatuPush(localDevice); } return localDevice; + } + + /// <summary> + /// 璁惧鐘舵�佹洿鏂� + /// </summary> + public Function UpdateDeviceStatu(Function function) + { + //鍏ㄩ儴鐣岄潰鎺ㄩ�� + HdlFormLogic.Current.DeviceStatuPush(function); + return function; } + #endregion } } diff --git a/HDL_ON/UI/UI1-Login/LoginPage.cs b/HDL_ON/UI/UI1-Login/LoginPage.cs index 3655638..0892b6e 100644 --- a/HDL_ON/UI/UI1-Login/LoginPage.cs +++ b/HDL_ON/UI/UI1-Login/LoginPage.cs @@ -218,6 +218,7 @@ //etAccount.Text = "13450425807";//榛勭婧� knx椤圭洰 etAccount.Text = "18244942707"; etAccount.Text = "tf@smarttech.com.ua"; + etAccount.Text = "13418062953"; } else { @@ -251,9 +252,9 @@ } b = !b; etPassword.Text = "123456"; - if(etAccount.Text == "15014291819") + if(etAccount.Text == "13418062953") { - etPassword.Text = "hdl123456"; + etPassword.Text = "a123456"; } //etPassword.Text = "Hdl85521566"; btnLogin.IsSelected = true; diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs index abf4b91..ebfe07b 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs @@ -63,7 +63,7 @@ case SPK.LightRGB: case SPK.LightRGBW: case SPK.LightCCT: - //case SPK.LightSwitch: + case SPK.LightSwitch: //绐楀笜 case SPK.CurtainSwitch: case SPK.CurtainRoller: diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs index 208a481..b2766cd 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs @@ -90,11 +90,11 @@ this.InitFrameWhiteContent1(); //鍒锋柊褰撳墠璁惧鐨勭姸鎬佺紦瀛� - this.RefreshNowDeviceStatuMemory(this.device); + //this.RefreshNowDeviceStatuMemory(this.device); //鍒锋柊鐣岄潰鐘舵�� this.RefreshFormStatu(); //璇诲彇鐘舵�� - Control.Ins.SendReadCommand(device); + Control.Ins.SendReadCommand(device); //new System.Threading.Thread(() => //{ // while (true) @@ -128,7 +128,9 @@ temp = 16; device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString()); } - + + + arcBar = new DiyArcSeekBar() { Gravity = Gravity.CenterHorizontal, @@ -171,7 +173,9 @@ Text = Convert.ToDouble(temp).ToString(), TextAlignment = TextAlignment.Center, }; + btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5); FrameWhiteCentet1.AddChidren(btnTemp); + btnTempUint = new Button() { @@ -193,7 +197,7 @@ Y = btnTemp.Bottom, Width = Application.GetRealWidth(120), Height = Application.GetRealHeight(20), - Text = Language.StringByID(StringId.IndoorTemp) + "20掳C", + Text = Language.StringByID(StringId.Indoor) + " 20掳C", TextColor = CSS_Color.PromptingColor1, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, }; @@ -871,7 +875,7 @@ if (this.device.sid != i_LocalDevice.sid) { return; } //鍒锋柊褰撳墠璁惧鐨勭姸鎬佺紦瀛� - this.RefreshNowDeviceStatuMemory(i_LocalDevice); + //this.RefreshNowDeviceStatuMemory(i_LocalDevice); //鍒锋柊鐣岄潰鐘舵�� this.RefreshFormStatu(); } @@ -910,6 +914,8 @@ controlTime = DateTime.Now; arcBar.Progress = temp; btnTemp.Text = temp.ToString(); + btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5); + btnTempUint.X = btnTemp.Right; device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString()); System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); d.Add(FunctionAttributeKey.SetTemp, temp.ToString()); @@ -938,6 +944,8 @@ controlTime = DateTime.Now; arcBar.Progress = temp; btnTemp.Text = temp.ToString(); + btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5); + btnTempUint.X = btnTemp.Right; device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString()); System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); d.Add(FunctionAttributeKey.SetTemp, temp.ToString()); @@ -959,6 +967,8 @@ { device.SetAttrState(FunctionAttributeKey.SetTemp, e.ToString()); btnTemp.Text = e.ToString(); + btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5); + btnTempUint.X = btnTemp.Right; }; //arcBar.MouseDownEventHandler = (sender, e) => { // Console.WriteLine("ddd"); @@ -1051,7 +1061,9 @@ } else { - btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp).Replace(",", "."))) + "掳C"; + //device = FunctionList.List.Functions.Find((obj) => obj.sid == device.sid); + + btnIndoorTemp.Text = Language.StringByID(StringId.Indoor) + " " + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp).Replace(",", "."))) + "掳C"; btnMode.SelectedImagePath = acFunction.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode)); btnSwing.SelectedImagePath = acFunction.GetSwingIconPath(device.GetAttrState(FunctionAttributeKey.Swing)); btnWindSpeed.SelectedImagePath = acFunction.GetFanIconPath(device.GetAttrState(FunctionAttributeKey.FanSpeed)); @@ -1062,7 +1074,9 @@ arcBar.Progress = temp; - btnTemp.Text = temp.ToString() ; + btnTemp.Text = temp.ToString(); + btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5); + btnTempUint.X = btnTemp.Right; if (device.trait_on_off.curValue.ToString() == "on") { @@ -1101,15 +1115,5 @@ #endregion - #region 鈻� 涓�鑸柟娉昣__________________________ - - /// <summary> - /// 鍒锋柊褰撳墠璁惧鐨勭姸鎬佺紦瀛� - /// </summary> - private void RefreshNowDeviceStatuMemory(Function i_LocalDevice) - { - } - - #endregion } } \ No newline at end of file diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacWeekHistoryPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacWeekHistoryPage.cs index 1f5553b..c5084de 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacWeekHistoryPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacWeekHistoryPage.cs @@ -20,7 +20,8 @@ /// room_humidity 婀垮害 /// </summary> string showType; - Dictionary<string, double> dataDic = new Dictionary<string, double>(); + Dictionary<string, double> dataDic = new Dictionary<string, double>(); + public CacWeekHistoryPage(Function device,string type) { bodyView = this; diff --git a/HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SenesorMegahealthPage.cs b/HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SenesorMegahealthPage.cs index 4aaf5eb..13e5034 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SenesorMegahealthPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SenesorMegahealthPage.cs @@ -3,6 +3,7 @@ using HDL_ON.UI.CSS; using HDL_ON.Entity; using System; +using HDL_ON.DAL.Server; namespace HDL_ON.UI { @@ -18,6 +19,11 @@ /// 鏂囨湰鎺т欢 /// </summary> private NormalViewControl btnSuctionView = null; + /// <summary> + /// 閫�鍑哄疄楠屽妯″紡鎺у埗鍖哄煙 + /// </summary> + FrameLayout exitLabView; + #endregion @@ -79,7 +85,7 @@ - //鍔犺浇鐬椂鍊� + var btnInstantaneousValue = new Button() { Gravity = Gravity.CenterHorizontal, @@ -103,16 +109,79 @@ }; FrameWhiteCentet1.AddChidren(btnInstantaneousValueText); EventHandler<MouseEventArgs> eventHandler = (sender, e) => { - //var page = new SocketPage_InstantaneousValue(function); - //MainPage.BasePageView.AddChidren(page); - //page.LoadPage(); - //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + var page = new SensorMegahealth_AlarmDataStatisticsPage(device); + MainPage.BasePageView.AddChidren(page); + page.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; btnInstantaneousValue.MouseUpEventHandler = eventHandler; btnInstantaneousValueText.MouseUpEventHandler = eventHandler; + exitLabView = new FrameLayout() + { + Y = Application.GetRealHeight(391), + Height = Application.GetRealHeight(135), + BackgroundColor = CSS_Color.MainBackgroundColor, + Visible = device.extSet.labModel, + }; + FrameWhiteCentet1.AddChidren(exitLabView); + + var labTipText = new Button() + { + Y = Application.GetRealHeight(10), + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(250), + Height = Application.GetRealHeight(50), + TextColor = CSS_Color.TextualColor, + TextID = StringId.LabTipText, + IsMoreLines = true, + TextAlignment = TextAlignment.CenterLeft, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + }; + exitLabView.AddChidren(labTipText); + + var btnExitLab = new Button() + { + Y = Application.GetRealHeight(75), + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(148), + Height = Application.GetRealHeight(40), + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.MainBackgroundColor, + IsBold = true, + Radius = (uint)Application.GetRealHeight(20), + TextSize = 16, + TextID = StringId.ExitLabModel, + BackgroundColor = CSS_Color.MainColor, + }; + exitLabView.AddChidren(btnExitLab); + btnExitLab.MouseUpEventHandler = (sender, e) => { + + new System.Threading.Thread(() => + { + device.extSet.labModel = false; + var result = new HttpServerRequest().DeviceExtSet(device.deviceId, device.extSet); + Application.RunOnMainThread(() => + { + if (result != null && result.Code == StateCode.SUCCESS) + { + exitLabView.Visible = false; + } + }); + }) + { IsBackground = true }.Start(); + }; + + base.SettionFinishEvent += () => { + exitLabView.Visible = device.extSet.labModel; + }; + + + } + + /// <summary> /// 鍒濆鍖栫浜屼釜绱㈠紩椤电殑鍐呭 @@ -169,7 +238,7 @@ else if (temp.state == "uninhabited")//鏃犱汉 { btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/UnderProtectionBgIcon.png"; - btnSuctionView.TextID = StringId.UnderProtection; + btnSuctionView.TextID = StringId.SensorNormalState; btnSuctionView.IsSelected = false; } else//鏈変汉 @@ -187,8 +256,10 @@ { if (temp.state == "true") { + btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/SomeoneInBgIcon.png"; btnIcon.IsSelected = true; - btnSuctionView.TextID = StringId.Someone; + btnIcon.IsSelected = false; + btnSuctionView.TextID = StringId.SomeoneIn; btnSuctionView.IsSelected = true; } else @@ -201,12 +272,67 @@ var tempStatus = device.attributes.Find((sta) => sta.key == FunctionAttributeKey.TargetStatus); if(tempStatus != null) { - if(tempStatus.state == "4") - { - btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/SomeoneFellBgIcon.png"; - btnSuctionView.TextID = StringId.SomeoneFell; - btnSuctionView.IsSelected = true; + + switch (tempStatus.state) + {//0绌猴紝1璧帮紝2璺戯紝3鍧愶紝4璺屽�掞紝5绔� + case "0": + btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/UnderProtectionBgIcon.png"; + btnIcon.IsSelected = true; + btnIcon.IsSelected = false; + btnSuctionView.TextID = StringId.SensorNormalState; + btnSuctionView.IsSelected = false; + break; + case "1": + btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/SomeoneInBgIcon.png"; + btnIcon.IsSelected = true; + btnIcon.IsSelected = false; + btnSuctionView.TextID = StringId.SomeoneIn; + btnSuctionView.IsSelected = true; + break; + case "2": + if (device.extSet.labModel) + { + btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/SomeoneRunBgIcon.png"; + btnIcon.IsSelected = true; + btnIcon.IsSelected = false; + btnSuctionView.TextID = StringId.SomeoneRunning; + btnSuctionView.IsSelected = true; + } + break; + case "3": + if (device.extSet.labModel) + { + btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/SomeoneSitBgIcon.png"; + btnIcon.IsSelected = true; + btnIcon.IsSelected = false; + btnSuctionView.TextID = StringId.SomeoneSitting; + btnSuctionView.IsSelected = true; + } + break; + case "4": + btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/SomeoneFellBgIcon.png"; + btnIcon.IsSelected = true; + btnIcon.IsSelected = false; + btnSuctionView.TextID = StringId.SomeoneFell; + btnSuctionView.IsSelected = true; + break; + case "5": + if (device.extSet.labModel) + { + btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/SomeoneStandBgIcon.png"; + btnIcon.IsSelected = true; + btnIcon.IsSelected = false; + btnSuctionView.TextID = StringId.SomeoneStanding; + btnSuctionView.IsSelected = true; + } + Console.WriteLine(btnSuctionView.Text); + break; + default: + + break; } + + } } } diff --git a/HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorMegahealth_AlarmDataStatisticsPage.cs b/HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorMegahealth_AlarmDataStatisticsPage.cs new file mode 100644 index 0000000..65fa200 --- /dev/null +++ b/HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorMegahealth_AlarmDataStatisticsPage.cs @@ -0,0 +1,270 @@ +锘縰sing System; +using System.Collections.Generic; +using HDL_ON.DAL.Server; +using HDL_ON.Entity; +using HDL_ON.UI.CSS; +using Shared; +namespace HDL_ON.UI +{ + public partial class SensorMegahealth_AlarmDataStatisticsPage : FrameLayout + { + + SensorMegahealth_AlarmDataStatisticsPage bodyView; + + FrameLayout showDataTypeView; + Button btnShowHistroyData_Day; + Button btnShowHistroyData_Week; + Button btnShowHistroyData_Month; + + FrameLayout historyDataView; + + MyEchartsViewOn myEchartsView; + + Sensor sensorTemp = new Sensor(); + + Function function; + List<Function> showFunctions; + List<Function> sensorList; + /// <summary> + /// 褰撳墠鏌ヨ绫诲瀷 + /// </summary> + string curQueryType = "hour"; + + List<string> tipColorStringList = new List<string>() + { + "#80AEFF","#FFD154","#FF9D54","#FE6A6A","#B183C3","#ADE764", + }; + + public SensorMegahealth_AlarmDataStatisticsPage(Function ss) + { + bodyView = this; + function = ss; + showFunctions = new List<Function>(); + showFunctions.Add(ss); + sensorList = FunctionList.List.GetEnvirSensorsList(); + } + + public void LoadPage() + { + bodyView.BackgroundColor = CSS_Color.BackgroundColor; + + VerticalScrolViewLayout contentView = new VerticalScrolViewLayout() + { + Y = Application.GetRealHeight(64), + Height = Application.GetRealHeight(600), + ScrollEnabled = false + }; + bodyView.AddChidren(contentView); + + contentView.AddChidren(new Button() { Height = Application.GetRealHeight(16) }); + + FrameLayout diagramView = new FrameLayout() + { + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(343), + Height = Application.GetRealWidth(450), + BackgroundColor = CSS_Color.MainBackgroundColor, + Radius = (uint)Application.GetRealWidth(12), + BorderColor = 0x00000000, + BorderWidth = 0, + }; + contentView.AddChidren(diagramView); + + #region 閫夋嫨鏁版嵁鏃ユ湡鑼冨洿 + showDataTypeView = new FrameLayout() + { + X = Application.GetRealWidth(183), + Y = Application.GetRealHeight(12), + Width = Application.GetRealWidth(144), + Height = Application.GetRealHeight(24), + BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg1.png", + }; + diagramView.AddChidren(showDataTypeView); + + btnShowHistroyData_Day = new Button() + { + Width = Application.GetRealWidth(48), + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.PromptingColor2, + SelectedTextColor = CSS_Color.MainColor, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + IsSelected = true, + TextID = StringId.day, + }; + showDataTypeView.AddChidren(btnShowHistroyData_Day); + + btnShowHistroyData_Week = new Button() + { + X = Application.GetRealWidth(48), + Width = Application.GetRealWidth(48), + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.PromptingColor2, + SelectedTextColor = CSS_Color.MainColor, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + TextID = StringId.week, + }; + showDataTypeView.AddChidren(btnShowHistroyData_Week); + + btnShowHistroyData_Month = new Button() + { + X = Application.GetRealWidth(48 * 2), + Width = Application.GetRealWidth(48), + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.PromptingColor2, + SelectedTextColor = CSS_Color.MainColor, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + Text = Language.StringByID(StringId.month),//DateTime.Now.Month.ToString() + + }; + showDataTypeView.AddChidren(btnShowHistroyData_Month); + #endregion + + historyDataView = new FrameLayout() + { + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealHeight(52), + Width = Application.GetRealWidth(343 - 22), + Height = Application.GetRealWidth(370), + }; + diagramView.AddChidren(historyDataView); + + myEchartsView = new MyEchartsViewOn(); + + historyDataView.AddChidren(myEchartsView); + + + contentView.AddChidren(new Button() { Height = Application.GetRealHeight(12) }); + + + new TopViewDiv(bodyView, Language.StringByID(StringId.AlarmDataStatistics)).LoadTopView(); + + LoadMothed_GetSensorHistoryData(); + LoadEvent_ChangeSensorHistoryShowType(); + } + } + + + //------------ + public partial class SensorMegahealth_AlarmDataStatisticsPage + { + /// <summary> + /// 璇诲彇浼犳劅鍣ㄥ巻鍙叉暟鎹� + /// </summary> + void LoadMothed_GetSensorHistoryData() + { + var loadPage = new Loading() + { + LodingBackgroundColor = 0x88888888, + }; + historyDataView.AddChidren(loadPage); + + new System.Threading.Thread(() => + { + try + { + Application.RunOnMainThread(() => { + loadPage.Start(Language.StringByID(StringId.PleaseWait)); + }); + int i = 0; + + var ebl = new EchartsOption_BrokenLine(); + + string yDataString = ""; + + foreach (var sr in showFunctions) + { + if (sr.spk != function.spk) + { + continue; + } + if (showFunctions.Find((obj) => obj.sid == sr.sid) == null) + { + i++; + continue; + } + + var sensorType = sr.spk.Split(".")[1]; + var queryType = sr.GetAttrState("spk").ToString(); + if (queryType == "0") + { + queryType = "value"; + } + + var revertObj = new HttpServerRequest().GetSensorHistory(curQueryType, sr.deviceId, "target_status"); + if (revertObj != null) + { + if (revertObj.Code == StateCode.SUCCESS) + { + var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<EnvironmentalSensorHistor>>(revertObj.Data.ToString()); + + if (i == 0) + { + List<string> vs = new List<string>(); + foreach (var data in revertData) + { + vs.Add(data.fieldName); + } + ebl.InitXdataText(vs); + } + yDataString += ebl.InitYdataText(sr.name, revertData, tipColorStringList[i]); + } + } + i++; + } + + + Application.RunOnMainThread(() => + { + myEchartsView.ShowWithOption(ebl.InitOption()); + }); + + } + catch (Exception ex) + { + MainPage.Log($"sensor history error : {ex.Message}"); + } + finally + { + Application.RunOnMainThread(() => { + loadPage.Hide(); + }); + } + }) + { IsBackground = true }.Start(); + } + + void LoadEvent_ChangeSensorHistoryShowType() + { + btnShowHistroyData_Day.MouseUpEventHandler = (sender, e) => + { + showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg1.png"; + btnShowHistroyData_Day.IsSelected = true; + btnShowHistroyData_Month.IsSelected = false; + btnShowHistroyData_Week.IsSelected = false; + curQueryType = "hour"; + LoadMothed_GetSensorHistoryData(); + }; + + btnShowHistroyData_Month.MouseUpEventHandler = (sender, e) => + { + showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg3.png"; + btnShowHistroyData_Day.IsSelected = false; + btnShowHistroyData_Month.IsSelected = true; + btnShowHistroyData_Week.IsSelected = false; + curQueryType = "month"; + LoadMothed_GetSensorHistoryData(); + }; + btnShowHistroyData_Week.MouseUpEventHandler = (sender, e) => + { + showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg2.png"; + btnShowHistroyData_Day.IsSelected = false; + btnShowHistroyData_Month.IsSelected = false; + btnShowHistroyData_Week.IsSelected = true; + curQueryType = "week"; + LoadMothed_GetSensorHistoryData(); + }; + + } + + + } +} \ No newline at end of file diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs index 0fc3660..ef576c6 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs @@ -20,7 +20,7 @@ return; bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = updateTemp.trait_on_off.curValue.ToString() == "on"; bodyView.barGradualChange.ProgressBarColor = updateTemp.trait_on_off.curValue.ToString() == "on" ? CSS.CSS_Color.MainColor : CSS.CSS_Color.PromptingColor2; - bodyView.barGradualChange.Progress = Convert.ToInt32(updateTemp.GetAttrState(FunctionAttributeKey.OpenLevel)); + bodyView.barGradualChange.Progress = Convert.ToInt32(updateTemp.GetAttrState(FunctionAttributeKey.fan_speed_percent)); } catch (Exception ex) { @@ -110,14 +110,13 @@ if (function.online) { - barGradualChange.OnProgressChangedEvent = (sender, e) => + barGradualChange.OnStopTrackingTouchEvent = (sender, e) => { - function.SetAttrState(FunctionAttributeKey.OpenLevel, e.ToString()); + function.SetAttrState(FunctionAttributeKey.fan_speed_percent, e.ToString()); new System.Threading.Thread(() => { - function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); - d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString()); + d.Add("fan_speed_percent", e.ToString()); Control.Ins.SendWriteCommand(function, d); }) { IsBackground = true }.Start(); diff --git a/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs b/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs index 7b0dd8e..9377363 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs @@ -1,5 +1,7 @@ 锘縰sing System; +using System.Collections.Generic; using HDL_ON.DAL.Server; +using HDL_ON.DriverLayer; using HDL_ON.Entity; using HDL_ON.UI.CSS; using Newtonsoft.Json.Linq; @@ -367,6 +369,8 @@ else if (function.spk == SPK.HvacCac) { + + #region 闇茬偣娓╁害 if (function.GetAttribute(FunctionAttributeKey.dew_point_temp) != null) { @@ -385,7 +389,7 @@ var btnText = new Button() { X = Application.GetRealWidth(16), - Width = Application.GetRealWidth(160), + Width = Application.GetRealWidth(260), TextAlignment = TextAlignment.CenterLeft, TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.SubheadingFontSize, @@ -406,14 +410,526 @@ #endregion + #region 琛ㄩ潰娓╁害 + if (function.GetAttribute(FunctionAttributeKey.surface_temp) != null) + { + contentView.AddChidren(new Button + { + Height = Application.GetRealHeight(10), + }); + + var surfaceTempRow = new FrameLayout() + { + Height = Application.GetRealHeight(55), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + contentView.AddChidren(surfaceTempRow); + + var btnSurfacaTempText = new Button() + { + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(260), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.SubheadingFontSize, + TextID = StringId.SurfaceTemperature, + }; + surfaceTempRow.AddChidren(btnSurfacaTempText); + + var btnSurfaceTempValue = new Button() + { + Width = Application.GetRealWidth(355), + TextAlignment = TextAlignment.CenterRight, + TextColor = CSS_Color.PromptingColor1, + TextSize = CSS_FontSize.TextFontSize, + Text = function.GetAttrState(FunctionAttributeKey.surface_temp) + "掳C", + }; + surfaceTempRow.AddChidren(btnSurfaceTempValue); + } + #endregion + + + #region 娓╁害鏍″噯 + if (function.GetAttribute(FunctionAttributeKey.room_temp_cc) != null) + { + contentView.AddChidren(new Button + { + Height = Application.GetRealHeight(10), + }); + + var tempCCrow = new FrameLayout() + { + Height = Application.GetRealHeight(55), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + contentView.AddChidren(tempCCrow); + + var btnTempCcText = new Button() + { + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(260), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.SubheadingFontSize, + TextID = StringId.TemperatureCalibration, + }; + tempCCrow.AddChidren(btnTempCcText); + + var btnTempCcValue = new Button() + { + Width = Application.GetRealWidth(335), + TextAlignment = TextAlignment.CenterRight, + TextColor = CSS_Color.PromptingColor1, + TextSize = CSS_FontSize.TextFontSize, + Text = function.GetAttrState(FunctionAttributeKey.room_temp_cc) + "掳C", + }; + tempCCrow.AddChidren(btnTempCcValue); + + var btnRightTempCc = new Button() + { + X = Application.GetRealWidth(339), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(16), + Height = Application.GetMinRealAverage(16), + UnSelectedImagePath = "Public/RightIcon.png", + }; + tempCCrow.AddChidren(btnRightTempCc); + + btnTempCcValue.MouseUpEventHandler = (sender, e) => + { + LoadEditDialog(-5, 5, Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.room_humidity_cc)), (reslut) => + { + btnTempCcValue.Text = reslut + "掳C"; + Dictionary<string, string> dic = new Dictionary<string, string>(); + dic.Add(FunctionAttributeKey.room_temp_cc, reslut); + Control.Ins.SendWriteCommand(function, dic); + }); + }; + } + #endregion + + + #region 婀垮害鏍″噯 + if (function.GetAttribute(FunctionAttributeKey.room_humidity_cc) != null) + { + contentView.AddChidren(new Button + { + Height = Application.GetRealHeight(10), + }); + + var humidityCCrow = new FrameLayout() + { + Height = Application.GetRealHeight(55), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + contentView.AddChidren(humidityCCrow); + + var btnHumidityCcText = new Button() + { + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(260), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.SubheadingFontSize, + TextID = StringId.HumidityCalibration, + }; + humidityCCrow.AddChidren(btnHumidityCcText); + + var btnHumidityCcValue = new Button() + { + Width = Application.GetRealWidth(335), + TextAlignment = TextAlignment.CenterRight, + TextColor = CSS_Color.PromptingColor1, + TextSize = CSS_FontSize.TextFontSize, + Text = function.GetAttrState(FunctionAttributeKey.room_humidity_cc) + "%", + }; + humidityCCrow.AddChidren(btnHumidityCcValue); + + + var btnRightHumidityCc = new Button() + { + X = Application.GetRealWidth(339), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(16), + Height = Application.GetMinRealAverage(16), + UnSelectedImagePath = "Public/RightIcon.png", + }; + humidityCCrow.AddChidren(btnRightHumidityCc); + + btnHumidityCcValue.MouseUpEventHandler = (sender, e) => + { + LoadEditDialog(-10, 10, Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.room_humidity_cc)), (reslut) => + { + btnHumidityCcValue.Text = reslut + "%"; + Dictionary<string, string> dic = new Dictionary<string, string>(); + dic.Add(FunctionAttributeKey.room_humidity_cc, reslut); + Control.Ins.SendWriteCommand(function, dic); + }); + }; + + } + #endregion + + + #region 姣涚粏闃�闂� + if (function.GetAttribute(FunctionAttributeKey.cac_valve) != null) + { + contentView.AddChidren(new Button + { + Height = Application.GetRealHeight(10), + }); + + var cacValveRow = new FrameLayout() + { + Height = Application.GetRealHeight(55), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + contentView.AddChidren(cacValveRow); + + var btnCacValveText = new Button() + { + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(260), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.SubheadingFontSize, + TextID = StringId.CapillaryValve, + }; + cacValveRow.AddChidren(btnCacValveText); + + var btnCacValvaValue = new Button() + { + Width = Application.GetRealWidth(355), + TextAlignment = TextAlignment.CenterRight, + TextColor = CSS_Color.PromptingColor1, + TextSize = CSS_FontSize.TextFontSize, + Text = function.GetAttrState(FunctionAttributeKey.cac_valve) + "掳C", + }; + cacValveRow.AddChidren(btnCacValvaValue); + } + #endregion + + #region 鍦版殩闃�闂� + if (function.GetAttribute(FunctionAttributeKey.fh_valve) != null) + { + contentView.AddChidren(new Button + { + Height = Application.GetRealHeight(10), + }); + + var fhValveRow = new FrameLayout() + { + Height = Application.GetRealHeight(55), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + contentView.AddChidren(fhValveRow); + + var btnFhValveText = new Button() + { + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(260), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.SubheadingFontSize, + TextID = StringId.FloorHeatingValve, + }; + fhValveRow.AddChidren(btnFhValveText); + + var btnFhValvaValue = new Button() + { + Width = Application.GetRealWidth(355), + TextAlignment = TextAlignment.CenterRight, + TextColor = CSS_Color.PromptingColor1, + TextSize = CSS_FontSize.TextFontSize, + Text = function.GetAttrState(FunctionAttributeKey.fh_valve), + }; + fhValveRow.AddChidren(btnFhValvaValue); + } + #endregion + } + else if(function.spk == SPK.SenesorMegahealth) + { + contentView.AddChidren(new Button + { + Height = Application.GetRealHeight(8), + }); + #region 鎺ㄩ�佸紑鍏� + var viewRow0 = new FrameLayout() + { + Height = Application.GetRealHeight(55), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + contentView.AddChidren(viewRow0); + + + var btnRowTitle0 = new Button() + { + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(160), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.SubheadingFontSize, + TextID = StringId.AlarmFunction, + }; + viewRow0.AddChidren(btnRowTitle0); + + var btnSwtichIcon0 = new Button() + { + X = Application.GetRealWidth(322), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(36), + Height = Application.GetMinRealAverage(36), + UnSelectedImagePath = "Public/Switch_2.png", + SelectedImagePath = "Public/SwitchOn_2.png", + }; + viewRow0.AddChidren(btnSwtichIcon0); + + DeviceMessageRules deviceMessageRules = new DeviceMessageRules() + { + deviceId = function.deviceId + }; + + btnSwtichIcon0.MouseUpEventHandler = (sender, e) => { + var push = btnSwtichIcon0.IsSelected = !btnSwtichIcon0.IsSelected; + new System.Threading.Thread(() => { + var result = new HttpServerRequest().DeviceMessageRulesSet(function.deviceId, deviceMessageRules.conditionIdentify, push);//璁剧疆鎺ㄩ�佷俊鎭� + Application.RunOnMainThread(() => + { + if (result != null && result.Code == StateCode.SUCCESS) + { + if (result.Data.ToString() == "true") + { + deviceMessageRules.push = push; + } + else + { + btnSwtichIcon0.IsSelected = deviceMessageRules.push; + } + } + else + { + btnSwtichIcon0.IsSelected = deviceMessageRules.push; + } + }); + }) + { IsBackground = true }.Start(); + }; + + + Loading waitView = new Loading(); + viewRow0.AddChidren(waitView); + new System.Threading.Thread(() => { + Application.RunOnMainThread(() => { + waitView.Start(""); + }); + var result = new HttpServerRequest().GetDeviceMessageRulesSet(function.deviceId); + //var result1 = new HttpServerRequest().DeviceMessageRulesSet(function.deviceId);//璁剧疆鎺ㄩ�佷俊鎭� + Application.RunOnMainThread(() => + { + if (result != null && result.Code == StateCode.SUCCESS && result.Data != null) + { + var data = Newtonsoft.Json.JsonConvert.DeserializeObject<List<DeviceMessageRules>>(result.Data.ToString()); + if (data.Count > 0) + { + deviceMessageRules = data[0]; + btnSwtichIcon0.IsSelected = deviceMessageRules.push; + } + } + else + { + btnSwtichIcon0.IsSelected = false; + } + waitView.Hide(); + waitView.RemoveFromParent(); + }); + }) + { IsBackground = true }.Start(); + + viewRow0.AddChidren(new Button() + { + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealHeight(54), + BackgroundColor = CSS_Color.DividingLineColor, + Width = Application.GetRealWidth(343), + Height = Application.GetRealHeight(1) + }); + #endregion + + #region 婕旂ず妯″紡 + var viewRow = new FrameLayout() + { + Height = Application.GetRealHeight(55), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + contentView.AddChidren(viewRow); + + + var btnRowTitle = new Button() + { + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(160), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.SubheadingFontSize, + TextID = StringId.LaboratoryMode, + }; + viewRow.AddChidren(btnRowTitle); + + var btnSwtichIcon = new Button() + { + X = Application.GetRealWidth(322), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(36), + Height = Application.GetMinRealAverage(36), + UnSelectedImagePath = "Public/Switch_2.png", + SelectedImagePath = "Public/SwitchOn_2.png", + IsSelected = function.extSet.labModel + }; + viewRow.AddChidren(btnSwtichIcon); + + btnSwtichIcon.MouseUpEventHandler = (sender, e) => + { + btnSwtichIcon.IsSelected = function.extSet.labModel = !btnSwtichIcon.IsSelected; + new System.Threading.Thread(() => + { + var result = new HttpServerRequest().DeviceExtSet(function.deviceId, function.extSet); + Application.RunOnMainThread(() => + { + if (result != null && result.Code == StateCode.SUCCESS) + { + if (Convert.ToBoolean( result.Data )) + { + function.extSet.labModel = btnSwtichIcon.IsSelected; + } + else + { + btnSwtichIcon.IsSelected = function.extSet.labModel = !btnSwtichIcon.IsSelected; + } + } + else + { + btnSwtichIcon.IsSelected = function.extSet.labModel = !btnSwtichIcon.IsSelected; + } + }); + }) + { IsBackground = true }.Start(); + }; + + #endregion + + } LoadEventList(); } + + /// <summary> + /// 鍔犺浇閫夋嫨寮圭獥 + /// </summary> + void LoadEditDialog(int min ,int max,int curValue,Action<string> action) + { + + List<string> pickerItems = new List<string>(); + + Dialog dialog = new Dialog(); + + var pView = new FrameLayout() + { + BackgroundColor = CSS_Color.DialogTransparentColor1, + }; + dialog.AddChidren(pView); + + var optionBaseView = new FrameLayout() + { + Y = Application.GetRealHeight(456 - 60), + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(343), + Height = Application.GetRealHeight(260), + AnimateSpeed = 0.3f, + Animate = Animate.DownToUp, + BackgroundColor = CSS_Color.MainBackgroundColor, + Radius = (uint)Application.GetRealWidth(12), + }; + pView.AddChidren(optionBaseView); + + var topView = new FrameLayout() + { + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(343), + Height = Application.GetRealHeight(40), + BackgroundColor = CSS_Color.MainBackgroundColor, + Radius = (uint)Application.GetRealWidth(12), + }; + optionBaseView.AddChidren(topView); + topView.AddChidren(new Button() { Y = Application.GetRealHeight(39), Height = Application.GetRealHeight(1), BackgroundColor = CSS_Color.DividingLineColor }); + + var btnCancel = new Button() + { + X = Application.GetRealWidth(21), + Width = Application.GetRealWidth(100), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.PromptingColor1, + TextSize = CSS_FontSize.TextFontSize, + TextID = StringId.Cancel, + }; + topView.AddChidren(btnCancel); + + var btnConfrim = new Button() + { + X = Application.GetRealWidth(160), + Width = Application.GetRealWidth(160), + TextAlignment = TextAlignment.CenterRight, + TextColor = CSS_Color.MainColor, + TextSize = CSS_FontSize.TextFontSize, + TextID = StringId.Confirm, + }; + topView.AddChidren(btnConfrim); + + UIPickerView uIPickerView = new UIPickerView() + { + Y = Application.GetRealHeight(40), + Height = Application.GetRealHeight(210), + Radius = (uint)Application.GetRealWidth(12), + }; + for (int i = min; i <= max; i += 1) + { + pickerItems.Add(i.ToString()); + } + uIPickerView.setNPicker(pickerItems, null, null); + optionBaseView.AddChidren(uIPickerView); + uIPickerView.setCurrentItems(pickerItems.IndexOf(curValue.ToString()), 4, 5); + + string selectItem = pickerItems[0]; + if (pickerItems.Contains(curValue.ToString())) + { + selectItem = curValue.ToString(); + } + + dialog.Show(); + + pView.MouseUpEventHandler = (sender, e) => { + dialog.Close(); + }; + + btnCancel.MouseUpEventHandler = (sender, e) => { + dialog.Close(); + }; + uIPickerView.OnSelectChangeEvent = (int1, int2, int3) => { + selectItem = pickerItems[int1]; + }; + btnConfrim.MouseUpEventHandler = (sender, e) => { + dialog.Close(); + action?.Invoke(selectItem); + }; + + } + + + } } diff --git a/HDL_ON/UI/UI2/FuntionControlView/Video/ObjectClass.cs b/HDL_ON/UI/UI2/FuntionControlView/Video/ObjectClass.cs index 384f58d..2cdae00 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Video/ObjectClass.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Video/ObjectClass.cs @@ -132,6 +132,11 @@ /// </summary> public string deviceName = string.Empty; /// <summary> + /// 鍖哄垎鏄媱鑰愬厠杩樻槸鑷爺 + /// 鐩墠鍙湁鑷爺鏈夊�硷細door.gate + /// </summary> + public string spk = string.Empty; + /// <summary> /// 璁惧id銆佸簭鍒楀彿銆乽uid /// </summary> public string deviceId = string.Empty; diff --git a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs index b6fa2c9..d13882a 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs @@ -5,11 +5,14 @@ using HDL_ON.Stan; using ZXing.QrCode.Internal; using static HDL_ON.UI.UI2.FuntionControlView.Video.VideoMethod; +using HDL_ON.UI.CSS; namespace HDL_ON.UI.UI2.FuntionControlView.Video { public class VideoMainView : FrameLayout { + List<Video> xiMoVideoList = new List<Video>(); + /// <summary> /// 鍔犺浇鍙瀵硅UI /// </summary> @@ -17,6 +20,7 @@ /// <param name="videoList">鍙瀵硅鍒楄〃</param> public void Show(List<CallView> listCall, List<Video> videoList) { + xiMoVideoList = videoList.FindAll((obj) => obj.spk == "door.gate"); #region 甯冨眬鐣岄潰 this.BackgroundColor = MusicColor.ViewColor; var topView = new TopView(); @@ -198,11 +202,17 @@ }; bjFl.AddChidren(vv); - bool bol = haveFlVideo(videoList); + bool bol = haveQRCodeVideo(videoList); if (bol) { //闂ㄧ浜岀淮鐮佸浐瀹氭湁鐨�,铏氭嫙涓�涓嚭鏉� - videoList.Add(new Video { deviceName = Language.StringByID(StringId.menjinerweima), interphoneType = "100" }); + videoList.Add(new Video { deviceName = Language.StringByID(StringId.menjinerweima), interphoneType = "100" ,devType = "100" }); + } + if (xiMoVideoList.Count > 0) + { + //寰樺緤鎶ヨ + videoList.Add(new Video { deviceName = Language.StringByID(StringId.WanderingAlarm), interphoneType = "222", devType = "222" }); + } //鏁扮粍涓暟 //int value = 15; @@ -277,16 +287,24 @@ var video2 = clickBtn.Tag as Video; if (video2.devType == "100") { - //闂ㄧ浜岀淮鐮佸浐瀹氭湁鐨� - VideoSend.GetQRcode(this, video2, (tag, paw) => - { - if (tag) - { - //娉ㄦ剰锛氬瘑鐮佹湁鍙兘寤舵椂1鍒嗛挓鐢熸晥 - View.ShowDialog showDialog = new View.ShowDialog(); - showDialog.QRcode(paw); - } - }); + ChooseVideoShowQRCode(); + + ////闂ㄧ浜岀淮鐮佸浐瀹氭湁鐨� + //VideoSend.GetQRcode(this, video2, (tag, paw) => + //{ + // if (tag) + // { + // //娉ㄦ剰锛氬瘑鐮佹湁鍙兘寤舵椂1鍒嗛挓鐢熸晥 + // View.ShowDialog showDialog = new View.ShowDialog(); + // showDialog.QRcode(paw); + // } + //}); + } + else if (video2.devType == "222") + { + ChooseAlarmShow(); + + } else { @@ -553,20 +571,273 @@ //鍒ゆ柇鏄惁鏈� 涓版灄鍙瀵硅 - private bool haveFlVideo(List<Video> videoList) + private bool haveQRCodeVideo(List<Video> videoList) { bool bol = false; for (int i = 0; i < videoList.Count; i++) { var _video = videoList[i]; - if (_video.interphoneType == "FLVI") + if (_video.interphoneType == "FLVI" || _video.spk == "door.gate") return true; } return bol; } + /// <summary> + /// 鑾峰彇闂ㄧ浜岀淮鐮� + /// </summary> + public void ChooseVideoShowQRCode() + { + Dialog dialog = new Dialog() + { + BackgroundColor = CSS_Color.DialogTransparentColor1, + }; + + FrameLayout dialogView = new FrameLayout(); + dialog.AddChidren(dialogView); + dialogView.MouseUpEventHandler = (sender, e) => { + dialog.Close(); + }; + + var contentView = new FrameLayout() + { + Gravity = Gravity.Center, + Width = Application.GetRealWidth(270), + Height = Application.GetRealHeight(200), + BackgroundColor = CSS_Color.MainBackgroundColor, + BorderColor = 0x00000000, + BorderWidth = 0, + Radius = (uint)Application.GetMinRealAverage(10), + }; + dialogView.AddChidren(contentView); + + var btnTitle = new Button() + { + Height = Application.GetRealHeight(64), + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.FirstLevelTitleColor, + TextID = StringId.menjinerweima, + TextSize = CSS_FontSize.SubheadingFontSize, + }; + contentView.AddChidren(btnTitle); + + var listView = new VerticalScrolViewLayout() + { + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealHeight(70), + Width = Application.GetRealWidth(230), + Height = Application.GetRealHeight(200), + }; + contentView.AddChidren(listView); + + //if (ximoVideoList.Count == 1) + { + Loading loading = new Loading(); + contentView.AddChidren(loading); + loading.Start(""); + new System.Threading.Thread(() => + { + try + { + var pack = VideoSend.GetQRcode(); + var pairs = Newtonsoft.Json.JsonConvert.DeserializeObject<List<AccessControlQRode>>(pack.Data.ToString()); + if (pairs.Count > 0) + { + Application.RunOnMainThread(() => + { + ImageView codeImage = new ImageView() + { + Gravity = Gravity.Center, + Height = Application.GetRealWidth(320), + Width = Application.GetRealWidth(320), + ImageBytes = Scan.BytesFromText(pairs[0].qrcode, Application.GetRealWidth(200), Application.GetRealWidth(200)), + }; + dialogView.AddChidren(codeImage); + }); + } + } + catch (Exception ex) + { + MainPage.Log($"鑾峰彇闂ㄧ浜岀淮鐮佸紓甯革細{ex.Message}"); + } + finally + { + Application.RunOnMainThread(() => + { + if (loading != null) + { + loading.Hide(); + loading.RemoveFromParent(); + } + }); + } + }) + { IsBackground = true }.Start(); + } + //else + //{ + + // foreach (var v in ximoVideoList) + // { + // Button btnMsg = new Button() + // { + // Gravity = Gravity.CenterHorizontal, + // Height = Application.GetRealHeight(50), + // Width = Application.GetRealHeight(160), + // TextAlignment = TextAlignment.Center, + // TextColor = CSS_Color.TextualColor, + // TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + // Text = v.deviceName, + // Radius = (uint)Application.GetRealWidth(5), + // BackgroundColor = CSS_Color.DividingLineColor, + // IsMoreLines = true, + // }; + // listView.AddChidren(btnMsg); + + // listView.AddChidren(new Button() { Height = Application.GetRealHeight(12) }); + + // btnMsg.MouseUpEventHandler = (sender, e) => + // { + + + // if (v.spk == "door.gate") + // { + + // return; + // } + + // //闂ㄧ浜岀淮鐮佸浐瀹氭湁鐨� + // VideoSend.GetQRcode(this, v, (tag, paw) => + // { + // if (tag) + // { + // //娉ㄦ剰锛氬瘑鐮佹湁鍙兘寤舵椂1鍒嗛挓鐢熸晥 + // View.ShowDialog showDialog = new View.ShowDialog(); + // showDialog.QRcode(paw); + // } + // }); + // dialog.Close(); + // }; + // } + //} + dialog.Show(); + + } + + + /// <summary> + /// 閫夋嫨寰樺緤鎶ヨ鍒楄〃鏄剧ず + /// </summary> + public void ChooseAlarmShow() + { + if (xiMoVideoList.Count == 1) + { + var wanderingAlarmPage = new WanderingAlarmPage(xiMoVideoList[0].deviceId); + MainPage.BasePageView.AddChidren(wanderingAlarmPage); + wanderingAlarmPage.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + + } + else + { + Dialog dialog = new Dialog() + { + BackgroundColor = CSS_Color.DialogTransparentColor1, + }; + + FrameLayout dialogView = new FrameLayout(); + dialog.AddChidren(dialogView); + dialogView.MouseUpEventHandler = (sender, e) => + { + dialog.Close(); + }; + + var contentView = new FrameLayout() + { + Gravity = Gravity.Center, + Width = Application.GetRealWidth(270), + Height = Application.GetRealHeight(280), + BackgroundColor = CSS_Color.MainBackgroundColor, + BorderColor = 0x00000000, + BorderWidth = 0, + Radius = (uint)Application.GetMinRealAverage(10), + }; + dialogView.AddChidren(contentView); + + var btnTitle = new Button() + { + Height = Application.GetRealHeight(64), + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.FirstLevelTitleColor, + TextID = StringId.WanderingAlarm, + TextSize = CSS_FontSize.SubheadingFontSize, + }; + contentView.AddChidren(btnTitle); + + var listView = new VerticalScrolViewLayout() + { + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealHeight(70), + Width = Application.GetRealWidth(230), + Height = Application.GetRealHeight(200), + }; + contentView.AddChidren(listView); + + + foreach (var v in xiMoVideoList) + { + Button btnMsg = new Button() + { + Gravity = Gravity.CenterHorizontal, + Height = Application.GetRealHeight(50), + Width = Application.GetRealHeight(160), + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.TextualColor, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + Text = v.deviceName, + Radius = (uint)Application.GetRealWidth(5), + BackgroundColor = CSS_Color.DividingLineColor, + IsMoreLines = true, + }; + listView.AddChidren(btnMsg); + + listView.AddChidren(new Button() { Height = Application.GetRealHeight(12) }); + + btnMsg.MouseUpEventHandler = (sender, e) => + { + + + var wanderingAlarmPage = new WanderingAlarmPage(v.deviceId); + MainPage.BasePageView.AddChidren(wanderingAlarmPage); + wanderingAlarmPage.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + + dialog.Close(); + }; + } + dialog.Show(); + } + + } + } + /// <summary> + /// 闂ㄧ浜岀淮鐮佹暟鎹� + /// </summary> + public class AccessControlQRode + { + public string title = string.Empty; + public string codeType = string.Empty; + public string userName = string.Empty; + public string houseFullName = string.Empty; + public string communityName = string.Empty; + public string desc = string.Empty; + public string businessType = string.Empty; + public string qrcode = string.Empty; + } + + } diff --git a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs index ae759bb..96acc51 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs @@ -3,6 +3,7 @@ using System.IO; using System.Net; using HDL_ON.DAL.Server; +using HDL_ON.Entity; using HDL_ON.UI.UI2.PersonalCenter.PirDevice; using Newtonsoft.Json.Linq; using Shared; @@ -82,6 +83,22 @@ } /// <summary> + /// 鑾峰彇闂ㄧ浜岀淮鐮侊紙鑷爺锛� + /// </summary> + /// <returns></returns> + public static ResponsePackNew GetQRcode() + { + var jobject = new JObject(); + jobject.Add("userId", UserInfo.Current.ID); + jobject.Add("userType", "C"); + jobject.Add("houseId", DB_ResidenceData.Instance.CurrentRegion.id); + jobject.Add("codeSecond", "60"); + var requestJson = HttpUtil.GetSignRequestJson(jobject);//鏁版嵁绛惧悕 + var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_OwnerQRCode, requestJson); + return revertObj; + } + + /// <summary> /// 涓婃姤鍔ㄦ�佸紑閿佸瘑鐮�(娉ㄦ剰锛氬瘑鐮佹湁鍙兘寤舵椂1鍒嗛挓鐢熸晥) /// </summary> public static void GetQRcode(FrameLayout frame, Video video, Action<bool, string> action) diff --git a/SiriIntents/Server/HttpUtil.cs b/SiriIntents/Server/HttpUtil.cs index f61de04..56a78a0 100644 --- a/SiriIntents/Server/HttpUtil.cs +++ b/SiriIntents/Server/HttpUtil.cs @@ -16,8 +16,8 @@ /// 鍥哄畾鍩熷悕,姝e紡鐜 /// 鍏叡鍩熷悕灏辫繎瑙f瀽 /// </summary> - public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; - //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm + //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; + public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm /// <summary> /// RegionMark /// </summary> -- Gitblit v1.8.0