| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.1.0" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202308041"> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.1.0" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202308071"> |
| | | <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" /> |
| | | <uses-permission android:name="android.permission.RECEIVE_SMS" /> |
| | | <!--友盟--> |
| | |
| | | //------------------------------------------------------------------------------ |
| | | // <auto-generated> |
| | | // This code was generated by a tool. |
| | | // Runtime Version:4.0.30319.42000 |
| | | // |
| | | // Changes to this file may cause incorrect behavior and will be lost if |
| | | // the code is regenerated. |
| | |
| | | { |
| | | |
| | | |
| | | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "12.2.8.165")] |
| | | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "13.2.0.99")] |
| | | public partial class Resource |
| | | { |
| | | |
| | |
| | | <MtouchDebug>true</MtouchDebug> |
| | | <CodesignKey>Apple Development: xuebiao huang (4P32GXQWWK)</CodesignKey> |
| | | <MtouchExtraArgs>-gcc_flags="-dead_strip -ObjC"</MtouchExtraArgs> |
| | | <CodesignProvision>OnPro230605-1-Dev</CodesignProvision> |
| | | <CodesignProvision>OnPro2307291-Dev</CodesignProvision> |
| | | <AllowUnsafeBlocks>true</AllowUnsafeBlocks> |
| | | </PropertyGroup> |
| | | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' "> |
| | |
| | | <MtouchEnableSGenConc>false</MtouchEnableSGenConc> |
| | | <CodesignEntitlements>Entitlements.plist</CodesignEntitlements> |
| | | <AllowUnsafeBlocks>true</AllowUnsafeBlocks> |
| | | <CodesignProvision>OnPro230630-1-Dev</CodesignProvision> |
| | | <CodesignProvision>OnPro2307291-Dev</CodesignProvision> |
| | | </PropertyGroup> |
| | | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' "> |
| | | <DebugType>none</DebugType> |
| | |
| | | // return; |
| | | //} |
| | | |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<AlinkFunctionStatusObj>(revString); |
| | | var temp = JsonConvert.DeserializeObject<AlinkFunctionStatusObj>(revString); |
| | | if (temp != null) |
| | | { |
| | | Control_Udp.ReceiveRepeatManager(temp.id, usefulBytes); |
| | |
| | | localFunction.SetAttrState(attr.key, attr.value); |
| | | |
| | | } |
| | | if(localFunction.spk == SPK.AirSwitchP3) |
| | | { |
| | | localFunction.online = updateTemp.online; |
| | | } |
| | | |
| | | //更新界面状态 |
| | | switch (localFunction.spk) |
| | |
| | | |
| | | |
| | | |
| | | //登录sip服务器 |
| | | #if __IOS__ |
| | | |
| | | Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().Login(mHDLSipInfo.sipAccount, mHDLSipInfo.sipPasswd, mHDLSipInfo.realm); |
| | | #else |
| | | if (mInterphoneType == InterphoneType.FREEVIEW.ToString()) |
| | |
| | | public string GetTempUnitString(Function function) |
| | | { |
| | | //var attr = function.GetAttribute(FunctionAttributeKey.TempType) |
| | | var tt = function.GetAttrState(FunctionAttributeKey.TempType); |
| | | if (tt == "0") |
| | | var tt = function.GetAttribute(FunctionAttributeKey.TempType); |
| | | if(tt == null) |
| | | { |
| | | return "°C"; |
| | | } |
| | | if (tt.unit == string.Empty) |
| | | { |
| | | return "°C"; |
| | | } |
| | | else |
| | | { |
| | | if (tt == "C") |
| | | if (tt.unit == "C") |
| | | { |
| | | return "°C"; |
| | | } |
| | | else if (tt == "F") |
| | | else if (tt.unit == "F") |
| | | { |
| | | return "°F"; |
| | | } |
| | | else |
| | | { |
| | | return tt; |
| | | return tt.unit; |
| | | } |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | public string GetTempUnitString(Function function) |
| | | { |
| | | var tt = function.GetAttrState(FunctionAttributeKey.TempType); |
| | | if (tt == "0") |
| | | var tt = function.GetAttribute(FunctionAttributeKey.TempType); |
| | | if (tt == null) |
| | | { |
| | | return "°C"; |
| | | } |
| | | if (tt.unit == string.Empty) |
| | | { |
| | | return "°C"; |
| | | } |
| | | else |
| | | { |
| | | return tt; |
| | | if (tt.unit == "C") |
| | | { |
| | | return "°C"; |
| | | } |
| | | else if (tt.unit == "F") |
| | | { |
| | | return "°F"; |
| | | } |
| | | else |
| | | { |
| | | return tt.unit; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | public bool collect = false; |
| | | |
| | | private bool _online = false; |
| | | /// <summary> |
| | | /// 是否在线 |
| | | /// </summary> |
| | | public bool online |
| | | { |
| | | private bool _online; |
| | | public bool online { |
| | | get |
| | | { |
| | | if (spk == SPK.AirSwitchP3) |
| | | { |
| | | return _online; |
| | | } |
| | | return true; |
| | | } |
| | | set |
| | | { |
| | | _online = value; |
| | | } |
| | | } |
| | | ///// <summary> |
| | | ///// 是否在线 |
| | | ///// </summary> |
| | | //public bool online |
| | | //{ |
| | | // get |
| | | // { |
| | | // if(spk == SPK.AirSwitchP3) |
| | | // { |
| | | // return _online; |
| | | // } |
| | | // return true; |
| | | // } |
| | | // set |
| | | // { |
| | | // _online = value; |
| | | // } |
| | | //} |
| | | |
| | | public bool isOnline() |
| | | { |
| | | if (spk == SPK.AirSwitchP3) |
| | | { |
| | | return online; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | public void setOnine(bool isOnline) |
| | | { |
| | | online = isOnline; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | foreach (var temp in gc.sids) |
| | | { |
| | | var light = FunctionList.List.GetLightList().Find((obj) => obj.sid == temp.sid); |
| | | if (light != null) |
| | | var tempDevice = FunctionList.List.GetLightList().Find((obj) => obj.sid == temp.sid); |
| | | if (tempDevice != null) |
| | | { |
| | | foreach (var attr in light.attributes) |
| | | foreach (var attr in tempDevice.attributes) |
| | | { |
| | | if (list.Find((obj) => obj.key == attr.key) == null) |
| | | { |
| | |
| | | sFunc.type = "5"; |
| | | } |
| | | |
| | | string us = ""; |
| | | switch (attr.key) |
| | | { |
| | | case FunctionAttributeKey.SetTemp: |
| | | var tt = GetAttribute(FunctionAttributeKey.TempType); |
| | | if (tt == null) |
| | | { |
| | | attr.unit = "°C"; |
| | | } |
| | | else |
| | | { |
| | | if (tt.unit == string.Empty) |
| | | { |
| | | attr.unit = "°C"; |
| | | } |
| | | else |
| | | { |
| | | if (tt.unit == "C") |
| | | { |
| | | attr.unit = "°C"; |
| | | } |
| | | else if (tt.unit == "F") |
| | | { |
| | | attr.unit = "°F"; |
| | | } |
| | | else |
| | | { |
| | | attr.unit = tt.unit; |
| | | } |
| | | } |
| | | } |
| | | break; |
| | | case FunctionAttributeKey.RoomTemp: |
| | | us = "°C"; |
| | | attr.unit = "°C"; |
| | | var tempType = attributes.Find((obj) => obj.key == FunctionAttributeKey.TempType); |
| | | if (tempType != null) |
| | | { |
| | | us = tempType.curValue.ToString(); |
| | | attr.unit = tempType.curValue.ToString(); |
| | | } |
| | | break; |
| | | case FunctionAttributeKey.Percent: |
| | | case FunctionAttributeKey.Brightness: |
| | | us = "%"; |
| | | attr.unit = "%"; |
| | | break; |
| | | case FunctionAttributeKey.CCT: |
| | | us = "K"; |
| | | attr.unit = "K"; |
| | | break; |
| | | case FunctionAttributeKey.Angle: |
| | | us = "°"; |
| | | attr.unit = "°"; |
| | | break; |
| | | } |
| | | |
| | |
| | | vv = 26; |
| | | } |
| | | sFunc.status.Add(new SceneFunctionStatus() { |
| | | UintString = us, |
| | | UintString = attr.unit, |
| | | key = attr.key, value = Convert.ToInt32(vv).ToString(), max = attr.max, min = attr.min }) ; |
| | | } |
| | | else |
| | | { |
| | | sFunc.status.Add(new SceneFunctionStatus() { |
| | | UintString = us, |
| | | UintString = attr.unit, |
| | | key = attr.key, value = attr.curValue.ToString(), max = attr.max, min = attr.min }); |
| | | } |
| | | break; |
| | |
| | | /// 云端负责生成 |
| | | /// </summary> |
| | | public string deviceId = "0"; |
| | | /// <summary> |
| | | /// 在线状态 |
| | | /// </summary> |
| | | public bool online = true; |
| | | public List<AttributesStatus> status = new List<AttributesStatus>(); |
| | | } |
| | | /// <summary> |
| | |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Tag = "OnlineTag", |
| | | Visible = !function.online |
| | | Visible = !function.isOnline() |
| | | }; |
| | | view.AddChidren(btnOffline); |
| | | |
| | |
| | | } |
| | | if (btn.Tag.ToString() == function.sid) |
| | | { |
| | | if (function.online) |
| | | if (function.isOnline()) |
| | | { |
| | | btn.UnSelectedImagePath = "Collection/Functionbg.png"; |
| | | btn.IsSelected = false; |
| | |
| | | } |
| | | else if (btn.Tag.ToString() == "OnlineTag") |
| | | { |
| | | btn.Visible = !function.online; |
| | | btn.Visible = !function.isOnline(); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | btnSwitch.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online)//离线不允许操作 |
| | | if (!function.isOnline())//离线不允许操作 |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | { |
| | | btnSwitch.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online)//离线不允许操作 |
| | | if (!function.isOnline())//离线不允许操作 |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | { |
| | | btnClose.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!curtain.online)//离线不允许操作 |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | //if (!curtain.isOnline())//离线不允许操作 |
| | | //{ |
| | | // new Tip() |
| | | // { |
| | | // CloseTime = 1, |
| | | // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | // Direction = AMPopTipDirection.None, |
| | | // }.Show(MainPage.BaseView); |
| | | // return; |
| | | //} |
| | | btnClose.IsSelected = true; |
| | | curtain.trait_on_off.curValue = "off"; |
| | | curtain.SetAttrState(FunctionAttributeKey.Percent, 0); |
| | |
| | | |
| | | btnOpen.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!curtain.online)//离线不允许操作 |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | //if (!curtain.isOnline())//离线不允许操作 |
| | | //{ |
| | | // new Tip() |
| | | // { |
| | | // CloseTime = 1, |
| | | // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | // Direction = AMPopTipDirection.None, |
| | | // }.Show(MainPage.BaseView); |
| | | // return; |
| | | //} |
| | | btnOpen.IsSelected = true; |
| | | curtain.trait_on_off.curValue = "on"; |
| | | curtain.SetAttrState(FunctionAttributeKey.Percent, 100); |
| | |
| | | }; |
| | | btnUp.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online)//离线不允许操作 |
| | | if (!function.isOnline())//离线不允许操作 |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | }; |
| | | btnDown.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online)//离线不允许操作 |
| | | if (!function.isOnline())//离线不允许操作 |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | { |
| | | if (scrolView.GetChildren(i).GetType() == typeof(FunctionControlZone)) { |
| | | var fcView = scrolView.GetChildren(i) as FunctionControlZone; |
| | | fcView.UpdataOnline(updataFunction.online); |
| | | fcView.UpdataOnline(updataFunction.isOnline()); |
| | | } |
| | | } |
| | | } |
| | |
| | | int count = 0; |
| | | foreach (var temp in FunctionList.List.InverterList()) |
| | | { |
| | | if (temp.online) |
| | | if (temp.isOnline()) |
| | | { |
| | | if (temp.trait_on_off.state.ToString() == "on") |
| | | { |
| | |
| | | bodyDiv.AddChidren(btnCollectionIcon); |
| | | } |
| | | |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | bodyDiv.BackgroundColor = CSS_Color.PromptingColor2; |
| | | btnOffline = new Button() |
| | |
| | | |
| | | btnSwitch.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online)//离线不允许操作 |
| | | if (!function.isOnline())//离线不允许操作 |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | /// </summary> |
| | | void LoadEvent_LightDimming(DiyImageSeekBar dimmerControlBar) |
| | | { |
| | | if (!function.online)//离线不允许操作 |
| | | if (!function.isOnline())//离线不允许操作 |
| | | { |
| | | //new Tip() |
| | | //{ |
| | |
| | | }; |
| | | btnUp.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online)//离线不允许操作 |
| | | if (!function.isOnline())//离线不允许操作 |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | }; |
| | | btnDown.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online)//离线不允许操作 |
| | | if (!function.isOnline())//离线不允许操作 |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | function.spk = videoDevice.spk; |
| | | function.name = videoDevice.deviceName; |
| | | function.deviceId = videoDevice.deviceId; |
| | | function.online = videoDevice.status == "online"; |
| | | function.setOnine( videoDevice.status == "online"); |
| | | function.sid = videoDevice.sid; |
| | | var video = functionList.Find((o) => o.deviceId == function.deviceId); |
| | | if (video == null) |
| | |
| | | /// <summary> |
| | | /// 显示功能Row |
| | | /// </summary> |
| | | void LoadFunctionListRow(List<Function> functions) |
| | | void LoadFunctionListRow(List<Function> functions, bool isAppend = false) |
| | | { |
| | | functionListView.RemoveAll(); |
| | | if (functions == null)
|
| | | {
|
| | | //初始值
|
| | |
| | | functions.AddRange(unallocatedList);
|
| | | functions.AddRange(allocatedList);
|
| | | } |
| | | foreach (var function in functions) |
| | | if (!isAppend) |
| | | { |
| | | showCount = -1; |
| | | functionListView.RemoveAll(); |
| | | } |
| | | for (var i = 0; i < 100; i++) |
| | | //foreach (var function in functions) |
| | | { |
| | | showCount++; |
| | | if (showCount >= functions.Count) |
| | | { |
| | | break; |
| | | } |
| | | var function = functions[showCount]; |
| | | if (!MainPage.SceneSupportFunctionList.Contains(function.spk)) |
| | | { |
| | | continue; |
| | |
| | | }; |
| | | functionRow.AddChidren(btnChooseIcon); |
| | | LoadEvent_SkipEditFunctionInfo(functionRow, btnFunctionFloorName, btnChooseIcon, btnFunctionName, function); |
| | | |
| | | } |
| | | if (functions.Count > showCount) |
| | | { |
| | | var btnAppend = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(60), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextID = StringId.LoadMore, |
| | | }; |
| | | functionListView.AddChidren(btnAppend); |
| | | btnAppend.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnAppend.RemoveFromParent(); |
| | | LoadFunctionListRow(functions, true); |
| | | }; |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 显示的设备的总数 |
| | | /// </summary> |
| | | int showCount = -1; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 住宅列表点击事件 |
| | |
| | | //红外宝当前有多少个遥控器 |
| | | pirView.geBtn.Text = Pir.currPir.FunctioList.Count.ToString(); |
| | | //红外宝是否在线-离线 |
| | | if (Pir.currPir.online) |
| | | if (Pir.currPir.isOnline()) |
| | | { |
| | | pirView.stateIconBtn.IsSelected = true; |
| | | pirView.stateTextBtn.IsSelected = true; |
| | |
| | | pirDevice.name = function.name; |
| | | pirDevice.deviceId = function.deviceId; |
| | | pirDevice.sid = function.sid; |
| | | pirDevice.online = function.online; |
| | | //pirDevice.setOnine = function.isOnline(); |
| | | pirDevice.versions = function.versions; |
| | | } |
| | | Pir.currPir = pirDevice; |
| | |
| | | }; |
| | | EventHandler<MouseEventArgs> eventHandler1 = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | if (!device.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | { |
| | | btnMinus.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | if (!device.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | }; |
| | | btnPlus.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | if (!device.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | }; |
| | | |
| | | if (!device.online) |
| | | if (!device.isOnline()) |
| | | { |
| | | arcBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | |
| | | { |
| | | btnCurtainClose.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | |
| | | btnCurtainStop.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | |
| | | btnCurtainOpen.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | CurtainAnimation(100); |
| | | }; |
| | | |
| | | if (function.online) |
| | | if (function.isOnline()) |
| | | { |
| | | btnCurtainStop.MouseDownEventHandler = (sender, e) => |
| | | { |
| | |
| | | void LoadEvent_ControlEvent() |
| | | { |
| | | btnCurtainClose.MouseUpEventHandler = (sender, e) => { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | |
| | | btnCurtainStop.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | }; |
| | | btnCurtainOpen.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | { |
| | | btnCurtainClose.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | |
| | | btnCurtainStop.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | |
| | | btnCurtainOpen.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | CurtainAnimation(100); |
| | | }; |
| | | |
| | | if (function.online) |
| | | if (function.isOnline()) |
| | | { |
| | | btnCurtainStop.MouseDownEventHandler = (sender, e) => |
| | | { |
| | |
| | | { |
| | | btnCurtainClose.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | |
| | | btnCurtainStop.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | |
| | | btnCurtainOpen.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | // DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | //}; |
| | | |
| | | if (function.online) |
| | | if (function.isOnline()) |
| | | { |
| | | |
| | | btnCurtainStop.MouseDownEventHandler = (sender, e) => |
| | |
| | | { |
| | | btnCurtainClose.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | |
| | | btnCurtainStop.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | |
| | | btnCurtainOpen.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | // DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | //}; |
| | | |
| | | if (function.online) |
| | | if (function.isOnline()) |
| | | { |
| | | |
| | | btnCurtainStop.MouseDownEventHandler = (sender, e) => |
| | |
| | | /// </summary> |
| | | private void RefreshNowDeviceStatuMemory(Function i_LocalDevice) |
| | | { |
| | | this.doorLockData.IsOnline = i_LocalDevice.online; |
| | | this.doorLockData.IsOnline = i_LocalDevice.isOnline(); |
| | | for (int i = 0; i < i_LocalDevice.attributes.Count; i++) |
| | | { |
| | | var data = i_LocalDevice.attributes[i]; |
| | |
| | | { |
| | | btnSwitchIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | }; |
| | | btnSwitch.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Net; |
| | | using HDL_ON.Common; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.DriverLayer; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Newtonsoft.Json; |
| | | //using OpenTK; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | |
| | | #endregion |
| | | |
| | | |
| | | if (Control.Ins.GatewayOnline_Local == true) |
| | | { |
| | | new System.Threading.Thread(() => |
| | | { |
| | | DriverLayer.Control.Ins.SendReadCommand(device); |
| | | Control.Ins.SendReadCommand(device); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | else |
| | | { |
| | | if (Control.Ins.GatewayOnline_Cloud) |
| | | { |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | var deviceResult = ApiUtlis.Ins.HttpRequest.GetDeviceInfo(device.deviceId); |
| | | |
| | | if (deviceResult != null) |
| | | { |
| | | if (deviceResult.Code == StateCode.SUCCESS) |
| | | { |
| | | if (deviceResult.Data != null) |
| | | { |
| | | var packList = JsonConvert.DeserializeObject<List<Function>>(deviceResult.Data.ToString()); |
| | | if (packList != null) |
| | | { |
| | | if (packList.Count > 0) |
| | | { |
| | | if (packList[0].isOnline()) |
| | | { |
| | | Control.Ins.SendReadCommand(device); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }catch(Exception ex) |
| | | { |
| | | |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | /// </summary> |
| | | public static void UpdataStatus(Function updataTemp) |
| | | { |
| | | if (!updataTemp.online)//设备不在线不更新状态 |
| | | { |
| | | return; |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | try |
| | |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | //controlView.AddChidren(btnRunStatus); //状态无法测试,暂时隐藏--2021-10-14 13:58:48 董泽斌 |
| | | controlView.AddChidren(btnRunStatus); |
| | | UpdataRunStatus(); |
| | | } |
| | | |
| | |
| | | { |
| | | btnSwitchIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | }; |
| | | btnSwitch.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | { |
| | | btnSwitchIcon.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | }; |
| | | btnSwitch.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | |
| | | if (function.online) |
| | | if (function.isOnline()) |
| | | { |
| | | barGradualChange.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | |
| | | |
| | | btn.MouseUpEventHandler = (sender, e) => { |
| | | |
| | | if (!device.online) |
| | | if (!device.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | { |
| | | btnSwitchIcon.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | }; |
| | | btnSwitch.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | /// </summary> |
| | | void LoadControlEvent() |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | /// </summary> |
| | | void LoadEvent_TempChange() |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | /// </summary>
|
| | | void LoadEvet_ChangeColorTemplatrue()
|
| | | {
|
| | | if (!function.online)
|
| | | if (!function.isOnline())
|
| | | {
|
| | | new Tip()
|
| | | {
|
| | |
| | | {
|
| | | dimmerBar.OnStopTrackingTouchEvent = (sender, e) =>
|
| | | {
|
| | | if (!function.online)
|
| | | if (!function.isOnline())
|
| | | {
|
| | | new Tip()
|
| | | {
|
| | |
| | | {
|
| | | btnSwitch.MouseUpEventHandler += (sender, e) =>
|
| | | {
|
| | | if (!function.online)
|
| | | if (!function.isOnline())
|
| | | {
|
| | | new Tip()
|
| | | {
|
| | |
| | | /// </summary> |
| | | void LoadEvent_DimmerBar() |
| | | { |
| | | if (function.online) |
| | | if (function.isOnline()) |
| | | { |
| | | dimmerBar.OnStartTrackingTouchEvent = (sender, e) => |
| | | { |
| | |
| | | { |
| | | btnSwitch.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | /// </summary> |
| | | public void LoadDiv(List<Function> functions,Action action) |
| | | { |
| | | try |
| | | { |
| | | btnIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | |
| | | } |
| | | bodyDiv.AddChidren(btnSelect); |
| | | |
| | | btnSelect.MouseUpEventHandler = (sender, e) => { |
| | | btnSelect.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | Application.HideSoftInput(); |
| | | btnSelect.IsSelected = !btnSelect.IsSelected; |
| | | if(btnSelect.IsSelected) |
| | |
| | | action(); |
| | | //} |
| | | }; |
| | | }catch (Exception ex) |
| | | { |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | /// </summary> |
| | | void LoadColorChangeEvent() |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | |
| | | dimmerBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | }; |
| | | if (function.online) |
| | | if (function.isOnline()) |
| | | { |
| | | dimmerBar.OnStartTrackingTouchEvent = (sender, e) => |
| | | { |
| | |
| | | { |
| | | btnRestoredPoint.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | return; |
| | | } |
| | |
| | | /// </summary> |
| | | void LoadColorChangeEvent() |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | |
| | | dimmerBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | }; |
| | | if (function.online) |
| | | if (function.isOnline()) |
| | | { |
| | | dimmerBar.OnStartTrackingTouchEvent = (sender, e) => |
| | | { |
| | |
| | | { |
| | | btnRestoredPoint.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | return; |
| | | } |
| | |
| | | { |
| | | btnSwitchIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | }; |
| | | btnSwitch.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | { |
| | | |
| | | var a31player = A31MusicModel.A31MusicModelList[i]; |
| | | //if (a31player.functionMusic.online == false) |
| | | //if (a31player.functionMusic.isOnline() == false) |
| | | //{ |
| | | // //不在线不显示 |
| | | // continue; |
| | |
| | | { |
| | | |
| | | var a31player = A31MusicModel.A31MusicModelList[i]; |
| | | if (a31player.functionMusic.online == false) |
| | | if (a31player.functionMusic.isOnline() == false) |
| | | { |
| | | //不在线不读取 |
| | | continue; |
| | |
| | | { |
| | | while (true) |
| | | { |
| | | if (!player.functionMusic.online) |
| | | if (!player.functionMusic.isOnline()) |
| | | { |
| | | ///不在线不读状态 |
| | | continue; |
| | |
| | | }; |
| | | faceUnlockView.AddChidren(btnFaceUnlockTipText); |
| | | |
| | | var btnFaceUnlockSwitchIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(322), |
| | | Y = Application.GetRealHeight(8), |
| | | Width = Application.GetMinRealAverage(36), |
| | | Height = Application.GetMinRealAverage(36), |
| | | UnSelectedImagePath = "Public/Switch_2.png", |
| | | SelectedImagePath = "Public/SwitchOn_2.png", |
| | | IsSelected = faceUnlockSwitch, |
| | | }; |
| | | faceUnlockView.AddChidren(btnFaceUnlockSwitchIcon); |
| | | //var btnFaceUnlockSwitchIcon = new Button() |
| | | //{ |
| | | // X = Application.GetRealWidth(322), |
| | | // Y = Application.GetRealHeight(8), |
| | | // Width = Application.GetMinRealAverage(36), |
| | | // Height = Application.GetMinRealAverage(36), |
| | | // UnSelectedImagePath = "Public/Switch_2.png", |
| | | // SelectedImagePath = "Public/SwitchOn_2.png", |
| | | // IsSelected = faceUnlockSwitch, |
| | | //}; |
| | | //faceUnlockView.AddChidren(btnFaceUnlockSwitchIcon); |
| | | |
| | | |
| | | |
| | |
| | | contentView.AddChidren(view); |
| | | |
| | | |
| | | btnFaceUnlockSwitchIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | waitPage.Start(""); |
| | | bool changeState = false; |
| | | if (!btnFaceUnlockSwitchIcon.IsSelected) |
| | | { |
| | | btnFaceUnlockSwitchIcon.IsSelected = true; |
| | | changeState = true; |
| | | } |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | var pack = ApiUtlis.Ins.HttpRequest.SetFaceUnlockCfg(device.deviceId, changeState, faceUnlockSetup.mode); |
| | | if (pack != null && pack.Code == StateCode.SUCCESS) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //更新界面 |
| | | faceUnlockSetup.enabled = btnFaceUnlockSwitchIcon.IsSelected = changeState; |
| | | loadSubView(view, faceUnlockSetup); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | //失败提示 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (!string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | if (string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | pack.message = Language.StringByID(StringId.OperationFailed); |
| | | } |
| | | var tip = new Tip() |
| | | { |
| | | MaxWidth = Application.GetRealWidth(300), |
| | | Text = $"{pack.message}({pack.Code})", |
| | | CloseTime = 3, |
| | | Direction = AMPopTipDirection.None |
| | | }; |
| | | tip.Show(MainPage.BaseView); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"btnFaceUnlockSwitchIcon error : {ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | //btnFaceUnlockSwitchIcon.MouseUpEventHandler = (sender, e) => |
| | | //{ |
| | | // waitPage.Start(""); |
| | | // bool changeState = false; |
| | | // if (!btnFaceUnlockSwitchIcon.IsSelected) |
| | | // { |
| | | // btnFaceUnlockSwitchIcon.IsSelected = true; |
| | | // changeState = true; |
| | | // } |
| | | // new System.Threading.Thread(() => |
| | | // { |
| | | // try |
| | | // { |
| | | // var pack = ApiUtlis.Ins.HttpRequest.SetFaceUnlockCfg(device.deviceId, changeState, faceUnlockSetup.mode); |
| | | // if (pack != null && pack.Code == StateCode.SUCCESS) |
| | | // { |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // //更新界面 |
| | | // faceUnlockSetup.enabled = btnFaceUnlockSwitchIcon.IsSelected = changeState; |
| | | // loadSubView(view, faceUnlockSetup); |
| | | // }); |
| | | // } |
| | | // else |
| | | // { |
| | | // //失败提示 |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // if (!string.IsNullOrEmpty(pack.message)) |
| | | // { |
| | | // if (string.IsNullOrEmpty(pack.message)) |
| | | // { |
| | | // pack.message = Language.StringByID(StringId.OperationFailed); |
| | | // } |
| | | // var tip = new Tip() |
| | | // { |
| | | // MaxWidth = Application.GetRealWidth(300), |
| | | // Text = $"{pack.message}({pack.Code})", |
| | | // CloseTime = 3, |
| | | // Direction = AMPopTipDirection.None |
| | | // }; |
| | | // tip.Show(MainPage.BaseView); |
| | | // } |
| | | // }); |
| | | // } |
| | | // } |
| | | // catch (Exception ex) |
| | | // { |
| | | // MainPage.Log($"btnFaceUnlockSwitchIcon error : {ex.Message}"); |
| | | // } |
| | | // finally |
| | | // { |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // waitPage.Hide(); |
| | | // }); |
| | | // } |
| | | // }) |
| | | // { IsBackground = true }.Start(); |
| | | //}; |
| | | |
| | | |
| | | new System.Threading.Thread(() => { |
| | | try |
| | | { |
| | | var pack = ApiUtlis.Ins.HttpRequest.GetFaceUnlockCfg(device.deviceId); |
| | | if (pack != null && pack.Code == StateCode.SUCCESS) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //更新界面 |
| | | faceUnlockSetup = Newtonsoft.Json.JsonConvert.DeserializeObject<FaceUnlockSetupObj>(pack.Data.ToString()); |
| | | btnFaceUnlockSwitchIcon.IsSelected = faceUnlockSetup.enabled; |
| | | loadSubView(view, faceUnlockSetup); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | //失败提示 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (!string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | if (string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | pack.message = Language.StringByID(StringId.OperationFailed); |
| | | } |
| | | var tip = new Tip() |
| | | { |
| | | MaxWidth = Application.GetRealWidth(300), |
| | | Text = $"{pack.message}({pack.Code})", |
| | | CloseTime = 3, |
| | | Direction = AMPopTipDirection.None |
| | | }; |
| | | tip.Show(MainPage.BaseView); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"UnlockSettingPage error : {ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | }); |
| | | } |
| | | //new System.Threading.Thread(() => { |
| | | // try |
| | | // { |
| | | // var pack = ApiUtlis.Ins.HttpRequest.GetFaceUnlockCfg(device.deviceId); |
| | | // if (pack != null && pack.Code == StateCode.SUCCESS) |
| | | // { |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // //更新界面 |
| | | // faceUnlockSetup = Newtonsoft.Json.JsonConvert.DeserializeObject<FaceUnlockSetupObj>(pack.Data.ToString()); |
| | | // btnFaceUnlockSwitchIcon.IsSelected = faceUnlockSetup.enabled; |
| | | // loadSubView(view, faceUnlockSetup); |
| | | // }); |
| | | // } |
| | | // else |
| | | // { |
| | | // //失败提示 |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // if (!string.IsNullOrEmpty(pack.message)) |
| | | // { |
| | | // if (string.IsNullOrEmpty(pack.message)) |
| | | // { |
| | | // pack.message = Language.StringByID(StringId.OperationFailed); |
| | | // } |
| | | // var tip = new Tip() |
| | | // { |
| | | // MaxWidth = Application.GetRealWidth(300), |
| | | // Text = $"{pack.message}({pack.Code})", |
| | | // CloseTime = 3, |
| | | // Direction = AMPopTipDirection.None |
| | | // }; |
| | | // tip.Show(MainPage.BaseView); |
| | | // } |
| | | // }); |
| | | // } |
| | | // } |
| | | // catch (Exception ex) |
| | | // { |
| | | // MainPage.Log($"UnlockSettingPage error : {ex.Message}"); |
| | | // } |
| | | // finally |
| | | // { |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // waitPage.Hide(); |
| | | // }); |
| | | // } |
| | | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | //}) |
| | | //{ IsBackground = true }.Start(); |
| | | |
| | | } |
| | | |
| | |
| | | /// <summary> |
| | | /// 开关 |
| | | /// </summary> |
| | | public bool enabled = false; |
| | | public bool enabled = true; |
| | | /// <summary> |
| | | /// 解锁方式 0-自动 1-手动 |
| | | /// </summary> |