From 05a85abd55bf6930a16f742abd9480efe33303df Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 16 十一月 2022 16:05:15 +0800
Subject: [PATCH] 1.6.2更新
---
HDL-ON_Android/Properties/AndroidManifest.xml | 2
HDL-ON_Android/Assets/Language.ini | 7
HDL_ON/Common/ApiUtlis.cs | 69 +-----
HDL_ON/UI/UI2/2-Classification/SceneControlZone.cs | 65 ++++++
HDL_ON/Entity/FunctionList.cs | 1
HDL_ON/UI/UI2/FuntionControlView/Light/LightScene/AddLightScene.cs | 378 ++++++++++++++++++++++---------------
HDL-ON_iOS/Info.plist | 4
HDL-ON_iOS/Resources/Language.ini | 7
HDL_ON/Common/HDLCommon.cs | 2
HDL_ON/DAL/Server/HttpUtil.cs | 4
HDL_ON/Common/R.cs | 4
HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubPage.cs | 6
HDL_ON/UI/UI1-Login/LoginPage.cs | 1
SiriIntents/Server/HttpUtil.cs | 4
14 files changed, 333 insertions(+), 221 deletions(-)
diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini
index c10bcf2..290b50b 100644
--- a/HDL-ON_Android/Assets/Language.ini
+++ b/HDL-ON_Android/Assets/Language.ini
@@ -564,6 +564,7 @@
577=Close
578=Mechanical Arm
579=Cancellation
+580=Are you sure to delete this combined dimming?
@@ -1793,6 +1794,7 @@
577=闃�闂ㄥ凡鎵撳紑
578=鏈烘鎵�
579=绔嬪嵆娉ㄩ攢
+580=纭畾鍒犻櫎璇ョ粍鍚堣皟鍏夊悧锛�
@@ -2999,7 +3001,7 @@
577=袟邪泻褉褘褌褜
578=Mechanical Arm
579=Cancellation
-
+580=Are you sure to delete this combined dimming?
2532=Visitor Invitation Record
2533=Visitor management
@@ -4212,6 +4214,8 @@
577=Cerrar
578=Mechanical Arm
579=Cancellation
+580=Are you sure to delete this combined dimming?
+
2532=Visitor Invitation Record
2533=Visitor management
@@ -5409,6 +5413,7 @@
576=袨褌胁芯褉械薪芯
577=袟邪褌胁芯褉懈
579=Cancellation
+580=Are you sure to delete this combined dimming?
1000=袙谢邪卸薪芯褋褌 胁 褋褌邪褟褌邪
diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml
index 87ace86..33f42a4 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.6.2" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202211111">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.6.2" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202211161">
<uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" />
<!--鍙嬬洘-->
<!--<uses-sdk android:minSdkVersion="8"></uses-sdk>-->
diff --git a/HDL-ON_iOS/Info.plist b/HDL-ON_iOS/Info.plist
index ed71fc1..9c982f0 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.6.202210281</string>
+ <string>1.6.202211161</string>
<key>CFBundleVersion</key>
- <string>1.6.210281</string>
+ <string>1.6.211161</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 c10bcf2..290b50b 100644
--- a/HDL-ON_iOS/Resources/Language.ini
+++ b/HDL-ON_iOS/Resources/Language.ini
@@ -564,6 +564,7 @@
577=Close
578=Mechanical Arm
579=Cancellation
+580=Are you sure to delete this combined dimming?
@@ -1793,6 +1794,7 @@
577=闃�闂ㄥ凡鎵撳紑
578=鏈烘鎵�
579=绔嬪嵆娉ㄩ攢
+580=纭畾鍒犻櫎璇ョ粍鍚堣皟鍏夊悧锛�
@@ -2999,7 +3001,7 @@
577=袟邪泻褉褘褌褜
578=Mechanical Arm
579=Cancellation
-
+580=Are you sure to delete this combined dimming?
2532=Visitor Invitation Record
2533=Visitor management
@@ -4212,6 +4214,8 @@
577=Cerrar
578=Mechanical Arm
579=Cancellation
+580=Are you sure to delete this combined dimming?
+
2532=Visitor Invitation Record
2533=Visitor management
@@ -5409,6 +5413,7 @@
576=袨褌胁芯褉械薪芯
577=袟邪褌胁芯褉懈
579=Cancellation
+580=Are you sure to delete this combined dimming?
1000=袙谢邪卸薪芯褋褌 胁 褋褌邪褟褌邪
diff --git a/HDL_ON/Common/ApiUtlis.cs b/HDL_ON/Common/ApiUtlis.cs
index ee2d4f8..eb7f100 100644
--- a/HDL_ON/Common/ApiUtlis.cs
+++ b/HDL_ON/Common/ApiUtlis.cs
@@ -51,6 +51,8 @@
/// 璇诲彇鍦烘櫙鏁版嵁瀹屾垚
/// </summary>
bool complateScene = false;
+ //绾跨▼缁撴潫鏃堕棿
+ DateTime endTime1;
/// <summary>
/// 鏍¢獙缃戝叧鏄惁鍦ㄧ嚎
@@ -69,7 +71,7 @@
/// <summary>
/// 涓嬭浇鏁版嵁瀹屾垚鏍囪
/// </summary>
- public bool DownloadDataComplete = true;
+ public bool DownloadDataComplete = false;
/// <summary>
/// 涓嬭浇鏁版嵁
/// </summary>
@@ -77,8 +79,8 @@
{
if (MainPage.InternetStatus == 0 || MainPage.NoLoginMode)
return;
- //绾跨▼寮�濮嬫椂闂�
- var endTime = DateTime.Now.AddSeconds(5);
+ endTime1 = DateTime.Now.AddSeconds(25);
+ complateDevice = complateScene = false;
MainPage.Log($"寮�濮嬪悓姝ヤ簯绔暟鎹�");
@@ -102,7 +104,6 @@
MainPage.Log($"鍒锋柊token澶辫触");
return;
}
- endTime = DateTime.Now.AddSeconds(5);
MainPage.Log($"鍒锋柊token鎴愬姛");
//===================鍒锋柊浣忓畢淇℃伅=======================
code = Ins.HttpRequest.GetHomePager();
@@ -111,7 +112,6 @@
MainPage.Log($"鍒锋柊浣忓畢淇℃伅澶辫触");
return;
}
- endTime = DateTime.Now.AddSeconds(5);
MainPage.Log($"鍒锋柊浣忓畢淇℃伅鎴愬姛");
//===================鍒锋柊涓汉淇℃伅=======================
code = Ins.HttpRequest.GetUserInfo();
@@ -120,7 +120,6 @@
MainPage.Log($"鍒锋柊涓汉淇℃伅澶辫触");
return;
}
- endTime = DateTime.Now.AddSeconds(5);
MainPage.Log($"鍒锋柊涓汉淇℃伅鎴愬姛");
//int count = 0;
@@ -148,7 +147,6 @@
var roomResult = Ins.HttpRequest.GetRoomList();
if (roomResult.Code == StateCode.SUCCESS)
{
- endTime = DateTime.Now.AddSeconds(100);
MainPage.Log($"璇诲彇鎴块棿淇℃伅鎴愬姛");
var revData = Newtonsoft.Json.JsonConvert.DeserializeObject<SpatialApiPack>(roomResult.Data.ToString());
if (revData == null)
@@ -158,7 +156,6 @@
{
SpatialInfo.CurrentSpatial.UpdateSpatialList(revData.list);
}
- endTime = DateTime.Now.AddSeconds(5);
}
else
{
@@ -174,7 +171,6 @@
var deviceResult = Ins.HttpRequest.GetDeviceList("30", "1");
if (deviceResult.Code == StateCode.SUCCESS)
{
- endTime = DateTime.Now.AddSeconds(5);
//MainPage.Log($"璇诲彇璁惧淇℃伅鎴愬姛");
//MainPage.Log($"sid鍒楄〃鑾峰彇====" + deviceResult.Data.ToString());
@@ -198,11 +194,10 @@
}
catch (Exception ex)
{
-
}
finally
{
- complateDevice = true;
+
}
string delFile = "";
@@ -237,7 +232,6 @@
FunctionList.List.IniFunctionList(newFunction.savePath);
MainPage.Log($"============璁惧============{iiii++}");
}
- endTime = DateTime.Now.AddSeconds(5);
}
else
{
@@ -250,7 +244,7 @@
finally
{
complateDevice = true;
- MainPage.Log($"============璁惧============瀹屾垚");
+ MainPage.Log($"============璁惧============瀹屾垚" + FunctionList.List.Functions.Count);
}
})
{ IsBackground = true }.Start();
@@ -260,11 +254,10 @@
{
try
{
- complateScene = true;
+ complateScene = false;
var pack = Ins.HttpRequest.GetSceneList();
if (pack.Code == StateCode.SUCCESS)
{
- endTime = DateTime.Now.AddSeconds(100);
MainPage.Log($"璇诲彇鍦烘櫙鏁版嵁鎴愬姛");
var sceneList = JsonConvert.DeserializeObject<List<Scene>>(pack.Data.ToString());
if (sceneList == null)
@@ -306,7 +299,6 @@
IMessageCommon.Current.ShowErrorInfoAlter(packInfo.Code);
}
}
- endTime = DateTime.Now.AddSeconds(5);
}
else
{
@@ -424,8 +416,6 @@
Application.RunOnMainThread(() =>
{
MainPage.Log($"缁撴潫璇诲彇浜戠鏁版嵁绾跨▼");
- endTime = DateTime.MinValue;
- DownloadDataComplete = true;
if (waitPage != null)
{
waitPage.RemoveFromParent();
@@ -435,7 +425,13 @@
//涓嶈�冭檻缃戝叧鎯呭喌锛岀洿鎺ヨ闃�
DAL.Mqtt.MqttClient.InitState();
- FunctionList.List.Read3tyFunctionStatus();
+ try
+ {
+ FunctionList.List.Read3tyFunctionStatus();
+ }catch(Exception ex)
+ {
+ MainPage.Log("璇诲彇绗笁鏂硅澶囩姸鎬佸け璐�:"+ex.Message);
+ }
}
});
downloadDataThread.IsBackground = true;
@@ -447,9 +443,9 @@
{
try
{
- while (endTime > DateTime.Now)
+ while (endTime1 > DateTime.Now)
{
- if (DownloadDataComplete && complateDevice && complateScene)
+ if ( complateDevice && complateScene)
{
break;
}
@@ -481,37 +477,6 @@
}
})
{ IsBackground = true }.Start();
-
-
-
-
- ////涓嬭浇鍏変紡鏁版嵁
- //new System.Threading.Thread(() => {
- // try
- // {//00
- // HttpServerRequest http = new HttpServerRequest();
- // var packData = http.GetInverterList();
- // if (packData != null)
- // {
- // if (packData.Code == StateCode.SUCCESS)
- // {
- // var inverterList = JsonConvert.DeserializeObject<List<InverterInfo>>(packData.Data.ToString());
- // if (inverterList!= null)
- // {
- // FunctionList.List.InverterList = inverterList;
- // }
- // }
- // }
- // }
- // catch (Exception ex)
- // {
- // MainPage.Log($"璇诲彇鍏変紡鏁版嵁寮傚父:{ex.Message}");
- // }
-
- //}) { IsBackground = true }.Start();
-
-
-
}
/// <summary>
diff --git a/HDL_ON/Common/HDLCommon.cs b/HDL_ON/Common/HDLCommon.cs
index b7df610..76f3d70 100644
--- a/HDL_ON/Common/HDLCommon.cs
+++ b/HDL_ON/Common/HDLCommon.cs
@@ -102,7 +102,7 @@
NewVersionUrl = appVersionRes.packageUrl
};
#if __IOS__
- mForceUpdateInfo.NewVersionUrl = appVersionRes.iosUrl;
+ mForceUpdateInfo.NewVersionUrl = appVersionRes.packageUrl;
#endif
//瑙f瀽鏇存柊鍐呭璇︽儏
//var reasonStrJson = GetReasonStrJson(appVersionRes.remark);
diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs
index afc49c6..3312c40 100644
--- a/HDL_ON/Common/R.cs
+++ b/HDL_ON/Common/R.cs
@@ -5,6 +5,10 @@
public static class StringId
{
/// <summary>
+ /// 鏄惁纭畾鍒犻櫎缁勫悎璋冨厜
+ /// </summary>
+ public const int DoYouWantDelCombinedDimming = 580;
+ /// <summary>
/// 娉ㄩ攢
/// </summary>
public const int Cancellation = 579;
diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs
index 511a91e..bf39c96 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/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs
index cdd06aa..673ce1b 100644
--- a/HDL_ON/Entity/FunctionList.cs
+++ b/HDL_ON/Entity/FunctionList.cs
@@ -428,7 +428,6 @@
/// <summary>
/// 鍒犻櫎鍦烘櫙
- /// todo
/// </summary>
public void DeleteScene(Scene scene,bool upSevser)
{
diff --git a/HDL_ON/UI/UI1-Login/LoginPage.cs b/HDL_ON/UI/UI1-Login/LoginPage.cs
index bcba6a6..b30848a 100644
--- a/HDL_ON/UI/UI1-Login/LoginPage.cs
+++ b/HDL_ON/UI/UI1-Login/LoginPage.cs
@@ -218,6 +218,7 @@
etAccount.Text = "tf@smarttech.com.ua";
etAccount.Text = "455740454@qq.com";
etAccount.Text = "18688565449";
+ etAccount.Text = "support7@hdlautomation.com";
}
else
{
diff --git a/HDL_ON/UI/UI2/2-Classification/SceneControlZone.cs b/HDL_ON/UI/UI2/2-Classification/SceneControlZone.cs
index 37b83e8..024d8d6 100644
--- a/HDL_ON/UI/UI2/2-Classification/SceneControlZone.cs
+++ b/HDL_ON/UI/UI2/2-Classification/SceneControlZone.cs
@@ -1,6 +1,7 @@
锘縰sing System;
using System.Collections.Generic;
using System.Threading;
+using HDL_ON.Common;
using HDL_ON.DAL.Server;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
@@ -128,7 +129,6 @@
{
if (scene.functions.Count == 0)
{
-
var waitPage = new Loading();
new Thread(() =>
{
@@ -206,6 +206,69 @@
btnName.MouseUpEventHandler = upEvent;
btnFromFloor.MouseUpEventHandler = upEvent;
this.MouseUpEventHandler = upEvent;
+
+
+ EventHandler<MouseEventArgs> delEvent = (sender, e) => {
+ Action action = () =>{
+ var waitPage = new Loading();
+ MainPage.BaseView.AddChidren(waitPage);
+ waitPage.Start("");
+ new System.Threading.Thread(() =>
+ {
+ try
+ {
+ var pm = new HttpServerRequest();
+ var packCode = pm.DeleteScene(scene.userSceneId);
+ if (packCode == StateCode.SUCCESS)
+ {
+ FileUtlis.Files.DeleteFile(scene.savePath);
+ try
+ {
+ foreach (var sss in FunctionList.List.scenes)
+ {
+ if (sss.userSceneId == scene.userSceneId)
+ {
+ FunctionList.List.scenes.Remove(sss);
+ break;
+ }
+ }
+ }
+ catch { }
+ Application.RunOnMainThread(() =>
+ {
+ this.RemoveFromParent();
+ });
+ }
+ else
+ {
+ Application.RunOnMainThread(() =>
+ {
+ IMessageCommon.Current.ShowErrorInfoAlter(packCode);
+ });
+ }
+ }
+ catch { }
+ finally
+ {
+ Application.RunOnMainThread(() => {
+ if(waitPage!= null)
+ {
+ waitPage.RemoveFromParent();
+ waitPage = null;
+ }
+ });
+ }
+ })
+ { IsBackground = true }.Start();
+
+
+ };
+ new PublicAssmebly().TipOptionMsg(StringId.Tip, StringId.DoYouWantDelCombinedDimming, action);
+ };
+ btnName.MouseLongEventHandler = delEvent;
+ btnFromFloor.MouseLongEventHandler = delEvent;
+ this.MouseLongEventHandler = delEvent;
+
}
else
{
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubPage.cs
index f004fbf..446bda8 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubPage.cs
@@ -254,8 +254,8 @@
contentView.AddChidren(btnMinValuesText);
- int progress = 0;
- int.TryParse(function.GetAttrState(FunctionAttributeKey.SetTemp),out progress);
+ //int progress = 0;
+ //int.TryParse(function.GetAttrState(FunctionAttributeKey.SetTemp),out progress);
tempBar = new DiyImageSeekBar()
{
@@ -268,7 +268,7 @@
ThumbImageHeight = Application.GetRealHeight(51),
ProgressBarColor = function.trait_on_off.curValue.ToString() == "on" ? curColor : CSS_Color.DividingLineColor,
MaxValue = 14,
- Progress = progress - 16,
+ Progress = setTempValue - 16,
SeekBarPadding = Application.GetRealWidth(20),
IsProgressTextShow = false,
ProgressChangeDelayTime = 0,
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/LightScene/AddLightScene.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/LightScene/AddLightScene.cs
index ee30315..656fa5f 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Light/LightScene/AddLightScene.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/LightScene/AddLightScene.cs
@@ -375,6 +375,7 @@
public void ShowDialog()
{
+ commandDic.Clear();
commandDic.Add(FunctionAttributeKey.OnOff, "off");
listSwitch = lights.FindAll((obj) => obj.spk == SPK.LightSwitch);
@@ -382,9 +383,31 @@
lightCCT = lights.FindAll((obj) => obj.spk == SPK.LightCCT);
lightRGB = lights.FindAll((obj) => obj.spk == SPK.LightRGB);
+
+
var hadDimming = lightDimming.Count > 0;
var hadCCT = lightCCT.Count > 0;
var hadRGB = lightRGB.Count > 0;
+ if ( hadRGB)
+ {
+ commandDic.Add(FunctionAttributeKey.RGB, lightRGB[0].GetAttrState(FunctionAttributeKey.RGB));
+ commandDic.Add(FunctionAttributeKey.Brightness, lightRGB[0].GetAttrState(FunctionAttributeKey.Brightness));
+ }
+ if (hadCCT)
+ {
+ commandDic.Add(FunctionAttributeKey.CCT, lightCCT[0].GetAttrState(FunctionAttributeKey.CCT));
+ if (!commandDic.ContainsKey(FunctionAttributeKey.Brightness))
+ {
+ commandDic.Add(FunctionAttributeKey.Brightness, lightCCT[0].GetAttrState(FunctionAttributeKey.Brightness));
+ }
+ }
+ if (hadDimming)
+ {
+ if (!commandDic.ContainsKey(FunctionAttributeKey.Brightness))
+ {
+ commandDic.Add(FunctionAttributeKey.Brightness, lightCCT[0].GetAttrState(FunctionAttributeKey.Brightness));
+ }
+ }
var bodyView = new FrameLayout();
this.AddChidren(bodyView);
@@ -435,9 +458,17 @@
X = Application.GetRealWidth(12) + btnTitle.Right,
Gravity = Gravity.CenterVertical,
UnSelectedImagePath = "Public/Edit.png",
- //SelectedImagePath = "Public/HookIcon.png"
};
- titleView.AddChidren(btnEditIcon);
+ if (string.IsNullOrEmpty(scene.userSceneId))
+ {
+ titleView.AddChidren(btnEditIcon);
+ }
+ else
+ {
+ btnTitle.Text = scene.name;
+ btnTitle.Width = btnTitle.GetTextWidth()+ Application.GetRealWidth(10);
+ btnTitle.Gravity = Gravity.Center;
+ }
Action<string> callBack = (str) =>
{
@@ -646,175 +677,198 @@
contentView.AddChidren(bottomView);
bottomView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor });
- var btnCacel = new Button()
+ if (string.IsNullOrEmpty(scene.userSceneId))
{
- Width = Application.GetRealWidth(172),
- Height = Application.GetRealHeight(44),
- TextAlignment = TextAlignment.Center,
- TextSize = CSS_FontSize.SubheadingFontSize,
- TextColor = CSS_Color.TextualColor,
- TextID = StringId.Cancel,
- };
- bottomView.AddChidren(btnCacel);
-
- var btnSave = new Button()
- {
- X = Application.GetRealWidth(172),
- Width = Application.GetRealWidth(172),
- Height = Application.GetRealHeight(46),
- BackgroundColor = CSS_Color.MainColor,
- TextColor = CSS_Color.MainBackgroundColor,
- TextAlignment = TextAlignment.Center,
- TextSize = CSS_FontSize.SubheadingFontSize,
- TextID = StringId.Save
- };
- bottomView.AddChidren(btnSave);
-
- //渚嬶細鍙充笅鍦嗚 澶у皬涓�50
- int mRectCornerID = HDLUtils.RectCornerBottomRight;
- btnSave.SetCornerWithSameRadius((uint)Application.GetRealWidth(14), mRectCornerID);
-
-
-
- btnCacel.MouseUpEventHandler = (sender, e) => {
- this.Close();
-
- //var waitPage = new Loading();
- //MainPage.BaseView.AddChidren(waitPage);
- //waitPage.Start(Language.StringByID(StringId.PleaseWait));
- //new Thread(() =>
- //{
- // try
- // {
- // foreach (var light in lights)
- // {
- // Dictionary<string, string> sendDate = new Dictionary<string, string>();
- // //璧嬪�煎満鏅姛鑳芥暟鎹�
- // foreach (var attr in light.GetAttributes())
- // {
- // if (commandDic.ContainsKey(attr))
- // {
- // try
- // {
- // sendDate.Add(attr, commandDic[attr]);
- // }
- // catch { }
- // }
-
- // }
- // Control.Ins.SendWriteCommand(light, sendDate);
- // Thread.Sleep(50);
- // }
- // }
- // catch
- // { }
- // finally
- // {
- // Application.RunOnMainThread(() =>
- // {
- // waitPage.Hide();
- // new PublicAssmebly().TipMsgAutoClose("缁勫悎鎺у埗宸叉墽琛�", true);
- // if (waitPage != null)
- // {
- // //backAction(null);
- // waitPage.RemoveFromParent();
- // }
- // });
- // }
- //})
- //{ IsBackground = true }.Start();
- };
-
-
-
- btnSave.MouseUpEventHandler = (sender, e) =>
- {
- if (string.IsNullOrEmpty(scene.name))
+ var btnCacel = new Button()
{
- new Tip()
- {
- CloseTime = 1,
- Text = Language.StringByID(StringId.NameCannotBeEmpty),
- Direction = AMPopTipDirection.None,
- }.Show(bodyView);
- return;
- }
- foreach (var tempRoom in FunctionList.List.scenes)
+ Width = Application.GetRealWidth(172),
+ Height = Application.GetRealHeight(44),
+ TextAlignment = TextAlignment.Center,
+ TextSize = CSS_FontSize.SubheadingFontSize,
+ TextColor = CSS_Color.TextualColor,
+ TextID = StringId.Cancel,
+ };
+ bottomView.AddChidren(btnCacel);
+
+ var btnSave = new Button()
{
- if (scene.name == tempRoom.name)
+ X = Application.GetRealWidth(172),
+ Width = Application.GetRealWidth(172),
+ Height = Application.GetRealHeight(46),
+ BackgroundColor = CSS_Color.MainColor,
+ TextColor = CSS_Color.MainBackgroundColor,
+ TextAlignment = TextAlignment.Center,
+ TextSize = CSS_FontSize.SubheadingFontSize,
+ TextID = StringId.Save
+ };
+ bottomView.AddChidren(btnSave);
+
+ //渚嬶細鍙充笅鍦嗚 澶у皬涓�50
+ int mRectCornerID = HDLUtils.RectCornerBottomRight;
+ btnSave.SetCornerWithSameRadius((uint)Application.GetRealWidth(14), mRectCornerID);
+
+ btnCacel.MouseUpEventHandler = (sender, e) =>
+ {
+ this.Close();
+
+ //var waitPage = new Loading();
+ //MainPage.BaseView.AddChidren(waitPage);
+ //waitPage.Start(Language.StringByID(StringId.PleaseWait));
+ //new Thread(() =>
+ //{
+ // try
+ // {
+ // foreach (var light in lights)
+ // {
+ // Dictionary<string, string> sendDate = new Dictionary<string, string>();
+ // //璧嬪�煎満鏅姛鑳芥暟鎹�
+ // foreach (var attr in light.GetAttributes())
+ // {
+ // if (commandDic.ContainsKey(attr))
+ // {
+ // try
+ // {
+ // sendDate.Add(attr, commandDic[attr]);
+ // }
+ // catch { }
+ // }
+
+ // }
+ // Control.Ins.SendWriteCommand(light, sendDate);
+ // Thread.Sleep(50);
+ // }
+ // }
+ // catch
+ // { }
+ // finally
+ // {
+ // Application.RunOnMainThread(() =>
+ // {
+ // waitPage.Hide();
+ // new PublicAssmebly().TipMsgAutoClose("缁勫悎鎺у埗宸叉墽琛�", true);
+ // if (waitPage != null)
+ // {
+ // //backAction(null);
+ // waitPage.RemoveFromParent();
+ // }
+ // });
+ // }
+ //})
+ //{ IsBackground = true }.Start();
+ };
+
+ btnSave.MouseUpEventHandler = (sender, e) =>
+ {
+ if (string.IsNullOrEmpty(scene.name))
{
- new PublicAssmebly().TipMsg(StringId.Tip, StringId.NameAlreadyExists);
+ new Tip()
+ {
+ CloseTime = 1,
+ Text = Language.StringByID(StringId.NameCannotBeEmpty),
+ Direction = AMPopTipDirection.None,
+ }.Show(bodyView);
return;
}
- }
- var waitPage = new Loading();
- MainPage.BaseView.AddChidren(waitPage);
- waitPage.Start(Language.StringByID(StringId.PleaseWait));
- new Thread(() =>
- {
- try
+ foreach (var tempRoom in FunctionList.List.scenes)
{
- var serverScene = new Scene();
- for (int i = 0; i < lights.Count; i++)
+ if (scene.name == tempRoom.name)
{
- var light = lights[i];
+ new PublicAssmebly().TipMsg(StringId.Tip, StringId.NameAlreadyExists);
+ return;
+ }
+ }
+ var waitPage = new Loading();
+ MainPage.BaseView.AddChidren(waitPage);
+ waitPage.Start(Language.StringByID(StringId.PleaseWait));
+ new Thread(() =>
+ {
+ try
+ {
+ var serverScene = new Scene();
+ for (int i = 0; i < lights.Count; i++)
+ {
+ var light = lights[i];
//璧嬪�煎満鏅姛鑳芥暟鎹�
foreach (var attr in light.GetAttributes())
- {
- if (commandDic.ContainsKey(attr))
{
- try
+ if (commandDic.ContainsKey(attr))
{
- light.SetAttrState(attr, commandDic[attr]);
+ try
+ {
+ light.SetAttrState(attr, commandDic[attr]);
+ }
+ catch { }
}
- catch { }
}
- }
//杞崲鍦烘櫙鐨勫姛鑳藉璞�
var sceneFunction = light.ConvertSceneFunction();
//鏌ヨ鏈夋病鏈夊瓨鍦�
var temp = scene.functions.Find((obj) => obj.sid == sceneFunction.sid);
//璧嬪��
if (temp != null)
- {
- temp = sceneFunction;
- }
- else
- {
- scene.functions.Add(sceneFunction);
- }
- }
- var result = FunctionList.List.AddScene(scene, out serverScene);
- Application.RunOnMainThread(() =>
- {
- if (result == StateCode.SUCCESS)
- {
- scene.userSceneId = serverScene.userSceneId;
- FunctionList.List.scenes.Add(scene);
- backAction?.Invoke(scene);
- this.Close();
- }
- else
- {
- if (result == "124005")
- IMessageCommon.Current.ShowErrorInfoAlter(Language.StringByID(StringId.GatewayOffline));
+ {
+ temp = sceneFunction;
+ }
else
- IMessageCommon.Current.ShowErrorInfoAlter(result);
+ {
+ scene.functions.Add(sceneFunction);
+ }
}
- });
- }
- catch { }
- finally
- {
- Application.RunOnMainThread(() => {
- waitPage.Hide();
- waitPage.RemoveFromParent();
- });
- }
- })
- { IsBackground = true, Priority = ThreadPriority.AboveNormal }.Start();
- };
+ var result = FunctionList.List.AddScene(scene, out serverScene);
+ Application.RunOnMainThread(() =>
+ {
+ if (result == StateCode.SUCCESS)
+ {
+ scene.userSceneId = serverScene.userSceneId;
+ FunctionList.List.scenes.Add(scene);
+ backAction?.Invoke(scene);
+ this.Close();
+ }
+ else
+ {
+ if (result == "124005")
+ IMessageCommon.Current.ShowErrorInfoAlter(Language.StringByID(StringId.GatewayOffline));
+ else
+ IMessageCommon.Current.ShowErrorInfoAlter(result);
+ }
+ });
+ }
+ catch { }
+ finally
+ {
+ Application.RunOnMainThread(() =>
+ {
+ waitPage.Hide();
+ waitPage.RemoveFromParent();
+ });
+ }
+ })
+ { IsBackground = true, Priority = ThreadPriority.AboveNormal }.Start();
+ };
+ }
+ else
+ {
+ var btnCacel = new Button()
+ {
+ Height = Application.GetRealHeight(44),
+ TextAlignment = TextAlignment.Center,
+ TextSize = CSS_FontSize.SubheadingFontSize,
+ TextColor = CSS_Color.TextualColor,
+ TextID = StringId.Close,
+ };
+ bottomView.AddChidren(btnCacel);
+
+ //渚嬶細鍙充笅鍦嗚 澶у皬涓�50
+ //int mRectCornerID = HDLUtils.RectCornerBottomRight;
+ //btnSave.SetCornerWithSameRadius((uint)Application.GetRealWidth(14), mRectCornerID);
+
+ btnCacel.MouseUpEventHandler = (sender, e) =>
+ {
+ this.Close();
+ };
+
+ }
@@ -833,8 +887,8 @@
/// <param name="attrView"></param>
void LoadDimmingAttrView(VerticalScrolViewLayout attrView)
{
-
- commandDic.TryAdd(FunctionAttributeKey.Percent, "0");
+ string briValue = "";
+ commandDic.TryGetValue(FunctionAttributeKey.Percent,out briValue);
var dimmingView = new FrameLayout()
{
@@ -939,6 +993,10 @@
{
#region 鑹叉俯
+ string valueStr = "2700";
+ commandDic.TryGetValue(FunctionAttributeKey.Percent, out valueStr);
+ int value = Convert.ToInt32(valueStr) / 100;
+
var cctView = new FrameLayout()
{
Height = Application.GetRealHeight(54 + 11)
@@ -1001,9 +1059,7 @@
barColorTemplatrue.SeekBarBackgroundColor = 0x00000000;
cctView.AddChidren(barColorTemplatrue);
barColorTemplatrue.Y = btnTempClolorMin.Y - (barColorTemplatrue.Height - btnTempClolorMin.Height) / 2;
- var cct = 27;
- //int.TryParse(cctLight.status.Find((obj) => obj.key == FunctionAttributeKey.CCT).value, out cct);
- barColorTemplatrue.Progress = cct;
+ barColorTemplatrue.Progress = value;
//璁剧疆鍒濆鍊�
btnTempClolor.Text = Language.StringByID(StringId.ColorTemperature) + " " + (barColorTemplatrue.Progress * 100 + "K");
barColorTemplatrue.OnProgressChangedEvent = (sender, e) =>
@@ -1052,7 +1108,9 @@
{
#region RGB
- commandDic.TryAdd(FunctionAttributeKey.RGB, "255,255,255");
+
+ string value = "255,255,255";
+ commandDic.TryGetValue(FunctionAttributeKey.Percent, out value);
var rgbView = new FrameLayout()
{
@@ -1122,6 +1180,10 @@
string rgbString = (e2[0] + "," + e2[1] + "," + e2[2]).ToString();
commandDic[FunctionAttributeKey.RGB] = rgbString;
btnCurColor.BackgroundColor = (uint)(0xFF000000 + tempLight.GetRGBcolor(rgbString));
+ foreach (var rgbTemp in lightRGB)
+ {
+ rgbTemp.SetAttrState(FunctionAttributeKey.RGB, rgbString);
+ }
};
colorPicker.MouseDownEventHandler += (sender, e) =>
{
@@ -1139,6 +1201,14 @@
btnWhiteRound.Visible = true;
}
};
+ colorPicker.MouseUpEventHandler = (sender, e) => {
+ foreach (var rgbTemp in lightRGB)
+ {
+ Dictionary<string, string> d = new Dictionary<string, string>();
+ d.Add(FunctionAttributeKey.RGB, tempLight.GetRGBcolorString(rgbTemp));
+ Control.Ins.SendWriteCommand(rgbTemp, d, false, 0);
+ }
+ };
colorPicker.MouseMoveEventHandler += (sender, e) =>
{
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