Merge remote-tracking branch 'origin/release0123' into wjc
| | |
| | | 526=Cancel account |
| | | 527=Homekit support notes |
| | | 528=Firmware update |
| | | |
| | | 529= |
| | | 530=In order to prevent the wrong touch and click of opening and closing the door and ensure family safety, please enter your door lock password. |
| | | 531=Password free unlocking within five minutes |
| | | 532=The device is offline and cannot be operated temporarily |
| | | |
| | | |
| | | 1000=Room Humidity |
| | | 1001=V-chip |
| | | 1002=Anion |
| | |
| | | 526=注销账号 |
| | | 527=支持HomeKit说明 |
| | | 528=固件更新 |
| | | 529= |
| | | 530=为防止开关门的误触点击,保证家庭安全,请输入您的门锁开门密码。 |
| | | 531=五分钟内免密码开锁 |
| | | 532=设备离线中,暂时无法操作 |
| | | |
| | | 1000=室内湿度 |
| | | 1001=童锁 |
| | |
| | | 526=аннулировать счёт |
| | | 527=инструкция по поддержке набора инструментальных средств для семей |
| | | 528=обновление прошивки |
| | | 529= |
| | | 530=In order to prevent the wrong touch and click of opening and closing the door and ensure family safety, please enter your door lock password. |
| | | 531=Password free unlocking within five minutes |
| | | 532=The device is offline and cannot be operated temporarily |
| | | |
| | | |
| | | |
| | | 1000=Влажность в Помещении |
| | | 1001=V-образный чип |
| | |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvironmentalScience\HistoryOpionBg2.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvironmentalScience\HistoryOpionBg3.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvironmentalScience\HistoryOpionBg4.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Collection\FunctionOfflineBg.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <AndroidResource Include="Resources\values\colors.xml" /> |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202202281" android:versionName="1.5.4" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools"> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202203111" android:versionName="1.5.5" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools"> |
| | | <uses-sdk android:minSdkVersion="28" android:targetSdkVersion="30" /> |
| | | <!--友盟--> |
| | | <!--<uses-sdk android:minSdkVersion="8"></uses-sdk>--> |
| | |
| | | { |
| | | //只触发一次 |
| | | //Shared.Application.LocationAction = null; |
| | | new HDL_ON.DAL.Server.HttpServerRequest().GetCityWeatherInfo(lon.ToString(), lat.ToString()); |
| | | new HDL_ON.DAL.Server.HttpServerRequest().GetCityWeatherInfo(lon.ToString().Replace(",", "."), lat.ToString().Replace(",", ".")); |
| | | } |
| | | isfirst = false; |
| | | ///监听经纬度 |
| | |
| | | { |
| | | Language.CurrentLanguage = "Czech"; |
| | | } |
| | | else if (NSLocale.PreferredLanguages[0].Contains("ru-")) |
| | | { |
| | | Language.CurrentLanguage = "russian"; |
| | | } |
| | | //else if (NSLocale.PreferredLanguages[0].Contains("ru-")) |
| | | //{ |
| | | // Language.CurrentLanguage = "russian"; |
| | | //} |
| | | else |
| | | { |
| | | Language.CurrentLanguage = "English"; |
| | |
| | | <WarningLevel>4</WarningLevel> |
| | | <CodesignEntitlements>Entitlements.plist</CodesignEntitlements> |
| | | <MtouchArch>ARM64</MtouchArch> |
| | | <CodesignKey>Apple Distribution: HDL Automation Co., Ltd (BVTA78PRYA)</CodesignKey> |
| | | <CodesignKey>iPhone Distribution: HDL Automation Co., Ltd (BVTA78PRYA)</CodesignKey> |
| | | <MtouchLink>SdkOnly</MtouchLink> |
| | | <MtouchExtraArgs>-gcc_flags="-dead_strip -ObjC"</MtouchExtraArgs> |
| | | <MtouchI18n>cjk</MtouchI18n> |
| | | <AllowUnsafeBlocks>true</AllowUnsafeBlocks> |
| | | <CodesignProvision>ComHdlOnProAdHoc20220117-1</CodesignProvision> |
| | | </PropertyGroup> |
| | | <ItemGroup> |
| | | <Reference Include="System" /> |
| | |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvironmentalScience\HistoryOpionBg2.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvironmentalScience\HistoryOpionBg3.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvironmentalScience\HistoryOpionBg4.png" /> |
| | | <BundleResource Include="Resources\Phone\Collection\FunctionOfflineBg.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ITunesArtwork Include="iTunesArtwork" /> |
| | |
| | | <key>UIStatusBarStyle</key> |
| | | <string>UIStatusBarStyleLightContent</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>1.5.402203011</string> |
| | | <string>1.5.502203111</string> |
| | | <key>CFBundleVersion</key> |
| | | <string>1.5.403011</string> |
| | | <string>1.5.503111</string> |
| | | <key>NSLocationWhenInUseUsageDescription</key> |
| | | <string>Use geographic location to provide services such as weather</string> |
| | | <key>NSAppleMusicUsageDescription</key> |
| | |
| | | try |
| | | { |
| | | Shared.Application.LocationAction = null; |
| | | new HttpServerRequest().GetCityWeatherInfo(lon.ToString(), lat.ToString()); |
| | | new HttpServerRequest().GetCityWeatherInfo(lon.ToString().Replace(",", "."), lat.ToString().Replace(",", ".")); |
| | | } |
| | | catch(Exception ex) |
| | | { |
| | |
| | | 526=Cancel account |
| | | 527=Homekit support notes |
| | | 528=Firmware update |
| | | |
| | | 529= |
| | | 530=In order to prevent the wrong touch and click of opening and closing the door and ensure family safety, please enter your door lock password. |
| | | 531=Password free unlocking within five minutes |
| | | 532=The device is offline and cannot be operated temporarily |
| | | |
| | | |
| | | 1000=Room Humidity |
| | | 1001=V-chip |
| | | 1002=Anion |
| | |
| | | 526=注销账号 |
| | | 527=支持HomeKit说明 |
| | | 528=固件更新 |
| | | 529= |
| | | 530=为防止开关门的误触点击,保证家庭安全,请输入您的门锁开门密码。 |
| | | 531=五分钟内免密码开锁 |
| | | 532=设备离线中,暂时无法操作 |
| | | |
| | | 1000=室内湿度 |
| | | 1001=童锁 |
| | |
| | | 526=аннулировать счёт |
| | | 527=инструкция по поддержке набора инструментальных средств для семей |
| | | 528=обновление прошивки |
| | | 529= |
| | | 530=In order to prevent the wrong touch and click of opening and closing the door and ensure family safety, please enter your door lock password. |
| | | 531=Password free unlocking within five minutes |
| | | 532=The device is offline and cannot be operated temporarily |
| | | |
| | | |
| | | |
| | | 1000=Влажность в Помещении |
| | | 1001=V-образный чип |
| | |
| | | { |
| | | public static class StringId |
| | | { |
| | | |
| | | |
| | | /// <summary> |
| | | /// 设备离线中,暂时无法操作 |
| | | /// </summary> |
| | | public const int DeviceOfflineCannotOption = 532; |
| | | /// <summary> |
| | | /// 五分钟内免密码开锁 |
| | | /// </summary> |
| | | public const int DoorLock5minTip = 531; |
| | | /// <summary> |
| | | /// 为防止开关门的误触点击,保证家庭安全,请输入您的门锁开门密码。 |
| | | /// </summary> |
| | | public const int DoorLockEntryPasswordTip = 530; |
| | | /// <summary> |
| | | /// 密码输入 |
| | | /// </summary> |
| | | public const int EntryPassword = 529; |
| | | /// <summary> |
| | | /// 固件更新 |
| | | /// </summary> |
| | |
| | | } |
| | | } |
| | | |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public DateTime LastTimeOpenDoor = DateTime.MinValue; |
| | | public bool VerOpenDoorPw |
| | | { |
| | | get |
| | | { |
| | | return (DateTime.Now - LastTime).TotalMinutes > 5; |
| | | } |
| | | } |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public string doorPasswordString; |
| | | |
| | | /// <summary> |
| | | /// 记录自动化筛选的房间的条件 |
| | | /// </summary> |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public Entity.Room logicselectedRoom = new Entity.Room { roomId = "6688",roomName = Language.StringByID(StringId.allAreas) }; |
| | | /// <summary> |
| | | /// 记录自动化筛选的功能的条件 |
| | | /// </summary> |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public string logicselectedFunction; |
| | | |
| | | #endregion |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="function"></param> |
| | | /// <param name="useRemote">是否直接使用远程发送</param> |
| | | /// <returns></returns> |
| | | public void SendWriteCommand(Function function, Dictionary<string, string> commandDictionary, bool useRemote = false,int resend = 3) |
| | | public bool SendWriteCommand(Function function, Dictionary<string, string> commandDictionary, bool useRemote = false,int resend = 3) |
| | | { |
| | | function.controlCounter++; |
| | | function.refreshTime = DateTime.Now; |
| | | |
| | | |
| | | //如果是控制调光的开时,亮度值不能为0 |
| | | if (commandDictionary.Count > 2) |
| | |
| | | upDataObj.objects.Add(asd); |
| | | revString = Newtonsoft.Json.JsonConvert.SerializeObject(upDataObj); |
| | | UpdataFunctionStatus(revString, null, true); |
| | | return; |
| | | return true; |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | /// <summary> |
| | | /// 全开全关功能 |
| | |
| | | } |
| | | else |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", doorlock.deviceId); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | HttpUtil.RequestHttpsPost("/home-wisdom/app/device/door/remoteOpen", requestJson); |
| | | ConfirmUnlocking(doorlock.deviceId, extStr); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 确认开锁 |
| | | /// </summary> |
| | | /// <param name="functionId"></param> |
| | | /// <param name="pwd"></param> |
| | | public void ConfirmUnlocking(string functionId,string pwd) |
| | | { |
| | | Loading loading = new Loading(); |
| | | MainPage.BaseView.AddChidren(loading); |
| | | loading.BackgroundColor = 0x88000000; |
| | | loading.LodingBackgroundColor = UI.CSS.CSS_Color.BackgroundColor; |
| | | loading.Start(Language.StringByID(StringId.PleaseWait)); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", functionId); |
| | | d.Add("pwd", pwd); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPost("/home-wisdom/app/device/door/pwdConfirm", requestJson); |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | Newtonsoft.Json.Linq.JObject pairs = Newtonsoft.Json.Linq.JObject.Parse(pack.Data.ToString()); |
| | | var scrip = pairs.GetValue("scrip"); |
| | | |
| | | d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", functionId); |
| | | d.Add("scrip", scrip); |
| | | requestJson = HttpUtil.GetSignRequestJson(d); |
| | | pack = HttpUtil.RequestHttpsPost("/home-wisdom/app/device/door/remoteOpen", requestJson); |
| | | //if(pack.Code == StateCode.SUCCESS) |
| | | //{ |
| | | // return true; |
| | | //} |
| | | //else |
| | | //{ |
| | | // return false; |
| | | //} |
| | | if (pack.Code != StateCode.SUCCESS) { |
| | | Application.RunOnMainThread(() => { |
| | | new PublicAssmebly().TipMsg(Language.StringByID(StringId.Tip), pack.message); |
| | | UserInfo.Current.doorPasswordString = "";// |
| | | UserInfo.Current.LastTimeOpenDoor = DateTime.MinValue; |
| | | }); |
| | | } |
| | | } |
| | | if (pack.Code != StateCode.SUCCESS) |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | new PublicAssmebly().TipMsg(Language.StringByID(StringId.Tip), pack.message); |
| | | }); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | loading.Hide(); |
| | | loading.RemoveFromParent(); |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | //密码冻结 |
| | | //密码验证 |
| | | |
| | |
| | | sendDataObj.time_stamp = Utlis.GetTimestamp(); |
| | | var acd = new AlinkDoorlockStatus(); |
| | | acd.sid = sid; |
| | | acd.user_id = userId; |
| | | acd.user_id = extStr; |
| | | acd.ext_str = extStr; |
| | | #if DEBUG |
| | | acd.user_id = "013"; |
| | | acd.ext_str = "999999"; |
| | | #endif |
| | | sendDataObj.objects.Add(acd); |
| | | return sendDataObj; |
| | | } |
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Music\MusicProperty.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\AboutOn\SupportHomeKitNotesPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\AboutOn\FirmwareUpdateView.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\DoorLock\DoorLockUnlockPage.cs" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" />
|
| | |
| | | /// <summary> |
| | | /// 版本号 |
| | | /// </summary> |
| | | public static string VersionString = "1.5.4"; |
| | | public static string VersionString = "1.5.5"; |
| | | ///// <summary> |
| | | ///// 客户端类型 |
| | | ///// </summary> |
| | |
| | | airFresh2.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | break; |
| | | case SPK.DoorLock: |
| | | var doorLockPage = new DoorLockListPage(); |
| | | var doorLockPage = new DoorLockPage(); |
| | | doorLockPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | break; |
| | | } |
| | |
| | | return eventHandler; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | btnIcon.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | |
| | | |
| | | //ESOnVideo.Current.Test(false); |
| | | |
| | | //return; |
| | |
| | | etAccount.Text = "18316672920"; |
| | | //etAccount.Text = "18316120654";//tujie |
| | | //etAccount.Text = "13450425807";//黄竹溪 knx项目 |
| | | //etAccount.Text = "18140004933"; |
| | | etAccount.Text = "18244942707"; |
| | | } |
| | | else |
| | | { |
| | |
| | | //etAccount.Text = "info@smartlife-ks.com"; |
| | | //etAccount.Text = "551775569@qq.com";//wcf |
| | | etAccount.Text = "15626203746"; |
| | | etAccount.Text = "zhangquansongjava@163.com"; |
| | | etAccount.Text = "s.savinov@hdlautomation.ru"; |
| | | //etAccount.Text = "zhangquansongjava@163.com"; |
| | | //etAccount.Text = "s.savinov@hdlautomation.ru"; |
| | | } |
| | | b = !b; |
| | | etPassword.Text = "123456"; |
| | |
| | | #if DEBUG |
| | | btnResidenceName.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | |
| | | if (UserInfo.Current.VerOpenDoorPw || string.IsNullOrEmpty(UserInfo.Current.doorPasswordString)) |
| | | { |
| | | var page = new DoorLockUnlockPage(new Function()); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadView(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | } |
| | | else |
| | | { |
| | | Control.Ins.OneKeyUnlocking(new Function(), UserInfo.Current.doorPasswordString); |
| | | } |
| | | |
| | | }; |
| | | #endif |
| | | |
| | |
| | | //音乐模块有主从关系,需要特殊处理 |
| | | if (SPK.MusicSpkList().Contains( function.spk)) |
| | | { |
| | | continue; |
| | | //var music = function as Music.A31MusicModel; |
| | | //var music = Music.A31MusicModel.A31MusicModelList.Find((obj) => obj.sid == function.sid); |
| | | //if (music == null) |
| | |
| | | functionViews.Add(functionView); |
| | | LoadDeviceFunctionDiv(functionView, function); |
| | | index++; |
| | | |
| | | |
| | | if (!function.online) |
| | | { |
| | | btnbg.UnSelectedImagePath = "Collection/FunctionOfflineBg.png"; |
| | | } |
| | | } |
| | | |
| | | if (index == 0) |
| | |
| | | { |
| | | UpdataFunctionStates(function); |
| | | } |
| | | |
| | | |
| | | if (!function.online) |
| | | { |
| | | var btnOffline = new Button() |
| | | { |
| | | X = btnIcon.Right, |
| | | Y = Application.GetRealWidth(16), |
| | | Height = Application.GetMinRealAverage(32), |
| | | TextID = StringId.DeviceOffline, |
| | | TextColor = CSS_Color.WarningColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextAlignment = TextAlignment.CenterLeft |
| | | }; |
| | | view.AddChidren(btnOffline); |
| | | |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | { |
| | | if (view.Tag.ToString() == function.sid) |
| | | { |
| | | //if (!function.online) |
| | | //{ |
| | | // view.UnSelectedImagePath = "Collection/FunctionOfflineBg.png"; |
| | | //} |
| | | |
| | | var state = false; |
| | | if (function.spk == SPK.CurtainRoller || function.spk == SPK.CurtainShades || function.spk == SPK.CurtainTrietex || |
| | | function.spk == SPK.CurtainSwitch)//窗帘设备根据百分比判断开关状态 |
| | |
| | | { |
| | | btnSwitch.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online)//离线不允许操作 |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | btnSwitch.IsSelected = !btnSwitch.IsSelected; |
| | | new System.Threading.Thread(() => |
| | | { |
| | |
| | | { |
| | | btnSwitch.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online)//离线不允许操作 |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | btnSwitch.IsSelected = !btnSwitch.IsSelected; |
| | |
| | | { |
| | | btnClose.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!curtain.online)//离线不允许操作 |
| | | { |
| | | 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; |
| | | } |
| | | btnOpen.IsSelected = true; |
| | | curtain.trait_on_off.curValue = "on"; |
| | | curtain.SetAttrState(FunctionAttributeKey.Percent, 100); |
| | |
| | | }; |
| | | btnUp.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online)//离线不允许操作 |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | |
| | | }; |
| | | btnDown.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online)//离线不允许操作 |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | |
| | | } |
| | | LoadDiv(); |
| | | |
| | | btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/{function.IconName}.png"; |
| | | |
| | | |
| | | btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/{function.IconName}.png"; |
| | | |
| | | if (SPK.CurtainSpkList().Contains(function.spk)) |
| | | {//窗帘没有开关按钮 |
| | | CurtainFragment(); |
| | |
| | | this.AddChidren(btnTipPowerLow); |
| | | } |
| | | } |
| | | } |
| | | else if (function.spk == SPK.DoorLock) |
| | | { |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/DoorLock/DoorLock.png"; |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | LoadEvent_DivSkipEvent(); |
| | | LoadEvent_FunctionCollection(); |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | UnSelectedImagePath = "Collection/CollectionGrayIcon.png", |
| | | IsSelected = function.collect |
| | | }; |
| | | if ( !SPK.ArmSensorSpkList().Contains(function.spk) && !SPK.EnvironDeviceSpkList().Contains( function.spk))//!DB_ResidenceData.Instance.CurrentRegion.isOtherShare && |
| | | if ( !SPK.ArmSensorSpkList().Contains(function.spk) |
| | | && function.spk != SPK.DoorLock |
| | | && !SPK.EnvironDeviceSpkList().Contains( function.spk))//!DB_ResidenceData.Instance.CurrentRegion.isOtherShare && |
| | | { |
| | | bodyDiv.AddChidren(btnCollectionIcon); |
| | | } |
| | | |
| | | if (!function.online) |
| | | { |
| | | bodyDiv.BackgroundColor = CSS_Color.PromptingColor2; |
| | | var btnOffline = new Button() |
| | | { |
| | | X = Application.GetRealWidth(8 + 10 + 32), |
| | | Y = Application.GetRealHeight(28 + 24), |
| | | Height = Application.GetRealHeight(30), |
| | | TextID = StringId.DeviceOffline, |
| | | TextColor = CSS_Color.WarningColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextAlignment = TextAlignment.CenterLeft |
| | | }; |
| | | bodyDiv.AddChidren(btnOffline); |
| | | } |
| | | } |
| | | |
| | |
| | | btnCurtainOpen.UnSelectedImagePath = "FunctionIcon/Curtain/CurtainUpIcon.png"; |
| | | btnCurtainOpen.SelectedImagePath = "FunctionIcon/Curtain/CurtainUpIconOn.png"; |
| | | } |
| | | LoadEvent_ControlCurtain(btnCurtainStop, btnCurtainOpen, btnCurtainClose, function); |
| | | LoadEvent_ControlCurtain(btnCurtainStop, btnCurtainOpen, btnCurtainClose); |
| | | #endregion |
| | | } |
| | | /// <summary> |
| | |
| | | }; |
| | | bodyDiv.AddChidren(btnLastStates); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | btnSwitch.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online)//离线不允许操作 |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | btnSwitch.IsSelected = !btnSwitch.IsSelected; |
| | | |
| | | if(SPK.NotStatusSpkList.Contains( function.spk )) |
| | |
| | | } |
| | | #region 灯光的事件列表 |
| | | |
| | | /// <summary> |
| | | /// 灯光开关事件 |
| | | /// </summary> |
| | | void LoadEvent_LightSwitch(Button btnSwitch) |
| | | { |
| | | btnSwitch.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | btnSwitch.IsSelected = !btnSwitch.IsSelected; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | if (SPK.LightSpkList().Contains( function.spk)) |
| | | { |
| | | function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("on_off", function.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 灯光亮度调节事件 |
| | | /// </summary> |
| | | void LoadEvent_LightDimming(DiyImageSeekBar dimmerControlBar) |
| | | { |
| | | if(function.spk == SPK.LightDimming || function.spk == SPK.LightRGB) |
| | | if (!function.online)//离线不允许操作 |
| | | { |
| | | //new Tip() |
| | | //{ |
| | | // CloseTime = 1, |
| | | // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | // Direction = AMPopTipDirection.None, |
| | | //}.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | if (function.spk == SPK.LightDimming || function.spk == SPK.LightRGB) |
| | | { |
| | | dimmerControlBar.OnStartTrackingTouchEvent = (sender, e) => { |
| | | onDimmerBar = true; |
| | |
| | | /// <param name="btnStop"></param> |
| | | /// <param name="btnOpen"></param> |
| | | /// <param name="btnClose"></param> |
| | | void LoadEvent_ControlCurtain(Button btnStop, Button btnOpen, Button btnClose, Function curtain) |
| | | void LoadEvent_ControlCurtain(Button btnStop, Button btnOpen, Button btnClose) |
| | | { |
| | | btnClose.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online)//离线不允许操作 |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | btnClose.IsSelected = true; |
| | | btnStop.IsSelected = false; |
| | | btnOpen.IsSelected = false; |
| | | curtain.trait_on_off.curValue = "off"; |
| | | curtain.SetAttrState(FunctionAttributeKey.Percent, 0); |
| | | function.trait_on_off.curValue = "off"; |
| | | function.SetAttrState(FunctionAttributeKey.Percent, 0); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(curtain, d); |
| | | d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | }; |
| | | |
| | | btnStop.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online)//离线不允许操作 |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | btnStop.IsSelected = true; |
| | | btnClose.IsSelected = false; |
| | | btnOpen.IsSelected = false; |
| | | curtain.trait_on_off.curValue = "stop"; |
| | | function.trait_on_off.curValue = "stop"; |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(curtain, d); |
| | | d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | }; |
| | | |
| | | btnOpen.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online)//离线不允许操作 |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | btnOpen.IsSelected = true; |
| | | btnClose.IsSelected = false; |
| | | btnStop.IsSelected = false; |
| | | curtain.trait_on_off.curValue = "on"; |
| | | curtain.SetAttrState(FunctionAttributeKey.Percent, 100); |
| | | function.trait_on_off.curValue = "on"; |
| | | function.SetAttrState(FunctionAttributeKey.Percent, 100); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(curtain, d); |
| | | d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | }; |
| | | } |
| | | #endregion |
| | |
| | | }; |
| | | btnUp.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online)//离线不允许操作 |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | |
| | | }; |
| | | btnDown.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online)//离线不允许操作 |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | |
| | | /// <summary> |
| | | /// 默认选中是房间时:全部区域 |
| | | /// </summary> |
| | | public static Entity.Room selectedRoom = new Entity.Room { roomId ="6688" }; |
| | | //public static Entity.Room selectedRoom = new Entity.Room { roomId ="6688" }; |
| | | |
| | | /// <summary> |
| | | /// 默认选中是设备类型时:全部功能 |
| | |
| | | funAllAreaView.btnText1.Text = (areaView.btnClick.Tag as Entity.Room).roomName; |
| | | ///切换房间默认功能类型全部; |
| | | funAllAreaView.btnText2.Text = Language.StringByID(StringId.allFun); |
| | | selectedRoom = (areaView.btnClick.Tag as Entity.Room); |
| | | //selectedRoom = (areaView.btnClick.Tag as Entity.Room); |
| | | UserInfo.Current.logicselectedRoom = (areaView.btnClick.Tag as Entity.Room); |
| | | UserInfo.Current.logicselectedFunction = ""; |
| | | ///获取显示设备列表 |
| | | var list = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(areaView.btnClick.Tag as Entity.Room, if_type); |
| | | |
| | |
| | | { |
| | | |
| | | //获取最终显示列表 |
| | | var functionList = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(selectedRoom, if_type); |
| | | var functionList = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(UserInfo.Current.logicselectedRoom, if_type); |
| | | //获取设备列表的类型(例如:灯光类,窗帘类。。。) |
| | | var deviceTypeList = LogicMethod.CurrLogicMethod.GetDeviceTypeList(functionList); |
| | | if (deviceTypeList.Count == 0) |
| | |
| | | { |
| | | fLayout.RemoveFromParent(); |
| | | funAllAreaView.btnText2.Text = areaView.btnClick.Tag.ToString(); |
| | | UserInfo.Current.logicselectedFunction = areaView.btnClick.Tag.ToString(); |
| | | ///获取单个类型(例如:灯光类。。)设备FunctionType列表 |
| | | var typeFunctionList = LogicMethod.CurrLogicMethod.GetDeviceTypeFunctionList(areaView.btnClick.Tag.ToString()); |
| | | var typeFunctionList = LogicMethod.CurrLogicMethod.GetDeviceTypeFunctionList(UserInfo.Current.logicselectedFunction); |
| | | ///获取单个灯光类型(例如:灯光1,灯光2。。)显示设备列表 |
| | | var lists = LogicMethod.CurrLogicMethod.GetShowDeviceList(typeFunctionList, functionList); |
| | | DeviceListView(vv, lists); |
| | | var lists2 = LogicMethod.CurrLogicMethod.GetShowDeviceList(typeFunctionList, functionList); |
| | | DeviceListView(vv, lists2); |
| | | |
| | | }; |
| | | if (deviceTypeList.Count - 1 == i) |
| | | { |
| | |
| | | funAllAreaView.btnText2.MouseUpEventHandler += funClick; |
| | | funAllAreaView.btnIcon2.MouseUpEventHandler += funClick; |
| | | ///获取显示设备列表 |
| | | var deviceList = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(selectedRoom, if_type); |
| | | DeviceListView(vv, deviceList); |
| | | var deviceList = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(UserInfo.Current.logicselectedRoom, if_type); |
| | | |
| | | if (!string.IsNullOrEmpty(UserInfo.Current.logicselectedFunction)) |
| | | { |
| | | |
| | | ///获取单个类型(例如:灯光类。。)设备FunctionType列表 |
| | | var typeFunctionList = LogicMethod.CurrLogicMethod.GetDeviceTypeFunctionList(UserInfo.Current.logicselectedFunction); |
| | | ///获取单个灯光类型(例如:灯光1,灯光2。。)显示设备列表 |
| | | var lists = LogicMethod.CurrLogicMethod.GetShowDeviceList(typeFunctionList, deviceList); |
| | | |
| | | funAllAreaView.btnText2.Text = UserInfo.Current.logicselectedFunction; |
| | | DeviceListView(vv, lists); |
| | | } |
| | | else |
| | | { |
| | | DeviceListView(vv, deviceList); |
| | | } |
| | | funAllAreaView.btnText1.Text = UserInfo.Current.logicselectedRoom.roomName; |
| | | } |
| | | |
| | | |
| | |
| | | /// <param name="deviceList"></param> |
| | | public void DeviceListView(VerticalScrolViewLayout verticalScrolView, List<HDL_ON.Entity.Function> deviceList) |
| | | { |
| | | |
| | | verticalScrolView.RemoveAll(); |
| | | foreach (var dev in deviceList) |
| | | { |
| | |
| | | continue; |
| | | } |
| | | //自动化配置输入条件纬度 |
| | | double lat = Convert.ToDouble(logicDate.geo_fence.latitude); |
| | | double lat = Convert.ToDouble(logicDate.geo_fence.latitude.Replace(",", ".")); |
| | | //自动化配置输入条件经度 |
| | | double lon = Convert.ToDouble(logicDate.geo_fence.longitude); |
| | | double lon = Convert.ToDouble(logicDate.geo_fence.longitude.Replace(",", ".")); |
| | | //自动化配置输入条件<地理围栏半径><单位,公里、千米.米> |
| | | int radius = int.Parse(logicDate.geo_fence.radius); |
| | | //计算2个经纬度之间的距离 |
| | |
| | | X = Application.GetRealWidth(34), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextID=StringId.allAreas, |
| | | |
| | | }; |
| | | |
| | | /// <summary> |
| | |
| | | }); |
| | | } |
| | | } |
| | | catch { } |
| | | catch (Exception ex) { |
| | | MainPage.Log(ex.Message); |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | |
| | | /// </summary> |
| | | private void InitFrameWhiteContent1() |
| | | { |
| | | temp = (int)Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp)); |
| | | temp = (int)Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")); |
| | | arcBar = new DiyArcSeekBar() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | |
| | | arcBar.IsOffline = device.GetAttrState(FunctionAttributeKey.OnOff) == "off"; |
| | | arcBar.MinValue = device.GetAttribute(FunctionAttributeKey.SetTemp).min; |
| | | arcBar.MaxValue = device.GetAttribute(FunctionAttributeKey.SetTemp).max; |
| | | arcBar.Progress = (int)Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp)); |
| | | arcBar.Progress = (int)Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")); |
| | | |
| | | btnTemp = new Button() |
| | | { |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = 50, |
| | | IsBold = true, |
| | | Text = Convert.ToDouble( device.GetAttrState(FunctionAttributeKey.SetTemp)).ToString(), |
| | | Text = Convert.ToDouble( device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")).ToString(), |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | FrameWhiteCentet1.AddChidren(btnTemp); |
| | |
| | | }; |
| | | EventHandler<MouseEventArgs> eventHandler1 = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | } |
| | | btnModeIcon.IsSelected = btnModeText.IsSelected = true; |
| | | device.SetAttrState(FunctionAttributeKey.Mode, m); |
| | | btnMode.UnSelectedImagePath = acFunction.GetModeIconPath(m); |
| | |
| | | }; |
| | | EventHandler<MouseEventArgs> eventHandler1 = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | } |
| | | btnModeIcon.IsSelected = btnModeText.IsSelected = true; |
| | | device.SetAttrState(FunctionAttributeKey.Swing, m); |
| | | btnSwing.UnSelectedImagePath = acFunction.GetSwingIconPath(m); |
| | |
| | | }; |
| | | EventHandler<MouseEventArgs> eventHandler1 = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | } |
| | | btnFanIcon.IsSelected = btnFanText.IsSelected = true; |
| | | device.SetAttrState(FunctionAttributeKey.FanSpeed, m); |
| | | btnWindSpeed.UnSelectedImagePath = acFunction.GetFanIconPath(m); |
| | |
| | | |
| | | btn.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | } |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(attr.key, ""); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | |
| | | { |
| | | btnMinus.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | } |
| | | if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan") |
| | | { |
| | | return; |
| | | } |
| | | |
| | | |
| | | if (temp <= device.GetAttribute(FunctionAttributeKey.SetTemp).min) |
| | | { |
| | | return; |
| | |
| | | }; |
| | | btnPlus.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | } |
| | | if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan") |
| | | { |
| | | return; |
| | |
| | | d.Add(FunctionAttributeKey.SetTemp, temp.ToString()); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | }; |
| | | arcBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | if (!device.online) |
| | | { |
| | | temp = arcBar.Progress; |
| | | device.SetAttrState(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString()); |
| | | btnTemp.Text = arcBar.Progress.ToString(); |
| | | controlTime = DateTime.Now; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString()); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | }; |
| | | arcBar.OnProgressChangedEvent = (sender, e) => |
| | | { |
| | | device.SetAttrState(FunctionAttributeKey.SetTemp, e.ToString()); |
| | | btnTemp.Text = e.ToString(); |
| | | }; |
| | | //arcBar.MouseDownEventHandler = (sender, e) => { |
| | | // Console.WriteLine("ddd"); |
| | | // MainPage.BasePageView.ScrollEnabled =false; |
| | | //}; |
| | | //arcBar.MouseUpEventHandler = (sender, e) => { |
| | | // Console.WriteLine("ddd2"); |
| | | // MainPage.BasePageView.ScrollEnabled = true; |
| | | //}; |
| | | arcBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | temp = arcBar.Progress; |
| | | device.SetAttrState(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString()); |
| | | btnTemp.Text = arcBar.Progress.ToString(); |
| | | controlTime = DateTime.Now; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString()); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | }; |
| | | arcBar.OnProgressChangedEvent = (sender, e) => |
| | | { |
| | | device.SetAttrState(FunctionAttributeKey.SetTemp, e.ToString()); |
| | | btnTemp.Text = e.ToString(); |
| | | }; |
| | | //arcBar.MouseDownEventHandler = (sender, e) => { |
| | | // Console.WriteLine("ddd"); |
| | | // MainPage.BasePageView.ScrollEnabled =false; |
| | | //}; |
| | | //arcBar.MouseUpEventHandler = (sender, e) => { |
| | | // Console.WriteLine("ddd2"); |
| | | // MainPage.BasePageView.ScrollEnabled = true; |
| | | //}; |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 控制模式事件 |
| | |
| | | |
| | | btnSwitch.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | } |
| | | btnSwitch.IsSelected = !btnSwitch.IsSelected; |
| | | device.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; |
| | | if (device.trait_on_off.curValue.ToString() == "on") |
| | |
| | | } |
| | | else |
| | | { |
| | | btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp))) + "°C"; |
| | | btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp).Replace(",", "."))) + "°C"; |
| | | btnMode.SelectedImagePath = acFunction.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode)); |
| | | btnSwing.SelectedImagePath = acFunction.GetSwingIconPath(device.GetAttrState(FunctionAttributeKey.Swing)); |
| | | btnWindSpeed.SelectedImagePath = acFunction.GetFanIconPath(device.GetAttrState(FunctionAttributeKey.FanSpeed)); |
| | | btnMode.UnSelectedImagePath = acFunction.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode), false); |
| | | btnSwing.UnSelectedImagePath = acFunction.GetSwingIconPath(device.GetAttrState(FunctionAttributeKey.Swing), false); |
| | | btnWindSpeed.UnSelectedImagePath = acFunction.GetFanIconPath(device.GetAttrState(FunctionAttributeKey.FanSpeed), false); |
| | | temp = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp))); |
| | | temp = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", "."))); |
| | | |
| | | |
| | | arcBar.Progress = temp; |
| | |
| | | /// <param name="comadValue">命令</param> |
| | | private void SendOtherComand(IconViewControl btnIcon, string comadKey, string comadValue) |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | } |
| | | btnIcon.CanClick = false; |
| | | |
| | | HdlThreadLogic.Current.RunThread(() => |
| | |
| | | /// </summary> |
| | | private void SendSwitchComand() |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | } |
| | | this.btnSwitch.CanClick = false; |
| | | |
| | | string statu = this.btnSwitch.IsSelected == true ? "off" : "on"; |
| | |
| | | FrameWhiteCentet1.AddChidren(btnSwitch); |
| | | btnSwitch.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | } |
| | | btnSwitch.IsSelected = !btnSwitch.IsSelected; |
| | | device.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; |
| | | new System.Threading.Thread(() => |
| | |
| | | /// <param name="comadValue">命令</param> |
| | | private void SendOtherComand(IconViewControl btnIcon, string comadKey, string comadValue) |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | } |
| | | btnIcon.CanClick = false; |
| | | |
| | | HdlThreadLogic.Current.RunThread(() => |
| | |
| | | }; |
| | | EventHandler<MouseEventArgs> eventHandler1 = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | } |
| | | btnModeIcon.IsSelected = btnModeText.IsSelected = true; |
| | | device.SetAttrState(FunctionAttributeKey.Mode, m); |
| | | btnMode.UnSelectedImagePath = fhTemp.GetModeIconPath(m); |
| | |
| | | { |
| | | btnMinus.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | } |
| | | if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan") |
| | | { |
| | | return; |
| | |
| | | }; |
| | | btnPlus.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | } |
| | | if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan") |
| | | { |
| | | return; |
| | |
| | | d.Add(FunctionAttributeKey.SetTemp, temp.ToString()); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | }; |
| | | arcBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | |
| | | if (!device.online) |
| | | { |
| | | device.SetAttrState(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString()); |
| | | btnTemp.Text = arcBar.Progress.ToString(); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString()); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | }; |
| | | arcBar.OnProgressChangedEvent = (sender, e) => |
| | | { |
| | | device.SetAttrState(FunctionAttributeKey.SetTemp, e.ToString()); |
| | | btnTemp.Text = e.ToString(); |
| | | }; |
| | | arcBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | device.SetAttrState(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString()); |
| | | btnTemp.Text = arcBar.Progress.ToString(); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString()); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | }; |
| | | arcBar.OnProgressChangedEvent = (sender, e) => |
| | | { |
| | | device.SetAttrState(FunctionAttributeKey.SetTemp, e.ToString()); |
| | | btnTemp.Text = e.ToString(); |
| | | }; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 控制模式事件 |
| | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnTemp.Text = device.GetAttrState(FunctionAttributeKey.SetTemp); |
| | | btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp))) + "°C"; |
| | | btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp).Replace(",", "."))) + "°C"; |
| | | btnMode.UnSelectedImagePath = fhTemp.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode)); |
| | | arcBar.Progress = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp))); |
| | | arcBar.Progress = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", "."))); |
| | | if (device.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | arcBar.IsOffline = false; |
| | |
| | | MaxValue = function.GetAttribute(FunctionAttributeKey.SetTemp).max, |
| | | //IsClickable = function.trait_on_off.curValue.ToString() == "on", |
| | | ArcColor = CSS_Color.BackgroundColor, |
| | | Progress = (int)Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp)), |
| | | Progress = (int)Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",",".")), |
| | | #if __IOS__ |
| | | Y = Application.GetRealHeight(120 + 25), |
| | | Width = Application.GetRealWidth(260 - 40), |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = 50, |
| | | IsBold = true, |
| | | Text = Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp)).ToString(), |
| | | Text = Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")).ToString(), |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | controlView.AddChidren(btnTemp); |
| | |
| | | } |
| | | AC temp = new AC(); |
| | | updataTime = DateTime.Now; |
| | | bodyView.btnTemp.Text = Convert.ToDouble( updateTemp.GetAttrState(FunctionAttributeKey.SetTemp)).ToString(); |
| | | bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState((string)FunctionAttributeKey.RoomTemp))) + "°C"; |
| | | bodyView.btnTemp.Text = Convert.ToDouble( updateTemp.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")).ToString(); |
| | | bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.RoomTemp).Replace(",", "."))) + "°C"; |
| | | bodyView.btnMode.UnSelectedImagePath = temp.GetModeIconPath(updateTemp.GetAttrState(FunctionAttributeKey.Mode)); |
| | | bodyView.btnWindSpeed.UnSelectedImagePath = temp.GetFanIconPath(updateTemp.GetAttrState(FunctionAttributeKey.FanSpeed)); |
| | | bodyView.arcBar.Progress = Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.SetTemp))); |
| | | bodyView.arcBar.Progress = Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", "."))); |
| | | if (updateTemp.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | bodyView.arcBar.IsOffline = false; |
| | |
| | | { |
| | | return; |
| | | } |
| | | var temp = (int)Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp)); |
| | | var temp = (int)Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")); |
| | | if (temp <= function.GetAttribute(FunctionAttributeKey.Mode).min) |
| | | { |
| | | return; |
| | |
| | | { |
| | | return; |
| | | } |
| | | var temp = (int)Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp)); |
| | | var temp = (int)Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")); |
| | | if (temp >= function.GetAttribute(FunctionAttributeKey.SetTemp).max) |
| | | { |
| | | return; |
| | |
| | | backAction = action; |
| | | } |
| | | |
| | | public override void RemoveFromParent() |
| | | { |
| | | backAction?.Invoke(); |
| | | base.RemoveFromParent(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载页面 |
| | | /// </summary> |
| | |
| | | void LoadEvent_ControlEvent() |
| | | { |
| | | btnCurtainClose.MouseUpEventHandler = (sender, e) => { |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | } |
| | | new System.Threading.Thread(() => { |
| | | System.Threading.Thread.Sleep(2000); |
| | | Application.RunOnMainThread(() => { |
| | |
| | | |
| | | btnCurtainStop.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | } |
| | | new System.Threading.Thread(() => { |
| | | System.Threading.Thread.Sleep(2000); |
| | | Application.RunOnMainThread(() => { |
| | |
| | | }; |
| | | btnCurtainOpen.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | } |
| | | new System.Threading.Thread(() => { |
| | | System.Threading.Thread.Sleep(2000); |
| | | Application.RunOnMainThread(() => { |
| | |
| | | { |
| | | btnCurtainClose.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | } |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | |
| | | |
| | | btnCurtainStop.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | } |
| | | onCurtainAnimation = false; |
| | | new System.Threading.Thread(() => |
| | | { |
| | |
| | | |
| | | btnCurtainOpen.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | } |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | |
| | | CurtainAnimation(100); |
| | | }; |
| | | |
| | | if (!function.online) |
| | | { |
| | | btnCurtainStop.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainStop.IsSelected = true; |
| | | btnCurtainClose.IsSelected = false; |
| | | btnCurtainOpen.IsSelected = false; |
| | | }; |
| | | btnCurtainOpen.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainOpen.IsSelected = true; |
| | | btnCurtainClose.IsSelected = false; |
| | | btnCurtainStop.IsSelected = false; |
| | | }; |
| | | btnCurtainClose.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainClose.IsSelected = true; |
| | | btnCurtainOpen.IsSelected = false; |
| | | btnCurtainStop.IsSelected = false; |
| | | }; |
| | | |
| | | btnCurtainStop.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainStop.IsSelected = true; |
| | | btnCurtainClose.IsSelected = false; |
| | | btnCurtainOpen.IsSelected = false; |
| | | }; |
| | | btnCurtainOpen.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainOpen.IsSelected = true; |
| | | btnCurtainClose.IsSelected = false; |
| | | btnCurtainStop.IsSelected = false; |
| | | }; |
| | | btnCurtainClose.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainClose.IsSelected = true; |
| | | btnCurtainOpen.IsSelected = false; |
| | | btnCurtainStop.IsSelected = false; |
| | | }; |
| | | //btnMinusSignIcon.MouseUpEventHandler = (sender, e) => |
| | | //{ |
| | | // function.percent--; |
| | | // controlBar.Progress = function.percent; |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add(FunctionAttributeKey.Percent, function.percent.ToString()); |
| | | // DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | //}; |
| | | |
| | | //btnMinusSignIcon.MouseUpEventHandler = (sender, e) => |
| | | //{ |
| | | // function.percent--; |
| | | // controlBar.Progress = function.percent; |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add(FunctionAttributeKey.Percent, function.percent.ToString()); |
| | | // DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | //}; |
| | | //btnPlusSgnIcon.MouseUpEventHandler = (sender, e) => |
| | | //{ |
| | | // function.percent++; |
| | | // controlBar.Progress = function.percent; |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add(FunctionAttributeKey.Percent, function.percent.ToString()); |
| | | // DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | //}; |
| | | |
| | | //btnPlusSgnIcon.MouseUpEventHandler = (sender, e) => |
| | | //{ |
| | | // function.percent++; |
| | | // controlBar.Progress = function.percent; |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add(FunctionAttributeKey.Percent, function.percent.ToString()); |
| | | // DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | //}; |
| | | |
| | | curtainSeekBar.OnProgressChangedEvent = (sender, e) => |
| | | { |
| | | btnProgress.Text = curtainSeekBar.Progress + "%"; |
| | | // controlBar.Progress = curtainSeekBar.Progress; |
| | | // new System.Threading.Thread(() => |
| | | // { |
| | | // if (controlBar.Progress == 0 || controlBar.Progress == 100 || (DateTime.Now - function.refreshTime).TotalMilliseconds > 300) |
| | | // { |
| | | // function.percent = e; |
| | | // function.refreshTime = DateTime.Now; |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add("percent", function.percent.ToString()); |
| | | // Control.SendWriteCommand(function, d); |
| | | // } |
| | | // }) |
| | | // { IsBackground = true }.Start(); |
| | | }; |
| | | curtainSeekBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | btnProgress.Text = curtainSeekBar.Progress + "%"; |
| | | curtainSeekBar.OnProgressChangedEvent = (sender, e) => |
| | | { |
| | | btnProgress.Text = curtainSeekBar.Progress + "%"; |
| | | // controlBar.Progress = curtainSeekBar.Progress; |
| | | // new System.Threading.Thread(() => |
| | | // { |
| | | // if (controlBar.Progress == 0 || controlBar.Progress == 100 || (DateTime.Now - function.refreshTime).TotalMilliseconds > 300) |
| | | // { |
| | | // function.percent = e; |
| | | // function.refreshTime = DateTime.Now; |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add("percent", function.percent.ToString()); |
| | | // Control.SendWriteCommand(function, d); |
| | | // } |
| | | // }) |
| | | // { IsBackground = true }.Start(); |
| | | }; |
| | | curtainSeekBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | btnProgress.Text = curtainSeekBar.Progress + "%"; |
| | | //controlBar.Progress = curtainSeekBar.Progress; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | function.SetAttrState(FunctionAttributeKey.Percent, e); |
| | | function.refreshTime = DateTime.Now; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.Percent, e.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | { |
| | | function.SetAttrState(FunctionAttributeKey.Percent, e); |
| | | function.refreshTime = DateTime.Now; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.Percent, e.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | |
| | | //controlBar.OnProgressChangedEvent = (sender, e) => |
| | | //{ |
| | | // curtainSeekBar.Progress = controlBar.Progress; |
| | | // new System.Threading.Thread(() => |
| | | // { |
| | | // if (controlBar.Progress == 0 || controlBar.Progress == 100 || (DateTime.Now - function.refreshTime).TotalMilliseconds > 300) |
| | | // { |
| | | // function.percent = e; |
| | | // function.refreshTime = DateTime.Now; |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add("percent", function.percent.ToString()); |
| | | // Control.SendWriteCommand(function, d); |
| | | // } |
| | | // }) |
| | | // { IsBackground = true }.Start(); |
| | | //}; |
| | | //controlBar.OnProgressChangedEvent = (sender, e) => |
| | | //{ |
| | | // curtainSeekBar.Progress = controlBar.Progress; |
| | | // new System.Threading.Thread(() => |
| | | // { |
| | | // if (controlBar.Progress == 0 || controlBar.Progress == 100 || (DateTime.Now - function.refreshTime).TotalMilliseconds > 300) |
| | | // { |
| | | // function.percent = e; |
| | | // function.refreshTime = DateTime.Now; |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add("percent", function.percent.ToString()); |
| | | // Control.SendWriteCommand(function, d); |
| | | // } |
| | | // }) |
| | | // { IsBackground = true }.Start(); |
| | | //}; |
| | | |
| | | //controlBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | //{ |
| | | // curtainSeekBar.Progress = controlBar.Progress; |
| | | // new System.Threading.Thread(() => |
| | | // { |
| | | // function.percent = e; |
| | | // function.refreshTime = DateTime.Now; |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add("percent", function.percent.ToString()); |
| | | // DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | // }) |
| | | // { IsBackground = true }.Start(); |
| | | //}; |
| | | |
| | | //controlBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | //{ |
| | | // curtainSeekBar.Progress = controlBar.Progress; |
| | | // new System.Threading.Thread(() => |
| | | // { |
| | | // function.percent = e; |
| | | // function.refreshTime = DateTime.Now; |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add("percent", function.percent.ToString()); |
| | | // DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | // }) |
| | | // { IsBackground = true }.Start(); |
| | | //}; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | btnCurtainClose.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | } |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | |
| | | |
| | | btnCurtainStop.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | } |
| | | new System.Threading.Thread(() => { |
| | | System.Threading.Thread.Sleep(2000); |
| | | Application.RunOnMainThread(() => { |
| | |
| | | |
| | | btnCurtainOpen.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | } |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | |
| | | // DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | //}; |
| | | |
| | | if (!function.online) |
| | | { |
| | | |
| | | btnCurtainStop.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainStop.IsSelected = true; |
| | | btnCurtainClose.IsSelected = false; |
| | | btnCurtainOpen.IsSelected = false; |
| | | }; |
| | | btnCurtainOpen.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainOpen.IsSelected = true; |
| | | btnCurtainClose.IsSelected = false; |
| | | btnCurtainStop.IsSelected = false; |
| | | }; |
| | | btnCurtainClose.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainClose.IsSelected = true; |
| | | btnCurtainOpen.IsSelected = false; |
| | | btnCurtainStop.IsSelected = false; |
| | | }; |
| | | btnCurtainStop.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainStop.IsSelected = true; |
| | | btnCurtainClose.IsSelected = false; |
| | | btnCurtainOpen.IsSelected = false; |
| | | }; |
| | | btnCurtainOpen.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainOpen.IsSelected = true; |
| | | btnCurtainClose.IsSelected = false; |
| | | btnCurtainStop.IsSelected = false; |
| | | }; |
| | | btnCurtainClose.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainClose.IsSelected = true; |
| | | btnCurtainOpen.IsSelected = false; |
| | | btnCurtainStop.IsSelected = false; |
| | | }; |
| | | |
| | | |
| | | //curtainSeekBar.OnProgressChangedEvent = (sender, e) => |
| | | //{ |
| | | // controlBar.Progress = curtainSeekBar.Progress; |
| | | // new System.Threading.Thread(() => |
| | | // { |
| | | // if (controlBar.Progress == 0 || controlBar.Progress == 100 || (DateTime.Now - function.refreshTime).TotalMilliseconds > 300) |
| | | // { |
| | | // function.percent = e; |
| | | // function.refreshTime = DateTime.Now; |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add("percent", function.percent.ToString()); |
| | | // Control.SendWriteCommand(function, d); |
| | | // } |
| | | // }) |
| | | // { IsBackground = true }.Start(); |
| | | //}; |
| | | curtainSeekBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | //curtainSeekBar.OnProgressChangedEvent = (sender, e) => |
| | | //{ |
| | | // controlBar.Progress = curtainSeekBar.Progress; |
| | | // new System.Threading.Thread(() => |
| | | // { |
| | | // if (controlBar.Progress == 0 || controlBar.Progress == 100 || (DateTime.Now - function.refreshTime).TotalMilliseconds > 300) |
| | | // { |
| | | // function.percent = e; |
| | | // function.refreshTime = DateTime.Now; |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add("percent", function.percent.ToString()); |
| | | // Control.SendWriteCommand(function, d); |
| | | // } |
| | | // }) |
| | | // { IsBackground = true }.Start(); |
| | | //}; |
| | | curtainSeekBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | //controlBar.Progress = curtainSeekBar.Progress; |
| | | btnProgress.Text = curtainSeekBar.Progress + "%"; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | function.SetAttrState(FunctionAttributeKey.Percent, e); |
| | | function.refreshTime = DateTime.Now; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.Percent, e.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | function.SetAttrState(FunctionAttributeKey.Percent, e); |
| | | function.refreshTime = DateTime.Now; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.Percent, e.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | |
| | | curtainSeekBar.OnProgressChangedEvent = (sender, e) => |
| | | { |
| | | btnProgress.Text = curtainSeekBar.Progress + "%"; |
| | | curtainSeekBar.OnProgressChangedEvent = (sender, e) => |
| | | { |
| | | btnProgress.Text = curtainSeekBar.Progress + "%"; |
| | | // new System.Threading.Thread(() => |
| | | // { |
| | | // if (controlBar.Progress == 0 || controlBar.Progress == 100 || (DateTime.Now - function.refreshTime).TotalMilliseconds > 300) |
| | |
| | | // { IsBackground = true }.Start(); |
| | | }; |
| | | |
| | | //controlBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | //{ |
| | | // curtainSeekBar.Progress = controlBar.Progress; |
| | | // btnProgress.Text = curtainSeekBar.Progress + "%"; |
| | | // new System.Threading.Thread(() => |
| | | // { |
| | | // function.SetAttrState(FunctionAttributeKey.Percent, e); |
| | | // function.refreshTime = DateTime.Now; |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add("percent", e.ToString()); |
| | | // DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | // }) |
| | | // { IsBackground = true }.Start(); |
| | | //}; |
| | | |
| | | //controlBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | //{ |
| | | // curtainSeekBar.Progress = controlBar.Progress; |
| | | // btnProgress.Text = curtainSeekBar.Progress + "%"; |
| | | // new System.Threading.Thread(() => |
| | | // { |
| | | // function.SetAttrState(FunctionAttributeKey.Percent, e); |
| | | // function.refreshTime = DateTime.Now; |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add("percent", e.ToString()); |
| | | // DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | // }) |
| | | // { IsBackground = true }.Start(); |
| | | //}; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | base.SetTitleText(Language.StringByID(StringId.DoorLock)); |
| | | |
| | | //初始化头部历史记录控件 |
| | | this.InitTopHistoryControl(); |
| | | //this.InitTopHistoryControl(); |
| | | |
| | | //初始化中部信息 |
| | | this.InitMiddleFrame(); |
| | |
| | | //电池图标 |
| | | var btnBattery = new BatteryPersentControl(); |
| | | btnBattery.Y = Application.GetRealHeight(62); |
| | | frameBack.AddChidren(btnBattery, ChidrenBindMode.BindEvent); |
| | | //frameBack.AddChidren(btnBattery, ChidrenBindMode.BindEvent); |
| | | btnBattery.InitControl(); |
| | | btnBattery.SetValue(80); |
| | | btnBattery.X = frameBack.Width - btnBattery.Width - Application.GetRealWidth(12); |
| | |
| | | //它有个最小的X轴 |
| | | batteryControl.X = Application.GetRealWidth(104) > base.btnRoomName.Right ? |
| | | Application.GetRealWidth(104) : base.btnRoomName.Right + Application.GetRealWidth(4); |
| | | FrameWhiteCentet1.AddChidren(batteryControl); |
| | | //FrameWhiteCentet1.AddChidren(batteryControl); |
| | | if (batteryControl.Height > base.btnRoomName.Height) |
| | | { |
| | | //一个是25,一个是21,弄不准到底谁更高,因为计算方法不一样 |
| | |
| | | btnOnlineIcon.X = batteryControl.Right + Application.GetRealWidth(12); |
| | | btnOnlineIcon.Y = batteryControl.Y; |
| | | btnOnlineIcon.UnSelectedImagePath = "FunctionIcon/DoorLock/Connect.png"; |
| | | FrameWhiteCentet1.AddChidren(btnOnlineIcon); |
| | | //FrameWhiteCentet1.AddChidren(btnOnlineIcon); |
| | | //在线文本 |
| | | this.btnOnlineView = new NormalViewControl(Application.GetRealWidth(100), btnOnlineIcon.Height, false); |
| | | btnOnlineView.X = btnOnlineIcon.Right + Application.GetRealWidth(4); |
| | |
| | | btnOnlineView.TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel; |
| | | btnOnlineView.TextColor = CSS_Color.PromptingColor1; |
| | | btnOnlineView.TextID = StringId.Connected; |
| | | FrameWhiteCentet1.AddChidren(btnOnlineView); |
| | | //FrameWhiteCentet1.AddChidren(btnOnlineView); |
| | | //右上角配置结束的事件 |
| | | base.SettionFinishEvent += () => |
| | | { |
| | |
| | | HdlMessageLogic.Current.ShowMassage(ShowMsgType.TipRemind, Language.StringByID(StringId.DeviceNotOnline), null, null, null, 2); |
| | | return; |
| | | } |
| | | Control.Ins.OneKeyUnlocking(this.device, this.device.GetAttrState("key")); |
| | | if (UserInfo.Current.VerOpenDoorPw || string.IsNullOrEmpty(UserInfo.Current.doorPasswordString)) |
| | | { |
| | | var page = new DoorLockUnlockPage(this.device); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadView(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | } |
| | | else |
| | | { |
| | | Control.Ins.OneKeyUnlocking(this.device, UserInfo.Current.doorPasswordString); |
| | | } |
| | | //第一次使用,请先绑定门锁密码 |
| | | //HdlMessageLogic.Current.ShowMassage(ShowMsgType.Confirm, Language.StringByID(StringId.PleaseBindTheDoorPswFirst), () => |
| | | //{ |
New file |
| | |
| | | using System; |
| | | using HDL_ON.DriverLayer; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.Stan; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | namespace HDL_ON.UI |
| | | { |
| | | public class DoorLockUnlockPage : FrameLayout |
| | | { |
| | | /// <summary> |
| | | /// 当前界面 |
| | | /// </summary> |
| | | FrameLayout bodyView; |
| | | |
| | | Function device; |
| | | |
| | | public DoorLockUnlockPage(Function function) |
| | | { |
| | | bodyView = this; |
| | | device = function; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载视图 |
| | | /// </summary> |
| | | public void LoadView() |
| | | { |
| | | |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.PlsEntryPassword)).LoadTopView(); |
| | | bodyView.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | |
| | | |
| | | var btnMsg = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(100), |
| | | Width = Application.GetRealWidth(300), |
| | | Height = Application.GetRealHeight(100), |
| | | TextAlignment = TextAlignment.TopCenter, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextID = StringId.DoorLockEntryPasswordTip, |
| | | IsMoreLines = true, |
| | | }; |
| | | bodyView.AddChidren(btnMsg); |
| | | |
| | | #region 密码填写 |
| | | var passwordView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(28), |
| | | Y = Application.GetRealHeight(200), |
| | | Width = Application.GetRealWidth(319), |
| | | Height = Application.GetRealHeight(44), |
| | | }; |
| | | bodyView.AddChidren(passwordView); |
| | | |
| | | |
| | | var etPassword = new EditText() |
| | | { |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | PlaceholderTextColor = CSS_Color.PromptingColor1, |
| | | PlaceholderText = Language.StringByID(StringId.PlsEntryPassword), |
| | | SecureTextEntry = true, |
| | | TextAlignment = TextAlignment.Center, |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | IsNumberKeyboardType = true |
| | | }; |
| | | passwordView.AddChidren(etPassword); |
| | | |
| | | //var btnVisiblePassword = new Button() |
| | | //{ |
| | | // X = Application.GetRealWidth(273), |
| | | // Gravity = Gravity.CenterVertical, |
| | | // Width = Application.GetMinRealAverage(20), |
| | | // Height = Application.GetMinRealAverage(20), |
| | | // UnSelectedImagePath = "LoginIcon/HidePasswordIcon.png", |
| | | // SelectedImagePath = "LoginIcon/ShowPasswordIcon.png", |
| | | //}; |
| | | //passwordView.AddChidren(btnVisiblePassword); |
| | | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | var frameRow = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(28), |
| | | Y = Application.GetRealHeight(258),//375 // 667 |
| | | }; |
| | | bodyView.AddChidren(frameRow); |
| | | |
| | | //同意按钮背景 |
| | | var agreeView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(28), |
| | | Width = Application.GetRealWidth(28), |
| | | X = Application.GetRealWidth(22), |
| | | }; |
| | | frameRow.AddChidren(agreeView); |
| | | |
| | | //同意图标按钮 |
| | | var agreeBtn = new Button() |
| | | { |
| | | Width = Application.GetMinRealAverage(28), |
| | | Height = Application.GetMinRealAverage(28), |
| | | UnSelectedImagePath = "Public/ChooseIcon.png", |
| | | SelectedImagePath = "Public/ChooseOnIcon.png", |
| | | IsSelected = false, |
| | | Gravity = Gravity.Center, |
| | | }; |
| | | agreeView.AddChidren(agreeBtn); |
| | | |
| | | var agreeTextBtn = new TextButton() |
| | | { |
| | | X = agreeView.Right, |
| | | Width = Application.GetRealWidth(28), |
| | | Height = Application.GetRealHeight(28), |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextID = StringId.DoorLock5minTip |
| | | }; |
| | | frameRow.AddChidren(agreeTextBtn); |
| | | agreeTextBtn.Width = Utlis.GetRealWidthByTextButton(agreeTextBtn); |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | agreeBtn.IsSelected = !agreeBtn.IsSelected; |
| | | }; |
| | | |
| | | agreeBtn.MouseUpEventHandler = eventHandler; |
| | | agreeView.MouseUpEventHandler = eventHandler; |
| | | agreeTextBtn.MouseUpEventHandler = eventHandler; |
| | | |
| | | |
| | | Button btnLine = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(607), |
| | | Height = Application.GetRealHeight(1), |
| | | BackgroundColor = CSS.CSS_Color.DividingLineColor, |
| | | }; |
| | | bodyView.AddChidren(btnLine); |
| | | |
| | | Button btnCancel = new Button() |
| | | { |
| | | Y = btnLine.Bottom, |
| | | Width = Application.GetRealWidth(374/2), |
| | | Height = Application.GetRealHeight(60), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.Cancel, |
| | | }; |
| | | bodyView.AddChidren(btnCancel); |
| | | btnCancel.MouseUpEventHandler = (sender, e) => { |
| | | this.RemoveFromParent(); |
| | | }; |
| | | |
| | | Button btnConfirm = new Button() |
| | | { |
| | | X = btnCancel.Right, |
| | | Y = btnLine.Y, |
| | | Width = Application.GetRealWidth(376 / 2), |
| | | Height = Application.GetRealHeight(60), |
| | | TextAlignment = TextAlignment.Center, |
| | | //TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | BackgroundColor = CSS_Color.MainColor, |
| | | TextID = StringId.Confirm, |
| | | }; |
| | | bodyView.AddChidren(btnConfirm); |
| | | btnConfirm.MouseUpEventHandler = (sender, e) => { |
| | | var password = etPassword.Text.Trim(); |
| | | if (password.Length == 0) |
| | | { |
| | | //设备不在线 |
| | | HdlMessageLogic.Current.ShowMassage(ShowMsgType.TipRemind, Language.StringByID(StringId.PlsEntryPassword), null, null, null, 2); |
| | | return; |
| | | } |
| | | if (agreeBtn.IsSelected) |
| | | { |
| | | UserInfo.Current.doorPasswordString = password; |
| | | } |
| | | Control.Ins.OneKeyUnlocking(this.device, etPassword.Text.Trim()); |
| | | this.RemoveFromParent(); |
| | | }; |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | { |
| | | btnSwitchIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | btnSwitch.IsSelected = btnSwitchIcon.IsSelected = !btnSwitchIcon.IsSelected; |
| | | new System.Threading.Thread(() => |
| | | { |
| | |
| | | }; |
| | | btnSwitch.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | btnSwitchIcon.IsSelected = btnSwitch.IsSelected = !btnSwitch.IsSelected; |
| | | new System.Threading.Thread(() => |
| | | { |
| | |
| | | FrameWhiteCentet1.AddChidren(btnDown); |
| | | |
| | | #region 控制 |
| | | btnUp.MouseDownEventHandler = (sender, e) => { |
| | | btnUp.IsSelected = true; |
| | | }; |
| | | btnUp.MouseUpEventHandler = (sender, e) => { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | }; |
| | | //---- |
| | | btnStop.MouseDownEventHandler = (sender, e) => { |
| | | btnStop.IsSelected = true; |
| | | }; |
| | | btnStop.MouseUpEventHandler = (sender, e) => { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | |
| | | d.Add(FunctionAttributeKey.Position, "stop"); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | }; |
| | | //----- |
| | | btnDown.MouseDownEventHandler = (sender, e) => { |
| | | btnDown.IsSelected = true; |
| | | }; |
| | | if (!device.online) |
| | | { |
| | | btnUp.MouseDownEventHandler = (sender, e) => { |
| | | btnUp.IsSelected = true; |
| | | }; |
| | | btnStop.MouseDownEventHandler = (sender, e) => { |
| | | btnStop.IsSelected = true; |
| | | }; |
| | | //----- |
| | | btnDown.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnDown.IsSelected = true; |
| | | }; |
| | | } |
| | | btnDown.MouseUpEventHandler = (sender, e) => { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | string onoff = hotDryView.Lighting ? "false" : "true"; |
| | | device.SetAttrState(FunctionAttributeKey.HotDry, onoff); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | string onoff = windDryView.Lighting ? "false" : "true"; |
| | | device.SetAttrState(FunctionAttributeKey.WindDry, onoff); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | string onoff = disinfectView.Lighting ? "false" : "true"; |
| | | device.SetAttrState(FunctionAttributeKey.Disinfect, onoff); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | string onoff = lightingView.Lighting ? "off" : "on"; |
| | | device.SetAttrState(FunctionAttributeKey.OnOff, onoff); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | |
| | | functionListView.AddChidren(hotDryTimeCell); |
| | | hotDryTimeCell.GoAction = () => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | BottomTimeSelectControl timeControl = new BottomTimeSelectControl(hRange, mRange,3, Language.StringByID(StringId.HotDryTime)); |
| | | timeControl.RowHeight = Application.GetRealHeight(50); |
| | | timeControl.InitControl(0, 1, 162); |
| | |
| | | functionListView.AddChidren(windDryCell); |
| | | windDryCell.GoAction = () => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | BottomTimeSelectControl timeControl = new BottomTimeSelectControl(hRange, mRange,3,Language.StringByID(StringId.WindDryTime)); |
| | | timeControl.RowHeight = Application.GetRealHeight(50); |
| | | timeControl.InitControl(0, 1, 162); |
| | |
| | | |
| | | functionListView.AddChidren(disinfectTimeCell); |
| | | disinfectTimeCell.GoAction = () => { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | BottomTimeSelectControl timeControl = new BottomTimeSelectControl(hRange, mRange,3, Language.StringByID(StringId.DisinfectTime)); |
| | | timeControl.RowHeight = Application.GetRealHeight(50); |
| | | timeControl.InitControl(0, 1, 162); |
| | |
| | | anionTimeCell.LineView.RemoveFromParent(); |
| | | |
| | | anionTimeCell.GoAction = () => { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | BottomTimeSelectControl timeControl = new BottomTimeSelectControl(hRange, mRange,3,Language.StringByID(StringId.AnionTime)); |
| | | |
| | | |
| | |
| | | { |
| | | btnSwitchIcon.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | btnSwitchIcon.IsSelected = btnSwitch.IsSelected = !btnSwitchIcon.IsSelected; |
| | | |
| | | new System.Threading.Thread(() => |
| | |
| | | }; |
| | | btnSwitch.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | btnSwitch.IsSelected = btnSwitchIcon.IsSelected = !btnSwitch.IsSelected; |
| | | |
| | | new System.Threading.Thread(() => |
| | |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | |
| | | barGradualChange.OnProgressChangedEvent = (sender, e) => { |
| | | function.SetAttrState(FunctionAttributeKey.OpenLevel, e.ToString()); |
| | | new System.Threading.Thread(() => |
| | | if (!function.online) |
| | | { |
| | | barGradualChange.OnProgressChangedEvent = (sender, e) => |
| | | { |
| | | function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | |
| | | function.SetAttrState(FunctionAttributeKey.OpenLevel, e.ToString()); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | row.AddChidren(btn); |
| | | |
| | | btn.MouseUpEventHandler = (sender, e) => { |
| | | |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(attr.key, ""); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | |
| | | |
| | | btn.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(attr.key, ""); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | |
| | | |
| | | btnChlPlus.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | |
| | | }; |
| | | btnChlReduce.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | |
| | | }; |
| | | btnVolPlus.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | |
| | | }; |
| | | btnVolReduce.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | |
| | | }; |
| | | btnBack.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | |
| | | }; |
| | | btnPower.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | |
| | | }; |
| | | btnMenu.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | topMenuView.BackgroundImagePath = "FunctionIcon/Electrical/TV/TVOkIcon.png"; |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | |
| | | } |
| | | }; |
| | | btnTopMenuUp.MouseUpEventHandler = (sender, e) => { |
| | | |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | topMenuView.BackgroundImagePath = "FunctionIcon/Electrical/TV/TVOkIcon.png"; |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | |
| | | } |
| | | }; |
| | | btnTopMenuLeft.MouseUpEventHandler = (sender, e) => { |
| | | |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | topMenuView.BackgroundImagePath = "FunctionIcon/Electrical/TV/TVOkIcon.png"; |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | |
| | | } |
| | | }; |
| | | btnTopMenuRight.MouseUpEventHandler = (sender, e) => { |
| | | |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | topMenuView.BackgroundImagePath = "FunctionIcon/Electrical/TV/TVOkIcon.png"; |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | |
| | | } |
| | | }; |
| | | btnTopMenuDown.MouseUpEventHandler = (sender, e) => { |
| | | |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | topMenuView.BackgroundImagePath = "FunctionIcon/Electrical/TV/TVOkIcon.png"; |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | |
| | | } |
| | | }; |
| | | btnOk.MouseUpEventHandler = (sender, e) => { |
| | | |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | topMenuView.BackgroundImagePath = "FunctionIcon/Electrical/TV/TVOkIcon.png"; |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | |
| | | { |
| | | btnSwitchIcon.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | btnSwitchIcon.IsSelected = btnSwitch.IsSelected = !btnSwitchIcon.IsSelected; |
| | | |
| | | new System.Threading.Thread(() => |
| | |
| | | }; |
| | | btnSwitch.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | btnSwitch.IsSelected = btnSwitchIcon.IsSelected = !btnSwitch.IsSelected; |
| | | |
| | | new System.Threading.Thread(() => |
| | |
| | | } |
| | | numberView.AddChidren(btn); |
| | | btn.MouseUpEventHandler = (sender, e) => { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | string index = (sender as Button).Text; |
| | | btn.IsSelected = false; |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | |
| | | { |
| | | btnMenu.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | |
| | | }; |
| | | btnChlPlus.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | |
| | | }; |
| | | btnChlReduce.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | |
| | | }; |
| | | btnVolPlus.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | |
| | | }; |
| | | btnVolReduce.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | |
| | | }; |
| | | btnBack.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | |
| | | |
| | | btnMenu.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | |
| | | }; |
| | | btn123.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | ShowNumberView(); |
| | | }; |
| | | btnMute.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | |
| | | }; |
| | | btnPower.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | |
| | | }; |
| | | |
| | | |
| | | btnTopMenuUp.MouseDownEventHandler = (sender, e) => { |
| | | topMenuView.BackgroundImagePath = "FunctionIcon/Electrical/TV/TVOkIconUp.png"; |
| | | }; |
| | | btnTopMenuDown.MouseDownEventHandler = (sender, e) => { |
| | | topMenuView.BackgroundImagePath = "FunctionIcon/Electrical/TV/TVOkIconDown.png"; |
| | | }; |
| | | btnTopMenuLeft.MouseDownEventHandler = (sender, e) => { |
| | | topMenuView.BackgroundImagePath = "FunctionIcon/Electrical/TV/TVOkIconLeft.png"; |
| | | }; |
| | | btnTopMenuRight.MouseDownEventHandler = (sender, e) => { |
| | | topMenuView.BackgroundImagePath = "FunctionIcon/Electrical/TV/TVOkIconRight.png"; |
| | | }; |
| | | btnOk.MouseDownEventHandler = (sender, e) => { |
| | | topMenuView.BackgroundImagePath = "FunctionIcon/Electrical/TV/TVOkIconOk.png"; |
| | | }; |
| | | if (!device.online) |
| | | { |
| | | btnTopMenuUp.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | topMenuView.BackgroundImagePath = "FunctionIcon/Electrical/TV/TVOkIconUp.png"; |
| | | }; |
| | | btnTopMenuDown.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | topMenuView.BackgroundImagePath = "FunctionIcon/Electrical/TV/TVOkIconDown.png"; |
| | | }; |
| | | btnTopMenuLeft.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | topMenuView.BackgroundImagePath = "FunctionIcon/Electrical/TV/TVOkIconLeft.png"; |
| | | }; |
| | | btnTopMenuRight.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | topMenuView.BackgroundImagePath = "FunctionIcon/Electrical/TV/TVOkIconRight.png"; |
| | | }; |
| | | btnOk.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | topMenuView.BackgroundImagePath = "FunctionIcon/Electrical/TV/TVOkIconOk.png"; |
| | | }; |
| | | } |
| | | btnMenu.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | topMenuView.BackgroundImagePath = "FunctionIcon/Electrical/TV/TVOkIcon.png"; |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | |
| | | } |
| | | }; |
| | | btnTopMenuUp.MouseUpEventHandler = (sender, e) => { |
| | | |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | topMenuView.BackgroundImagePath = "FunctionIcon/Electrical/TV/TVOkIcon.png"; |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | |
| | | } |
| | | }; |
| | | btnTopMenuLeft.MouseUpEventHandler = (sender, e) => { |
| | | |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | topMenuView.BackgroundImagePath = "FunctionIcon/Electrical/TV/TVOkIcon.png"; |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | |
| | | } |
| | | }; |
| | | btnTopMenuRight.MouseUpEventHandler = (sender, e) => { |
| | | |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | topMenuView.BackgroundImagePath = "FunctionIcon/Electrical/TV/TVOkIcon.png"; |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | |
| | | } |
| | | }; |
| | | btnTopMenuDown.MouseUpEventHandler = (sender, e) => { |
| | | |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | topMenuView.BackgroundImagePath = "FunctionIcon/Electrical/TV/TVOkIcon.png"; |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | |
| | | } |
| | | }; |
| | | btnOk.MouseUpEventHandler = (sender, e) => { |
| | | |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | topMenuView.BackgroundImagePath = "FunctionIcon/Electrical/TV/TVOkIcon.png"; |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | |
| | | |
| | | btn.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(attr.key, ""); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | |
| | | /// </summary> |
| | | void LoadControlEvent() |
| | | { |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | btnChangeTVAV.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | |
| | | /// </summary>
|
| | | /// <param name="value">auto:自动 sleep:睡眠 manual:手动 strong:强烈</param>
|
| | | private void SendModeComand(string value)
|
| | | {
|
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | }
|
| | | this.btnMode.CanClick = false;
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | |
| | | /// </summary>
|
| | | /// <param name="value">canel:取消 1:1小时 2:2小时 3:4小时 4:8小时</param>
|
| | | private void SendTimingComand(string value)
|
| | | {
|
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | }
|
| | | this.btnTime.CanClick = false;
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | |
| | | /// </summary>
|
| | | /// <param name="value">1:低档 2:中档 3:高档</param>
|
| | | private void SendFanSpeedComand(string value)
|
| | | {
|
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | }
|
| | | this.btnFan.CanClick = false;
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | |
| | | /// 发送开关命令
|
| | | /// </summary>
|
| | | private void SendSwitchComand()
|
| | | {
|
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | }
|
| | | this.btnPictrue.CanClick = false;
|
| | | this.btnSwitch.CanClick = false;
|
| | |
|
| | |
| | | /// 发送使能命令
|
| | | /// </summary>
|
| | | private void SendEnableComand(MostRightIconControl btnSwitch, string sendKey, string value)
|
| | | {
|
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | }
|
| | | if (btnSwitch != null)
|
| | | {
|
| | | btnSwitch.CanClick = false;
|
| | |
| | | //刷新界面状态
|
| | | this.RefreshFormStatu(false);
|
| | | //档
|
| | | var strView = Language.StringByID(StringId.Gear);
|
| | | seekBarContr.ProgressChangedEvent += (div, value) =>
|
| | | {
|
| | | this.btnNowGear.Text = value + strView;
|
| | | //滑动中
|
| | | if (div == 0) { this.fanData.IsProgressing = true; }
|
| | | //滑动结束
|
| | | else
|
| | | {
|
| | | this.fanData.IsProgressing = false;
|
| | | this.fanData.ProgressEndTime = DateTime.Now;
|
| | | //发送风速命令
|
| | | this.SendSpeedComand(value);
|
| | | }
|
| | | };
|
| | | var strView = Language.StringByID(StringId.Gear); |
| | | |
| | | if (device.online) |
| | | { |
| | | seekBarContr.ProgressChangedEvent += (div, value) => |
| | | { |
| | | this.btnNowGear.Text = value + strView; |
| | | //滑动中 |
| | | if (div == 0) { this.fanData.IsProgressing = true; } |
| | | //滑动结束 |
| | | else |
| | | { |
| | | this.fanData.IsProgressing = false; |
| | | this.fanData.ProgressEndTime = DateTime.Now; |
| | | //发送风速命令 |
| | | this.SendSpeedComand(value); |
| | | } |
| | | }; |
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | /// 发送开关命令
|
| | | /// </summary>
|
| | | private void SendSwitchComand()
|
| | | {
|
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | }
|
| | | this.btnSwitch.CanClick = false;
|
| | |
|
| | | string statu = this.btnSwitch.IsSelected == true ? "off" : "on";
|
| | |
| | | /// 发送风速命令
|
| | | /// </summary>
|
| | | private void SendSpeedComand(int value)
|
| | | {
|
| | | { |
| | | |
| | | var dic = new Dictionary<string, string>();
|
| | | dic.Add("fan_speed_percent", value.ToString());
|
| | | Control.Ins.SendWriteCommand(this.device, dic, true);
|
| | |
| | | /// </summary> |
| | | private void SendSwitchComand() |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | this.btnPictrue.CanClick = false; |
| | | this.btnSwitch.CanClick = false; |
| | | |
| | |
| | | |
| | | private void SetControlTime() |
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | var timeControl = new BottomTimeSelectControl(); |
| | | timeControl.RowCount = 5; |
| | | timeControl.InitControl(0,0); |
| | |
| | | btnSwitch.IsSelected = i_brushStatu;
|
| | | btnSwitch.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | if (!i_device.online)
|
| | | {
|
| | | new Tip()
|
| | | {
|
| | | CloseTime = 1,
|
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
|
| | | Direction = AMPopTipDirection.None,
|
| | | }.Show(MainPage.BaseView);
|
| | | return;
|
| | | }
|
| | | if (btnSwitch.IsSelected == true)
|
| | | {
|
| | | //取消的话直接取消
|
| | |
| | | /// 发送命令
|
| | | /// </summary>
|
| | | private void SendComand(string key, string i_value)
|
| | | {
|
| | | { |
| | | if (!device.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | }
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | var dic = new Dictionary<string, string>();
|
| | |
| | | sensorSPK = showList[0].spk; |
| | | foreach (var s in showList) |
| | | { |
| | | assembleValues += Convert.ToDouble(s.GetAttrState("value")); |
| | | assembleValues += Convert.ToDouble(s.GetAttrState("value").Replace(",", ".")); |
| | | } |
| | | |
| | | |
| | |
| | | assembleValues = 0; |
| | | foreach (var s in sensorList) |
| | | { |
| | | assembleValues += Convert.ToDouble(s.GetAttrState("value")); |
| | | assembleValues += Convert.ToDouble(s.GetAttrState("value").Replace(",", ".")); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | return; |
| | | } |
| | | var outinTemp = Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.SetTemp))); |
| | | var outinTemp = Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", "."))); |
| | | bodyView.btnTemp.Text = outinTemp.ToString(); |
| | | bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.RoomTemp))) + "°C"; |
| | | bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.RoomTemp).Replace(",", "."))) + "°C"; |
| | | bodyView.btnMode.SelectedImagePath = bodyView.fhTemp.GetModeIconPath(updateTemp.GetAttrState(FunctionAttributeKey.Mode)); |
| | | bodyView.btnMode.UnSelectedImagePath = bodyView.fhTemp.GetModeIconPath(updateTemp.GetAttrState(FunctionAttributeKey.Mode),false); |
| | | bodyView.arcBar.Progress = outinTemp; |
| | |
| | | /// </summary> |
| | | void LoadEvent_TempChange() |
| | | { |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | btnMinus.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if(function.trait_on_off.curValue.ToString() == "off") |
| | |
| | | return; |
| | | } |
| | | |
| | | var temp = (int)Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp)); |
| | | var temp = (int)Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")); |
| | | if (temp <= Convert.ToInt32(function.GetAttribute(FunctionAttributeKey.SetTemp).min)) |
| | | { |
| | | return; |
| | |
| | | { |
| | | return; |
| | | } |
| | | var temp =(int) Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp)); |
| | | var temp =(int) Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")); |
| | | if (temp >= Convert.ToDouble(function.GetAttribute(FunctionAttributeKey.SetTemp).max)) |
| | | { |
| | | return; |
| | |
| | | arcBar.OnProgressChangedEvent = (sender, e) => |
| | | { |
| | | function.SetAttrState(FunctionAttributeKey.SetTemp, e); |
| | | btnTemp.Text = Convert.ToDouble( function.GetAttrState(FunctionAttributeKey.SetTemp)).ToString(); |
| | | btnTemp.Text = Convert.ToDouble( function.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")).ToString(); |
| | | }; |
| | | } |
| | | /// <summary> |
| | |
| | | function = func; |
| | | actionRefresh = action; |
| | | } |
| | | |
| | | public override void RemoveFromParent() |
| | | { |
| | | actionRefresh?.Invoke(); |
| | | base.RemoveFromParent(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载界面 |
| | | /// </summary> |
| | |
| | | /// 修改色温
|
| | | /// </summary>
|
| | | void LoadEvet_ChangeColorTemplatrue()
|
| | | {
|
| | | { |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | }
|
| | | barColorTemplatrue.OnProgressChangedEvent += (sender, value) =>
|
| | | {
|
| | | new System.Threading.Thread(() => |
| | |
| | | /// </summary>
|
| | | void LoadEvent_DimmerBar()
|
| | | {
|
| | | dimmerBar.OnStartTrackingTouchEvent = (sender, e) => {
|
| | | onDimmerBar = true;
|
| | | };
|
| | | dimmerBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | {
|
| | | { |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | }
|
| | | onDimmerBar = false;
|
| | | function.SetAttrState(FunctionAttributeKey.Brightness, dimmerBar.Progress);
|
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
|
| | |
| | | btnBrightnessText.Text = dimmerBar.Progress + "%"; |
| | | |
| | | dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1); |
| | | };
|
| | | dimmerBar.OnProgressChangedEvent = (sender, e) => |
| | | {
|
| | | dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1); |
| | | //function.fadeTime = 0;
|
| | | //if (!btnSwitch.IsSelected)
|
| | | //{
|
| | | // dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
|
| | | //}
|
| | | //btnSwitch.IsSelected = e > 0 ? true : false;
|
| | | //function.brightness = e;
|
| | | //function.trait_on_off.curValue = e > 0 ? "on" : "off";
|
| | |
|
| | | //if (e == 0 || e == 100)
|
| | | //{
|
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
|
| | | // d.Add(FunctionAttributeKey.Brightness, function.brightness.ToString());
|
| | | // Control.Ins.SendWriteCommand(function, d);
|
| | | //}
|
| | | //else
|
| | | //{
|
| | | // if (200 < (DateTime.Now - function.refreshTime).TotalMilliseconds)
|
| | | // {
|
| | | // function.refreshTime = DateTime.Now;
|
| | | // new System.Threading.Thread(() =>
|
| | | // {
|
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
|
| | | // d.Add(FunctionAttributeKey.Brightness, function.brightness.ToString());
|
| | | // Control.Ins.SendWriteCommand(function, d);
|
| | | // })
|
| | | // { IsBackground = true }.Start();
|
| | | // }
|
| | | //}
|
| | |
|
| | | //btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16 - 16) / 100) + Application.GetRealWidth(40);
|
| | | //btnBrightnessText.Text = function.brightness + "%";
|
| | |
|
| | | }; |
| | | if (function.online) |
| | | { |
| | | dimmerBar.OnStartTrackingTouchEvent = (sender, e) => |
| | | { |
| | | onDimmerBar = true; |
| | | }; |
| | | dimmerBar.OnProgressChangedEvent = (sender, e) => |
| | | { |
| | | dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1); |
| | | //function.fadeTime = 0; |
| | | //if (!btnSwitch.IsSelected) |
| | | //{ |
| | | // dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1); |
| | | //} |
| | | //btnSwitch.IsSelected = e > 0 ? true : false; |
| | | //function.brightness = e; |
| | | //function.trait_on_off.curValue = e > 0 ? "on" : "off"; |
| | | |
| | | //if (e == 0 || e == 100) |
| | | //{ |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add(FunctionAttributeKey.Brightness, function.brightness.ToString()); |
| | | // Control.Ins.SendWriteCommand(function, d); |
| | | //} |
| | | //else |
| | | //{ |
| | | // if (200 < (DateTime.Now - function.refreshTime).TotalMilliseconds) |
| | | // { |
| | | // function.refreshTime = DateTime.Now; |
| | | // new System.Threading.Thread(() => |
| | | // { |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add(FunctionAttributeKey.Brightness, function.brightness.ToString()); |
| | | // Control.Ins.SendWriteCommand(function, d); |
| | | // }) |
| | | // { IsBackground = true }.Start(); |
| | | // } |
| | | //} |
| | | |
| | | //btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16 - 16) / 100) + Application.GetRealWidth(40); |
| | | //btnBrightnessText.Text = function.brightness + "%"; |
| | | |
| | | btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100) + Application.GetRealWidth(80); |
| | | btnBrightnessText.Text = dimmerBar.Progress + "%";
|
| | | };
|
| | |
|
| | |
|
| | | btnBrightnessText.Text = dimmerBar.Progress + "%"; |
| | | }; |
| | | |
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | void LoadSwitchEvent()
|
| | | {
|
| | | btnSwitch.MouseUpEventHandler += (sender, e) =>
|
| | | {
|
| | | { |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | }
|
| | | //function.fadeTime = barFadeTime.Progress;
|
| | | btnSwitch.IsSelected = !btnSwitch.IsSelected;
|
| | | if (btnSwitch.IsSelected)
|
| | |
| | | /// </summary> |
| | | void LoadEvent_DimmerBar() |
| | | { |
| | | dimmerBar.OnStartTrackingTouchEvent = (sender, e) => { |
| | | onDimmerBar = true; |
| | | }; |
| | | dimmerBar.OnStopTrackingTouchEvent = (sender, e) => { |
| | | onDimmerBar = false; |
| | | function.SetAttrState(FunctionAttributeKey.Brightness, dimmerBar.Progress); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.Brightness, dimmerBar.Progress.ToString()); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | btnBrightnessText.Text = dimmerBar.Progress + "%"; |
| | | }; |
| | | //20201223 删除滑动发送命令,防止控件跳动 |
| | | dimmerBar.OnProgressChangedEvent = (sender, e) => |
| | | if (function.online) |
| | | { |
| | | dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1); |
| | | dimmerBar.OnStartTrackingTouchEvent = (sender, e) => |
| | | { |
| | | onDimmerBar = true; |
| | | }; |
| | | dimmerBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | onDimmerBar = false; |
| | | function.SetAttrState(FunctionAttributeKey.Brightness, dimmerBar.Progress); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.Brightness, dimmerBar.Progress.ToString()); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | btnBrightnessText.Text = dimmerBar.Progress + "%"; |
| | | }; |
| | | //20201223 删除滑动发送命令,防止控件跳动 |
| | | dimmerBar.OnProgressChangedEvent = (sender, e) => |
| | | { |
| | | dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1); |
| | | //function.fadeTime = 0; |
| | | //if (!btnSwitch.IsSelected) |
| | | //{ |
| | |
| | | // } |
| | | //} |
| | | btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(288 - 16 - 16) / 100) + Application.GetRealWidth(40); |
| | | btnBrightnessText.Text = dimmerBar.Progress + "%"; |
| | | }; |
| | | btnBrightnessText.Text = dimmerBar.Progress + "%"; |
| | | }; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载开关事件 |
| | | /// </summary> |
| | |
| | | { |
| | | btnSwitch.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | btnSwitch.IsSelected = !btnSwitch.IsSelected; |
| | | if (btnSwitch.IsSelected) |
| | | { |
| | |
| | | /// </summary> |
| | | void LoadColorChangeEvent() |
| | | { |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | DateTime colorChangeTime = DateTime.MinValue; |
| | | //bool send = false; |
| | | |
| | |
| | | /// </summary> |
| | | void LoadEvent_DimmerBar() |
| | | { |
| | | dimmerBar.OnStartTrackingTouchEvent = (sender, e)=>{ |
| | | onDimmerBar = true; |
| | | }; |
| | | dimmerBar.OnStopTrackingTouchEvent = (sender, e) => { |
| | | new System.Threading.Thread(() => { |
| | | |
| | | dimmerBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(200); |
| | | onDimmerBar = false; |
| | | }) |
| | |
| | | function.SetAttrState(FunctionAttributeKey.Brightness, dimmerBar.Progress); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.Brightness, dimmerBar.Progress.ToString()); |
| | | |
| | | |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | }; |
| | | dimmerBar.OnProgressChangedEvent = (sender, e) => { |
| | | //function.fadeTime = 0; |
| | | //if (!btnSwitch.IsSelected) |
| | | //{ |
| | | // dimmerBar.ProgressBarColor = CSS.CSS_Color.AuxiliaryColor1; |
| | | //} |
| | | //btnSwitch.IsSelected = e > 0 ? true : false; |
| | | //function.brightness = e; |
| | | //function.trait_on_off.curValue = e > 0 ? "on" : "off"; |
| | | if (function.online) |
| | | { |
| | | dimmerBar.OnStartTrackingTouchEvent = (sender, e) => |
| | | { |
| | | onDimmerBar = true; |
| | | }; |
| | | dimmerBar.OnProgressChangedEvent = (sender, e) => |
| | | { |
| | | //function.fadeTime = 0; |
| | | //if (!btnSwitch.IsSelected) |
| | | //{ |
| | | // dimmerBar.ProgressBarColor = CSS.CSS_Color.AuxiliaryColor1; |
| | | //} |
| | | //btnSwitch.IsSelected = e > 0 ? true : false; |
| | | //function.brightness = e; |
| | | //function.trait_on_off.curValue = e > 0 ? "on" : "off"; |
| | | |
| | | //if (e == 0 || e == 100) |
| | | //{ |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add(FunctionAttributeKey.Brightness, function.brightness.ToString()); |
| | | // Control.Ins.SendWriteCommand(function, d); |
| | | //} |
| | | //else |
| | | //{ |
| | | // if (200 < (DateTime.Now - function.refreshTime).TotalMilliseconds) |
| | | // { |
| | | // function.refreshTime = DateTime.Now; |
| | | // new System.Threading.Thread(() => |
| | | // { |
| | | // //Control.Send(CommandType_A.write, function); |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add(FunctionAttributeKey.Brightness, function.brightness.ToString()); |
| | | // Control.Ins.SendWriteCommand(function, d); |
| | | // }) |
| | | // { IsBackground = true }.Start(); |
| | | // } |
| | | // else |
| | | // { |
| | | // MainPage.Log("skip dimmer control!!"); |
| | | // } |
| | | //} |
| | | }; |
| | | //if (e == 0 || e == 100) |
| | | //{ |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add(FunctionAttributeKey.Brightness, function.brightness.ToString()); |
| | | // Control.Ins.SendWriteCommand(function, d); |
| | | //} |
| | | //else |
| | | //{ |
| | | // if (200 < (DateTime.Now - function.refreshTime).TotalMilliseconds) |
| | | // { |
| | | // function.refreshTime = DateTime.Now; |
| | | // new System.Threading.Thread(() => |
| | | // { |
| | | // //Control.Send(CommandType_A.write, function); |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add(FunctionAttributeKey.Brightness, function.brightness.ToString()); |
| | | // Control.Ins.SendWriteCommand(function, d); |
| | | // }) |
| | | // { IsBackground = true }.Start(); |
| | | // } |
| | | // else |
| | | // { |
| | | // MainPage.Log("skip dimmer control!!"); |
| | | // } |
| | | //} |
| | | }; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 修改灯光渐变时间 |
| | | /// </summary> |
| | |
| | | { |
| | | btnRestoredPoint.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | { |
| | | return; |
| | | } |
| | | if(function.trait_on_off.curValue.ToString() == "off") |
| | | { |
| | | return; |
| | |
| | | { |
| | | btnSwitchIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | btnSwitch.IsSelected = btnSwitchIcon.IsSelected = !btnSwitchIcon.IsSelected; |
| | | new System.Threading.Thread(() => |
| | | { |
| | |
| | | }; |
| | | btnSwitch.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | btnSwitchIcon.IsSelected = btnSwitch.IsSelected = !btnSwitch.IsSelected; |
| | | new System.Threading.Thread(() => |
| | | { |
| | |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </summary> |
| | | public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | /// <summary> |
| | | /// RegionMark |
| | | /// </summary> |