20201220-1
1.场景配置调光类设备,增加变化速度
2.特殊字符输出限制
3.RGB关闭时,调色板消失的问题。
4.窗帘空间流畅性优化。
| | |
| | | <Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default"> |
| | | <Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default"> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008020-000404163432002E" /> |
| | | <MonoDevelop.Ide.Workbench> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs"> |
| | | <Files> |
| | | <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs" Line="436" Column="42" /> |
| | | <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs" Line="562" Column="37" /> |
| | | <File FileName="HDL_ON/Entity/FunctionList.cs" Line="726" Column="23" /> |
| | | <File FileName="HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs" Line="637" Column="37" /> |
| | | <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePage.cs" Line="963" Column="52" /> |
| | | <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs" Line="213" Column="36" /> |
| | | <File FileName="HDL_ON/Entity/Function/Scene.cs" Line="220" Column="21" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePage.cs" Line="430" Column="97" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePageBLL.cs" Line="14" Column="64" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs" Line="1" Column="1" /> |
| | | <File FileName="HDL-ON_iOS/Info.plist" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePage.cs" Line="157" Column="59" /> |
| | | <File FileName="HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs" Line="14" Column="78" /> |
| | | <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs" Line="205" Column="39" /> |
| | | <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs" Line="344" Column="37" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePageBLL.cs" Line="30" Column="22" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs" Line="105" Column="56" /> |
| | | <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs" Line="371" Column="1" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs" Line="105" Column="56" /> |
| | | </Files> |
| | | <Pads> |
| | | <Pad Id="ProjectPad"> |
| | | <State name="__root__"> |
| | | <Node name="HDL_APP_Project" expanded="True"> |
| | | <Node name="HDL-ON_Android" selected="True" /> |
| | | <Node name="HDL_ON" expanded="True"> |
| | | <Node name="Common" expanded="True" /> |
| | | <Node name="DAL" expanded="True"> |
| | | <Node name="DriverLayer" expanded="True" /> |
| | | </Node> |
| | | <Node name="Entity" expanded="True"> |
| | | <Node name="Function" expanded="True" /> |
| | | </Node> |
| | | <Node name="UI" expanded="True"> |
| | | <Node name="UI0-Public" expanded="True" /> |
| | | <Node name="UI2" expanded="True"> |
| | | <Node name="2-Classification" expanded="True" /> |
| | | <Node name="3-Intelligence" expanded="True"> |
| | | <Node name="Scene" expanded="True" /> |
| | | </Node> |
| | | <Node name="FuntionControlView" expanded="True"> |
| | | <Node name="AC" expanded="True" /> |
| | | <Node name="Curtain" expanded="True"> |
| | | <Node name="RollingShutterPageBLL.cs" selected="True" /> |
| | | </Node> |
| | | <Node name="EnvironmentalScience" expanded="True" /> |
| | | <Node name="Light" 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="Public" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | <Node name="HDL-ON_iOS" expanded="True"> |
| | | <Node name="Other" expanded="True" /> |
| | | <Node name="Resources" expanded="True" /> |
| | | <Node name="Resources" expanded="True"> |
| | | <Node name="Phone" expanded="True"> |
| | | <Node name="FunctionIcon" expanded="True"> |
| | | <Node name="Light" expanded="True" /> |
| | | </Node> |
| | | <Node name="LoginIcon" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </State> |
| | |
| | | <String>Shared.Droid.TouchID/Shared.Droid.TouchID.csproj</String> |
| | | <String>Shared.IOS/Shared.IOS.csproj</String> |
| | | </DisabledProjects> |
| | | <MonoDevelop.Ide.Workspace ActiveConfiguration="Release|iPhone" /> |
| | | <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" /> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.SelectDevice" /> |
| | | <MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <BreakpointStore /> |
| | |
| | | 373=添加楼层失败。 |
| | | 374=住宅数据已被删除,APP将自动切换到另一住宅。 |
| | | 375=网关未连接服务器,无法创建场景。 |
| | | 376=无法输入特殊字符. |
| | | 376=无法输入特殊字符 |
| | | 377=全宅区域 |
| | | 378=变化时间 |
| | | 379=变化速度 |
| | | 400=欢迎回家 |
| | | 401=二维码失效,请重试 |
| | | 402=重试 |
| | |
| | | 373=添加楼层失败。 |
| | | 374=住宅数据已被删除,APP将自动切换到另一住宅。 |
| | | 375=网关未连接服务器,无法创建场景。 |
| | | 376=无法输入特殊字符. |
| | | 376=无法输入特殊字符 |
| | | 377=全宅区域 |
| | | 378=变化时间 |
| | | 379=变化速度 |
| | | 400=欢迎回家 |
| | | 401=二维码失效,请重试 |
| | | 402=重试 |
| | |
| | | public const int Retry = 402; |
| | | public const int QRCodeIsInvalid = 401; |
| | | public const int WellComBackHome = 400; |
| | | public const int FadeSpeed = 379; |
| | | public const int FadeTime = 378; |
| | | public const int WholeZone = 377; |
| | | public const int CannotEnterSpecialCharacters = 376; |
| | | public const int GatewayOfflineCannotCreateScene = 375; |
| | |
| | | } |
| | | } |
| | | |
| | | ///// <summary> |
| | | ///// 改变通讯方式 |
| | | ///// </summary> |
| | | //public void ChangeCommunicationMode(CommunicationMode communicationMode) |
| | | //{ |
| | | // this.communicationMode = communicationMode; |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// 搜索本地网关列表 |
| | | /// </summary> |
| | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | function.usageCount++; |
| | | function.refreshTime = DateTime.Now; |
| | | |
| | | //如果是控制调光的开时,亮度值不能为0 |
| | | if (commandDictionary.Count > 2) |
| | | { |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.OnOff) && commandDictionary.ContainsKey(FunctionAttributeKey.Brightness)) |
| | | { |
| | | if (commandDictionary[FunctionAttributeKey.OnOff] == "on") |
| | | { |
| | | if (commandDictionary[FunctionAttributeKey.Brightness] == "0") |
| | | { |
| | | commandDictionary[FunctionAttributeKey.Brightness] = "100"; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //远程通讯 |
| | | if (Ins.IsRemote) |
| | | { |
old mode 100755
new mode 100644
| | |
| | | UdpSocket._BusSocket.AsyncBeginSend(packet); |
| | | controlLostCount++; |
| | | } |
| | | System.Threading.Thread.Sleep(100); |
| | | System.Threading.Thread.Sleep(300); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | { |
| | | roomNameList += ","; |
| | | } |
| | | roomNameList += findRoom.floorName + findRoom.roomName; |
| | | roomNameList += findRoom.floorName +"-"+ findRoom.roomName; |
| | | } |
| | | if (roomNameList == "" && functionType == FunctionType.Scene) |
| | | { |
| | |
| | | var sFunc = new SceneFunction(); |
| | | foreach (var attr in attributes) |
| | | { |
| | | if (attr.curValue.ToString() == "{}") |
| | | switch (attr.key) |
| | | { |
| | | attr.curValue = "0"; |
| | | } |
| | | if (attr.key == FunctionAttributeKey.SetTemp) |
| | | { |
| | | double vv = 16; |
| | | Double.TryParse(attr.curValue.ToString(),out vv); |
| | | sFunc.status.Add(new SceneFunctionStatus() { key = attr.key, value = Convert.ToInt32(vv).ToString() }); |
| | | } |
| | | else |
| | | { |
| | | sFunc.status.Add(new SceneFunctionStatus() { key = attr.key, value = attr.curValue.ToString() }); |
| | | case FunctionAttributeKey.OnOff: |
| | | case FunctionAttributeKey.Brightness: |
| | | case FunctionAttributeKey.Mode: |
| | | case FunctionAttributeKey.SetTemp: |
| | | case FunctionAttributeKey.FanSpeed: |
| | | case FunctionAttributeKey.Percent: |
| | | case FunctionAttributeKey.FadeTime: |
| | | if (attr.curValue.ToString() == "{}") |
| | | { |
| | | attr.curValue = "0"; |
| | | } |
| | | if (attr.key == FunctionAttributeKey.SetTemp) |
| | | { |
| | | double vv = 16; |
| | | Double.TryParse(attr.curValue.ToString(), out vv); |
| | | sFunc.status.Add(new SceneFunctionStatus() { key = attr.key, value = Convert.ToInt32(vv).ToString() }); |
| | | } |
| | | else |
| | | { |
| | | sFunc.status.Add(new SceneFunctionStatus() { key = attr.key, value = attr.curValue.ToString() }); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | sFunc.sid = this.sid; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | #region RGB |
| | | /// <summary> |
| | | /// 获取rgb颜色 |
| | | /// </summary> |
| | |
| | | return blueColor; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region CCT |
| | | FunctionAttributes attr_CCT; |
| | | /// <summary> |
| | | /// 色温 |
| | | /// </summary> |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public FunctionAttributes Attr_CCT |
| | | { |
| | | get |
| | | { |
| | | if(attr_CCT == null) |
| | | { |
| | | attr_CCT = attributes.Find((obj) => obj.key == FunctionAttributeKey.CCT); |
| | | if(attr_CCT== null) |
| | | { |
| | | attr_CCT = new FunctionAttributes() |
| | | { |
| | | key = FunctionAttributeKey.CCT, |
| | | value = new List<string> (), |
| | | max = 6500, |
| | | min = 2700, |
| | | curValue = 2700 |
| | | }; |
| | | } |
| | | } |
| | | var result = 2700; |
| | | int.TryParse(attr_CCT.curValue.ToString(), out result); |
| | | return attr_CCT; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (time / 60 > 1) |
| | | if (time > 60) |
| | | { |
| | | btnShowDelay.Text = (time / 60).ToString() + "min"; |
| | | btnShowDelay.Text = (time / 60).ToString() + "min" + time % 60 + "s"; |
| | | } |
| | | else |
| | | { |
| | | btnShowDelay.Text = (time--).ToString() + "s"; |
| | | btnShowDelay.Text = time.ToString() + "s"; |
| | | } |
| | | }); |
| | | if (time / 60 > 1) |
| | | { |
| | | System.Threading.Thread.Sleep(time / 60 * 60000); |
| | | } |
| | | else |
| | | { |
| | | System.Threading.Thread.Sleep(1000); |
| | | } |
| | | System.Threading.Thread.Sleep(1000); |
| | | time--; |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | case FunctionAttributeKey.Percent: |
| | | text = Language.StringByID(StringId.PercentAdjustment); |
| | | break; |
| | | case FunctionAttributeKey.FadeTime: |
| | | text = Language.StringByID(StringId.FadeSpeed); |
| | | break; |
| | | } |
| | | return text; |
| | | } |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text.RegularExpressions; |
| | | using System.Threading; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | |
| | | |
| | | btnConfirm.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | //btnConfirm.IsSelected = false; |
| | | if (string.IsNullOrEmpty(editText.Text.Trim()) || list.Contains(editText.Text.Trim())) |
| | | var text = editText.Text.Trim(); |
| | | Regex regtest = new Regex(@"\p{Cs}"); |
| | | Match match = regtest.Match(text); |
| | | if (match.Success) |
| | | { |
| | | HDLCommon.Current.ShowAlert(Language.StringByID(StringId.CannotEnterSpecialCharacters)); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(text) || list.Contains(text)) |
| | | { |
| | | //if (titleId == StringId.ModifyMemberNickname) |
| | | //{ |
| | | // return; |
| | | //} |
| | | string tipMsgString = ""; |
| | | if (string.IsNullOrEmpty(editText.Text.Trim())) |
| | | if (string.IsNullOrEmpty(text)) |
| | | { |
| | | tipMsgString = Language.StringByID(errorId_IsNullOrEmpty); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | callBackAction(editText.Text.Trim()); |
| | | callBackAction(text); |
| | | dialog.Close(); |
| | | }; |
| | | } |
| | |
| | | |
| | | btnLightPower.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | LoadEvent_SwitchFunction(btnLightPower, item); |
| | | LoadEvent_SwitchFunction(btnLightPower, item, functionView); |
| | | }; |
| | | functionPageTitleId = StringId.Lights; |
| | | |
| | |
| | | functionView.AddChidren(btnAcPower); |
| | | btnAcPower.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | LoadEvent_SwitchFunction(btnAcPower, item); |
| | | LoadEvent_SwitchFunction(btnAcPower, item, functionView); |
| | | }; |
| | | functionPageTitleId = StringId.AC; |
| | | #endregion |
| | |
| | | IsSelected = DB_ResidenceData.Instance.GlobalCurtainStatus, |
| | | }; |
| | | functionView.AddChidren(btnOpen); |
| | | LoadEvent_CurtainSwitch(btnClose, btnOpen); |
| | | LoadEvent_CurtainSwitch(btnClose, btnOpen, functionView); |
| | | |
| | | functionPageTitleId = StringId.Curtain; |
| | | #endregion |
| | |
| | | functionView.AddChidren(btnFhPower); |
| | | btnFhPower.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | LoadEvent_SwitchFunction(btnFhPower, item); |
| | | LoadEvent_SwitchFunction(btnFhPower, item, functionView); |
| | | }; |
| | | functionPageTitleId = StringId.FloorHeating; |
| | | #endregion |
| | |
| | | functionView.AddChidren(btnElectricPower); |
| | | btnElectricPower.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | LoadEvent_SwitchFunction(btnElectricPower, item); |
| | | LoadEvent_SwitchFunction(btnElectricPower, item, functionView); |
| | | }; |
| | | functionPageTitleId = StringId.Electric; |
| | | #endregion |
| | |
| | | /// <summary> |
| | | /// 关闭打开全部选中类型功能 |
| | | /// </summary> |
| | | void LoadEvent_SwitchFunction(Button btn, ShowFunction functionCategory) |
| | | void LoadEvent_SwitchFunction(Button btn, ShowFunction functionCategory,FrameLayout view) |
| | | { |
| | | btn.MouseUpEventHandler = (sender, e) => { |
| | | btn.IsSelected = !btn.IsSelected; |
| | | var onoff = btn.IsSelected ? "on" : "off"; |
| | | switch (functionCategory) |
| | | var waitPage = new Loading(); |
| | | view.AddChidren(waitPage); |
| | | waitPage.Start(""); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | case ShowFunction.AC: |
| | | foreach (var f in FunctionList.List.aCs) |
| | | try |
| | | { |
| | | switch (functionCategory) |
| | | { |
| | | f.trait_on_off.curValue = onoff; |
| | | //Control.Send(CommandType_A.write, f); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | case ShowFunction.AC: |
| | | foreach (var f in FunctionList.List.aCs) |
| | | { |
| | | f.trait_on_off.curValue = onoff; |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | System.Threading.Thread.Sleep(100); |
| | | } |
| | | break; |
| | | case ShowFunction.FloorHeating: |
| | | foreach (var f in FunctionList.List.floorHeatings) |
| | | { |
| | | f.trait_on_off.curValue = onoff; |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | System.Threading.Thread.Sleep(100); |
| | | } |
| | | break; |
| | | case ShowFunction.Light: |
| | | foreach (var f in FunctionList.List.lights) |
| | | { |
| | | f.trait_on_off.curValue = onoff; |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | System.Threading.Thread.Sleep(100); |
| | | } |
| | | break; |
| | | case ShowFunction.Electric: |
| | | foreach (var f in FunctionList.List.electricals) |
| | | { |
| | | f.trait_on_off.curValue = onoff; |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | System.Threading.Thread.Sleep(100); |
| | | } |
| | | break; |
| | | } |
| | | break; |
| | | case ShowFunction.FloorHeating: |
| | | foreach (var f in FunctionList.List.floorHeatings) |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"{functionCategory}全开全关失败:{ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | f.trait_on_off.curValue = onoff; |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | } |
| | | break; |
| | | case ShowFunction.Curtain: |
| | | //foreach (var f in FunctionList.List.curtains) |
| | | //{ |
| | | // f.trait_on_off.value = onoff; |
| | | // //Control.Send(CommandType_A.write, f); |
| | | // Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | // d.Add("percent", "100"); |
| | | // Control.SendWriteCommand(f, d); |
| | | //} |
| | | break; |
| | | case ShowFunction.Light: |
| | | foreach (var f in FunctionList.List.lights) |
| | | { |
| | | f.trait_on_off.curValue = onoff; |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | } |
| | | break; |
| | | case ShowFunction.Electric: |
| | | foreach (var f in FunctionList.List.electricals) |
| | | { |
| | | f.trait_on_off.curValue = onoff; |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | } |
| | | break; |
| | | } |
| | | |
| | | waitPage.Hide(); |
| | | waitPage.RemoveFromParent(); |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true, Priority = System.Threading.ThreadPriority.AboveNormal }.Start(); |
| | | }; |
| | | } |
| | | |
| | |
| | | /// <summary> |
| | | /// 窗帘全开全关 |
| | | /// </summary> |
| | | void LoadEvent_CurtainSwitch(Button btnClose, Button btnOpen) |
| | | void LoadEvent_CurtainSwitch(Button btnClose, Button btnOpen,FrameLayout view) |
| | | { |
| | | btnOpen.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | DB_ResidenceData.Instance.GlobalCurtainStatus = true; |
| | | btnOpen.IsSelected = true; |
| | | btnClose.IsSelected = false; |
| | | foreach (var f in FunctionList.List.curtains) |
| | | var waitPage = new Loading(); |
| | | view.AddChidren(waitPage); |
| | | waitPage.Start(""); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | f.trait_on_off.curValue = "on"; |
| | | f.percent = 100; |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("on_off", f.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | } |
| | | try |
| | | { |
| | | foreach (var f in FunctionList.List.curtains) |
| | | { |
| | | f.trait_on_off.curValue = "on"; |
| | | f.percent = 100; |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("on_off", f.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | System.Threading.Thread.Sleep(100); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"窗帘全开全关失败:{ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | waitPage.RemoveFromParent(); |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true, Priority = System.Threading.ThreadPriority.AboveNormal }.Start(); |
| | | }; |
| | | |
| | | btnClose.MouseUpEventHandler = (sender, e) => |
old mode 100755
new mode 100644
| | |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "FunctionIcon/Curtain/CurtainCloseIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Curtain/CurtainCloseOnIcon.png", |
| | | Tag = function.functionType + "_off_" + function.sid |
| | | IsSelected = function.trait_on_off.curValue.ToString() == "off", |
| | | Tag = function.sid + "_off" |
| | | }; |
| | | bodyDiv.AddChidren(btnCurtainClose); |
| | | |
| | |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "FunctionIcon/Curtain/CurtainStopIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Curtain/CurtainStopOnIcon.png", |
| | | Tag = function.sid + "_stop", |
| | | IsSelected = function.trait_on_off.curValue.ToString() == "stop" |
| | | }; |
| | | bodyDiv.AddChidren(btnCurtainStop); |
| | | |
| | |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "FunctionIcon/Curtain/CurtainOpenIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Curtain/CurtainOpenOnIcon.png", |
| | | Tag = function.functionType + "_on_" + function.sid |
| | | Tag = function.sid + "_on", |
| | | IsSelected = function.trait_on_off.curValue.ToString() == "on" |
| | | }; |
| | | bodyDiv.AddChidren(btnCurtainOpen); |
| | | LoadEvent_ControlCurtain(btnCurtainStop, btnCurtainOpen, btnCurtainClose, function as Curtain); |
old mode 100755
new mode 100644
| | |
| | | btnClose.IsSelected = false; |
| | | btnOpen.IsSelected = false; |
| | | curtain.trait_on_off.curValue = "stop"; |
| | | //curtain.percent = 0; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("on_off", curtain.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(curtain, d); |
| | |
| | | case FunctionAttributeKey.Brightness: |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness)); |
| | | break; |
| | | case FunctionAttributeKey.FadeTime: |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.FadeTime)); |
| | | break; |
| | | } |
| | | } |
| | | |
| | |
| | | case FunctionAttributeKey.SetTemp: |
| | | LoadEditDialog_Temp(sceneStatus, btnFunctionText); |
| | | break; |
| | | case "delay": |
| | | case FunctionAttributeKey.FadeTime: |
| | | |
| | | break; |
| | | case "cct": |
| | | break; |
| | |
| | | } |
| | | }; |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加载变化速度选择弹窗 |
| | | /// </summary> |
| | | /// <param name="function"></param> |
| | | /// <param name="btn"></param> |
| | | void LoadEditDialog_FadeTime(SceneFunctionStatus trait, Button btn) |
| | | { |
| | | if (trait == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | Dialog dialog = new Dialog(); |
| | | |
| | | var pView = new FrameLayout() |
| | | { |
| | | BackgroundColor = CSS_Color.DialogTransparentColor1, |
| | | }; |
| | | dialog.AddChidren(pView); |
| | | |
| | | var optionBaseView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(467), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(180), |
| | | AnimateSpeed = 0.3f, |
| | | Animate = Animate.DownToUp, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | }; |
| | | pView.AddChidren(optionBaseView); |
| | | |
| | | var topView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(40), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | }; |
| | | optionBaseView.AddChidren(topView); |
| | | topView.AddChidren(new Button() { Y = Application.GetRealHeight(39), Height = Application.GetRealHeight(1), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | var btnTitle = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | TextAlignment = TextAlignment.Center, |
| | | Width = Application.GetRealWidth(100), |
| | | Text = FunctionList.List.GetNameText(trait.key), |
| | | IsBold = true, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | }; |
| | | topView.AddChidren(btnTitle); |
| | | |
| | | var btnCancel = new Button() |
| | | { |
| | | X = Application.GetRealWidth(21), |
| | | Width = Application.GetRealWidth(100), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextID = StringId.Cancel, |
| | | }; |
| | | topView.AddChidren(btnCancel); |
| | | |
| | | var btnConfrim = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(320), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextID = StringId.Confirm, |
| | | }; |
| | | topView.AddChidren(btnConfrim); |
| | | |
| | | Button btnMinusSignIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(26), |
| | | Y = Application.GetRealHeight(118), |
| | | Width = Application.GetMinRealAverage(24), |
| | | Height = Application.GetMinRealAverage(24), |
| | | Text = "0s", |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | optionBaseView.AddChidren(btnMinusSignIcon); |
| | | |
| | | DiyImageSeekBar controlBar = new DiyImageSeekBar() |
| | | { |
| | | X = btnMinusSignIcon.Right + Application.GetRealWidth(12), |
| | | Y = Application.GetRealHeight(100),//414,设计数据 |
| | | Width = Application.GetRealWidth(220), |
| | | Height = Application.GetRealHeight(54), |
| | | SeekBarViewHeight = Application.GetRealHeight(8), |
| | | ThumbImagePath = "Public/ThumbImage.png", |
| | | ThumbImageHeight = Application.GetRealHeight(54), |
| | | ProgressBarColor = CSS_Color.MainColor, |
| | | ProgressTextColor = CSS_Color.FirstLevelTitleColor, |
| | | ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | MaxValue = 100, |
| | | Progress = trait.value.ToString().Replace("{}", "") == "" ? 0 : Convert.ToInt32(trait.value.Replace("{}", "")), |
| | | SeekBarPadding = Application.GetRealWidth(20), |
| | | }; |
| | | optionBaseView.AddChidren(controlBar); |
| | | |
| | | Button btnPlusSgnIcon = new Button() |
| | | { |
| | | X = controlBar.Right + Application.GetRealWidth(12), |
| | | Y = Application.GetRealHeight(118), |
| | | Width = Application.GetMinRealAverage(24), |
| | | Height = Application.GetMinRealAverage(24), |
| | | Text = "10s", |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | optionBaseView.AddChidren(btnPlusSgnIcon); |
| | | |
| | | btnMinusSignIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | controlBar.Progress--; |
| | | }; |
| | | btnPlusSgnIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | controlBar.Progress++; |
| | | }; |
| | | |
| | | dialog.Show(); |
| | | pView.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | btnCancel.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | trait.value = controlBar.Progress.ToString(); |
| | | btn.Text = trait.value + FunctionList.List.GetUintString(trait.key); |
| | | }; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加载功能属性数据选择弹窗 |
| | | /// </summary> |
old mode 100755
new mode 100644
| | |
| | | Height = Application.GetMinRealAverage(40), |
| | | UnSelectedImagePath = "FunctionIcon/Curtain/CurtainCloseIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Curtain/CurtainCloseOnIcon.png", |
| | | IsSelected = curtain.trait_on_off.curValue.ToString() == "off", |
| | | }; |
| | | controlView.AddChidren(btnCurtainClose); |
| | | |
| | |
| | | Height = Application.GetMinRealAverage(40), |
| | | UnSelectedImagePath = "FunctionIcon/Curtain/CurtainStopIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Curtain/CurtainStopOnIcon.png", |
| | | IsSelected = curtain.trait_on_off.curValue.ToString() == "stop", |
| | | }; |
| | | controlView.AddChidren(btnCurtainStop); |
| | | |
| | |
| | | Height = Application.GetMinRealAverage(40), |
| | | UnSelectedImagePath = "FunctionIcon/Curtain/CurtainOpenIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Curtain/CurtainOpenOnIcon.png", |
| | | IsSelected = curtain.trait_on_off.curValue.ToString() == "on", |
| | | }; |
| | | controlView.AddChidren(btnCurtainOpen); |
| | | |
old mode 100755
new mode 100644
| | |
| | | { |
| | | if (uCurtain.trait_on_off.curValue.ToString() == "stop") |
| | | { |
| | | //bodyView.btnCurtainOpen.IsSelected = true; |
| | | //bodyView.btnCurtainClose.IsSelected = false; |
| | | //bodyView.btnCurtainStop.IsSelected = false; |
| | | bodyView.btnCurtainOpen.IsSelected = true; |
| | | bodyView.btnCurtainClose.IsSelected = false; |
| | | bodyView.btnCurtainStop.IsSelected = false; |
| | | //bodyView.btnCurtainBgIcon.IsSelected = true; |
| | | } |
| | | else if (uCurtain.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | //bodyView.btnCurtainOpen.IsSelected = true; |
| | | //bodyView.btnCurtainClose.IsSelected = false; |
| | | //bodyView.btnCurtainStop.IsSelected = false; |
| | | bodyView.btnCurtainOpen.IsSelected = true; |
| | | bodyView.btnCurtainClose.IsSelected = false; |
| | | bodyView.btnCurtainStop.IsSelected = false; |
| | | bodyView.btnCurtainBgIcon.IsSelected = true; |
| | | } |
| | | else if (uCurtain.trait_on_off.curValue.ToString() == "off") |
| | | { |
| | | //bodyView.btnCurtainOpen.IsSelected = false; |
| | | //bodyView.btnCurtainClose.IsSelected = true; |
| | | //bodyView.btnCurtainStop.IsSelected = false; |
| | | bodyView.btnCurtainOpen.IsSelected = false; |
| | | bodyView.btnCurtainClose.IsSelected = true; |
| | | bodyView.btnCurtainStop.IsSelected = false; |
| | | bodyView.btnCurtainBgIcon.IsSelected = false; |
| | | } |
| | | } |
old mode 100755
new mode 100644
| | |
| | | /// </summary> |
| | | Action actionRefresh; |
| | | #endregion |
| | | /// <summary> |
| | | /// 正在控制 |
| | | /// </summary> |
| | | bool onControl = false; |
| | | |
| | | public MotorCurtainPage(Curtain func) |
| | | { |
| | | bodyView = this; |
| | |
| | | Height = Application.GetRealWidth(177), |
| | | Progress = curtain.percent, |
| | | ProgressTextColor =0x00000000, |
| | | IsInvertedProgress = true, |
| | | }; |
| | | controlView.AddChidren(curtainSeekBar); |
| | | |
old mode 100755
new mode 100644
| | |
| | | Application.RunOnMainThread(() => { |
| | | if (bodyView == null) |
| | | return; |
| | | if (bodyView.onControl) |
| | | return; |
| | | if (uCurtain.functionType == bodyView.curtain.functionType && uCurtain.sid == bodyView.curtain.sid) |
| | | { |
| | | if (uCurtain.trait_on_off.curValue.ToString() == "stop") |
| | |
| | | bodyView.btnCurtainClose.IsSelected = true; |
| | | bodyView.btnCurtainStop.IsSelected = false; |
| | | } |
| | | if ((DateTime.Now - uCurtain.refreshTime).TotalMilliseconds > 300) |
| | | try |
| | | { |
| | | bodyView.controlBar.Progress = bodyView.curtainSeekBar.Progress = Convert.ToInt32(uCurtain.percent); |
| | | if (!bodyView.onCurtainAnimation) |
| | | { |
| | | bodyView.CurtainAnimation(Convert.ToInt32(uCurtain.trait_percent.curValue.ToString())); |
| | | } |
| | | } |
| | | |
| | | |
| | | catch { } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 正在执行窗帘动画 |
| | | /// </summary> |
| | | bool onCurtainAnimation = false; |
| | | /// <summary> |
| | | /// 窗帘动画 |
| | | /// </summary> |
| | | /// <param name="progress"></param> |
| | | void CurtainAnimation(int progress) |
| | | { |
| | | onCurtainAnimation = true; |
| | | //运行方向 打开(加进度):关闭(减进度) |
| | | bool runningDirection = progress > curtainSeekBar.Progress; |
| | | int curBarProgress = curtainSeekBar.Progress; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | while (progress != curBarProgress && onCurtainAnimation) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (runningDirection) |
| | | { |
| | | if (curtainSeekBar.Progress + 10 > progress) |
| | | { |
| | | curtainSeekBar.Progress = progress; |
| | | } |
| | | else |
| | | { |
| | | curtainSeekBar.Progress = curtainSeekBar.Progress + 10; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (curtainSeekBar.Progress - 10 < progress) |
| | | { |
| | | curtainSeekBar.Progress = progress; |
| | | } |
| | | else |
| | | { |
| | | curtainSeekBar.Progress = curtainSeekBar.Progress - 10; |
| | | } |
| | | } |
| | | curBarProgress = curtainSeekBar.Progress; |
| | | }); |
| | | System.Threading.Thread.Sleep(100); |
| | | } |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | new System.Threading.Thread(() => { |
| | | System.Threading.Thread.Sleep(3000); |
| | | onCurtainAnimation = false; |
| | | }) |
| | | { IsBackground = true, Priority = System.Threading.ThreadPriority.Lowest }.Start(); |
| | | } |
| | | }).Start(); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加载事件列表 |
| | |
| | | btnCurtainClose.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainClose.IsSelected = true; |
| | | btnCurtainStop.IsSelected = false; |
| | | btnCurtainOpen.IsSelected = false; |
| | | btnCurtainStop.IsSelected = false; |
| | | curtain.trait_on_off.curValue = "off"; |
| | | curtain.percent = 0; |
| | | curtain.percent = 100; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("on_off", curtain.trait_on_off.curValue.ToString()); |
| | | d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(curtain, d); |
| | | CurtainAnimation(curtain.percent); |
| | | }; |
| | | |
| | | //btnCurtainStop.MouseDownEventHandler = (sender, e) => |
| | | //{ |
| | | // btnCurtainStop.IsSelected = true; |
| | | // btnCurtainClose.IsSelected = false; |
| | | // btnCurtainOpen.IsSelected = false; |
| | | //}; |
| | | btnCurtainStop.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | //btnCurtainOpen.IsSelected = true; |
| | | //btnCurtainClose.IsSelected = false; |
| | | //btnCurtainStop.IsSelected = false; |
| | | |
| | | btnCurtainStop.IsSelected = true; |
| | | btnCurtainClose.IsSelected = false; |
| | | btnCurtainOpen.IsSelected = false; |
| | | curtain.trait_on_off.curValue = "stop"; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("on_off", curtain.trait_on_off.curValue.ToString()); |
| | | d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(curtain, d); |
| | | onCurtainAnimation = false; |
| | | }; |
| | | |
| | | btnCurtainOpen.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainOpen.IsSelected = true; |
| | | |
| | | btnCurtainClose.IsSelected = false; |
| | | btnCurtainStop.IsSelected = false; |
| | | btnCurtainOpen.IsSelected = true; |
| | | curtain.trait_on_off.curValue = "on"; |
| | | curtain.percent = 100; |
| | | curtain.percent = 0; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("on_off", curtain.trait_on_off.curValue.ToString()); |
| | | d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(curtain, d); |
| | | CurtainAnimation(curtain.percent); |
| | | }; |
| | | |
| | | btnMinusSignIcon.MouseUpEventHandler = (sender, e) => |
| | |
| | | curtain.percent--; |
| | | controlBar.Progress = curtain.percent; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("percent", curtain.percent.ToString()); |
| | | d.Add(FunctionAttributeKey.Percent, curtain.percent.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(curtain, d); |
| | | }; |
| | | |
| | |
| | | curtain.percent++; |
| | | controlBar.Progress = curtain.percent; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("percent", curtain.percent.ToString()); |
| | | d.Add(FunctionAttributeKey.Percent, curtain.percent.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(curtain, d); |
| | | }; |
| | | |
| | |
| | | curtain.percent = e; |
| | | curtain.refreshTime = DateTime.Now; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("percent", curtain.percent.ToString()); |
| | | d.Add(FunctionAttributeKey.Percent, curtain.percent.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(curtain, d); |
| | | }) |
| | | { IsBackground = true }.Start(); |
old mode 100755
new mode 100644
| | |
| | | /// </summary> |
| | | Action actionRefresh; |
| | | #endregion |
| | | /// <summary> |
| | | /// 正在控制 |
| | | /// </summary> |
| | | bool onControl = false; |
| | | public RollingShutterPage(Curtain func) |
| | | { |
| | | bodyView = this; |
| | |
| | | Width = Application.GetRealWidth(170), |
| | | Height = Application.GetRealWidth(210), |
| | | Progress = curtain.percent, |
| | | ProgressTextColor = 0x00000000 |
| | | IsInvertedProgress = true, |
| | | ProgressTextColor = 0x00000000, |
| | | }; |
| | | controlView.AddChidren(curtainSeekBar); |
| | | |
old mode 100755
new mode 100644
| | |
| | | using System; |
| | | using HDL_ON.DriverLayer; |
| | | using HDL_ON.Entity; |
| | | using Shared; |
| | | |
| | |
| | | { |
| | | public partial class RollingShutterPage |
| | | { |
| | | bool inControl = false; |
| | | |
| | | /// <summary> |
| | | /// 更新窗帘 |
| | | /// </summary> |
| | |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | if (bodyView == null) |
| | | return; |
| | | if (bodyView.onControl) |
| | | return; |
| | | if (uCurtain.functionType == bodyView.curtain.functionType && uCurtain.sid == bodyView.curtain.sid) |
| | | { |
| | |
| | | bodyView.btnCurtainClose.IsSelected = true; |
| | | bodyView.btnCurtainStop.IsSelected = false; |
| | | } |
| | | if ((DateTime.Now - uCurtain.refreshTime).TotalMilliseconds > 300 && !bodyView.inControl) |
| | | try |
| | | { |
| | | bodyView.controlBar.Progress = bodyView.curtainSeekBar.Progress = Convert.ToInt32(uCurtain.percent); |
| | | if (!bodyView.onCurtainAnimation) |
| | | { |
| | | bodyView.CurtainAnimation(Convert.ToInt32(uCurtain.trait_percent.curValue.ToString())); |
| | | } |
| | | } |
| | | catch { } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 正在执行窗帘动画 |
| | | /// </summary> |
| | | bool onCurtainAnimation = false; |
| | | /// <summary> |
| | | /// 窗帘动画 |
| | | /// </summary> |
| | | /// <param name="progress"></param> |
| | | void CurtainAnimation(int progress) |
| | | { |
| | | onCurtainAnimation = true; |
| | | //运行方向 打开(加进度):关闭(减进度) |
| | | bool runningDirection = progress > curtainSeekBar.Progress; |
| | | int curBarProgress = curtainSeekBar.Progress; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | while (progress != curBarProgress && onCurtainAnimation) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (runningDirection) |
| | | { |
| | | if (curtainSeekBar.Progress + 10 > progress) |
| | | { |
| | | curtainSeekBar.Progress = progress; |
| | | } |
| | | else |
| | | { |
| | | curtainSeekBar.Progress = curtainSeekBar.Progress + 10; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (curtainSeekBar.Progress - 10 < progress) |
| | | { |
| | | curtainSeekBar.Progress = progress; |
| | | } |
| | | else |
| | | { |
| | | curtainSeekBar.Progress = curtainSeekBar.Progress - 10; |
| | | } |
| | | } |
| | | curBarProgress = curtainSeekBar.Progress; |
| | | }); |
| | | System.Threading.Thread.Sleep(100); |
| | | } |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | new System.Threading.Thread(() => { |
| | | System.Threading.Thread.Sleep(3000); |
| | | onCurtainAnimation = false; |
| | | }) |
| | | { IsBackground = true, Priority = System.Threading.ThreadPriority.Lowest }.Start(); |
| | | } |
| | | }).Start(); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加载事件列表 |
| | |
| | | { |
| | | btnFunctionName.Text = btnFunctionName_Out.Text = curtain.name; |
| | | btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = curtain.GetRoomListName(); |
| | | curtain.SaveFunctionData(true); |
| | | //curtain.SaveFunctionData(true); |
| | | }; |
| | | } |
| | | /// <summary> |
| | |
| | | { |
| | | btnCurtainClose.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainOpen.IsSelected = false; |
| | | btnCurtainClose.IsSelected = true; |
| | | btnCurtainStop.IsSelected = false; |
| | | btnCurtainOpen.IsSelected = false; |
| | | curtain.trait_on_off.curValue = "off"; |
| | | curtain.percent = 0; |
| | | //Control.Send(CommandType_A.write, curtain); |
| | | curtain.percent = 100; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("on_off", curtain.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(curtain, d); |
| | | d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(curtain, d); |
| | | CurtainAnimation(curtain.percent); |
| | | }; |
| | | |
| | | //btnCurtainStop.MouseDownEventHandler = (sender, e) => |
| | | //{ |
| | | // btnCurtainStop.IsSelected = true; |
| | | // btnCurtainClose.IsSelected = false; |
| | | // btnCurtainOpen.IsSelected = false; |
| | | //}; |
| | | btnCurtainStop.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainStop.IsSelected = true; |
| | | btnCurtainClose.IsSelected = false; |
| | | btnCurtainOpen.IsSelected = false; |
| | | curtain.trait_on_off.curValue = "stop"; |
| | | //Control.Send(CommandType_A.write, curtain); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("on_off", curtain.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(curtain, d); |
| | | d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(curtain, d); |
| | | onCurtainAnimation = false; |
| | | }; |
| | | |
| | | btnCurtainOpen.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainOpen.IsSelected = true; |
| | | btnCurtainClose.IsSelected = false; |
| | | btnCurtainStop.IsSelected = false; |
| | | btnCurtainOpen.IsSelected = true; |
| | | curtain.trait_on_off.curValue = "on"; |
| | | curtain.percent = 100; |
| | | //Control.Send(CommandType_A.write, curtain); |
| | | curtain.percent = 0; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("on_off", curtain.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(curtain, d); |
| | | d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(curtain, d); |
| | | CurtainAnimation(curtain.percent); |
| | | }; |
| | | |
| | | |
| | | btnMinusSignIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | curtain.percent--; |
| | | controlBar.Progress = curtain.percent; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("percent", curtain.percent.ToString()); |
| | | Control.Ins.SendWriteCommand(curtain, d); |
| | | d.Add(FunctionAttributeKey.Percent, curtain.percent.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(curtain, d); |
| | | }; |
| | | |
| | | btnPlusSgnIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | curtain.percent++; |
| | | controlBar.Progress = curtain.percent; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("percent", curtain.percent.ToString()); |
| | | Control.Ins.SendWriteCommand(curtain, d); |
| | | d.Add(FunctionAttributeKey.Percent, curtain.percent.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(curtain, d); |
| | | }; |
| | | curtainSeekBar.OnStartTrackingTouchEvent = (sender, e) => |
| | | { |
| | | inControl = true; |
| | | }; |
| | | |
| | | //curtainSeekBar.OnProgressChangedEvent = (sender, e) => |
| | | //{ |
| | | // controlBar.Progress = curtainSeekBar.Progress; |
| | | // new System.Threading.Thread(() => |
| | | // { |
| | | // if (controlBar.Progress == 0 || controlBar.Progress == 100 || (DateTime.Now - curtain.refreshTime).TotalMilliseconds > 300) |
| | | // { |
| | | // curtain.percent = e; |
| | | // curtain.refreshTime = DateTime.Now; |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add("percent", curtain.percent.ToString()); |
| | | // Control.SendWriteCommand(curtain, d); |
| | | // } |
| | | // }) |
| | | // { IsBackground = true }.Start(); |
| | | //}; |
| | | curtainSeekBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | inControl = false; |
| | | controlBar.Progress = curtainSeekBar.Progress; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | curtain.percent = e; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("percent", curtain.percent.ToString()); |
| | | Control.Ins.SendWriteCommand(curtain, d); |
| | | curtain.refreshTime = DateTime.Now; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.Percent, curtain.percent.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(curtain, d); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | |
| | | controlBar.OnStartTrackingTouchEvent = (sender, e) => |
| | | { |
| | | inControl = true; |
| | | }; |
| | | //controlBar.OnProgressChangedEvent = (sender, e) => |
| | | //{ |
| | | // curtainSeekBar.Progress = controlBar.Progress; |
| | | // new System.Threading.Thread(() => |
| | | // { |
| | | // if (controlBar.Progress == 0 || controlBar.Progress == 100 || (DateTime.Now - curtain.refreshTime).TotalMilliseconds > 300) |
| | | // { |
| | | // curtain.percent = e; |
| | | // curtain.refreshTime = DateTime.Now; |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add("percent", curtain.percent.ToString()); |
| | | // Control.SendWriteCommand(curtain, d); |
| | | // } |
| | | // }) |
| | | // { IsBackground = true }.Start(); |
| | | //}; |
| | | |
| | | controlBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | inControl = false; |
| | | curtainSeekBar.Progress = controlBar.Progress; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | curtain.percent = e; |
| | | curtain.refreshTime = DateTime.Now; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("percent", curtain.percent.ToString()); |
| | | Control.Ins.SendWriteCommand(curtain, d); |
| | | curtain.refreshTime = DateTime.Now; |
| | | DriverLayer.Control.Ins.SendWriteCommand(curtain, d); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | if (room.roomId == "" || sensor.roomIds.Contains(room.roomId)) |
| | | { |
| | | var sensorTag = sensor.sid; |
| | | if (sensor.bus != null) |
| | | { |
| | | sensorTag = ((int)sensor.functionType % 256) + "_" + sensor.bus.SubnetID + "_" + sensor.bus.DeviceID + "_" + sensor.bus.LoopId; |
| | | } |
| | | FrameLayout sensorView = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(148), |
old mode 100755
new mode 100644
| | |
| | | for (int i = 0; i < bodyView.sensorListView.ChildrenCount; i++) |
| | | { |
| | | var sensorTag = sensor.sid; |
| | | if (sensor.bus != null) |
| | | { |
| | | sensorTag = ((int)sensor.functionType % 256) + "_" + sensor.bus.SubnetID + "_" + sensor.bus.DeviceID + "_" + sensor.bus.LoopId; |
| | | } |
| | | var view = bodyView.sensorListView.GetChildren(i); |
| | | if (view.GetType() == typeof(FrameLayout)) |
| | | { |
old mode 100755
new mode 100644
| | |
| | | } |
| | | if (function.name != name) |
| | | { |
| | | Regex regtest = new Regex(@"\p{Cs}"); |
| | | Match match = regtest.Match(name); |
| | | if (match.Success) |
| | | { |
| | | HDLCommon.Current.ShowAlert(Language.StringByID(StringId.CannotEnterSpecialCharacters)); |
| | | return; |
| | | } |
| | | function.name = name; |
| | | btnFunctionName.Text = name; |
| | | function.SaveFunctionData(true); |
old mode 100755
new mode 100644
| | |
| | | /// </summary>
|
| | | void LoadEvet_ChangeFadeTime()
|
| | | {
|
| | | barFadeTime.OnProgressChangedEvent = (sender, e) =>
|
| | | barFadeTime.OnStopTrackingTouchEvent = (sender, e) =>
|
| | | {
|
| | | light.fadeTime = e;
|
| | | light.SaveFunctionData(true);
|
| | |
| | | {
|
| | | barColorTemplatrue.OnProgressChangedEvent += (sender, value) =>
|
| | | {
|
| | | //设置自定义的文本
|
| | | barColorTemplatrue.SetCustomText(value * 100 + "K");
|
| | | new System.Threading.Thread(() => |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //设置自定义的文本 |
| | | barColorTemplatrue.SetCustomText(value * 100 + "K"); |
| | | light.Attr_CCT.curValue = value * 100; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(light, d); |
| | | });
|
| | | System.Threading.Thread.Sleep(200);
|
| | | }).Start();
|
| | | };
|
| | | }
|
| | |
|
| | |
| | |
|
| | | if (e == 0 || e == 100)
|
| | | {
|
| | | //Control.Send(CommandType_A.write, this.light);
|
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
|
| | | d.Add(FunctionAttributeKey.Brightness, light.brightness.ToString());
|
| | | Control.Ins.SendWriteCommand(light, d);
|
old mode 100755
new mode 100644
| | |
| | | /// </summary> |
| | | void LoadEvet_ChangeFadeTime() |
| | | { |
| | | barFadeTime.OnProgressChangedEvent = (sender, e) => |
| | | barFadeTime.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | light.fadeTime = e; |
| | | light.SaveFunctionData(true); |
| | |
| | | light.SetRGBcolor(e2); |
| | | colorChangeTime = DateTime.Now; |
| | | btnCurColor.BackgroundColor = (uint)(0xFF000000 + light.GetRGBcolor()); |
| | | //Control.Send(CommandType_A.write, this.light); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.RGB, light.GetRGBcolorString()); |
| | | Control.Ins.SendWriteCommand(light, d); |
| | |
| | | }; |
| | | dimmerBar.OnStopTrackingTouchEvent = (sender, e) => { |
| | | new System.Threading.Thread(() => { |
| | | System.Threading.Thread.Sleep(100); |
| | | System.Threading.Thread.Sleep(200); |
| | | onDimmerBar = false; |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | |
| | | |
| | | if (e == 0 || e == 100) |
| | | { |
| | | //Control.Send(CommandType_A.write, this.light); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.Brightness, light.brightness.ToString()); |
| | | Control.Ins.SendWriteCommand(light, d); |
| | |
| | | /// </summary> |
| | | void LoadEvet_ChangeFadeTime() |
| | | { |
| | | barFadeTime.MouseUpEventHandler = (sender, e) => |
| | | barFadeTime.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | light.fadeTime = barFadeTime.Progress; |
| | | light.SaveFunctionData(true); |
| | |
| | | { |
| | | btnSwitch.IsSelected = !btnSwitch.IsSelected; |
| | | dimmerBar.ProgressBarColor = btnSwitch.IsSelected ? CSS.CSS_Color.AuxiliaryColor1 : CSS.CSS_Color.PromptingColor2; |
| | | bodyView.colorPicker.ColorImagePath = btnSwitch.IsSelected ? "FunctionIcon/Light/ColorWheel.png" : "FunctionIcon /Light/ColorWheelGray.png"; |
| | | bodyView.colorPicker.ColorImagePath = btnSwitch.IsSelected ? "FunctionIcon/Light/ColorWheel.png" : "FunctionIcon/Light/ColorWheelGray.png"; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | light.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; |