.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 /> 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(); } 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=室内湿度 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" />--> 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> 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) { 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=室内湿度 HDL_ON/Common/ApiUtlis.cs
@@ -376,6 +376,7 @@ //重新连接mqtt DAL.Mqtt.MqttClient.DisConnectRemote("刷新数据,重连mqtt",false); #endregion } } }) HDL_ON/Common/R.cs
@@ -6,6 +6,10 @@ { /// <summary> /// 未配置网关地址信息 /// </summary> public const int GatewayLocationInformationIsNotConfigured = 514; /// <summary> /// 请输入配对码 /// </summary> public const int PlsEntryPairCode = 513; HDL_ON/Common/Utlis.cs
@@ -61,8 +61,10 @@ public static string PhoneForForeignRegexStr = "^[0-9]*$"; /// <summary> /// 用于验证邮箱正则表达式 /// 2021-10-21 11:07:44 同步云端正则格式 --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> /// 判断是否包含大写字母 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 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字符串转为byte数组 byte[] bodyBytes = Encoding.ASCII.GetBytes(bodyDataString); byte[] bodyBytes = Encoding.UTF8.GetBytes(bodyDataString); //判断是否需加密Body数据 if (isEncryption && IsLocalEncryptAndGetAesKey) { @@ -734,7 +750,7 @@ //3.拼接body的Length长度数据 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的byte数组数据 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">转String后的数据</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; 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> /// 发送udp A协议数据 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端口的数据 { 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 HDL_ON/DAL/Server/HttpUtil.cs
@@ -17,8 +17,8 @@ /// 固定域名,正式环境 /// 公共域名就近解析 /// </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> HDL_ON/Entity/DB_ResidenceData.cs
@@ -256,6 +256,11 @@ } ///// <summary> ///// 城市信息 ///// </summary> //public static Entity.CityInfo cityInfo = new Entity.CityInfo(); /// <summary> /// 住宅图片 /// </summary> 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}"); } } 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> /// 天气代码 /// </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", HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs
@@ -62,7 +62,7 @@ /// <summary> /// 住宅地址 /// </summary> public string homeAddress { get; set; } public string homeAddress = string.Empty; /// <summary> /// 是否为其他主用户分享过来的住宅 /// </summary> 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> 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个zzy //4个。。没有5个的背景图wxr 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); } 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 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(); 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); } HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs
@@ -92,6 +92,11 @@ //日出/日落/正午点击事件 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(); 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(); HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/MiniRemoteControl/AddMiniRemoteControlDirection3Page.cs
@@ -1,4 +1,5 @@ using HDL_ON.Stan; using 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(); 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"; } }); } 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))); } 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; } }); } 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; 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; 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; 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);