From f48b20ee2ed48652ff4f0bfcdc2cfb8b9340685c Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期四, 14 四月 2022 15:37:06 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/wjc' into release0123
---
SiriIntents/SiriIntents.csproj | 7
HDL_APP_Project.sln | 5
HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs | 83 ++++++++++++-
HDL-ON_iOS/HDL-ON_iOS.csproj | 3
HDL_ON/UI/UI2/FuntionControlView/Music/MusicProperty.cs | 8 +
LogicMethod.cs | 0
HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicModel.cs | 12 -
HDL_ON/HDL_ON.projitems | 1
HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs | 47 ++++++-
HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs | 23 ++-
HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs | 100 +++++++++-------
HDL_ON/Entity/Function/Function.cs | 24 +++
HDL_ON/UI/UI2/FuntionControlView/Music/A31PlayMusicPage.cs | 40 +++++-
HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs | 1
HDL_ON/UI/UI2/FuntionControlView/Light/RelayPage.cs | 2
SiriIntentsUI/SiriIntentsUI.csproj | 1
HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs | 2
17 files changed, 269 insertions(+), 90 deletions(-)
diff --git a/HDL-ON_iOS/HDL-ON_iOS.csproj b/HDL-ON_iOS/HDL-ON_iOS.csproj
index efe52e3..c7399fb 100644
--- a/HDL-ON_iOS/HDL-ON_iOS.csproj
+++ b/HDL-ON_iOS/HDL-ON_iOS.csproj
@@ -59,6 +59,7 @@
<MtouchEnableSGenConc>false</MtouchEnableSGenConc>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+<CodesignProvision>OnPro220307-2-Dev</CodesignProvision>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>none</DebugType>
@@ -108,7 +109,7 @@
<HintPath>..\DLL\Linphone\iOS\Shared.IOS.HDLLinphoneSDK.dll</HintPath>
</Reference>
<Reference Include="Shared.IOS.HDLSceneSiri">
- <HintPath>..\..\HDLXamarinSceneSiri\Shared.IOS.HDLSceneSiri\Shared.IOS.HDLSceneSiri\bin\Release\Shared.IOS.HDLSceneSiri.dll</HintPath>
+ <HintPath>..\DLL\IOS\Shared.IOS.HDLSceneSiri.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
diff --git a/HDL_APP_Project.sln b/HDL_APP_Project.sln
index fab839a..965bf82 100644
--- a/HDL_APP_Project.sln
+++ b/HDL_APP_Project.sln
@@ -18,6 +18,11 @@
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UMSdk", "UMSdk\UMSdk.csproj", "{5CD1B2DE-1ABD-4B46-8C97-CCB6EA90346A}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{510DDCFF-AA25-4C6E-B578-B3B7A2EFBB96}"
+ ProjectSection(SolutionItems) = preProject
+ LogicMethod.cs = LogicMethod.cs
+ EndProjectSection
+EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
HDL_ON\HDL_ON.projitems*{09712674-2a38-407b-b1e2-560b2c352f9a}*SharedItemsImports = 4
diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs
index 6e3b439..5f8beba 100644
--- a/HDL_ON/Entity/Function/Function.cs
+++ b/HDL_ON/Entity/Function/Function.cs
@@ -111,13 +111,35 @@
/// <returns></returns>
public string GetAttrState(string key)
{
+ //涓�绾ф煡璇eyValue鍊�
var attrState = attributes.Find((s) => s.key == key.ToString());
- if (attrState == null || string.IsNullOrEmpty(attrState.state))
+ if (attrState == null)
{
return "0";
}
+ if (string.IsNullOrEmpty(attrState.state))
+ {
+ //浜岀骇鏌ヨkeyValue鍊�
+ return GetOriginalState(key);
+ }
return attrState.state;
}
+
+ /// <summary>
+ /// 鑾峰彇鍒濆鐘舵��
+ /// 榛樿鍊硷細0
+ /// </summary>
+ /// <param name="key">璇泙瀹氫箟鐨勫睘鎬у��</param>
+ /// <returns></returns>
+ public string GetOriginalState(string key)
+ {
+ var originalState = status.Find((s) => s.key == key.ToString());
+ if (originalState == null || string.IsNullOrEmpty(originalState.value))
+ {
+ return "0";
+ }
+ return originalState.value;
+ }
/// <summary>
/// 璁剧疆灞炴�х姸鎬�
/// </summary>
diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems
index 748a5ce..cbbabbe 100644
--- a/HDL_ON/HDL_ON.projitems
+++ b/HDL_ON/HDL_ON.projitems
@@ -383,7 +383,6 @@
<Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\AirQuality.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\MainView.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\OnePortAutomation.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicMethod.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\Time3.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\AddLogic.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\Set.cs" />
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs
index 4cf6765..dbe2972 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs
@@ -9,13 +9,13 @@
{
public FunTpye(string str)
{
- if_type = str;
+ if_Type = str;
}
/// <summary>
/// 琛ㄧず鏄�(鏉′欢/鐩爣)
/// </summary>
- private string if_type;
-
+ private string if_Type;
+ Loading loading = new Loading();
/// <summary>
/// 璁惧鍔熻兘ui
/// </summary>
@@ -23,6 +23,7 @@
/// <param name="bottm"></param>
/// <param name="funCount">鏀寔鍔熻兘绫诲瀷涓暟<琛ㄧず涓婇潰鎵�鍗犻珮搴�></param>
public void FunTypeView(FrameLayout viewLayout,int bottm,int funCount) {
+ viewLayout.AddChidren(loading);
LogicView.FunAllAreaView funAllAreaView = new LogicView.FunAllAreaView();
funAllAreaView.frameLayout.Y = bottm + Application.GetRealHeight(8);
viewLayout.AddChidren(funAllAreaView.FLayoutView());
@@ -120,9 +121,9 @@
///鍒囨崲鎴块棿榛樿:鍏ㄩ儴鍔熻兘
UserInfo.Current.logicselectedFunction = Language.StringByID(StringId.allFun);
///鑾峰彇鏄剧ず璁惧鍒楄〃
- var list = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(areaView.btnClick.Tag as Entity.Room, if_type);
+ var list = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(areaView.btnClick.Tag as Entity.Room, if_Type);
- DeviceListView(vv, list);
+ this.LoadingDeviceListView(vv, list);
};
if (roomList.Count - 1 == i)
{
@@ -138,7 +139,7 @@
{
//鑾峰彇鏈�缁堟樉绀哄垪琛�
- var functionList = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(UserInfo.Current.logicselectedRoom, if_type);
+ var functionList = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(UserInfo.Current.logicselectedRoom, if_Type);
//鑾峰彇璁惧鍒楄〃鐨勭被鍨嬶紙渚嬪锛氱伅鍏夌被锛岀獥甯樼被銆傘�傘�傦級
var deviceTypeList = LogicMethod.CurrLogicMethod.GetDeviceTypeList(functionList);
if (deviceTypeList.Count == 0)
@@ -220,11 +221,11 @@
fLayout.RemoveFromParent();
funAllAreaView.btnText2.Text = areaView.btnClick.Tag.ToString();
UserInfo.Current.logicselectedFunction = areaView.btnClick.Tag.ToString();
- ///鑾峰彇鍗曚釜绫诲瀷锛堜緥濡傦細鐏厜绫汇�傘�傦級璁惧FunctionType鍒楄〃<绠�绉�:spk鍒楄〃>
+ ///鑾峰彇璁惧鍗曚釜澶х被spk鍒楄〃锛堜緥濡�:鐏厜绫�,绌鸿皟绫�...锛�
var typeFunctionList2 = LogicMethod.CurrLogicMethod.GetDeviceTypeFunctionList(UserInfo.Current.logicselectedFunction);
- ///鑾峰彇鍗曚釜鐏厜绫诲瀷锛堜緥濡傦細鐏厜1,鐏厜2銆傘�傦級璁惧鍒楄〃
+ ///鑾峰彇璁惧鍗曚釜灏忕被鍒楄〃锛堜緥濡傦細鐏厜1,鐏厜2...锛�
var lists2 = LogicMethod.CurrLogicMethod.GetShowDeviceList(typeFunctionList2, functionList);
- DeviceListView(vv, lists2);
+ this.LoadingDeviceListView(vv, lists2);
};
if (deviceTypeList.Count - 1 == i)
@@ -237,16 +238,17 @@
funAllAreaView.btnText2.MouseUpEventHandler += funClick;
funAllAreaView.btnIcon2.MouseUpEventHandler += funClick;
///鑾峰彇鎴块棿鏀寔鐨勮澶囧垪琛�
- var deviceList = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(UserInfo.Current.logicselectedRoom, if_type);
- ///鑾峰彇鍗曚釜绫诲瀷锛堜緥濡�:鐏厜绫汇�傘�傦級璁惧FunctionType鍒楄〃<绠�绉�:spk鍒楄〃>
+ var deviceList = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(UserInfo.Current.logicselectedRoom, if_Type);
+ ///鑾峰彇璁惧鍗曚釜澶х被spk鍒楄〃锛堜緥濡�:鐏厜绫�,绌鸿皟绫�...锛�
var typeFunctionList = LogicMethod.CurrLogicMethod.GetDeviceTypeFunctionList(UserInfo.Current.logicselectedFunction);
- ///鑾峰彇鍗曚釜鐏厜绫诲瀷锛堜緥濡傦細鐏厜1,鐏厜2銆傘�傦級璁惧鍒楄〃
+ ///鑾峰彇璁惧鍗曚釜灏忕被鍒楄〃锛堜緥濡傦細鐏厜1,鐏厜2...锛�
var lists = LogicMethod.CurrLogicMethod.GetShowDeviceList(typeFunctionList, deviceList);
///鎴块棿鍚嶇О
funAllAreaView.btnText1.Text = UserInfo.Current.logicselectedRoom.roomName;
- ///鍔熻兘绫诲瀷鍚嶇О<鐏厜绫汇�傘�傘�傘�傘��>
+ ///璁惧澶х被鍚嶇О<鐏厜绫汇�傘�傘�傘�傘��>
funAllAreaView.btnText2.Text = UserInfo.Current.logicselectedFunction;
- DeviceListView(vv, lists);
+ this.LoadingDeviceListView(vv, lists);
+
}
@@ -255,40 +257,50 @@
/// </summary>
/// <param name="verticalScrolView">涓婁笅婊戝姩</param>
/// <param name="deviceList"></param>
- public void DeviceListView(VerticalScrolViewLayout verticalScrolView, List<HDL_ON.Entity.Function> deviceList)
+ private void LoadingDeviceListView(VerticalScrolViewLayout verticalScrolView, List<HDL_ON.Entity.Function> deviceList)
{
-
- verticalScrolView.RemoveAll();
- foreach (var dev in deviceList)
+ loading.Start();
+ System.Threading.Tasks.Task.Run(() =>
{
- LogicView.SelectTypeView funView = new LogicView.SelectTypeView();
- funView.btnText.Visible = false;
- funView.btnDeviceName.Visible = true;
- funView.btnRoomName.Visible = true;
- funView.btnLine.X = Application.GetRealWidth(16);
- funView.btnLine.Width = Application.GetRealWidth(343);
- verticalScrolView.AddChidren(funView.FLayoutView());
- funView.btnIcon.UnSelectedImagePath = LogicMethod.CurrLogicMethod.GetIconPath(dev.spk);
- funView.btnDeviceName.Text = dev.name;
- funView.btnRoomName.Text = dev.GetRoomListName();
- funView.btnClick.MouseUpEventHandler += (sen, e) => {
- if (if_type == LogicMethod.condition_if)
+ Application.RunOnMainThread(() =>
+ {
+ loading.Hide();
+ verticalScrolView.RemoveAll();
+ foreach (var dev in deviceList)
{
- ConditionDeviceFunList conditionDeviceFunList = new ConditionDeviceFunList();
- MainPage.BasePageView.AddChidren(conditionDeviceFunList);
- conditionDeviceFunList.Show(dev, 0, false);
- MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
- }
- else
- {
- TargetDeviceFunList targetDeviceFunList = new TargetDeviceFunList();
- MainPage.BasePageView.AddChidren(targetDeviceFunList);
- targetDeviceFunList.Show(dev, 0, false);
- MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
- }
+ LogicView.SelectTypeView funView = new LogicView.SelectTypeView();
+ funView.btnText.Visible = false;
+ funView.btnDeviceName.Visible = true;
+ funView.btnRoomName.Visible = true;
+ funView.btnLine.X = Application.GetRealWidth(16);
+ funView.btnLine.Width = Application.GetRealWidth(343);
+ verticalScrolView.AddChidren(funView.FLayoutView());
+ funView.btnIcon.UnSelectedImagePath = LogicMethod.CurrLogicMethod.GetIconPath(dev.spk);
+ funView.btnDeviceName.Text = dev.name;
+ funView.btnRoomName.Text = dev.GetRoomListName();
+ funView.btnClick.MouseUpEventHandler += (sen, e) =>
+ {
+ if (if_Type == LogicMethod.condition_if)
+ {
+ ConditionDeviceFunList conditionDeviceFunList = new ConditionDeviceFunList();
+ MainPage.BasePageView.AddChidren(conditionDeviceFunList);
+ conditionDeviceFunList.Show(dev, 0, false);
+ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ }
+ else
+ {
+ TargetDeviceFunList targetDeviceFunList = new TargetDeviceFunList();
+ MainPage.BasePageView.AddChidren(targetDeviceFunList);
+ targetDeviceFunList.Show(dev, 0, false);
+ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ }
- };
- }
+ };
+ }
+
+ });
+
+ });
}
}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
index b9c6f17..aff5ca0 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
@@ -992,8 +992,6 @@
}
break;
case SPK.CurtainSwitch:
- case SPK.CurtainTrietex:
- case SPK.CurtainRoller:
{
foreach (var dic in dicList)
{
@@ -1016,6 +1014,29 @@
}
break;
}
+ }
+ }
+ break;
+ case SPK.CurtainTrietex:
+ case SPK.CurtainRoller:
+ {
+ string on_off = GetKeyValue("on_off", dicList);
+ string percent = GetKeyValue("percent", dicList);
+ if (on_off == "on" && percent != "")
+ {
+ stateStr = Language.StringByID(StringId.onLogic) + percent + "%";
+ }
+ else if (on_off == "on")
+ {
+ stateStr = Language.StringByID(StringId.onLogic);
+ }
+ else if (on_off == "off")
+ {
+ stateStr = Language.StringByID(StringId.offLogic);
+ }
+ else if (percent != "")
+ {
+ stateStr = percent + "%";
}
}
break;
@@ -1455,8 +1476,6 @@
}
break;
case SPK.CurtainSwitch:
- case SPK.CurtainTrietex:
- case SPK.CurtainRoller:
{
foreach (var dic in dicList)
{
@@ -1480,6 +1499,52 @@
break;
}
}
+ }
+ break;
+ case SPK.CurtainTrietex:
+ case SPK.CurtainRoller:
+ {
+ foreach (var dic in dicList)
+ {
+ string value = dic["value"];
+ switch (dic["key"])
+ {
+ case "on_off":
+ {
+ switch (value)
+ {
+ case "on":
+ {
+ button1.Text = Language.StringByID(StringId.onLogic);
+ }
+ break;
+ case "off":
+ {
+ button1.Text = Language.StringByID(StringId.offLogic);
+ }
+ break;
+ case "stop":
+ {
+ button1.Text = Language.StringByID(StringId.stop);
+ }
+ break;
+ }
+ }
+ break;
+ case "percent":
+ {
+ if (button2 == null)
+ {
+ //鎬曡皟璇曡蒋浠朵贡涓婁笢瑗垮鑷存姏寮傚父
+ break;
+ }
+ button2.Text = value + "%";
+ }
+ break;
+ }
+
+ }
+
}
break;
case SPK.AcStandard:
@@ -2147,11 +2212,11 @@
//纭畾鐐瑰嚮浜嬩欢
timePointView.btnConfirm.MouseUpEventHandler += (sender, e3) =>
{
- if (timepoint == 0)
- {
- //鎻愮ず
- return;
- }
+ //if (timepoint == 0)
+ //{
+ // //鎻愮ず
+ // return;
+ //}
fLayout.RemoveFromParent();
action(timepoint);
};
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs
index 8cae2d3..7258f5f 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs
@@ -173,6 +173,7 @@
logicIfon.Add("noticeConfig", noticeConfigJObject);
logicIfon.Add("pushConfigs", pushConfigsArray);
logicjArray.Add(logicIfon);
+ //string str = logicIfon.ToString();
var jObject = new JObject { { "homeId", LogicMethod.CurrLogicMethod.HomeId }, { "logics", logicjArray } };
responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_Add, 5);
//濡傛灉鏄痶oken杩囨湡鍒欏埛鏂皌oken
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
index 9866147..e5894e8 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
@@ -68,6 +68,7 @@
lightSwitchView.btnText.TextID = StringId.switchLogic;
fLayout.AddChidren(lightSwitchView.FLayoutView());
+
///璁惧寤舵椂iewv
DelayView(fLayout, lightSwitchView.frameLayout.Bottom);
#endregion
@@ -101,7 +102,7 @@
brightnessView.frameLayout.Y = lightSwitchView.frameLayout.Bottom;
brightnessView.btnText.TextID = StringId.brightnesLogic;
fLayout.AddChidren(brightnessView.FLayoutView());
- brightnessView.btnState.Text = "5%";//浜у搧缁忕悊鏅撹緣瑕佹眰鏀圭殑 2021-11-06
+ //brightnessView.btnState.Text = "5%";//浜у搧缁忕悊鏅撹緣瑕佹眰鏀圭殑 2021-11-06
///璁惧寤舵椂iewv
DelayView(fLayout, brightnessView.frameLayout.Bottom);
#endregion
@@ -127,15 +128,12 @@
break;
//绐楀笜
case SPK.CurtainSwitch:
- case SPK.CurtainTrietex:
- case SPK.CurtainRoller:
{
#region 鐣岄潰
///寮�鍏�
LogicView.FunTypeView curtainSwitchView = new LogicView.FunTypeView();
curtainSwitchView.btnText.TextID = StringId.switchLogic;
fLayout.AddChidren(curtainSwitchView.FLayoutView());
- ///璁惧寤舵椂iewv
DelayView(fLayout, curtainSwitchView.frameLayout.Bottom);
#endregion
#region 鐐瑰嚮浜嬩欢
@@ -148,6 +146,42 @@
{
//鏄剧ず缂栬緫涔嬪墠鐨勮澶囩姸鎬�
GetEditState(device, index, curtainSwitchView.btnState, null, null, null);
+ }
+ #endregion
+ }
+ break;
+ case SPK.CurtainTrietex:
+ case SPK.CurtainRoller:
+ {
+ #region 鐣岄潰
+ ///寮�鍏�
+ LogicView.FunTypeView curtainSwitchView = new LogicView.FunTypeView();
+ curtainSwitchView.btnText.TextID = StringId.switchLogic;
+ fLayout.AddChidren(curtainSwitchView.FLayoutView());
+ ///鐧惧垎姣�
+ LogicView.FunTypeView crtainPercentumView = new LogicView.FunTypeView();
+ crtainPercentumView.frameLayout.Y = curtainSwitchView.frameLayout.Bottom;
+ crtainPercentumView.btnText.TextID = StringId.percentum;
+ fLayout.AddChidren(crtainPercentumView.FLayoutView());
+ crtainPercentumView.btnState.Text = "5%";//浜у搧缁忕悊鏅撹緣瑕佹眰鏀圭殑 2021-11-06
+ ///璁惧寤舵椂iewv
+ DelayView(fLayout, crtainPercentumView.frameLayout.Bottom);
+ #endregion
+ #region 鐐瑰嚮浜嬩欢
+ ///寮�鍏崇偣鍑讳簨浠�
+ curtainSwitchView.btnClick.MouseUpEventHandler += (sender, e) =>
+ {
+ SwitchViewMethod(device, curtainSwitchView.btnState, 3);
+ };
+ ///鐧惧垎姣旂偣鍑讳簨浠�
+ crtainPercentumView.btnClick.MouseUpEventHandler += (sender, e) =>
+ {
+ BrightnessMethod(device, crtainPercentumView.btnState, crtainPercentumView.btnText.Text);
+ };
+ if (edit)
+ {
+ //鏄剧ず缂栬緫涔嬪墠鐨勮澶囩姸鎬�
+ GetEditState(device, index, curtainSwitchView.btnState, crtainPercentumView.btnState, null, null);
}
#endregion
}
@@ -604,8 +638,9 @@
/// <summary>
/// 浜害/鐧惧垎姣�=鍔熻兘涓嬩竴绾х晫闈�
/// </summary>
- /// <param name="device"></param>
- /// <param name="button"></param>
+ /// <param name="device">璁惧瀵硅薄</param>
+ /// <param name="button">鏄剧ず鐘舵�佸璞�</param>
+ /// <param name="titleName">鏍囬</param>
private void BrightnessMethod(Entity.Function device, Button button, string titleName)
{
#region 鐣岄潰
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/RelayPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/RelayPage.cs
index 1bb8d06..f4c4801 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Light/RelayPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/RelayPage.cs
@@ -52,7 +52,7 @@
{
bodyView = this;
function = func;
-
+
}
/// <summary>
/// 鍔犺浇鐣岄潰
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicModel.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicModel.cs
index 92009db..0f8eabb 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicModel.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicModel.cs
@@ -57,13 +57,14 @@
/// ((褰撳墠鏃堕棿)DateTime.Now - (璁板綍鏃堕棿)LastDateTimeLastDateTime).TotalSeconds=璇樊鏃堕棿(绉�)
/// </summary>
public DateTime LastDateTime;
-
+ /// <summary>
+ /// 璁板綍婊戝姩闊抽噺鏉℃椂闂�<鐢ㄦ潵澶勭悊闊抽噺璺冲姩>
+ /// </summary>
+ public static DateTime ProgressDateTime = DateTime.MinValue;
/// <summary>
/// 闊充箰鎾斁鍣↖D
/// </summary>
public string UniqueDeviceName = string.Empty;
-
-
public MusicInfo CurrentMusic = new MusicInfo();
@@ -114,10 +115,7 @@
public Slaves Slave = new Slaves();
- /// <summary>
- /// 璁板綍鏃堕棿
- /// </summary>
- public static DateTime ProgressDateTime = DateTime.Now;
+
/// <summary>
/// 鍒ゆ柇鏄惁鏄痡son鏁版嵁
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/A31PlayMusicPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/A31PlayMusicPage.cs
index 244082b..d0d4d23 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Music/A31PlayMusicPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Music/A31PlayMusicPage.cs
@@ -92,7 +92,8 @@
{
string modeValueString = string.Empty;
string msg = Language.StringByID(StringId.switchTo);
- switch (A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.mode))
+ string modeKeyValue = A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.mode);
+ switch (modeKeyValue)
{
//list_cycle鍒楄〃寰幆锛宻ingle_cycle鍗曟洸寰幆锛宺andom闅忔満鎾斁;
case ValueProperty.list_cycle:
@@ -110,6 +111,7 @@
playView.playOrderBtn.UnSelectedImagePath = "MusicIcon/list.png";
msg += Language.StringByID(StringId.listMode);
break;
+
}
A31MusicModel.Current.functionMusic.SetAttrState(KeyProperty.mode, modeValueString);
new PublicAssmebly().TipMsgAutoClose(msg, false,1000);
@@ -213,6 +215,8 @@
playView.volValueBtn.Text = playView.volSeekBar.Progress + "%";
if (startVolume != e)
{
+ ///鏇存柊鏈�鏂板��
+ A31MusicModel.ProgressDateTime = DateTime.Now;
startVolume = e;
A31MusicModel.Current.functionMusic.SetAttrState(KeyProperty.volume, startVolume);
Dictionary<string, string> dic = new Dictionary<string, string>();
@@ -245,7 +249,8 @@
if (playView.playBtn.IsSelected)
{
playView.playBtn.IsSelected = false;
- status = ValueProperty.off;
+ status = ValueProperty.off;
+
}
else
{
@@ -388,8 +393,8 @@
// playView.volValueBtn.Text = A31MusicModel.Current.A31PlayStatus.vol + "%";
// }
//}
-
- if (1000 < (DateTime.Now - A31MusicModel.ProgressDateTime).TotalMilliseconds)
+ //涓轰簡闃叉闊抽噺鏉¤烦鍔�,寤堕暱鏇存柊鏃堕棿(澶氬姞1s)
+ if (2000 < (DateTime.Now - A31MusicModel.ProgressDateTime).TotalMilliseconds || A31MusicModel.ProgressDateTime==DateTime.MinValue)
{
//闊抽噺杩涘害鏉�;
playView.volSeekBar.Progress = int.Parse(A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.volume));
@@ -397,15 +402,31 @@
playView.volValueBtn.Text = A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.volume) + "%";
}
//鏇存柊鎾斁鍣ㄩ煶閲忕粰绯荤粺闊抽噺
- Volume.MusicVolume = playView.volSeekBar.Progress;
+ //Volume.MusicVolume = playView.volSeekBar.Progress;
//褰撳墠鎾斁闊充箰鏃堕棿
//鎸夐亾鐞嗕笉浼氫负绌猴紝GetAttrState("playing_time")鍊煎彲鑳戒负绌猴紝寮哄埗杞崲int.Parse(锛変細鍑虹幇寮傚父锛屼笉杩囦篃鍋氫簡寮傚父澶勭悊浜�
- int playSecond = int.Parse(A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.playing_time))+ (int)(DateTime.Now - A31MusicModel.Current.LastDateTime).TotalSeconds;
-
+ int playSecond = int.Parse(A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.playing_time));
+ //璇嗗埆闊充箰鐘舵�佹槸鍚﹀湪鎾斁鐘舵��
+ if (A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.on_off) == ValueProperty.on)
+ {
+ //闊充箰鍦ㄦ挱鏀炬椂锛屽啀璁$畻鎾斁鏃堕棿(鐜板湪鏃堕棿=鍘熸潵鏃堕棿+1绉�)
+ playSecond +=(int)(DateTime.Now - A31MusicModel.Current.LastDateTime).TotalSeconds;
+ ///姝屾洸璁板綍鏆傛椂鏃堕棿鍐欏叆缂撳瓨锛�
+ A31MusicModel.Current.functionMusic.SetAttrState(KeyProperty.playing_time, playSecond);
+ }
+ if (playSecond<=0)
+ {
+ ///鎾斁鏃堕棿涓嶈兘灏忎簬0锛�
+ playSecond = 0;
+ }
+ if (playSecond >=totalSecond)
+ {
+ ///鎾斁鏃堕棿涓嶈兘瓒呰繃鎬绘椂闂达紱
+ playSecond = totalSecond;
+ }
int playMusicMinute = playSecond / 60;
//绉掗挓
int playMusicSecond = playSecond % 60;
-
string playTime = (playMusicMinute.ToString().Length < 2 ? "0" + playMusicMinute.ToString() : playMusicMinute.ToString()) + ":" + (playMusicSecond.ToString().Length < 2 ? "0" + playMusicSecond.ToString() : playMusicSecond.ToString());
if (A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.on_off) == ValueProperty.on)
@@ -431,6 +452,9 @@
playView.playBtn.IsSelected = false;
//鍋滄鎾斁
playView.startTimeBtn.Text =playTime;
+ //playView.startTimeBtn.Text ="00:00";
+ ///姝屾洸璁板綍鏆傚仠鏃堕棿锛�<LastDateTime 璁$畻鏃堕棿鎾斁鏃堕棿鏈夌敤鍒�>
+ A31MusicModel.Current.LastDateTime = DateTime.Now;
}
playView.songNameTextView.Text = A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.song_name) == null ? "Unkown" : A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.song_name);
playView.singerBtn.Text = A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.song_name) == null ? "Unkown" : A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.song_name);
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs
index 0556fea..cef6e69 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs
@@ -167,6 +167,7 @@
{
try
{
+
SendMethod.mMethod.RefreshDeviceStatus(new List<string> { a31player.functionMusic.deviceId });
System.Threading.Thread.Sleep(500);
}
@@ -290,6 +291,7 @@
musicView.musicNameBtn.Text = player.functionMusic.name;
if (player.functionMusic.GetAttrState(KeyProperty.on_off) == ValueProperty.on)
{
+
musicView.playBtn.IsSelected = true;
}
else
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/MusicProperty.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/MusicProperty.cs
index 22bd45a..65be6b6 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Music/MusicProperty.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Music/MusicProperty.cs
@@ -105,14 +105,18 @@
/// </summary>
public const string down = "down";
/// <summary>
- /// 寮�<on>
+ /// 寮�/鎾斁<on>
/// </summary>
public const string on = "on";
/// <summary>
- /// 鍏�<off>
+ /// 鍏�/鍋滄<off>
/// </summary>
public const string off = "off";
/// <summary>
+ /// 鏆傚仠
+ /// </summary>
+ public const string pause = "pause";
+ /// <summary>
/// 鍗曟洸<single>
/// </summary>
public const string single = "single";
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs
index fda2963..5c5590d 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs
@@ -12,7 +12,7 @@
{
public class SendMethod
{
- private static SendMethod sMethod=null;
+ private static SendMethod sMethod = null;
public static SendMethod mMethod
{
get
@@ -48,7 +48,8 @@
})
{ IsBackground = true }.Start();
}
-
+ //璁板綍姝屾洸鎾斁鏃堕棿
+ private int songPlayTime = -1;
/// <summary>
/// 鑾峰彇璁惧鏈�鏂扮殑鐘舵��
/// </summary>
@@ -58,7 +59,7 @@
try
{
//RefreshDeviceStatus(functionIds);
- a31Music.LastDateTime = DateTime.Now;
+ //a31Music.LastDateTime = DateTime.Now;
///浠庣紦瀛橀噷闈㈡煡鎵鹃煶涔愭挱鏀惧櫒瀵硅薄<缂撳瓨鏁版嵁鏀跺埌鎺ㄩ�佽繃鏉ョ殑鐘舵�佷細鏇存柊缂撳瓨鏁版嵁>
var allLocalFuntion = FunctionList.List.GetDeviceFunctionList();
var localFunction = allLocalFuntion.Find((obj) => obj.sid == sid);
@@ -68,6 +69,13 @@
}
///鏇存柊鐨勬暟鎹�
a31Music.functionMusic = localFunction;
+ if (int.Parse(A31MusicModel.Current.functionMusic.GetAttrState(UI2.FuntionControlView.Music.KeyProperty.playing_time)) != songPlayTime)
+ {
+ ///姝屾洸璁板綍鏃堕棿鍜屽綋鍓嶆椂闂翠笉涓�鏍凤紝绔嬪嵆鏇存柊鏁版嵁鍙嶉鏃堕棿
+ a31Music.LastDateTime = DateTime.Now;
+ ///姝屾洸璁板綍鏃堕棿鍜屽綋鍓嶆椂闂翠笉涓�鏍凤紝绔嬪嵆鏇存柊姝屾洸鎾斁鏃堕棿
+ songPlayTime = int.Parse(A31MusicModel.Current.functionMusic.GetAttrState(UI2.FuntionControlView.Music.KeyProperty.playing_time));
+ }
}
catch { }
@@ -89,6 +97,7 @@
{
return;
}
+
}
catch { }
}
@@ -121,7 +130,7 @@
d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("deviceIds", new List<string> { music.deviceId });
var responsePackNew = RequestServerhomeId(d, NewAPI.Api_Post_PlayerList);
- if (responsePackNew.Code != "0"||responsePackNew.Data == null ||responsePackNew.Data.ToString() == "")
+ if (responsePackNew.Code != "0" || responsePackNew.Data == null || responsePackNew.Data.ToString() == "")
{
return;
}
@@ -130,7 +139,7 @@
var palyLists = Newtonsoft.Json.JsonConvert.DeserializeObject<List<PalyListInfo>>(str);
if (palyLists == null)
{
- palyLists =new List<PalyListInfo>();
+ palyLists = new List<PalyListInfo>();
}
if (palyLists.Count > 0)
{
@@ -143,12 +152,12 @@
}
}
-
+
/// <summary>
///璇锋眰鏈嶅姟鍣紙涓庝綇瀹呮湁鍏�:渚嬪锛沨omeId锛�
/// </summary>
/// <returns></returns>
- public ResponsePackNew RequestServerhomeId(object o, string api_Url, int mTimeout = 5)
+ public ResponsePackNew RequestServerhomeId(object o, string api_Url, int mTimeout = 5)
{
var requestJson = HttpUtil.GetSignRequestJson(o);
return HttpUtil.RequestHttpsPostFroHome(api_Url, requestJson, mTimeout);
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs b/LogicMethod.cs
similarity index 100%
rename from HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
rename to LogicMethod.cs
diff --git a/SiriIntents/SiriIntents.csproj b/SiriIntents/SiriIntents.csproj
index a36210c..5029570 100644
--- a/SiriIntents/SiriIntents.csproj
+++ b/SiriIntents/SiriIntents.csproj
@@ -28,6 +28,7 @@
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
<DeviceSpecificBuild>false</DeviceSpecificBuild>
<MtouchVerbosity></MtouchVerbosity>
+ <CodesignProvision>OnProSiri220307-2-Dev</CodesignProvision>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>pdbonly</DebugType>
@@ -85,15 +86,15 @@
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Xamarin.iOS" />
- <Reference Include="Shared.IOS.HDLSceneSiri">
- <HintPath>..\DLL\IOS\Shared.IOS.HDLSceneSiri.dll</HintPath>
- </Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\netstandard2.0\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="RestSharp">
<HintPath>..\packages\RestSharp.106.13.0\lib\netstandard2.0\RestSharp.dll</HintPath>
</Reference>
+ <Reference Include="Shared.IOS.HDLSceneSiri">
+ <HintPath>..\DLL\IOS\Shared.IOS.HDLSceneSiri.dll</HintPath>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
diff --git a/SiriIntentsUI/SiriIntentsUI.csproj b/SiriIntentsUI/SiriIntentsUI.csproj
index da2da8b..324b36f 100644
--- a/SiriIntentsUI/SiriIntentsUI.csproj
+++ b/SiriIntentsUI/SiriIntentsUI.csproj
@@ -29,6 +29,7 @@
<DeviceSpecificBuild>false</DeviceSpecificBuild>
<MtouchVerbosity></MtouchVerbosity>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <CodesignProvision>OnProSiriUI220307-2-Dev</CodesignProvision>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>pdbonly</DebugType>
--
Gitblit v1.8.0