From 270b3d8539f6b4a991a9ebf3b3a9eceb436d61d5 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期四, 28 十月 2021 17:08:02 +0800
Subject: [PATCH] 自动化地址问题修复
---
HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TopView.cs | 20 +-
HDL-ON_Android/Properties/AndroidManifest.xml | 2
HDL_ON/DAL/DriverLayer/UdpSocket.cs | 2
HDL_ON/UI/UI2/1-HomePage/HomePage.cs | 4
HDL-ON_Android/Assets/Language.ini | 2
HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs | 1
HDL_ON/UI/UI0-Stan/Controls/CompoundControls/DialogTitleMenuControl.cs | 11
HDL_ON/Common/ApiUtlis.cs | 1
HDL_ON/Entity/ResponseEntity/CityInfo.cs | 30 +-
HDL_ON/DAL/DriverLayer/A_Protocol_Common.cs | 22 ++
HDL_ON/UI/UI2/3-Intelligence/Automation/AddInputType.cs | 5
HDL-ON_iOS/Info.plist | 4
HDL-ON_iOS/Resources/Language.ini | 2
HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs | 8
HDL_ON/Common/Utlis.cs | 4
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs | 8
HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/MiniRemoteControl/AddMiniRemoteControlDirection3Page.cs | 6
.vs/HDL_APP_Project/xs/UserPrefs.xml | 75 ++----
HDL_ON/DAL/DriverLayer/Control.cs | 30 ++
HDL_ON/UI/MainPage.cs | 5
HDL-ON_Android/Application.cs | 2
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs | 23 ++
HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs | 9
HDL_ON/Entity/DB_ResidenceData.cs | 5
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AirFreshRelayControlPage.cs | 26 +
HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs | 8
HDL_ON/DAL/DriverLayer/Control_Udp.cs | 46 +++-
HDL-ON_iOS/Main.cs | 2
HDL_ON/Entity/FunctionList.cs | 109 +++++-----
HDL_ON/DAL/Server/HttpUtil.cs | 4
HDL_ON/Common/R.cs | 4
HDL_ON/DAL/Server/HttpServerRequest.cs | 57 +++++
HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs | 5
HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs | 31 +++
HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs | 2
35 files changed, 390 insertions(+), 185 deletions(-)
diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml
index 0eb9b07..7ee5297 100644
--- a/.vs/HDL_APP_Project/xs/UserPrefs.xml
+++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,55 +1,48 @@
锘�<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default">
- <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.6242be7109c740c6cb8999a8904b6e0ea8d45192" />
- <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/Common/Utlis.cs">
+ <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget" />
+ <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TopView.cs">
<Files>
- <File FileName="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs" Line="138" Column="39" />
- <File FileName="HDL_ON/DAL/Server/HttpUtil.cs" />
- <File FileName="HDL_ON/Common/ApiUtlis.cs" Line="265" Column="24" />
- <File FileName="HDL_ON/UI/UI1-Login/LoginPage.cs" Line="506" Column="21" />
- <File FileName="HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs" />
- <File FileName="HDL_ON/Entity/Function/Function.cs" />
- <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs" Line="52" Column="6" />
- <File FileName="HDL_ON/UI/UI1-Login/LoginPageBLL.cs" Line="509" Column="46" />
- <File FileName="HDL_ON/Common/Utlis.cs" Line="118" Column="39" />
+ <File FileName="HDL_ON/DAL/Server/HttpUtil.cs" Line="12" Column="26" />
+ <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs" />
+ <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/AddInputType.cs" />
+ <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TopView.cs" Line="100" Column="16" />
</Files>
<Pads>
<Pad Id="ProjectPad">
<State name="__root__">
<Node name="HDL_APP_Project" expanded="True">
<Node name="HDL_ON" expanded="True">
- <Node name="Common" expanded="True">
- <Node name="Utlis.cs" selected="True" />
- </Node>
+ <Node name="Common" expanded="True" />
<Node name="DAL" expanded="True">
- <Node name="Mqtt" expanded="True" />
+ <Node name="DriverLayer" expanded="True" />
+ <Node name="Server" expanded="True" />
</Node>
<Node name="Entity" expanded="True">
- <Node name="Function" expanded="True" />
+ <Node name="ResponseEntity" expanded="True" />
</Node>
<Node name="UI" expanded="True">
- <Node name="UI1-Login" expanded="True" />
<Node name="UI2" expanded="True">
- <Node name="2-Classification" expanded="True" />
- <Node name="FuntionControlView" expanded="True">
- <Node name="Energy" expanded="True" />
- <Node name="EnvironmentalScience" expanded="True" />
- </Node>
- </Node>
- </Node>
- </Node>
- <Node name="HDL-ON_Android" expanded="True">
- <Node name="Assets" expanded="True">
- <Node name="Phone" expanded="True">
- <Node name="FunctionIcon" expanded="True">
- <Node name="Icon" expanded="True">
- <Node name="HomeIcon" expanded="True" />
+ <Node name="3-Intelligence" expanded="True">
+ <Node name="Automation" expanded="True">
+ <Node name="LogicView" expanded="True">
+ <Node name="TopView.cs" selected="True" />
+ </Node>
</Node>
+ </Node>
+ <Node name="FuntionControlView" expanded="True">
+ <Node name="Curtain" expanded="True" />
+ <Node name="FoolHeating" expanded="True" />
</Node>
</Node>
</Node>
</Node>
<Node name="HDL-ON_iOS" expanded="True" />
</Node>
+ </State>
+ </Pad>
+ <Pad Id="MonoDevelop.Debugger.WatchPad">
+ <State>
+ <Value>this.Height</Value>
</State>
</Pad>
</Pads>
@@ -60,27 +53,11 @@
<String>Shared.Droid.TouchID/Shared.Droid.TouchID.csproj</String>
<String>Shared.IOS/Shared.IOS.csproj</String>
</DisabledProjects>
- <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
+ <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" />
<MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.364c4b3158493098" />
<MonoDevelop.Ide.DebuggingService.Breakpoints>
<BreakpointStore>
- <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/Electrical/IrFanPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/Electrical/IrFanPage.cs" line="42" column="1" />
- <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Mqtt/MqttClient.cs" relfile="HDL_ON/DAL/Mqtt/MqttClient.cs" line="431" column="1" />
- <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs" line="758" column="1" />
- <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferUserConfirmPage.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferUserConfirmPage.cs" line="106" column="1" />
- <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" line="481" column="1" />
- <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" line="541" column="1" />
- <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs" line="865" column="1" />
- <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Server/HttpServerRequest.cs" relfile="HDL_ON/DAL/Server/HttpServerRequest.cs" line="2691" column="1" />
- <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Server/HttpServerRequest.cs" relfile="HDL_ON/DAL/Server/HttpServerRequest.cs" line="2687" column="1" />
- <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/Entity/Function/Scene.cs" relfile="HDL_ON/Entity/Function/Scene.cs" line="322" column="1" />
- <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" line="798" column="1" />
- <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" line="852" column="11" />
- <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" line="837" column="12" />
- <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" line="835" column="12" />
- <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs" line="200" column="1" />
- <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/DriverLayer/Control.cs" relfile="HDL_ON/DAL/DriverLayer/Control.cs" line="727" column="1" />
- <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddInputPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddInputPage.cs" line="178" column="1" />
+ <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Server/HttpServerRequest.cs" relfile="HDL_ON/DAL/Server/HttpServerRequest.cs" line="1415" column="1" />
</BreakpointStore>
</MonoDevelop.Ide.DebuggingService.Breakpoints>
<MultiItemStartupConfigurations />
diff --git a/HDL-ON_Android/Application.cs b/HDL-ON_Android/Application.cs
index 4c277a1..52059fc 100644
--- a/HDL-ON_Android/Application.cs
+++ b/HDL-ON_Android/Application.cs
@@ -155,7 +155,7 @@
try
{
Shared.Application.LocationAction = null;
- new HDL_ON.DAL.Server.HttpServerRequest().GetCityInfo(lon.ToString(), lat.ToString());
+ new HDL_ON.DAL.Server.HttpServerRequest().GetCityWeatherInfo(lon.ToString(), lat.ToString());
//鍏抽棴瀹氫綅鏈嶅姟
Shared.Application.StopGPSLocationService();
}
diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini
index a5fa4b3..df14822 100644
--- a/HDL-ON_Android/Assets/Language.ini
+++ b/HDL-ON_Android/Assets/Language.ini
@@ -499,6 +499,7 @@
511=Combined dimming
512=Message push is not enabled, please go to settings.
513=Please enter the pairing code
+514=Gateway location information is not configured
1000=Room Humidity
1001=V-chip
@@ -1618,6 +1619,7 @@
511=缁勫悎璋冨厜
512=娑堟伅鎺ㄩ�佹湭寮�鍚紝璇峰墠寰�璁剧疆銆�
513=璇疯緭鍏ラ厤瀵圭爜
+514=鏈厤缃綉鍏充綅缃俊鎭�
1000=瀹ゅ唴婀垮害
diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml
index 0ca8872..9200e3f 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="202110191" android:versionName="1.2.202110191" package="com.hdl.onpro">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202110281" android:versionName="1.2.202110281" package="com.hdl.onpro">
<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="28" />
<!-- 涔愭鍙瀵硅闇�瑕佺殑鏉冮檺 -->
<!--<uses-permission android:name="android.permission.INTERNET" />-->
diff --git a/HDL-ON_iOS/Info.plist b/HDL-ON_iOS/Info.plist
index 763bdef..be3c8cc 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.2.202110201</string>
+ <string>1.2.202110281</string>
<key>CFBundleVersion</key>
- <string>1.2.10201</string>
+ <string>1.2.10281</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Use geographic location to provide services such as weather</string>
<key>NSAppleMusicUsageDescription</key>
diff --git a/HDL-ON_iOS/Main.cs b/HDL-ON_iOS/Main.cs
index 8ebc107..1c6b56e 100644
--- a/HDL-ON_iOS/Main.cs
+++ b/HDL-ON_iOS/Main.cs
@@ -16,7 +16,7 @@
try
{
Shared.Application.LocationAction = null;
- new HttpServerRequest().GetCityInfo(lon.ToString(), lat.ToString());
+ new HttpServerRequest().GetCityWeatherInfo(lon.ToString(), lat.ToString());
}
catch(Exception ex)
{
diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini
index a5fa4b3..df14822 100644
--- a/HDL-ON_iOS/Resources/Language.ini
+++ b/HDL-ON_iOS/Resources/Language.ini
@@ -499,6 +499,7 @@
511=Combined dimming
512=Message push is not enabled, please go to settings.
513=Please enter the pairing code
+514=Gateway location information is not configured
1000=Room Humidity
1001=V-chip
@@ -1618,6 +1619,7 @@
511=缁勫悎璋冨厜
512=娑堟伅鎺ㄩ�佹湭寮�鍚紝璇峰墠寰�璁剧疆銆�
513=璇疯緭鍏ラ厤瀵圭爜
+514=鏈厤缃綉鍏充綅缃俊鎭�
1000=瀹ゅ唴婀垮害
diff --git a/HDL_ON/Common/ApiUtlis.cs b/HDL_ON/Common/ApiUtlis.cs
index 0bb6e41..5ef087c 100644
--- a/HDL_ON/Common/ApiUtlis.cs
+++ b/HDL_ON/Common/ApiUtlis.cs
@@ -376,6 +376,7 @@
//閲嶆柊杩炴帴mqtt
DAL.Mqtt.MqttClient.DisConnectRemote("鍒锋柊鏁版嵁锛岄噸杩瀖qtt",false);
#endregion
+
}
}
})
diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs
index a09cbb6..b4a8bf3 100644
--- a/HDL_ON/Common/R.cs
+++ b/HDL_ON/Common/R.cs
@@ -6,6 +6,10 @@
{
/// <summary>
+ /// 鏈厤缃綉鍏冲湴鍧�淇℃伅
+ /// </summary>
+ public const int GatewayLocationInformationIsNotConfigured = 514;
+ /// <summary>
/// 璇疯緭鍏ラ厤瀵圭爜
/// </summary>
public const int PlsEntryPairCode = 513;
diff --git a/HDL_ON/Common/Utlis.cs b/HDL_ON/Common/Utlis.cs
index 37e1aa8..13a4af0 100644
--- a/HDL_ON/Common/Utlis.cs
+++ b/HDL_ON/Common/Utlis.cs
@@ -61,8 +61,10 @@
public static string PhoneForForeignRegexStr = "^[0-9]*$";
/// <summary>
/// 鐢ㄤ簬楠岃瘉閭姝e垯琛ㄨ揪寮�
+ /// 2021-10-21 11:07:44 鍚屾浜戠姝e垯鏍煎紡 --wxr
/// </summary>
- public static string EmailRegexStr = "^\\s*([A-Za-z0-9_-]+(\\.\\w+)*@(\\w+\\.)+\\w{2,5})\\s*$";
+ public static string EmailRegexStr = "^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*\\.[a-zA-Z0-9]{2,6}$";
+ //public static string EmailRegexStr = "^\\s*([A-Za-z0-9_-]+(\\.\\w+)*@(\\w+\\.)+\\w{2,5})\\s*$";
/// <summary>
/// 鍒ゆ柇鏄惁鍖呭惈澶у啓瀛楁瘝
diff --git a/HDL_ON/DAL/DriverLayer/A_Protocol_Common.cs b/HDL_ON/DAL/DriverLayer/A_Protocol_Common.cs
index 550bce8..b4c7484 100644
--- a/HDL_ON/DAL/DriverLayer/A_Protocol_Common.cs
+++ b/HDL_ON/DAL/DriverLayer/A_Protocol_Common.cs
@@ -122,6 +122,17 @@
}
/// <summary>
+ /// 鑾峰彇缃戝叧鐨勫姛鑳藉垪琛�
+ /// </summary>
+ public string GetGatewayFunctionList
+ {
+ get
+ {
+ return $"/user/{Control.Ins.GatewayId}/custom/device/list/get";
+ }
+ }
+
+ /// <summary>
/// 缃戝叧涓婃姤璁惧鐘舵��
/// 鍘绘帀id瀵规瘮
/// </summary>
@@ -145,6 +156,17 @@
}
/// <summary>
+ /// 缃戝叧杩涘叆閰嶇綉妯″紡
+ /// </summary>
+ public string AuthGateway
+ {
+ get
+ {
+ return $"/user/{Control.Ins.GatewayId}/custom/device/auth_gateway";
+ }
+ }
+
+ /// <summary>
/// 瀹夐槻鎺у埗
/// </summary>
public string ControlSeurity
diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs
index f0d20ac..686064e 100644
--- a/HDL_ON/DAL/DriverLayer/Control.cs
+++ b/HDL_ON/DAL/DriverLayer/Control.cs
@@ -279,6 +279,7 @@
else if (DB_ResidenceData.Instance.GatewayType == 1)
{
new Control_Udp().SearchLocalGateway();
+ new Control_Udp().SearchLocalGateway(true);
}
System.Threading.Thread.Sleep(500);
}
@@ -702,6 +703,21 @@
}
}
/// <summary>
+ /// 缃戝叧杩涘叆閰嶇綉妯″紡
+ /// </summary>
+ public void AuthGateway()
+ {
+ var objects1 = new { spk = "", time = "180" };
+ //{"objects":[{"spk":"","time":"180"}],"id":"8","time_stamp":"1635241216669"}
+ var sendId = Ins.msg_id.ToString();
+ var sendObj = new { objects = objects1, id = sendId, time_stamp = Utlis.GetTimestamp() };
+
+ var aLinkJson = Newtonsoft.Json.JsonConvert.SerializeObject(sendObj);
+ var sendBytes = Ins.ConvertSendBodyData(CommunicationTopic.ct.AuthGateway, aLinkJson);
+ new Control_Udp().SendLocalHdlLinkData(sendBytes, Ins.msg_id.ToString());
+ }
+
+ /// <summary>
/// 杞崲鍙戦�佹暟鎹�
/// </summary>
/// <param name="topic">涓婚</param>
@@ -723,7 +739,7 @@
//1.鎷兼帴澶�
string topicString = "Topic:" + topic + "\r\n";
//2.Body瀛楃涓茶浆涓篵yte鏁扮粍
- byte[] bodyBytes = Encoding.ASCII.GetBytes(bodyDataString);
+ byte[] bodyBytes = Encoding.UTF8.GetBytes(bodyDataString);
//鍒ゆ柇鏄惁闇�鍔犲瘑Body鏁版嵁
if (isEncryption && IsLocalEncryptAndGetAesKey)
{
@@ -734,7 +750,7 @@
//3.鎷兼帴body鐨凩ength闀垮害鏁版嵁
string lengthString = "Length:" + bodyBytes.Length.ToString() + "\r\n" + "\r\n";
string topicAndLengthString = topicString + lengthString;
- byte[] topicAndLengthBytes = Encoding.ASCII.GetBytes(topicAndLengthString);
+ byte[] topicAndLengthBytes = Encoding.UTF8.GetBytes(topicAndLengthString);
//4.鎷兼帴鍚堝苟 Topic 鍜� body鐨刡yte鏁扮粍鏁版嵁
byte[] sendDataBytes = new byte[topicAndLengthBytes.Length + bodyBytes.Length];
topicAndLengthBytes.CopyTo(sendDataBytes, 0);
@@ -750,10 +766,10 @@
/// 杞崲鎺ユ敹鍒扮殑鏁版嵁
/// </summary>
/// <returns></returns>
- public void ConvertReceiveData(byte[] receiveBytes)
+ public void ConvertReceiveData(byte[] receiveBytes,string ip)
{
var reString = Encoding.UTF8.GetString(receiveBytes);
- AnalysisReceiveData(reString, receiveBytes);
+ AnalysisReceiveData(reString, receiveBytes,ip);
}
/// <summary>
/// 杞崲鎺ユ敹鍒扮殑鏁版嵁
@@ -761,7 +777,7 @@
/// <param name="receiveString">杞琒tring鍚庣殑鏁版嵁</param>
/// <param name="originalReceiveBytes"鍘熷Bytes鏁版嵁</param>
/// <returns></returns>
- public LocalCommunicationData AnalysisReceiveData(string receiveString, byte[] originalReceiveBytes)
+ public LocalCommunicationData AnalysisReceiveData(string receiveString, byte[] originalReceiveBytes , string sIp = null)
{
LocalCommunicationData receiveObj = new LocalCommunicationData();
@@ -854,6 +870,10 @@
{
Ins.GatewayId = device.device_mac;
}
+ if (!string.IsNullOrEmpty(sIp))
+ {
+ device.ip_address = sIp;
+ }
reportIp = device.ip_address;//涓绘挱鍦板潃涔熻兘鎺у埗璁惧//"239.0.168.188";//
//2021-09-23 鏂板鑾峰彇褰撳墠缃戝叧鏄惁鏈湴鍔犲瘑
Ins.IsLocalEncrypt = device.isLocalEncrypt;
diff --git a/HDL_ON/DAL/DriverLayer/Control_Udp.cs b/HDL_ON/DAL/DriverLayer/Control_Udp.cs
index e5fb38e..5f929c0 100644
--- a/HDL_ON/DAL/DriverLayer/Control_Udp.cs
+++ b/HDL_ON/DAL/DriverLayer/Control_Udp.cs
@@ -978,7 +978,7 @@
UdpSocket._BusSocket.AsyncBeginSend(packet);
controlLostCount++;
}
- System.Threading.Thread.Sleep(300);
+ System.Threading.Thread.Sleep(1000);
}
}
catch (Exception ex)
@@ -1078,7 +1078,7 @@
/// <summary>
/// 璇诲彇缃戝叧IP
/// </summary>
- public void SearchLocalGateway()
+ public void SearchLocalGateway(bool broadcast = false)
{
try
{
@@ -1086,23 +1086,21 @@
var bodyString = JsonConvert.SerializeObject(sendJob);
var sendBytes = Control.Ins.ConvertSendBodyData(CommunicationTopic.SearchLoaclGateway, bodyString, false);
- //缁勬挱鍙戦��
- packet = new Packet(sendBytes, new System.Net.IPEndPoint(System.Net.IPAddress.Parse("239.0.168.188"), 8585));
+ if (broadcast)
+ {
+ //骞挎挱
+ packet = new Packet(sendBytes, new System.Net.IPEndPoint(System.Net.IPAddress.Parse("255.255.255.255"), 8585));
+ }
+ else
+ {
+ //缁勬挱鍙戦��
+ packet = new Packet(sendBytes, new System.Net.IPEndPoint(System.Net.IPAddress.Parse("239.0.168.188"), 8585));
+ }
packet.HaveSendCount = 4;
System.Threading.Thread thread = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(managerSendCount));
thread.IsBackground = true;
thread.Start(packet);
//wait();涓嶉渶瑕佺瓑寰�
-
-
-
-
- //hjSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
- //hjSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, true);
- //EndPoint ipep = new IPEndPoint(IPAddress.Parse(CsConst.myLocalIP), HDLUDP.UDPPort);
- //hjSocket.Bind(ipep);
-
-
}
catch (Exception ex)
@@ -1111,6 +1109,26 @@
}
}
+ /// <summary>
+ /// 璇诲彇缃戝叧IP
+ /// </summary>
+ public void SendLinkCommand(string topic,string bodyString)
+ {
+ try
+ {
+ var sendBytes = Control.Ins.ConvertSendBodyData(topic, bodyString, false);
+ //缁勬挱鍙戦��
+ packet = new Packet(sendBytes, new System.Net.IPEndPoint(System.Net.IPAddress.Parse("239.0.168.188"), 8585));
+ packet.HaveSendCount = 4;
+ System.Threading.Thread thread = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(managerSendCount));
+ thread.IsBackground = true;
+ thread.Start(packet);
+ }
+ catch (Exception ex)
+ {
+ MainPage.Log($"Send bus data error {ex.Message}");
+ }
+ }
/// <summary>
/// 鍙戦�乽dp A鍗忚鏁版嵁
diff --git a/HDL_ON/DAL/DriverLayer/UdpSocket.cs b/HDL_ON/DAL/DriverLayer/UdpSocket.cs
index 4946986..4f78319 100644
--- a/HDL_ON/DAL/DriverLayer/UdpSocket.cs
+++ b/HDL_ON/DAL/DriverLayer/UdpSocket.cs
@@ -135,7 +135,7 @@
//mqtt杩炴帴鏁版嵁璇诲彇 A鍗忚缃戠粶璁惧淇℃伅璇诲彇鍥炲 澶勭悊
if (((IPEndPoint)packet.RemoteEndPoint).Port == 8585)
{
- Control.Ins.ConvertReceiveData(bytes);
+ Control.Ins.ConvertReceiveData(bytes, ((IPEndPoint)packet.RemoteEndPoint).Address.ToString());
}
else if(((IPEndPoint)packet.RemoteEndPoint).Port == 6000)//澶勭悊bus 6000绔彛鐨勬暟鎹�
{
diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index aec2776..1fbd42c 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -1307,9 +1307,9 @@
#region 鑾峰彇澶╂皵閮ㄥ垎
/// <summary>
- /// 鑾峰彇鎸囧畾缁忕含搴︾殑鍩庡競淇℃伅
+ /// 鑾峰彇鎸囧畾缁忕含搴︾殑鍩庡競淇℃伅澶╂皵淇℃伅
/// </summary>
- public void GetCityInfo(string lon, string lat)
+ public void GetCityWeatherInfo(string lon, string lat)
{
System.Threading.Tasks.Task.Run(() =>
{
@@ -1372,6 +1372,59 @@
});
});
}
+ ///// <summary>
+ ///// 鑾峰彇鎸囧畾缁忕含搴︾殑鍩庡競淇℃伅
+ ///// </summary>
+ ///// <param name="lon"></param>
+ ///// <param name="lat"></param>
+ //public void GetCityInfo()
+ //{
+ // if (DB_ResidenceData.Instance.CurrentRegion.longitude == 0 && DB_ResidenceData.Instance.CurrentRegion.latitude == 0)
+ // {
+ // return;
+ // }
+ // string lon = DB_ResidenceData.Instance.CurrentRegion.longitude.ToString();
+ // string lat = DB_ResidenceData.Instance.CurrentRegion.latitude.ToString();
+ // System.Threading.Tasks.Task.Run(() =>
+ // {
+ // while (true)
+ // {
+ // var webClient = new WebClient();
+ // string url = $"https://developer.hdlcontrol.com/Weather/Weather/FindCity/?lon={lon}&lat={lat}";
+ // string responseString = null;
+ // try
+ // {
+ // responseString = Encoding.UTF8.GetString(webClient.DownloadData(url));
+ // }
+ // catch (Exception ex)
+ // {
+ // MainPage.Log(ex.Message);
+ // }
+
+ // if (responseString != null)
+ // {
+ // try
+ // {
+ // var revertObj = Newtonsoft.Json.JsonConvert.DeserializeObject<ResponsePack>(responseString);
+ // JObject jt = Newtonsoft.Json.JsonConvert.DeserializeObject<JObject>(revertObj.ResponseData.ToString());
+
+ // DB_ResidenceData.cityInfo.location = jt.GetValue("Location").ToString();
+ // DB_ResidenceData.cityInfo.province = jt.GetValue("Province").ToString();
+ // DB_ResidenceData.cityInfo.country = jt.GetValue("Country").ToString();
+ // DB_ResidenceData.cityInfo.timeZone = jt.GetValue("TimeZone").ToString();
+ // DB_ResidenceData.Instance.SaveResidenceData();
+
+ // return;
+ // }
+ // catch (Exception ex)
+ // {
+ // MainPage.Log($"get weather error : {ex.Message}");
+ // }
+ // }
+ // }
+ // });
+ //}
+
#endregion
diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs
index cf4a06a..d2292ee 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/Entity/DB_ResidenceData.cs b/HDL_ON/Entity/DB_ResidenceData.cs
index 7999151..7e9c6f8 100644
--- a/HDL_ON/Entity/DB_ResidenceData.cs
+++ b/HDL_ON/Entity/DB_ResidenceData.cs
@@ -256,6 +256,11 @@
}
+ ///// <summary>
+ ///// 鍩庡競淇℃伅
+ ///// </summary>
+ //public static Entity.CityInfo cityInfo = new Entity.CityInfo();
+
/// <summary>
/// 浣忓畢鍥剧墖
/// </summary>
diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs
index 593bb36..b76cae2 100644
--- a/HDL_ON/Entity/FunctionList.cs
+++ b/HDL_ON/Entity/FunctionList.cs
@@ -186,72 +186,79 @@
/// <para>false:鐩存帴鏃犳潯浠舵坊鍔�</para></param>
public void IniFunctionList(string filePath, bool checkRepeat = false)
{
- // todo 澧炲姞璁惧锛屽鍔犲姛鑳借繘鍔熻兘鍒楄〃
- if (filePath.StartsWith("FunctionData_"))
+ try
{
- var functionDataBytes = FileUtlis.Files.ReadFile(filePath);
- var functionDataString = System.Text.Encoding.UTF8.GetString(functionDataBytes);
- var tempFunction = Newtonsoft.Json.JsonConvert.DeserializeObject<Function>(functionDataString);
- if (tempFunction == null)
+ // todo 澧炲姞璁惧锛屽鍔犲姛鑳借繘鍔熻兘鍒楄〃
+ if (filePath.StartsWith("FunctionData_"))
{
- MainPage.Log("null");
- FileUtlis.Files.DeleteFile(filePath);
- return;
- }
- //闊充箰閮ㄥ垎瑕佷慨鏀�
- //if(tempFunction.spk.ToString() == SPK.MusicStandard)
- //{
- // UI.Music.A31MusicModel.A31MusicModelList.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<UI.Music.A31MusicModel>(functionDataString));
- //}
- if (checkRepeat == true)
- {
- //妫�娴嬮噸澶�
- for (int i = 0; i < Functions.Count; i++)
+ var functionDataBytes = FileUtlis.Files.ReadFile(filePath);
+ var functionDataString = System.Text.Encoding.UTF8.GetString(functionDataBytes);
+ var tempFunction = Newtonsoft.Json.JsonConvert.DeserializeObject<Function>(functionDataString);
+ if (tempFunction == null)
{
- if (Functions[i].deviceId == tempFunction.deviceId)
+ MainPage.Log("null");
+ FileUtlis.Files.DeleteFile(filePath);
+ return;
+ }
+ //闊充箰閮ㄥ垎瑕佷慨鏀�
+ //if(tempFunction.spk.ToString() == SPK.MusicStandard)
+ //{
+ // UI.Music.A31MusicModel.A31MusicModelList.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<UI.Music.A31MusicModel>(functionDataString));
+ //}
+ if (checkRepeat == true)
+ {
+ //妫�娴嬮噸澶�
+ for (int i = 0; i < Functions.Count; i++)
{
- //鍏堢Щ闄ゆ帀鍐嶅姞
- Functions.RemoveAt(i);
- Functions.Add(tempFunction);
- return;
+ if (Functions[i].deviceId == tempFunction.deviceId)
+ {
+ //鍏堢Щ闄ゆ帀鍐嶅姞
+ Functions.RemoveAt(i);
+ Functions.Add(tempFunction);
+ return;
+ }
}
}
+ Functions.Add(tempFunction);
}
- Functions.Add(tempFunction);
- }
- if (filePath.StartsWith("SceneData_"))
- {
- var sceneDataBytes = FileUtlis.Files.ReadFile(filePath);
- var sceneDataString = System.Text.Encoding.UTF8.GetString(sceneDataBytes);
- var tempScene = Newtonsoft.Json.JsonConvert.DeserializeObject<Scene>(sceneDataString);
- List.scenes.Add(tempScene);
- }
- else if (filePath.StartsWith("SecurityData_"))
- {
- var dataBytes = FileUtlis.Files.ReadFile(filePath);
- var dataString = System.Text.Encoding.UTF8.GetString(dataBytes);
- var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<SecurityAlarm>(dataString);
- if (temp == null)
+ if (filePath.StartsWith("SceneData_"))
{
- MainPage.Log("null");
- FileUtlis.Files.DeleteFile(filePath);
- return;
+ var sceneDataBytes = FileUtlis.Files.ReadFile(filePath);
+ var sceneDataString = System.Text.Encoding.UTF8.GetString(sceneDataBytes);
+ var tempScene = Newtonsoft.Json.JsonConvert.DeserializeObject<Scene>(sceneDataString);
+ List.scenes.Add(tempScene);
}
- if (checkRepeat == true)
+ else if (filePath.StartsWith("SecurityData_"))
{
- //妫�娴嬮噸澶�
- for (int i = 0; i < securities.Count; i++)
+ var dataBytes = FileUtlis.Files.ReadFile(filePath);
+ var dataString = System.Text.Encoding.UTF8.GetString(dataBytes);
+ var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<SecurityAlarm>(dataString);
+ if (temp == null)
{
- if (securities[i].sid == temp.sid)
+ MainPage.Log("null");
+ FileUtlis.Files.DeleteFile(filePath);
+ return;
+ }
+ if (checkRepeat == true)
+ {
+ //妫�娴嬮噸澶�
+ for (int i = 0; i < securities.Count; i++)
{
- //鍏堢Щ闄ゆ帀鍐嶅姞
- securities.RemoveAt(i);
- securities.Add(temp);
- return;
+ if (securities[i].sid == temp.sid)
+ {
+ //鍏堢Щ闄ゆ帀鍐嶅姞
+ securities.RemoveAt(i);
+ securities.Add(temp);
+ return;
+ }
}
}
+ securities.Add(temp);
}
- securities.Add(temp);
+ }
+ catch (Exception ex)
+ {
+ MainPage.Log($"IniFunctionList error : {ex.Message}");
}
}
diff --git a/HDL_ON/Entity/ResponseEntity/CityInfo.cs b/HDL_ON/Entity/ResponseEntity/CityInfo.cs
index 9a8a914..d5abdca 100644
--- a/HDL_ON/Entity/ResponseEntity/CityInfo.cs
+++ b/HDL_ON/Entity/ResponseEntity/CityInfo.cs
@@ -9,27 +9,27 @@
/// <summary>
/// 鍩庡競id
/// </summary>
- public string cid;
+ public string cid = string.Empty;
/// <summary>
/// 浣嶇疆
/// </summary>
- public string location;
+ public string location = string.Empty;
/// <summary>
/// 鍩庡競
/// </summary>
- public string city;
+ public string city = string.Empty;
/// <summary>
/// 鍖哄煙
/// </summary>
- public string province;
+ public string province = string.Empty;
/// <summary>
/// 鍥藉
/// </summary>
- public string country;
+ public string country = string.Empty;
/// <summary>
/// 鏃跺尯
/// </summary>
- public string timeZone;
+ public string timeZone = string.Empty;
/// <summary>
/// 鏈�浣庢俯
/// </summary>
@@ -50,27 +50,27 @@
/// <summary>
/// 澶╂皵鐘舵��
/// </summary>
- public string weather;
+ public string weather = string.Empty;
/// <summary>
/// 澶╂皵浠g爜
/// </summary>
- public string weatherCode;
+ public string weatherCode = string.Empty;
/// <summary>
/// 椋庨�熺瓑绾�
/// </summary>
- public string windLevel;
+ public string windLevel = string.Empty;
/// <summary>
/// 椋庡悜
/// </summary>
- public string windDir;
+ public string windDir = string.Empty;
//"UpdateTime": "0001-01-01T00:00:00",
- public string aqi;
+ public string aqi = string.Empty;
public string air_Quality = "--";
- public string pm10;
+ public string pm10 = string.Empty;
public string pm25 = "--";
- public string no2;
- public string so2;
- public string co;
+ public string no2 = string.Empty;
+ public string so2 = string.Empty;
+ public string co = string.Empty;
/*
*{"StateCode":"SUCCESS","ErrorInfo":null,"ResponseData":{"Temperature":"33","Humidity":"60","Weather":"澶氫簯","WeatherCode":"101",
diff --git a/HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs b/HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs
index 5708458..5266a87 100644
--- a/HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs
+++ b/HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs
@@ -62,7 +62,7 @@
/// <summary>
/// 浣忓畢鍦板潃
/// </summary>
- public string homeAddress { get; set; }
+ public string homeAddress = string.Empty;
/// <summary>
/// 鏄惁涓哄叾浠栦富鐢ㄦ埛鍒嗕韩杩囨潵鐨勪綇瀹�
/// </summary>
diff --git a/HDL_ON/UI/MainPage.cs b/HDL_ON/UI/MainPage.cs
index 7d6b90b..eb53385 100644
--- a/HDL_ON/UI/MainPage.cs
+++ b/HDL_ON/UI/MainPage.cs
@@ -25,7 +25,7 @@
/// <summary>
/// 鐗堟湰鍙�
/// </summary>
- public static string VersionString = "1.2.1019";
+ public static string VersionString = "1.2.1028";
///// <summary>
///// 瀹㈡埛绔被鍨�
///// </summary>
@@ -133,8 +133,6 @@
return _RoomNotSupportFunctionList;
}
}
-
-
public static void Show()
{
@@ -382,6 +380,7 @@
});
}
}).Start();
+
}
/// <summary>
diff --git a/HDL_ON/UI/UI0-Stan/Controls/CompoundControls/DialogTitleMenuControl.cs b/HDL_ON/UI/UI0-Stan/Controls/CompoundControls/DialogTitleMenuControl.cs
index 1b4a3dc..f22eb92 100644
--- a/HDL_ON/UI/UI0-Stan/Controls/CompoundControls/DialogTitleMenuControl.cs
+++ b/HDL_ON/UI/UI0-Stan/Controls/CompoundControls/DialogTitleMenuControl.cs
@@ -17,6 +17,10 @@
/// 鍒楄〃鎺т欢
/// </summary>
private VerticalListControl listView = null;
+ /// <summary>
+ /// 鍒楄〃鎺т欢鏄惁鑳芥粴鍔�
+ /// </summary>
+ private bool listViewScroll = false;
/// <summary>
/// 鏍囬(鍒濆鍖栦箣鍚庝細缃┖)
/// </summary>
@@ -41,9 +45,11 @@
/// <param name="i_title">鏍囬</param>
public DialogTitleMenuControl(int i_RowCount, string i_title)
{
- //鏈�澶ф樉绀�5涓�
- this.RowCount = i_RowCount > 5 ? 5 : i_RowCount;
+ //鏈�澶ф樉绀�5涓獄zy //4涓�傘�傛病鏈�5涓殑鑳屾櫙鍥緒xr
+ this.RowCount = i_RowCount > 4 ? 4 : i_RowCount;
+ this.listViewScroll = i_RowCount > 4;
this.StrTitle = i_title;
+ this.Height = Application.GetRealHeight(64 + 45 * this.RowCount);
}
/// <summary>
@@ -81,6 +87,7 @@
this.listView = new VerticalListControl();
listView.Y = rowTitle.Bottom;
listView.Height = this.RowCount * this.RowHeight;
+ listView.ScrollEnabled = this.listViewScroll;
this.AddChidren(listView);
}
diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
index 7de95a3..1c437a3 100644
--- a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
@@ -188,10 +188,10 @@
topView.AddChidren(btnResidenceName);
#if DEBUG
- //鎼滅储缃戝叧
+ int msdId = 111;
btnResidenceName.MouseUpEventHandler = (sender, e) =>
{
-
+ Control.Ins.AuthGateway();
};
#endif
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddInputType.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddInputType.cs
index 65f2bec..46264c7 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddInputType.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddInputType.cs
@@ -92,6 +92,11 @@
};
//瀹ゅ鍙樺寲
shiwaiView.btnClick.MouseUpEventHandler += (sen, e) => {
+ if (string.IsNullOrEmpty(Entity.DB_ResidenceData.Instance.CurrentRegion.homeAddress))//.longitude == 0 && Entity.DB_ResidenceData.Instance.CurrentRegion.latitude == 0)
+ {
+ new PublicAssmebly().TipMsg(StringId.tip, StringId.GatewayLocationInformationIsNotConfigured);
+ return;
+ }
Weather weather = new Weather();
MainPage.BasePageView.AddChidren(weather);
weather.Show();
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TopView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TopView.cs
index 4a2d600..fe8f4e1 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TopView.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TopView.cs
@@ -91,15 +91,15 @@
//鑾峰彇瀹藉害
int widthValue = topNameBtn.GetTextWidth();
int textWidth = (Application.GetRealWidth(255) - widthValue) / 2;
- Button locationBtn = new Button
- {
- Width = Application.GetRealWidth(18),
- Height = Application.GetRealWidth(18),
- X = Application.GetRealWidth(60 + 4) + textWidth + widthValue,
- Y = Application.GetRealHeight(34 + 1),
- UnSelectedImagePath = "LogicIcon/location.png",
- };
- frameLayout.AddChidren(locationBtn);
+ //Button locationBtn = new Button
+ //{
+ // Width = Application.GetRealWidth(18),
+ // Height = Application.GetRealWidth(18),
+ // X = Application.GetRealWidth(60 + 4) + textWidth + widthValue,
+ // Y = Application.GetRealHeight(34 + 1),
+ // UnSelectedImagePath = "LogicIcon/location.png",
+ //};
+ //frameLayout.AddChidren(locationBtn);
Button textBtn = new Button
{
@@ -107,7 +107,7 @@
Y = Application.GetRealHeight(57),
TextSize = LogicView.TextSize.text10,
TextColor = CSS.CSS_Color.textCancelColor,
- //Text = "骞夸笢骞垮窞甯傜暘绂哄尯鐭虫ゼ闀�",
+ Text = Entity.DB_ResidenceData.Instance.CurrentRegion.homeAddress ,// "骞夸笢骞垮窞甯傜暘绂哄尯鐭虫ゼ闀�",
};
frameLayout.AddChidren(textBtn);
}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs
index fb0a481..2181e67 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs
@@ -92,6 +92,11 @@
//鏃ュ嚭/鏃ヨ惤/姝e崍鐐瑰嚮浜嬩欢
timeSpecialView.btnClick.MouseUpEventHandler += (sen, e) =>
{
+ if (string.IsNullOrEmpty( Entity.DB_ResidenceData.Instance.CurrentRegion.homeAddress))//.longitude == 0 && Entity.DB_ResidenceData.Instance.CurrentRegion.latitude == 0)
+ {
+ new PublicAssmebly().TipMsg(StringId.tip, StringId.GatewayLocationInformationIsNotConfigured);
+ return;
+ }
SpeciaTime speciaTime = new SpeciaTime();
MainPage.BasePageView.AddChidren(speciaTime);
speciaTime.Show();
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs
index 62e3077..6795a57 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs
@@ -850,6 +850,7 @@
{
if (result == StateCode.SUCCESS)
{
+ serverScene.functions = scene.functions;
scene = serverScene;
FunctionList.List.scenes.Add(scene);
backAction();
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/MiniRemoteControl/AddMiniRemoteControlDirection3Page.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/MiniRemoteControl/AddMiniRemoteControlDirection3Page.cs
index 2332a70..2583809 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/MiniRemoteControl/AddMiniRemoteControlDirection3Page.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/MiniRemoteControl/AddMiniRemoteControlDirection3Page.cs
@@ -1,4 +1,5 @@
-锘縰sing HDL_ON.Stan;
+锘縰sing HDL_ON.DriverLayer;
+using HDL_ON.Stan;
using Shared;
using System;
using System.Collections.Generic;
@@ -152,6 +153,9 @@
return;
}
+ //2021-10-26 09:32:50 澧炲姞缃戝叧杩涘叆閰嶇綉妯″紡 wxr
+ Control.Ins.AuthGateway();
+
//杩涘叆涓嬩竴涓晫闈�
this.CloseForm();
var form = new AddMiniRemoteControlDirection4Page();
diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
index ab536d6..6a70e2c 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
@@ -51,7 +51,10 @@
AC acFunction = new AC();
-
+ /// <summary>
+ /// app鑷繁鎺у埗鐨勬俯搴︽暟鍊艰褰�
+ /// </summary>
+ List<string> seltControlTemp = new List<string>();
#endregion
@@ -814,11 +817,12 @@
return;
}
var temp = (int)Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp));
- if (temp <= device.GetAttribute(FunctionAttributeKey.Mode).min)
+ if (temp <= device.GetAttribute(FunctionAttributeKey.SetTemp).min)
{
return;
}
temp--;
+ seltControlTemp.Add(temp.ToString());
arcBar.Progress = temp;
btnTemp.Text = temp.ToString();
device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString());
@@ -838,6 +842,7 @@
return;
}
temp++;
+ seltControlTemp.Add(temp.ToString());
arcBar.Progress = temp;
btnTemp.Text = temp.ToString();
device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString());
@@ -941,7 +946,18 @@
btnMode.UnSelectedImagePath = acFunction.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode),false);
btnSwing.UnSelectedImagePath = acFunction.GetSwingIconPath(device.GetAttrState(FunctionAttributeKey.Swing),false);
btnWindSpeed.UnSelectedImagePath = acFunction.GetFanIconPath(device.GetAttrState(FunctionAttributeKey.FanSpeed),false);
- arcBar.Progress = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp)));
+ var updataTemp = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp)));
+
+ //app鑷繁鎺у埗鐨勪笉鐢ㄦ洿鏂帮紝浼氶�犳垚璺冲姩
+ if (seltControlTemp.Contains(updataTemp.ToString()))
+ {
+ seltControlTemp.Remove(updataTemp.ToString());
+ }
+ else
+ {
+ arcBar.Progress = updataTemp;
+ }
+
if (device.trait_on_off.curValue.ToString() == "on")
{
btnMode.IsSelected = btnSwing.IsSelected = btnWindSpeed.IsSelected = true;
@@ -965,6 +981,7 @@
arcBar.IsClickable = false;
arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png";
}
+
});
}
diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AirFreshRelayControlPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AirFreshRelayControlPage.cs
index 51d665c..3f665d1 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AirFreshRelayControlPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AirFreshRelayControlPage.cs
@@ -142,18 +142,10 @@
var menuContr = new DialogTitleMenuControl(valueCount, Language.StringByID(StringId.FanSpeed));
//menuContr.X = Application.GetRealWidth(209);
menuContr.Gravity = Gravity.CenterHorizontal;
- menuContr.Y = Application.GetRealHeight(231);
menuContr.Width = Application.GetRealWidth(160);
- if (valueCount > 2)
- {
- menuContr.Height = Application.GetRealHeight(199);
- }
- else
- {
- menuContr.Height = Application.GetRealHeight(154);
- }
dialogBody.AddChidren(menuContr);
+ int count = 0;
foreach(var fanAttrValue in fanAttr.value)
{
bool isSelecte = false;
@@ -188,7 +180,22 @@
isSelecte = true;
}
}
+ else if(fanAttrValue == "auto")
+ {
+ text = Language.StringByID(StringId.Auto);
+ iconPath = "FunctionIcon/AirFresh/Fan2.png";
+ if (this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "auto" )
+ {
+ iconPath = "FunctionIcon/AirFresh/Fan2Select.png";
+ isSelecte = true;
+ }
+ }
+ else
+ {
+ continue;
+ }
+ count++;
menuContr.AddRowMenu(text, iconPath, isSelecte, () =>
{
frameBack.Close();
@@ -196,6 +203,7 @@
this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, fanAttrValue);
});
}
+ menuContr.Y = Application.GetRealHeight(231 - (46 * (count-3)));
}
diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs
index 57fe38e..07ee250 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs
@@ -484,6 +484,14 @@
arcBar.IsClickable = false;
arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png";
}
+ //鑷姩妯″紡涓嶅厑璁歌皟娓╁害 2021-10-27 09:41:35 wxr 闄堢惓鍙嶉
+ if (device.GetAttrState(FunctionAttributeKey.Mode) == "auto")
+ {
+ btnPlus.Enable = false;
+ btnMinus.Enable = false;
+ arcBar.IsClickable = false;
+ arcBar.IsOffline = true;
+ }
});
}
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs
index af394c5..7638d01 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs
@@ -64,24 +64,24 @@
{
if (runningDirection)
{
- if (curtainSeekBar.Progress + 10 > progress)
+ if (curtainSeekBar.Progress + 5 > progress)
{
curtainSeekBar.Progress = progress;
}
else
{
- curtainSeekBar.Progress = curtainSeekBar.Progress + 10;
+ curtainSeekBar.Progress = curtainSeekBar.Progress + 5;
}
}
else
{
- if (curtainSeekBar.Progress - 10 < progress)
+ if (curtainSeekBar.Progress - 5 < progress)
{
curtainSeekBar.Progress = progress;
}
else
{
- curtainSeekBar.Progress = curtainSeekBar.Progress - 10;
+ curtainSeekBar.Progress = curtainSeekBar.Progress - 5;
}
}
curBarProgress = curtainSeekBar.Progress;
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs
index a1a2aa8..25b967f 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs
@@ -61,24 +61,24 @@
{
if (runningDirection)
{
- if (curtainSeekBar.Progress + 10 > progress)
+ if (curtainSeekBar.Progress + 5 > progress)
{
curtainSeekBar.Progress = progress;
}
else
{
- curtainSeekBar.Progress = curtainSeekBar.Progress + 10;
+ curtainSeekBar.Progress = curtainSeekBar.Progress + 5;
}
}
else
{
- if (curtainSeekBar.Progress - 10 < progress)
+ if (curtainSeekBar.Progress - 5 < progress)
{
curtainSeekBar.Progress = progress;
}
else
{
- curtainSeekBar.Progress = curtainSeekBar.Progress - 10;
+ curtainSeekBar.Progress = curtainSeekBar.Progress - 5;
}
}
curBarProgress = curtainSeekBar.Progress;
diff --git a/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs b/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs
index b90cd61..7eacd06 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs
@@ -2,6 +2,7 @@
using Shared;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
+using System.Collections.Generic;
namespace HDL_ON.UI
{
@@ -72,6 +73,14 @@
/// </summary>
Action actionRefresh;
#endregion
+
+
+ /// <summary>
+ /// app鑷繁鎺у埗鐨勬俯搴︽暟鍊艰褰�
+ /// </summary>
+ List<string> seltControlTemp = new List<string>();
+
+
public FloorHeatingPage(Function func)
{
bodyView = this;
diff --git a/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs
index ac2dad9..5a8281e 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs
@@ -38,6 +38,18 @@
// bodyView.arcBar.IsOffline = true;
//}
+
+ //app鑷繁鎺у埗鐨勪笉鐢ㄦ洿鏂帮紝浼氶�犳垚璺冲姩
+ if (bodyView.seltControlTemp.Contains(outinTemp.ToString()))
+ {
+ bodyView.seltControlTemp.Remove(outinTemp.ToString());
+ }
+ else
+ {
+ bodyView.arcBar.Progress = outinTemp;
+ }
+
+
if (updateTemp.trait_on_off.curValue.ToString() == "on")
{
bodyView.btnMode.IsSelected = true;
@@ -61,7 +73,14 @@
bodyView.arcBar.IsClickable = false;
bodyView.arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png";
}
-
+ //鑷姩妯″紡涓嶅厑璁歌皟娓╁害 2021-10-27 09:41:35 wxr 闄堢惓鍙嶉
+ if (updateTemp.GetAttrState(FunctionAttributeKey.Mode) == "auto"|| updateTemp.GetAttrState(FunctionAttributeKey.Mode) == "timer")
+ {
+ bodyView.btnPlus.Enable = false;
+ bodyView.btnMinus.Enable = false;
+ bodyView.arcBar.IsClickable = false;
+ bodyView.arcBar.IsOffline = true;
+ }
});
}
@@ -83,6 +102,14 @@
btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = function.GetRoomListName();
//function.SaveFunctionData(true);
};
+ //鑷姩妯″紡涓嶅厑璁歌皟娓╁害 2021-10-27 09:41:35 wxr 闄堢惓鍙嶉
+ if (function.GetAttrState(FunctionAttributeKey.Mode) == "auto" || function.GetAttrState(FunctionAttributeKey.Mode) == "timer")
+ {
+ btnPlus.Enable = false;
+ btnMinus.Enable = false;
+ arcBar.IsClickable = false;
+ arcBar.IsOffline = true;
+ }
}
/// <summary>
@@ -115,6 +142,7 @@
return;
}
temp--;
+ seltControlTemp.Add(temp.ToString());
arcBar.Progress = temp;
function.SetAttrState(FunctionAttributeKey.SetTemp, temp);
btnTemp.Text = temp.ToString();
@@ -134,6 +162,7 @@
return;
}
temp++;
+ seltControlTemp.Add(temp.ToString());
arcBar.Progress = temp;
btnTemp.Text = temp.ToString();
function.SetAttrState(FunctionAttributeKey.SetTemp, temp);
--
Gitblit v1.8.0