old mode 100644
new mode 100755
| | |
| | | 5274=检测无漏水 |
| | | 5275=检测到燃气 |
| | | 5276=检测无燃气 |
| | | 5277=检测到烟幕 |
| | | 5278=检测无烟幕 |
| | | 5277=检测到烟雾 |
| | | 5278=检测无烟雾 |
| | | 5279=添加安防 |
| | | 5280=立即执行 |
| | | 5281=时间范围 |
| | |
| | | 10113=请再次输入密码 |
| | | 10114=发送验证码成功,请注意查收 |
| | | 10115=确定 |
| | | 10116=该账号已注册,可直接登录 |
| | | 10116=该用户已存在,可直接登录 |
| | | 10117=提供的参数错误 |
| | | 10118=两次密码不一致 |
| | | 10119=验证码错误 |
| | | 10118=确认密码不一致,请重新输入 |
| | | 10119=验证码错误,请重新输入 |
| | | 10120=请求服务器失败 |
| | | 10121=恭喜注册成功! |
| | | 10122=即将自动登录 |
| | |
| | | 10137=住宅名称为空 |
| | | 10138=邮箱错误,请重新输入 |
| | | 10139=手机号错误,请重新输入 |
| | | 10140=请输入长度为6-13个字符的密码 |
| | | 10141=你已被强制下线! |
| | | |
| | | |
| | | 10150=改房间名称已存在 |
| | | 10151=场景名不能为空 |
| | | 10152=控制场景失败 |
| | |
| | | <ItemGroup>
|
| | | <AndroidAsset Include="Assets\Phone\Scene\Background.png" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <AndroidAsset Include="Assets\Phone\ZigeeLogic\selectedsensor0.png" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <AndroidAsset Include="Assets\Phone\ZigeeLogic\sensor0.png" />
|
| | | </ItemGroup>
|
| | | <Import Project="..\Shared\Shared.projitems" Label="Shared" Condition="Exists('..\Shared\Shared.projitems')" />
|
| | | <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
| | | <Import Project="..\packages\Xamarin.Android.Support.Annotations.26.0.2\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Annotations.26.0.2\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets')" />
|
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="2019120501" android:installLocation="auto" android:versionName="1.0.19120501"> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="2019120901" android:installLocation="auto" android:versionName="1.0.19120901"> |
| | | <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="26" /> |
| | | <permission android:name="com.hdl.home.permission.JPUSH_MESSAGE" android:protectionLevel="signature" /> |
| | | <uses-permission android:name="android.permission.WAKE_LOCK" /> |
| | |
| | | <BundleResource Include="Resources\Phone\Item\InputAccountIconSelected.png" /> |
| | | <BundleResource Include="Resources\Phone\ZigeeLogic\deviceselectedbackgroundcolor.png" /> |
| | | <BundleResource Include="Resources\Phone\ZigeeLogic\add.png" /> |
| | | <BundleResource Include="Resources\Phone\ZigeeLogic\sensor0.png" /> |
| | | <BundleResource Include="Resources\Phone\ZigeeLogic\selectedsensor13.png" /> |
| | | <BundleResource Include="Resources\Phone\ZigeeLogic\logicbj1.png" /> |
| | | <BundleResource Include="Resources\Phone\ZigeeLogic\dimmableLight.png" /> |
| | |
| | | <BundleResource Include="Resources\Phone\ZigeeLogic\selectedsensor40.png" /> |
| | | <BundleResource Include="Resources\Phone\ZigeeLogic\deviceunselectedbackgroundcolor.png" /> |
| | | <BundleResource Include="Resources\Phone\ZigeeLogic\sensor21.png" /> |
| | | <BundleResource Include="Resources\Phone\ZigeeLogic\selectedsensor0.png" /> |
| | | <BundleResource Include="Resources\Phone\ZigeeLogic\next.png" /> |
| | | <BundleResource Include="Resources\Phone\ZigeeLogic\iconSelectedBackgroundColor.png" /> |
| | | <BundleResource Include="Resources\Phone\ZigeeLogic\security.png" /> |
old mode 100644
new mode 100755
| | |
| | | 5274=检测无漏水 |
| | | 5275=检测到燃气 |
| | | 5276=检测无燃气 |
| | | 5277=检测到烟幕 |
| | | 5278=检测无烟幕 |
| | | 5277=检测到烟雾 |
| | | 5278=检测无烟雾 |
| | | 5279=添加安防 |
| | | 5280=立即执行 |
| | | 5281=时间范围 |
| | |
| | | 10113=请再次输入密码 |
| | | 10114=发送验证码成功,请注意查收 |
| | | 10115=确定 |
| | | 10116=该账号已注册,可直接登录 |
| | | 10116=该用户已存在,可直接登录 |
| | | 10117=提供的参数错误 |
| | | 10118=两次密码不一致 |
| | | 10119=验证码错误 |
| | | 10118=确认密码不一致,请重新输入 |
| | | 10119=验证码错误,请重新输入 |
| | | 10120=请求服务器失败 |
| | | 10121=恭喜注册成功! |
| | | 10122=即将自动登录 |
| | |
| | | 10137=住宅名称为空 |
| | | 10138=邮箱错误,请重新输入 |
| | | 10139=手机号错误,请重新输入 |
| | | 10140=请输入长度为6-13个字符的密码 |
| | | 10141=你已被强制下线! |
| | | |
| | | |
| | | 10150=改房间名称已存在 |
| | | 10151=场景名不能为空 |
| | | 10152=控制场景失败 |
| | |
| | | Phone.UserView.HomePage.Instance.InitPage(); |
| | | |
| | | var roomList = new Shared.Phone.Device.Room.RoomManagement(); |
| | | |
| | | |
| | | Instance.AddLeftView(roomList); |
| | | roomList.Show(); |
| | | } |
| | |
| | | /// <summary> |
| | | /// 版本号 |
| | | /// </summary> |
| | | public static string CodeIDString = "1.0.19120501"; |
| | | public static string CodeIDString = "1.0.19120901"; |
| | | /// <summary> |
| | | /// 注册来源(0:HDL On 1:Zigbee) |
| | | /// </summary> |
| | |
| | | } |
| | | |
| | | var responeData = Newtonsoft.Json.JsonConvert.DeserializeObject<ResponseEntity.ApkInfoRes>(result.ResponseData.ToString()); |
| | | if (responeData == null || responeData.pageData == null || responeData.pageData.Count==0) |
| | | if (responeData == null || responeData.pageData == null || responeData.pageData.Count == 0) |
| | | { |
| | | return null; |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | Application.RunOnMainThread( () => |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //设定一个时间 |
| | | Config.Instance.LoginDateTime = new DateTime(1970, 1, 1); |
| | |
| | | temperatrue = true;
|
| | | }
|
| | | //湿度传感器
|
| | | else if(((TemperatureSensor)device).SensorDiv == 2)
|
| | | else if (((TemperatureSensor)device).SensorDiv == 2)
|
| | | {
|
| | | humidity = true;
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | | //如果是调光器
|
| | | else if (mainDevice.Type == DeviceType.DimmableLight )
|
| | | else if (mainDevice.Type == DeviceType.DimmableLight)
|
| | | {
|
| | | mainDevice.DfunctionType = DeviceFunctionType.A灯光;
|
| | | if (mainDevice.IsCustomizeImage == false)
|
| | |
| | | }
|
| | | }
|
| | | //如果是彩灯的话
|
| | | else if ( mainDevice.Type == DeviceType.ColorDimmableLight)
|
| | | else if (mainDevice.Type == DeviceType.ColorDimmableLight)
|
| | | {
|
| | | mainDevice.DfunctionType = DeviceFunctionType.A灯光;
|
| | | if (mainDevice.IsCustomizeImage == false)
|
| | |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public List<Room> GetRoomsByFloorId(string id) |
| | | public List<Room> GetRoomsByFloorId(string id) |
| | | { |
| | | return Lists.FindAll((obj) => obj.FloorId==id); |
| | | return Lists.FindAll((obj) => obj.FloorId == id); |
| | | } |
| | | /// <summary> |
| | | /// 获取当前楼层的房间名称 |
| | |
| | | return -1; |
| | | } |
| | | } |
| | | |
| | | |
| | | var getSceneIdAllData = await ZigBee.Device.Scene.GetSceneNewIdAsync(sceneName); |
| | | if (getSceneIdAllData == null || getSceneIdAllData.getSceneIdData == null) |
| | | { |
| | |
| | | }
|
| | |
|
| | | #endregion |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | public string IconPath = "Scene/SceneDefault.png"; |
| | | /// <summary> |
| | | /// 图片来源 0--本地图库 1--拍照 2--系统图库 |
| | | /// 图片来源 0--本地图库 1--拍照 2--系统图库 |
| | | /// </summary> |
| | | public int IconPathType = 0; |
| | | |
| | |
| | | |
| | | if (Shared.Common.Room.AllRoomDeviceUIList.Count == 0) |
| | | { |
| | | |
| | | |
| | | if (Shared.Common.Room.AllRoomDeviceUIList.Count == 0) |
| | | { |
| | | CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.ThisSceneHaveNoDevice); |
| | |
| | | if (sceneDeviceList.getSceneDeviceListInfo != null) |
| | | { |
| | | var deviceList = sceneDeviceList.getSceneDeviceListInfo.DeviceList; |
| | | |
| | | |
| | | if (deviceList != null && Room.AllRoomDeviceUIList.Count != 0) |
| | | { |
| | | foreach (var sceneDev in deviceList) |
| | |
| | | Text = ACControlBase.GetModeNameByModeId(ac.currentSystemMode) |
| | | }; |
| | | itemView.AddChidren(currentModeBtn); |
| | | |
| | | |
| | | reduceTemperatureBtn = new Button() |
| | | { |
| | | X = Application.GetRealWidth(268), |
| | |
| | | /// <param name="mouseEventArgs"></param> |
| | | private async void SendCode_MouseUpEventAsync(object sender, MouseEventArgs mouseEventArgs) |
| | | { |
| | | if (CheckAccount(account) == false) |
| | | { |
| | | return; |
| | | } |
| | | //先判断2次密码输入是否一致 |
| | | if (pwdRow.PasswrodET.Text.Trim() != pwdComfireRow.PasswrodET.Text.Trim()) |
| | | { |
| | | errorBtn.TextID = R.MyInternationalizationString.TwoPasswordInconsistency; |
| | | return; |
| | | } |
| | | |
| | | if (AccountLogic.Instance.CheckPwdLength(pwdRow.PasswrodET.Text.Trim()) == false) |
| | | { |
| | | errorBtn.TextID = R.MyInternationalizationString.ThePWDLengthError; |
| | | return; |
| | | } |
| | | |
| | | (sender as Button).Enable = (sender as Button).IsSelected = false; |
| | | CommonPage.Loading.Start(); |
| | | try |
| | |
| | | CommonPage.Loading.Hide(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// CheckAccount |
| | | /// </summary> |
| | | /// <param name="accountStr"></param> |
| | | /// <returns></returns> |
| | | private bool CheckAccount(string accountStr) |
| | | { |
| | | errorBtn.Text = string.Empty; |
| | | if (phoneEmailForm.SelectedEmail.IsSelected) |
| | | { |
| | | if (AccountLogic.Instance.CheckEmail(accountStr) == false) |
| | | { |
| | | errorBtn.TextID = R.MyInternationalizationString.TheEmailError; |
| | | return false; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (AccountLogic.Instance.CheckPhoneWithZone(accountStr, CommonPage.PhoneZoneStr) == false) |
| | | { |
| | | errorBtn.TextID = R.MyInternationalizationString.ThePhoneError; |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ◆ 确认修改__________________________ |
| | |
| | | /// <param name="mouseEventArgs"></param> |
| | | private async void Reset(object sender,MouseEventArgs mouseEventArgs) |
| | | { |
| | | |
| | | if (CheckAccount(account) == false) |
| | | { |
| | | return; |
| | | } |
| | | //先判断2次密码输入是否一致 |
| | | if (pwdRow.PasswrodET.Text.Trim() != pwdComfireRow.PasswrodET.Text.Trim()) |
| | | { |
| | | var alert = new Alert(Language.StringByID(R.MyInternationalizationString.TIP), Language.StringByID(R.MyInternationalizationString.TwoPasswordInconsistency), Language.StringByID(R.MyInternationalizationString.Confrim)); |
| | | alert.Show(); |
| | | errorBtn.TextID = R.MyInternationalizationString.TwoPasswordInconsistency; |
| | | return; |
| | | } |
| | | if (AccountLogic.Instance.CheckPwdLength(pwdRow.PasswrodET.Text.Trim()) == false) |
| | | { |
| | | errorBtn.TextID = R.MyInternationalizationString.ThePWDLengthError; |
| | | return; |
| | | } |
| | | |
| | | CommonPage.Loading.Start(); |
| | | try |
| | | { |
| | |
| | | /// <param name="phone">手机号</param> |
| | | /// <param name="zoneCode">区号</param> |
| | | /// <returns></returns> |
| | | public bool CheckPhoneWithZone(string phone,string zoneCode) |
| | | public bool CheckPhoneWithZone(string phone, string zoneCode) |
| | | { |
| | | if(zoneCode=="86") |
| | | if (zoneCode == "86") |
| | | { |
| | | var regex = new Regex(CommonPage.PhoneRegexStr); |
| | | return regex.IsMatch(phone); |
| | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ◆ 密码____________________________ |
| | | |
| | | /// <summary> |
| | | /// 检查密码长度合法性 |
| | | /// </summary> |
| | | /// <param name="password"></param> |
| | | /// <returns></returns> |
| | | public bool CheckPwdLength(string password) |
| | | { |
| | | if (password.Trim().Length >= 6 && password.Trim().Length <= 13) |
| | | { |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | Config.Instance.Save(); |
| | | |
| | | var resultRegID = await Shared.Common.CommonPage.Instance.PushRegID(); |
| | | var homes = await House.GetHomeLists();
|
| | | var homes = await House.GetHomeLists(); |
| | | //刷新个人中心的内存及线程 |
| | | await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread();
|
| | | //启动ZigBee
|
| | | ZigBee.Common.Application.Init(); |
| | | //刷新个人中心的内存及线程 |
| | | await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread(); |
| | | |
| | | Shared.Common.Room.InitAllRoom(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | HomePage.Instance.ShowLoginLoadView(); |
| | | }); |
| | | var resultRegID = await Shared.Common.CommonPage.Instance.PushRegID(); |
| | | var homes = await House.GetHomeLists();
|
| | | var homes = await House.GetHomeLists(); |
| | | //刷新个人中心的内存及线程 |
| | | await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread();
|
| | | //启动ZigBee
|
| | | ZigBee.Common.Application.Init(); |
| | | //刷新个人中心的内存及线程 |
| | | await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread(); |
| | | Shared.Common.Room.InitAllRoom(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | Config.Instance.Save(); |
| | | return true; |
| | | } |
| | | else |
| | | else |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// phone/email 选择 |
| | |
| | | Config.Instance.Save(); |
| | | var resultRegID = await CommonPage.Instance.PushRegID(); |
| | | var homes = await House.GetHomeLists();
|
| | | |
| | | //刷新个人中心的内存及线程 |
| | | await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread();
|
| | | //启动ZigBee
|
| | | ZigBee.Common.Application.Init(); |
| | | //刷新个人中心的内存及线程 |
| | | await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread(); |
| | | |
| | | Shared.Common.Room.InitAllRoom(); |
| | | Application.RunOnMainThread(() => |
| | |
| | | //AddBody |
| | | AddBodyView(); |
| | | |
| | | |
| | | //bind |
| | | BindEvent(); |
| | | } |
| | |
| | | } |
| | | pwdRow = new PwdRowForm(); |
| | | pwdRow.Init(accountCodeFrameLayout, 29, 196); |
| | | //pwdRow.PasswrodET.TextChangeEventHandler += Account_TextChange; |
| | | pwdRow.PasswrodET.TextChangeEventHandler += Code_TextChange; |
| | | |
| | | pwdComfireRow = new PwdRowForm(); |
| | | pwdComfireRow.Init(accountCodeFrameLayout, 29, 363); |
| | | //pwdComfireRow.PasswrodET.TextChangeEventHandler += Account_TextChange; |
| | | pwdComfireRow.PasswrodET.TextChangeEventHandler += Code_TextChange; |
| | | pwdComfireRow.SetPlaceholdText(Language.StringByID(R.MyInternationalizationString.PleaseComfirePWD)); |
| | | |
| | | codeRow = new CodeForRegisterRowForm(); |
| | |
| | | phoneEmailForm.SelectedEmail.MouseUpEventHandler += SelectPhoneOrEmail_MouseUpEvent; |
| | | registerBtn.MouseUpEventHandler += Register; |
| | | loginByAccountPWDBtn.MouseUpEventHandler += LoginByPWD; |
| | | codeRow.VerificationCodeET.TextChangeEventHandler += Code_TextChange; |
| | | } |
| | | #endregion |
| | | |
| | |
| | | /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param> |
| | | private async void Register(object sender, MouseEventArgs mouseEventArgs) |
| | | { |
| | | if (CheckAccount(account) == false) |
| | | { |
| | | return; |
| | | } |
| | | //先判断2次密码输入是否一致 |
| | | if (pwdRow.PasswrodET.Text.Trim() != pwdComfireRow.PasswrodET.Text.Trim()) |
| | | { |
| | | errorBtn.TextID = R.MyInternationalizationString.TwoPasswordInconsistency; |
| | | return; |
| | | } |
| | | |
| | | if (AccountLogic.Instance.CheckPwdLength(pwdRow.PasswrodET.Text.Trim()) == false) |
| | | { |
| | | errorBtn.TextID = R.MyInternationalizationString.ThePWDLengthError; |
| | | return; |
| | | } |
| | | |
| | | CommonPage.Loading.Start(); |
| | | try |
| | | { |
| | |
| | | errorBtn.Text = string.Empty; |
| | | if ((sender as EditText).Text.Trim().Length > 0) |
| | | { |
| | | //IsRightAccount = true; |
| | | codeRow.SendCodeBtn.Enable = codeRow.SendCodeBtn.IsSelected = true; |
| | | } |
| | | else |
| | | { |
| | | //IsRightAccount = false; |
| | | codeRow.SendCodeBtn.Enable = codeRow.SendCodeBtn.IsSelected = false; |
| | | } |
| | | account = (sender as EditText).Text.Trim(); |
| | |
| | | private void Code_TextChange(object sender, string mouseEventArgs) |
| | | { |
| | | errorBtn.Text = string.Empty; |
| | | if ((sender as EditText).Text.Trim().Length > 0) |
| | | if (codeRow.VerificationCodeET.Text.Trim().Length > 0 && account.Trim().Length > 0 && pwdRow.PasswrodET.Text.Trim().Length > 0 && pwdComfireRow.PasswrodET.Text.Trim().Length > 0) |
| | | { |
| | | registerBtn.Enable = registerBtn.IsSelected = true; |
| | | } |
| | |
| | | /// <param name="mouseEventArgs"></param> |
| | | private async void SendCode_MouseUpEventAsync(object sender, MouseEventArgs mouseEventArgs) |
| | | { |
| | | (sender as Button).Enable = (sender as Button).IsSelected = false; |
| | | //先判断2次密码输入是否一致 |
| | | if (pwdRow.PasswrodET.Text.Trim() != pwdComfireRow.PasswrodET.Text.Trim()) |
| | | { |
| | | var alert = new Alert(Language.StringByID(R.MyInternationalizationString.TIP), Language.StringByID(R.MyInternationalizationString.TwoPasswordInconsistency), Language.StringByID(R.MyInternationalizationString.Confrim)); |
| | | alert.Show(); |
| | | codeRow.SendCodeBtn.Enable = codeRow.SendCodeBtn.IsSelected = false; |
| | | if (CheckAccount(account) == false) |
| | | { |
| | | return; |
| | | } |
| | | //先判断2次密码输入是否一致 |
| | | if (pwdRow.PasswrodET.Text.Trim() != pwdComfireRow.PasswrodET.Text.Trim()) |
| | | { |
| | | errorBtn.TextID = R.MyInternationalizationString.TwoPasswordInconsistency; |
| | | return; |
| | | } |
| | | |
| | | if (AccountLogic.Instance.CheckPwdLength(pwdRow.PasswrodET.Text.Trim()) == false) |
| | | { |
| | | errorBtn.TextID = R.MyInternationalizationString.ThePWDLengthError; |
| | | return; |
| | | } |
| | | |
| | | CommonPage.Loading.Start(); |
| | | (sender as Button).Enable = (sender as Button).IsSelected = false; |
| | | try |
| | |
| | | CommonPage.Loading.Hide(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// CheckAccount |
| | | /// </summary> |
| | | /// <param name="accountStr"></param> |
| | | /// <returns></returns> |
| | | private bool CheckAccount(string accountStr) |
| | | { |
| | | errorBtn.Text = string.Empty; |
| | | if (phoneEmailForm.SelectedEmail.IsSelected) |
| | | { |
| | | if (AccountLogic.Instance.CheckEmail(accountStr) == false) |
| | | { |
| | | errorBtn.TextID = R.MyInternationalizationString.TheEmailError; |
| | | return false; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (AccountLogic.Instance.CheckPhoneWithZone(accountStr, CommonPage.PhoneZoneStr) == false) |
| | | { |
| | | errorBtn.TextID = R.MyInternationalizationString.ThePhoneError; |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | } |
| | | //登录成功 |
| | | var homes = await House.GetHomeLists();
|
| | | ZigBee.Common.Application.Init(); |
| | | |
| | | //刷新个人中心的内存及线程 |
| | | await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread(); |
| | | await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread();
|
| | | //启动ZigBee |
| | | ZigBee.Common.Application.Init(); |
| | | |
| | | Shared.Common.Room.InitAllRoom(); |
| | | |
| | |
| | | |
| | | AccountET = new EditText() |
| | | { |
| | | X = Application.GetRealWidth(236), |
| | | X = Application.GetRealWidth(222), |
| | | Width = Application.GetRealWidth(700), |
| | | Height = Application.GetRealHeight(Button_Height), |
| | | Gravity = Gravity.CenterVertical, |
| | |
| | | accountFL.AddChidren(accountLine); |
| | | } |
| | | } |
| | | |
| | | |
| | | public class EmailLoginRowForm : FrameLayout |
| | | { |
| | |
| | | |
| | | AccountET = new EditText() |
| | | { |
| | | X = Application.GetRealWidth(193), |
| | | X = Application.GetRealWidth(222), |
| | | Width = Application.GetRealWidth(700), |
| | | Height = Application.GetRealHeight(Button_Height), |
| | | Gravity = Gravity.CenterVertical, |
| | |
| | | |
| | | VerificationCodeET = new EditText() |
| | | { |
| | | X = Application.GetRealWidth(236), |
| | | X = Application.GetRealWidth(222), |
| | | Width = Application.GetRealWidth(350), |
| | | Height = Application.GetRealHeight(Button_Height), |
| | | Gravity = Gravity.CenterVertical, |
| | |
| | | |
| | | VerificationCodeET = new EditText() |
| | | { |
| | | X = Application.GetRealWidth(236), |
| | | X = Application.GetRealWidth(222), |
| | | Width = Application.GetRealWidth(300), |
| | | Height = Application.GetRealHeight(Button_Height), |
| | | Gravity = Gravity.CenterVertical, |
| | |
| | | #endregion |
| | | |
| | | #region ◆ 自动化__________________________ |
| | | |
| | | |
| | | /// <summary> |
| | | /// 自动化 |
| | | /// 自动化功能代码入口 |
| | | /// </summary> |
| | | private async void ShowAutotion() |
| | | private void ShowAutotion() |
| | | {
|
| | |
|
| | | functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
|
| | |
| | | Y = Application.GetRealHeight(30), |
| | | }; |
| | | functionSceneAutoBodyView.AddChidren(bjFrameLayout); |
| | | bjFrameLayout.SetCornerWithSameRadius(25, HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerBottomLeft); |
| | | bjFrameLayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerBottomLeft); |
| | | var sigBtn = new Button |
| | | { |
| | | Width = Application.GetMinRealAverage(84), |
| | |
| | | TextID = MyInternationalizationString.logictemplate, |
| | | Gravity = Gravity.CenterVertical, |
| | | TextColor = ZigbeeColor.Current.LogicBtnSelectedColor, |
| | | TextSize=15, |
| | | TextSize = 15, |
| | | }; |
| | | bjFrameLayout.AddChidren(recommendtextBtn); |
| | | |
| | |
| | | }; |
| | | functionSceneAutoBodyView.AddChidren(scenehorizontalScrol); |
| | | |
| | | var logicScrolView = new VerticalScrolViewLayout |
| | | var logicScrolView = new VerticalRefreshLayout//VerticalScrolViewLayout |
| | | { |
| | | Height = functionSceneAutoBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30), |
| | | BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, |
| | |
| | | Y = scenehorizontalScrol.Bottom, |
| | | }; |
| | | functionSceneAutoBodyView.AddChidren(logicScrolView); |
| | | logicScrolView.SetCornerWithSameRadius(20, HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerBottomLeft); |
| | | |
| | | logicScrolView.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft); |
| | | |
| | | recommendswitchBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | |
| | | logicScrolView.Height = functionSceneAutoBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30) - Yheight; |
| | | Automationview(logicScrolView); |
| | | }; |
| | | logicScrolView.BeginHeaderRefreshingAction += () => |
| | | { |
| | | //重新刷新logic列表 |
| | | Common.Logic.LogicList.Clear(); |
| | | Read(logicScrolView); |
| | | //关闭刷新View; |
| | | logicScrolView.EndHeaderRefreshing(); |
| | | }; |
| | | |
| | | Read(logicScrolView); |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 读取自动化列表数据; |
| | | /// </summary> |
| | | /// <param name="logicScrolView"></param> |
| | | private async void Read(VerticalRefreshLayout logicScrolView) |
| | | { |
| | | CommonPage.Loading.Start(); |
| | | if (Common.Logic.LogicList.Count == 0) |
| | | { |
| | | var Idlist = await Logic.Send.GetLogicId(0); |
| | | if (Idlist.Count != 0) |
| | | { |
| | | var listlogic = await Logic.Send.ReadList(Idlist.Count,0); |
| | | var listlogic = await Logic.Send.ReadList(Idlist.Count, 0); |
| | | //foreach可能集合已被修改,枚举操作可能不会执行,可能出现崩溃(建议for)。 |
| | | for (int j = 0; j < listlogic.Count; j++) |
| | | { |
| | |
| | | //自动化 |
| | | Automationview(logicScrolView); |
| | | CommonPage.Loading.Hide(); |
| | | |
| | | } |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 自动化列表界面 |
| | | /// 加载自动化列表界面 |
| | | /// </summary> |
| | | /// <param name="refresview">Refresview.</param> |
| | | private async void Automationview(VerticalScrolViewLayout refresview) |
| | | private async void Automationview(VerticalRefreshLayout refresview) |
| | | { |
| | | refresview.RemoveAll(); |
| | | foreach (var logic in Common.Logic.LogicList) |
| | |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 显示图标的颜色 |
| | | /// 显示自动化输出功能模块图标的颜色 |
| | | /// </summary> |
| | | /// <param name="logic"></param> |
| | | /// <param name="logicRowlayout"></param> |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ◆ 控制状态_________________________ |
| | |
| | | /// </summary> |
| | | private string ImagePath="SceneIcon/1.png"; |
| | | /// <summary> |
| | | /// 图片来源 0--本地图库 1--拍照 2--系统图库 |
| | | /// 图片来源 0--本地图库 1--拍照 2--系统图库 |
| | | /// </summary> |
| | | public int IconPathType = 0; |
| | | /// <summary> |
| | |
| | | targetRow.SetNameText(devNameText); |
| | | targetRow.SetZoneText(targetDevice.SceneUI.GetZone()); |
| | | } |
| | | |
| | | |
| | | var editBtn = new Button() |
| | | { |
| | | BackgroundColor = ZigbeeColor.Current.GXCEditBackGroundColor, |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | private void Init() |
| | | { |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | backGround.ImageBytes = Shared.IO.FileUtils.ReadFile(imagePath); |
| | | backGround.ImagePath = imagePath; |
| | | System.IO.File.Delete(imagePath); |
| | | |
| | | |
| | | }, fileName, 2, 1); |
| | | }; |
| | | |
| | | |
| | | selectAblumsBtn.MouseUpEventHandler += (send, ee) => |
| | | { |
| | | selectFL.RemoveFromParent(); |
| | |
| | | sceneTargetDevicesList.Add(selectedScene); |
| | | RefreshTargetListView(); |
| | | }; |
| | | |
| | | |
| | | }; |
| | | //添加时间间隔 |
| | | selectedTimerBtn.MouseUpEventHandler += (send, ee) => |
| | |
| | | { |
| | | if (modifyRoom != curRoom) |
| | | { |
| | | |
| | | modifyRoom.SceneUIList.Remove(modifySceneUI); |
| | | modifyRoom.SceneUIFilePathList.Remove(modifySceneUI.FileName); |
| | | curRoom.SceneUIList.Add(modifySceneUI); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | }; |
| | | #endregion |
| | | } |
| | |
| | | }; |
| | | functionSceneBodyView.AddChidren(deviceListScrolView); |
| | | tempFunctionTypeBtn = new FunctionButton(); |
| | | tempFunctionTypeBtn.Init("",""); |
| | | |
| | | EventHandler<MouseEventArgs> ShowSameTypeFunction = (object typeSender, MouseEventArgs mouseEventArgs) => |
| | | { |
| | |
| | | if (string.IsNullOrEmpty(room.HumidityDevice) == false) |
| | | { |
| | | HdlGatewayReceiveLogic.Current.RemoveEvent("HumidityDevice"); |
| | | HdlGatewayReceiveLogic.Current.AddAttributeEvent("HumidityDevice", ReceiveComandDiv.A设备属性上报, (report) => |
| | | HdlGatewayReceiveLogic.Current.AddAttributeEvent("HumidityDevice", ReceiveComandDiv.A设备属性上报, (report) => |
| | | { |
| | | string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(report); |
| | | if (room.HumidityDevice != mainKeys) |
| | |
| | | Tag = "Logic"; |
| | | } |
| | | |
| | | public void Show(int isInt=0, bool edit=false) |
| | | public void Show(int isInt = 0, bool edit = false) |
| | | { |
| | | |
| | | |
| | | #region 最上面的布局代码 |
| | | var topRowLayout = new RowLayout |
| | |
| | | }; |
| | | this.AddChidren(middle); |
| | | |
| | | |
| | | var blancolor = new FrameLayout |
| | | { |
| | | Width = Application.GetMinRealAverage(200), |
| | |
| | | Height = Application.GetMinRealAverage(60), |
| | | X = Application.GetRealWidth(300), |
| | | Y = blancolor.Bottom + Application.GetRealHeight(50), |
| | | TextID =MyInternationalizationString.createtimetext, |
| | | TextID = MyInternationalizationString.createtimetext, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | TextSize = 15, |
| | | |
| | |
| | | }; |
| | | middle.AddChidren(PickerViewfra); |
| | | PickerViewfra.SetCornerWithSameRadius(Application.GetRealHeight(50), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight); |
| | | |
| | | |
| | | var mUIPickerView = new UIPickerView |
| | | { |
| | |
| | | int value = 0; |
| | | if (edit) |
| | | { |
| | | |
| | | |
| | | timevalue = int.Parse(Common.Logic.CurrentLogic.Actions[isInt]["DelayTime"].ToString()); |
| | | if (timevalue > 3600)
|
| | | {
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | |
| | | var minutevalue1 = timevalue / 60;
|
| | | var secondvalue1 = timevalue % 60;
|
| | | //更新最新状态
|
| | | mUIPickerView.setCurrentItems(minutevalue1, secondvalue1, 0);
|
| | | } |
| | | |
| | | value = timevalue; |
| | | } |
| | | string selectde = ""; |
| | |
| | | selectde = "yes"; |
| | | |
| | | }; |
| | | |
| | | |
| | | var btnsave = new Button |
| | | { |
| | |
| | | { |
| | | return; |
| | | } |
| | | if (selectde != ""|| timevalue==5) |
| | | if (selectde != "" || timevalue == 5) |
| | | { |
| | | Dictionary<string, object> actionsInfo = new Dictionary<string, object>(); |
| | | actionsInfo.Add("LinkType", 7); |
| | |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | logicCommunalPage.Show(() => { }); |
| | | }; |
| | | |
| | | } |
| | | } |
| | | } |
old mode 100755
new mode 100644
| | |
| | | Button clickbutton = new Button(); |
| | | Button clicktextcolcrbutton = new Button(); |
| | | |
| | | public void Show() |
| | | public void Show() |
| | | { |
| | | |
| | | |
| | | UserView.HomePage.Instance.ScrollEnabled = false; |
| | | this.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor; |
| | | #region 最上面的布局代码 |
| | |
| | | Width = Application.GetRealWidth(600), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor, |
| | | TextSize=14, |
| | | }; |
| | | timeoutrowlayout.AddChidren(btntimeout); |
| | | |
| | |
| | | { |
| | | ///从列表移除当前门锁全部的旧数据; |
| | | Send.LockList.Remove(Send.LockList[i]); |
| | | i--; |
| | | } |
| | | } |
| | | Read(); |
| | |
| | | /// </summary> |
| | | public void UserAllView(string macport) |
| | | { |
| | | |
| | | middle.RemoveAll(); |
| | | for (int i = 0; i < Send.LockList.Count; i++) |
| | | { |
| | | var user = Send.LockList[i]; |
| | |
| | | case 21: |
| | | case 22: |
| | | { |
| | | conditionIcon.UnSelectedImagePath = "ZigeeLogic/doormagnetism.png"; |
| | | if (intvalue == "1") |
| | | { |
| | | devicestatus.TextID = MyInternationalizationString.logicopen; |
| | |
| | | break; |
| | | case 40: |
| | | { |
| | | conditionIcon.UnSelectedImagePath = "ZigeeLogic/smoke.png"; |
| | | if (intvalue == "1") |
| | | { |
| | | devicestatus.TextID = MyInternationalizationString.smokescreen; |
| | |
| | | break; |
| | | case 42: |
| | | { |
| | | conditionIcon.UnSelectedImagePath = "ZigeeLogic/waterleakage.png"; |
| | | if (intvalue == "1") |
| | | { |
| | | devicestatus.TextID = MyInternationalizationString.waterleakage; |
| | |
| | | break; |
| | | case 43: |
| | | { |
| | | conditionIcon.UnSelectedImagePath = "ZigeeLogic/gas.png"; |
| | | if (intvalue == "1") |
| | | { |
| | | devicestatus.TextID = MyInternationalizationString.gas; |
| | |
| | | break; |
| | | case 277: |
| | | { |
| | | conditionIcon.UnSelectedImagePath = "ZigeeLogic/waterleakage.png"; |
| | | if (intvalue == "1") |
| | | { |
| | | devicestatus.TextID = MyInternationalizationString.callthepolice; |
| | |
| | | break; |
| | | default: |
| | | { |
| | | conditionIcon.UnSelectedImagePath = "ZigeeLogic/infraredsensor.png"; |
| | | if (intvalue == "1") |
| | | { |
| | | devicestatus.TextID = MyInternationalizationString.callthepolice; |
| | |
| | | VerticalRefreshLayout middle; |
| | | CommonDevice common; |
| | | Dictionary<string, string> editdeviceConditionsInfo; |
| | | |
| | | public void Show(CommonDevice commondevice, Dictionary<string, string> editdeviceConditions = null) |
| | | { |
| | | common = commondevice; |
| | |
| | | { |
| | | ///从列表移除当前门锁全部的旧数据; |
| | | Send.LockList.Remove(Send.LockList[i]); |
| | | i--; |
| | | } |
| | | } |
| | | Read(); |
| | |
| | | /// <param name="macport"></param> |
| | | public void UserList(string macport) |
| | | { |
| | | |
| | | middle.RemoveAll(); |
| | | foreach (var user in Send.LockList) |
| | | { |
| | | if (user.DoorLockMacPort != macport) |
| | |
| | | } |
| | | }; |
| | | } |
| | | |
| | | |
| | | var temperatureRow = new DeviceInfoRow(446); |
| | | temperatureRow.Init(); |
| | | temperatureRow.SetTipTitle(R.MyInternationalizationString.Temperature); |
| | |
| | | |
| | | |
| | | tempFunctionTypeBtn = new FunctionButton(); |
| | | tempFunctionTypeBtn.Init("", ""); |
| | | |
| | | foreach (var deviceType in Common.Room.AllRoomDeviceTypeList) |
| | | { |
| | |
| | | //请求参数错误
|
| | | dic["ParameterOrEmpty"] = R.MyInternationalizationString.uParameterError;
|
| | | //验证码发送失败
|
| | | dic["SendFail "] = R.MyInternationalizationString.RegisterSendVerCode_SendFail;
|
| | | dic["SendFail"] = R.MyInternationalizationString.RegisterSendVerCode_SendFail;
|
| | | //操作失败,请重试
|
| | | dic["Fail"] = R.MyInternationalizationString.uOperationFailed;
|
| | | //账号不存在
|
| | |
| | | else { this.SetClickStatu(); }
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 是否是长按状态
|
| | | /// 圆角度
|
| | | /// </summary>
|
| | | private bool isLongClick = false;
|
| | | public int RadiusEx
|
| | | {
|
| | | set { this.Radius = (uint)Application.GetRealHeight(value); }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 控件的点击事件(自定义封装事件,此事件被认可为执行按钮按下事件,受CanClick属性控制)
|
| | | /// </summary>
|
| | | public Action<Button, MouseEventArgs> ButtonClickEvent = null;
|
| | | /// <summary>
|
| | | /// (★当前不要使用★)控件的长按事件,当事件为null时,代表长按结束(自定义封装事件,此事件被认可为执行按钮长按事件,受CanClick属性控制)
|
| | | /// </summary>
|
| | | public Action<Button, MouseEventArgs> ButtonLongClickEvent = null;
|
| | | /// <summary>
|
| | | /// 控件的按下事件(自定义封装事件,此事件被认可为执行按钮按下事件,受CanClick属性控制)
|
| | | /// </summary>
|
| | |
| | | this.MouseUpEventHandler += ButtonBase_MouseUpEventHandler;
|
| | | //按下事件
|
| | | this.MouseDownEventHandler += ButtonBase_MouseDownEventHandler;
|
| | | //长按事件
|
| | | this.MouseLongEventHandler += ButtonBase_MouseLongEventHandler;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | |
|
| | | try
|
| | | {
|
| | | if (this.isLongClick == false)
|
| | | {
|
| | | this.ButtonClickEvent(this, e);
|
| | | }
|
| | | else if (ButtonLongClickEvent != null)
|
| | | {
|
| | | //长按结束
|
| | | this.ButtonLongClickEvent(this, null);
|
| | | }
|
| | | this.ButtonClickEvent(this, e);
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | |
| | | HdlLogLogic.Current.WriteLog(ex);
|
| | | }
|
| | | }
|
| | | //状态还原
|
| | | this.isLongClick = false;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | /// <param name="e"></param>
|
| | | private void ButtonBase_MouseDownEventHandler(object sender, MouseEventArgs e)
|
| | | {
|
| | | //还原状态
|
| | | this.isLongClick = false;
|
| | |
|
| | | if (CanClick == false || this.ButtonDownClickEvent == null)
|
| | | {
|
| | | //不能点击
|
| | |
| | | alert.Show();
|
| | | //Log出力
|
| | | HdlLogLogic.Current.WriteLog(ex);
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 长按事件___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 长按事件
|
| | | /// </summary>
|
| | | /// <param name="sender"></param>
|
| | | /// <param name="e"></param>
|
| | | private void ButtonBase_MouseLongEventHandler(object sender, MouseEventArgs e)
|
| | | {
|
| | | //长按状态
|
| | | this.isLongClick = true;
|
| | |
|
| | | if (ButtonLongClickEvent == null)
|
| | | {
|
| | | this.MouseLongEventHandler -= ButtonBase_MouseLongEventHandler;
|
| | | return;
|
| | | }
|
| | | if (CanClick == true)
|
| | | {
|
| | | //Log出力
|
| | | this.WriteLog(1);
|
| | |
|
| | | try
|
| | | {
|
| | | this.ButtonLongClickEvent(this, e);
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | //出现未知错误
|
| | | var alert = new ShowMsgControl(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnKnownError));
|
| | | alert.Show();
|
| | | //Log出力
|
| | | HdlLogLogic.Current.WriteLog(ex);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | ButtonClickEvent = null;
|
| | | ButtonDownClickEvent = null;
|
| | | ButtonLongClickEvent = null;
|
| | |
|
| | | base.RemoveFromParent();
|
| | | }
|
| | |
| | | this.Gravity = Gravity.CenterHorizontal;
|
| | | this.Radius = (uint)Application.GetRealHeight(128) / 2; |
| | | this.TextSize = 16; |
| | | this.IsBold = true; |
| | | }
|
| | | }
|
| | | }
|
| | |
| | | /// <param name="i_width">宽度,真实值</param>
|
| | | /// <param name="i_height">高度,真实值</param>
|
| | | /// <param name="i_radius">圆角度(只对安卓有效)</param>
|
| | | public BottomLeftClickButton(int i_width, int i_height, uint i_radius = 8)
|
| | | public BottomLeftClickButton(int i_width, int i_height, int i_radius = 17)
|
| | | {
|
| | | this.Height = i_height;
|
| | | this.Width = i_width;
|
| | | this.Gravity = Gravity.BottomLeft;
|
| | |
|
| | | #if Android
|
| | | this.Radius = i_radius;
|
| | | this.RadiusEx = i_radius;
|
| | | #endif
|
| | | }
|
| | |
|
| | |
| | | /// <param name="i_width">宽度,真实值</param>
|
| | | /// <param name="i_height">高度,真实值</param>
|
| | | /// <param name="i_radius">圆角度(只对安卓有效)</param>
|
| | | public BottomRightClickButton(int i_width, int i_height, uint i_radius = 8)
|
| | | public BottomRightClickButton(int i_width, int i_height, int i_radius = 17)
|
| | | {
|
| | | this.Height = i_height;
|
| | | this.Width = i_width;
|
| | | this.Gravity = Gravity.BottomRight;
|
| | |
|
| | | #if Android
|
| | | this.Radius = i_radius;
|
| | | this.RadiusEx = i_radius;
|
| | | #endif
|
| | | }
|
| | |
|
| | |
| | | this.AddChidren(btnBomTemp, ChidrenBindMode.BindEventOnly);
|
| | | //确认按钮
|
| | | this.btnConfirm = new NormalViewControl(this.Width - Application.GetRealWidth(10), Application.GetRealHeight(60), false);
|
| | | btnConfirm.IsBold = true;
|
| | | btnConfirm.Gravity = Gravity.Center;
|
| | | btnConfirm.TextColor = UserCenterColor.Current.White;
|
| | | btnConfirm.Text = i_text;
|
| | |
| | | #if iOS
|
| | | //确认按钮
|
| | | this.btnConfirm = new NormalClickButton(this.Width, this.Height, false);
|
| | | btnConfirm.IsBold = true;
|
| | | btnConfirm.Gravity = Gravity.BottomRight;
|
| | | btnConfirm.TextColor = UserCenterColor.Current.White;
|
| | | btnConfirm.Text = i_text;
|
| | |
| | | frameBack.BackgroundColor = UserCenterColor.Current.White;
|
| | | frameBack.Gravity = Gravity.CenterHorizontal;
|
| | | frameBack.Y = Application.GetRealHeight(683);
|
| | | frameBack.Radius = 6;
|
| | | frameBack.Radius = (uint)Application.GetRealHeight(17);
|
| | | bodyFrameLayout.AddChidren(frameBack);
|
| | |
|
| | | //进度显示文本
|
| | |
| | | this.btnProgressBar = new FrameLayout();
|
| | | btnProgressBar.Width = 0;
|
| | | btnProgressBar.Height = btnProRow.Height;
|
| | | btnProgressBar.Radius = btnProRow.Radius;
|
| | | btnProgressBar.BackgroundColor = 0xfffb744a;
|
| | | btnProgressBar.Radius = (uint)Application.GetRealHeight(29) / 2;
|
| | | btnProRow.AddChidren(btnProgressBar);
|
| | |
| | | var btnProgressPic = new PicViewControl(84, 60);
|
| | | btnProgressPic.UnSelectedImagePath = "Item/ProgressMsg.png";
|
| | | frameProgress.AddChidren(btnProgressPic);
|
| | | this.btnProgressView = new NormalViewControl(84, 32, true);
|
| | | this.btnProgressView = new NormalViewControl(84, 45, true);
|
| | | btnProgressView.TextSize = 10;
|
| | | btnProgressView.TextAlignment = TextAlignment.Center;
|
| | | btnProgressView.Text = "0%";
|
| | |
| | | btnTitle.TextAlignment = TextAlignment.Center;
|
| | | btnTitle.TextSize = 18;
|
| | | btnTitle.Text = i_title;
|
| | | btnTitle.IsBold = true;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | this.Height = Application.GetMinRealAverage(NumberSize * 4 + NumberTopButtomSpace * 3) + Application.GetRealHeight(368);
|
| | | this.btnTitle = new NormalViewControl(Application.CurrentWidth, Application.GetRealWidth(75), false);
|
| | | btnTitle.Text = i_title;
|
| | | btnTitle.IsBold = true;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | {
|
| | | this.frameTable = new FrameLayout();
|
| | | frameTable.Gravity = Gravity.CenterHorizontal;
|
| | | frameTable.Radius = 8;
|
| | | frameTable.Radius = (uint)Application.GetRealHeight(17);
|
| | | frameTable.Height= Application.GetRealHeight(260);
|
| | | frameTable.Width = Application.GetRealWidth(968);
|
| | | frameTable.BackgroundColor = UserCenterColor.Current.White;
|
| | |
| | | this.frameTable = new FrameLayout();
|
| | | frameTable.Height = this.Height;
|
| | | frameTable.Width = this.Width;
|
| | | frameTable.Radius = 20;
|
| | | frameTable.Radius = (uint)Application.GetRealHeight(58);
|
| | | frameTable.BackgroundColor = UserCenterColor.Current.White;
|
| | | this.AddChidren(frameTable);
|
| | |
|
| | | //右上圆角背景
|
| | | var btnTopRight = new NormalViewControl(150, 60, true);
|
| | | btnTopRight.BackgroundColor = UserCenterColor.Current.White;
|
| | | btnTopRight.Radius = 6;
|
| | | btnTopRight.RadiusEx = 17;
|
| | | this.AddChidren(btnTopRight);
|
| | | btnTopRight.X = this.Width - btnTopRight.Width;
|
| | |
|
| | | //左下圆角背景
|
| | | var btnBottomRight = new NormalViewControl(150, 60, true);
|
| | | btnBottomRight.BackgroundColor = UserCenterColor.Current.White;
|
| | | btnBottomRight.Radius = 6;
|
| | | btnBottomRight.RadiusEx = 17;
|
| | | this.AddChidren(btnBottomRight);
|
| | | btnBottomRight.Y = this.Height - btnBottomRight.Height;
|
| | |
|
| | |
| | | this.Width = Application.GetRealWidth(968);
|
| | | this.Gravity = Gravity.CenterHorizontal;
|
| | | this.BackgroundColor = UserCenterColor.Current.White;
|
| | | this.Radius = 8;
|
| | | this.Radius = (uint)Application.GetRealHeight(17);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | var btnScene = new NormalViewControl(frameScene.Width, Application.GetRealHeight(63), false);
|
| | | btnScene.Text = btnTemp.Text;
|
| | | btnScene.TextSize = 16;
|
| | | btnScene.IsBold = true;
|
| | | btnScene.TextColor = UserCenterColor.Current.TextColor2;
|
| | | frameScene.AddChidren(btnScene, ChidrenBindMode.BindEventOnly);
|
| | | //底线
|
| | |
| | | this.m_nowSelectIndex = 1;
|
| | |
|
| | | btnScene.TextSize = 16;
|
| | | btnScene.IsBold = true;
|
| | | btnScene.TextColor = UserCenterColor.Current.TextColor2;
|
| | | btnFunc.TextSize = 14;
|
| | | btnFunc.IsBold = false;
|
| | | btnFunc.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | btnSceneLine.Visible = true;
|
| | | btnFuncLine.Visible = false;
|
| | |
| | | this.m_nowSelectIndex = 2;
|
| | |
|
| | | btnScene.TextSize = 14;
|
| | | btnScene.IsBold = false;
|
| | | btnScene.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | btnFunc.TextSize = 16;
|
| | | btnFunc.IsBold = true;
|
| | | btnFunc.TextColor = UserCenterColor.Current.TextColor2;
|
| | | btnFuncLine.Visible = true;
|
| | | btnSceneLine.Visible = false;
|
| | |
| | | this.Width = Application.GetRealWidth(width); |
| | | this.Height = Application.GetRealHeight(height);
|
| | | this.Gravity = Gravity.CenterHorizontal;
|
| | | this.Radius = 6; |
| | | this.Radius = (uint)Application.GetRealHeight(17); |
| | | this.BackgroundColor = 0xfff8f7f7; |
| | | } |
| | | |
| | |
| | | frameTable.Height = Application.GetRealHeight(RowHeight * rowCount);
|
| | | frameTable.BackgroundColor = UserCenterColor.Current.White;
|
| | | frameTable.BorderColor = UserCenterColor.Current.Transparent;
|
| | | frameTable.Radius = 6;
|
| | | frameTable.Radius = (uint)Application.GetRealHeight(17);
|
| | | this.AddChidren(frameTable);
|
| | |
|
| | | if (titleText != null)
|
| | |
| | | //拥有标题
|
| | | listView.Y = Application.GetRealHeight(RowHeight);
|
| | | }
|
| | | listView.Radius = frameTable.Radius;
|
| | | listView.Radius = (uint)Application.GetRealHeight(17);
|
| | | frameTable.AddChidren(listView);
|
| | |
|
| | | //三角形图标
|
| | |
| | | frameCode.X = i * Application.GetRealWidth(115 + 49);
|
| | | frameCode.Width = Application.GetRealWidth(115);
|
| | | frameCode.Height = Application.GetRealHeight(104);
|
| | | frameCode.Radius = 6;
|
| | | frameCode.Radius = (uint)Application.GetRealHeight(17);
|
| | | frameCode.BorderWidth = 1;
|
| | | frameCode.BorderColor = UserCenterColor.Current.TextFrameColor;
|
| | | this.AddChidren(frameCode);
|
| | |
| | | btnDeviceRoom.Y = Application.GetRealHeight(72) + this.chidrenYaxis;
|
| | | btnDeviceRoom.TextSize = 12;
|
| | | btnDeviceRoom.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | | btnDeviceRoom.Text = Common.LocalDevice.Current.GetDeviceMacName(listDevice[0]);
|
| | | frameTable.AddChidren(btnDeviceRoom, ChidrenBindMode.BindEventOnly);
|
| | |
|
| | | //底线
|
| | |
| | | /// 子控件Y轴偏移量(共通定义而已)
|
| | | /// </summary>
|
| | | public int chidrenYaxis = 0;
|
| | | /// <summary>
|
| | | /// 圆角度
|
| | | /// </summary>
|
| | | public int RadiusEx
|
| | | {
|
| | | set { this.Radius = (uint)Application.GetRealHeight(value); }
|
| | | }
|
| | |
|
| | | #endregion |
| | |
|
| | |
| | | frameBack.BackgroundColor = UserCenterColor.Current.White;
|
| | | frameBack.Y = Application.GetRealHeight(706);
|
| | | frameBack.Gravity = Gravity.CenterHorizontal;
|
| | | frameBack.Radius = 8;
|
| | | frameBack.Radius = (uint)Application.GetRealHeight(17);
|
| | | frameMain.AddChidren(frameBack);
|
| | | //标题
|
| | | var btnTitle = new NormalViewControl(frameBack.Width, Application.GetRealHeight(65), false);
|
| | |
| | | frameConfirm.Height = Application.GetRealHeight(127);
|
| | | frameConfirm.Width = frameBack.Width;
|
| | | frameConfirm.Gravity = Gravity.BottomCenter;
|
| | | frameConfirm.Radius = 8;
|
| | | frameConfirm.RadiusEx = 17;
|
| | | frameConfirm.BackgroundColor = UserCenterColor.Current.ClickButtonDefultColor;
|
| | | frameBack.AddChidren(frameConfirm);
|
| | | //把上圆角覆盖为方角
|
| | |
| | | frameBack.BackgroundColor = UserCenterColor.Current.White;
|
| | | frameBack.Y = Application.GetRealHeight(691);
|
| | | frameBack.Gravity = Gravity.CenterHorizontal;
|
| | | frameBack.Radius = 8;
|
| | | frameBack.Radius = (uint)Application.GetRealHeight(17);
|
| | | this.AddChidren(frameBack);
|
| | | //标题信息
|
| | | this.btnTitle = new NormalViewControl(frameBack.Width, Application.GetRealHeight(65), false);
|
| | |
| | | frameText.Gravity = Gravity.CenterHorizontal;
|
| | | frameText.BorderColor = 0xff676767;
|
| | | frameText.BorderWidth = 1;
|
| | | frameText.Radius = 8;
|
| | | frameText.Radius = (uint)Application.GetRealHeight(17);
|
| | | frameBack.AddChidren(frameText);
|
| | | //输入框
|
| | | this.txtInput = new TextInputControl(frameText.Width - Application.GetRealWidth(20), frameText.Height, false);
|
| | |
| | | var frameBack = new FrameLayout(); |
| | | frameBack.Width = Application.GetRealWidth(850); |
| | | frameBack.Height = Application.GetRealHeight(1342); |
| | | frameBack.Radius = 6; |
| | | frameBack.Radius = (uint)Application.GetRealHeight(17); |
| | | frameBack.BackgroundColor = UserCenterColor.Current.White; |
| | | frameBack.Gravity = Gravity.CenterHorizontal; |
| | | frameBack.Y = Application.GetRealHeight(328); |
| | |
| | | this.listView = new VerticalListControl(3); |
| | | listView.Y = Application.GetRealHeight(164 - 11); |
| | | listView.Height = frameBack.Height - Application.GetRealHeight(164 - 11); |
| | | listView.Radius = frameBack.Radius;
|
| | | listView.Radius = (uint)Application.GetRealHeight(17);
|
| | | frameBack.AddChidren(listView);
|
| | |
|
| | | //请选择区号
|
| | |
| | | //桌布控件
|
| | | this.Width = Application.GetRealWidth(458);
|
| | | this.Height = Application.GetRealHeight(104);
|
| | | this.Radius = 6;
|
| | | this.Radius = (uint)Application.GetRealHeight(17);
|
| | | this.BorderColor = 0xffbfc1c2;
|
| | | this.BorderWidth = (uint)Application.GetMinRealAverage(3);
|
| | | }
|
| | |
| | | //标题 |
| | | var txttitle = new TopLayoutTitleControl(); |
| | | topFrameLayout.AddChidren(txttitle); |
| | | //粗体 |
| | | txttitle.IsBold = true; |
| | | topFrameLayout.AddTag("txtTitle", txttitle); |
| | | } |
| | |
|
| | |
| | | //菜单的桌布控件
|
| | | this.frameMenuTable = new FrameLayout();
|
| | | frameMenuTable.Gravity = Gravity.CenterHorizontal;
|
| | | frameMenuTable.Radius = 12;
|
| | | frameMenuTable.Radius = (uint)Application.GetRealHeight(35);
|
| | | frameMenuTable.Width = Application.GetRealWidth(1034);
|
| | | frameMenuTable.Height = this.menuHeight * menuCount;
|
| | | frameMenuTable.BackgroundColor = UserCenterColor.Current.White;
|
| | |
| | | var frameCancel = new FrameLayout();
|
| | | frameCancel.Y = frameAnimateTable.Height - this.menuHeight - Application.GetRealHeight(23);
|
| | | frameCancel.Gravity = Gravity.CenterHorizontal;
|
| | | frameCancel.Radius = 12;
|
| | | frameCancel.Radius = (uint)Application.GetRealHeight(35);
|
| | | frameCancel.Width = Application.GetRealWidth(1034);
|
| | | frameCancel.Height = this.menuHeight;
|
| | | frameCancel.BackgroundColor = UserCenterColor.Current.White;
|
| | |
| | | frameBack.Width = Application.GetRealWidth(965);
|
| | | frameBack.Height = Application.GetRealHeight(1584);
|
| | | frameBack.BackgroundColor = UserCenterColor.Current.White;
|
| | | frameBack.Radius = 6;
|
| | | frameBack.Radius = (uint)Application.GetRealHeight(17);
|
| | | bodyFrameLayout.AddChidren(frameBack);
|
| | |
|
| | | //密码输入控件
|
| | |
| | | frameBack.Width = Application.GetRealWidth(965);
|
| | | frameBack.Height = Application.GetRealHeight(1486);
|
| | | frameBack.BackgroundColor = UserCenterColor.Current.White;
|
| | | frameBack.Radius = 8;
|
| | | frameBack.Radius = (uint)Application.GetRealHeight(17);
|
| | | bodyFrameLayout.AddChidren(frameBack);
|
| | |
|
| | | //手势验证控件
|
| | |
| | | frameBack.Width = Application.GetRealWidth(965);
|
| | | frameBack.Height = Application.GetRealHeight(1711);
|
| | | frameBack.BackgroundColor = UserCenterColor.Current.White;
|
| | | frameBack.Radius = 8;
|
| | | frameBack.Radius = (uint)Application.GetRealHeight(17);
|
| | | bodyFrameLayout.AddChidren(frameBack);
|
| | |
|
| | | //密码输入控件
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | if (listFile.Contains(DirNameResourse.ShowOptionMenuFile) == true)
|
| | | //检测
|
| | | string checkKeys = UserCenterLogic.EncryptPassword(UserCenterResourse.FileEncryptKey, DirNameResourse.ShowOptionMenuFile + UserCenterResourse.UserInfo.Account);
|
| | | if (listFile.Contains(checkKeys) == true)
|
| | | {
|
| | | //显示主页隐藏菜单(Debug用)
|
| | | UserCenterResourse.HideOption.CenterHideMenu = 1;
|
| | | }
|
| | | if (listFile.Contains(DirNameResourse.DetailedLogFile) == true)
|
| | | checkKeys = UserCenterLogic.EncryptPassword(UserCenterResourse.FileEncryptKey, DirNameResourse.DetailedLogFile + UserCenterResourse.UserInfo.Account);
|
| | | if (listFile.Contains(checkKeys) == true)
|
| | | {
|
| | | //出力详细Log(Debug用)
|
| | | UserCenterResourse.HideOption.DetailedLog = 1;
|
| | |
| | | foreach (var data in result.delDeviceBindResponseData.RemoveBindList)
|
| | | {
|
| | | //0:成功 1:设备不在绑定列表中 ,也可以代表成功
|
| | | if (data.Result == 0 || data.Result == 1)
|
| | | if (data.Result == 0 || data.Result == 1 || data.Result == 5)
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
| | | this.ShowErrorMsg(msg);
|
| | | return false;
|
| | | }
|
| | | //4:未知,由节点设备反馈发送“Bind/BindResult”主题消息确定是否成功
|
| | | else if (data.Result == 4)
|
| | | //2:未知,由节点设备反馈发送“Bind/BindResult”主题消息确定是否成功
|
| | | else if (data.Result == 2)
|
| | | {
|
| | | if (result.removeBindResultResponseData == null)
|
| | | {
|
| | |
| | | msg += Language.StringByID(R.MyInternationalizationString.uOtherBindTargetsIsDelettingPleaseWait);
|
| | | this.ShowErrorMsg(msg);
|
| | | }
|
| | | //4:未知,由节点设备反馈发送“Bind/BindResult”主题消息确定是否成功
|
| | | else if (data.Result == 4)
|
| | | //2:未知,由节点设备反馈发送“Bind/BindResult”主题消息确定是否成功
|
| | | else if (data.Result == 2)
|
| | | {
|
| | | if (result.removeBindResultResponseData == null)
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | //保存协调器的nv分区组网信息
|
| | | bool result = this.SaveNVFile(realGateway);
|
| | | if (result == false)
|
| | | {
|
| | | //如果上传失败的话,就把它删除
|
| | | await HdlBackupLogic.Current.DeleteDbBackupData(backupClassId);
|
| | | //关闭进度条
|
| | | ProgressFormBar.Current.Close();
|
| | | return;
|
| | | }
|
| | | //bool result = this.SaveNVFile(realGateway);
|
| | | //if (result == false)
|
| | | //{
|
| | | // //如果上传失败的话,就把它删除
|
| | | // await HdlBackupLogic.Current.DeleteDbBackupData(backupClassId);
|
| | | // //关闭进度条
|
| | | // ProgressFormBar.Current.Close();
|
| | | // return;
|
| | | //}
|
| | |
|
| | | //打开协调器串口发送功能
|
| | | result = this.OpenZbMsComSend(realGateway);
|
| | | if (result == false)
|
| | | {
|
| | | //如果上传失败的话,就把它删除
|
| | | await HdlBackupLogic.Current.DeleteDbBackupData(backupClassId);
|
| | | //关闭进度条
|
| | | ProgressFormBar.Current.Close();
|
| | | return;
|
| | | }
|
| | | //result = this.OpenZbMsComSend(realGateway);
|
| | | //if (result == false)
|
| | | //{
|
| | | // //如果上传失败的话,就把它删除
|
| | | // await HdlBackupLogic.Current.DeleteDbBackupData(backupClassId);
|
| | | // //关闭进度条
|
| | | // ProgressFormBar.Current.Close();
|
| | | // return;
|
| | | //}
|
| | |
|
| | | //开始上传数据
|
| | | result = this.StartUpLoadData(realGateway, backupClassId);
|
| | | bool result = this.StartUpLoadData(realGateway, backupClassId);
|
| | | if (result == false)
|
| | | {
|
| | | //如果上传失败的话,就把它删除
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | //恢复协调器nv分区的组网信息
|
| | | result = this.RestoreGatewayNV(realGateway);
|
| | | if (result == false)
|
| | | {
|
| | | //关闭进度条
|
| | | ProgressFormBar.Current.Close();
|
| | | return false;
|
| | | }
|
| | | ////恢复协调器nv分区的组网信息
|
| | | //result = this.RestoreGatewayNV(realGateway);
|
| | | //if (result == false)
|
| | | //{
|
| | | // //关闭进度条
|
| | | // ProgressFormBar.Current.Close();
|
| | | // return false;
|
| | | //}
|
| | |
|
| | | //打开协调器串口发送功能
|
| | | result = this.OpenZbMsComSend(realGateway);
|
| | | if (result == false)
|
| | | {
|
| | | //关闭进度条
|
| | | ProgressFormBar.Current.Close();
|
| | | return false;
|
| | | }
|
| | | //result = this.OpenZbMsComSend(realGateway);
|
| | | //if (result == false)
|
| | | //{
|
| | | // //关闭进度条
|
| | | // ProgressFormBar.Current.Close();
|
| | | // return false;
|
| | | //}
|
| | |
|
| | | //重启网关系统
|
| | | result = this.GatewayReboot(realGateway);
|
| | |
| | | bool result = await this.SetHomeIdToGateway(realWay, string.Empty);
|
| | | if (result == false)
|
| | | {
|
| | | //网关解绑失败
|
| | | //网关解绑失败 不理它,因为网关可以按按键强制搜索得到
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uGatewayUnBindFail);
|
| | | this.ShowErrorMsg(msg);
|
| | | return false;
|
| | | //this.ShowErrorMsg(msg);
|
| | | //return false;
|
| | | }
|
| | | }
|
| | |
|
| | | //删除云端的网关
|
| | | await Phone.UserCenter.HdlGatewayLogic.Current.DeleteDataBaseGateway(zbGatewayID);
|
| | | await this.DeleteDataBaseGateway(zbGatewayID);
|
| | |
|
| | | //删除网关文件 |
| | | this.DeleteGatewayFile(zbGatewayID); |
| | |
| | | //获取控制主人账号的Token
|
| | | Pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
|
| | |
|
| | | List<string> listNotShowError = new List<string>() { "NoExist", "NoBind", "NoRecord" };
|
| | | List<string> listNotShowError = new List<string>() { "NoExist", "NoBind", "NoRecord", "NotSetAgain" };
|
| | |
|
| | | bool result = await UserCenterLogic.GetResultStatuByRequestHttps("App/ReleaseGatewayToHome", true, Pra, listNotShowError);
|
| | | if (result == false)
|
| | |
| | | {
|
| | | fileName += "Log";
|
| | | }
|
| | | fileName = UserCenterLogic.EncryptPassword("4^Olh_3f", fileName);
|
| | | fileName = UserCenterLogic.EncryptPassword(UserCenterResourse.FileEncryptKey, fileName);
|
| | | return fileName;
|
| | | }
|
| | | #endregion
|
old mode 100755
new mode 100644
| | |
| | | public string SSID
|
| | | {
|
| | | get
|
| | | {
|
| | | { |
| | | #if iOS
|
| | | return string.Empty;
|
| | | string ssiD = Shared.WiimuUPnP.SSID; |
| | | if (string.IsNullOrEmpty(ssiD) == false && ssiD.StartsWith("\"") && ssiD.EndsWith("\"")) |
| | | { |
| | | ssiD = ssiD.Substring(1, ssiD.Length - 2); |
| | | }
|
| | | return ssiD;
|
| | | #endif
|
| | | #if Android
|
| | | string ssiD = null;
|
| | |
| | | {
|
| | | if (hdlWiFi == null)
|
| | | {
|
| | | Com.Mediatek.Elian.ElianNative.LoadLib();
|
| | | var result2 = Com.Mediatek.Elian.ElianNative.LoadLib();
|
| | | //初始化Wi-Fi配网
|
| | | this.hdlWiFi = new Com.Mediatek.Elian.ElianNative();
|
| | | var value = hdlWiFi.InitSmartConnection(null, 1, 0);
|
| | | var value = hdlWiFi.InitSmartConnection(null, 1, 1);
|
| | | }
|
| | | //开始Wi-Fi配网
|
| | | var result = hdlWiFi.StartSmartConnection(wifiName, wifiPsw, p2);
|
| | |
| | | {
|
| | | //停止Wi-Fi配网
|
| | | var result = hdlWiFi.StopSmartConnection();
|
| | | hdlWiFi = null;
|
| | | }
|
| | | }
|
| | | #endif
|
| | |
| | | /// <param name="wifiPsw">wifi密码</param>
|
| | | /// <param name="p2">我也不知道这个是什么东西</param>
|
| | | /// <returns></returns>
|
| | | public bool StartSmartConnection(string wifiName, string wifiPsw, string p2 = "1")
|
| | | public bool StartSmartConnection(string wifiName, string wifiPsw, string p2 = "")
|
| | | {
|
| | | //初始化Wi-Fi连接
|
| | | Com.Mediatek.Elian.ElianNative.InitSmartConnection(null, 1, 1);
|
| | | Com.Mediatek.Elian.ElianNative.InitSmartConnection("1", 1, 1);
|
| | | //开始Wi-Fi连接
|
| | | var result = Com.Mediatek.Elian.ElianNative.StartSmartConnection(wifiName, wifiPsw, p2);
|
| | | return true;
|
| | |
| | | /// <returns></returns>
|
| | | public static string EncryptPassword(string keys, string strPsw)
|
| | | {
|
| | | if (strPsw == string.Empty)
|
| | | try
|
| | | {
|
| | | return strPsw;
|
| | | if (strPsw == string.Empty)
|
| | | {
|
| | | return strPsw;
|
| | | }
|
| | | var des = new System.Security.Cryptography.DESCryptoServiceProvider();
|
| | | byte[] inputByteArray = Encoding.Default.GetBytes(strPsw);
|
| | | des.Key = ASCIIEncoding.ASCII.GetBytes(keys);
|
| | | des.IV = ASCIIEncoding.ASCII.GetBytes(keys);
|
| | | var ms = new System.IO.MemoryStream();
|
| | | var cs = new System.Security.Cryptography.CryptoStream(ms, des.CreateEncryptor(), System.Security.Cryptography.CryptoStreamMode.Write);
|
| | | cs.Write(inputByteArray, 0, inputByteArray.Length);
|
| | | cs.FlushFinalBlock();
|
| | | StringBuilder ret = new StringBuilder();
|
| | | foreach (byte b in ms.ToArray())
|
| | | {
|
| | | ret.AppendFormat("{0:X2}", b);
|
| | | }
|
| | | return ret.ToString().ToLower();
|
| | | }
|
| | | var des = new System.Security.Cryptography.DESCryptoServiceProvider();
|
| | | byte[] inputByteArray = Encoding.Default.GetBytes(strPsw);
|
| | | des.Key = ASCIIEncoding.ASCII.GetBytes(keys);
|
| | | des.IV = ASCIIEncoding.ASCII.GetBytes(keys);
|
| | | var ms = new System.IO.MemoryStream();
|
| | | var cs = new System.Security.Cryptography.CryptoStream(ms, des.CreateEncryptor(), System.Security.Cryptography.CryptoStreamMode.Write);
|
| | | cs.Write(inputByteArray, 0, inputByteArray.Length);
|
| | | cs.FlushFinalBlock();
|
| | | StringBuilder ret = new StringBuilder();
|
| | | foreach (byte b in ms.ToArray())
|
| | | {
|
| | | ret.AppendFormat("{0:X2}", b);
|
| | | }
|
| | | return ret.ToString();
|
| | | catch { return strPsw; }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | /// <returns></returns>
|
| | | public static string DecryptPassword(string keys, string strPsw)
|
| | | {
|
| | | if (strPsw == string.Empty)
|
| | | try
|
| | | {
|
| | | return strPsw;
|
| | | if (strPsw == string.Empty)
|
| | | {
|
| | | return strPsw;
|
| | | }
|
| | | var des = new System.Security.Cryptography.DESCryptoServiceProvider();
|
| | |
|
| | | byte[] inputByteArray = new byte[strPsw.Length / 2];
|
| | | for (int x = 0; x < strPsw.Length / 2; x++)
|
| | | {
|
| | | int i = (Convert.ToInt32(strPsw.Substring(x * 2, 2), 16));
|
| | | inputByteArray[x] = (byte)i;
|
| | | }
|
| | |
|
| | | des.Key = ASCIIEncoding.ASCII.GetBytes(keys);
|
| | | des.IV = ASCIIEncoding.ASCII.GetBytes(keys);
|
| | | var ms = new System.IO.MemoryStream();
|
| | | var cs = new System.Security.Cryptography.CryptoStream(ms, des.CreateDecryptor(), System.Security.Cryptography.CryptoStreamMode.Write);
|
| | | cs.Write(inputByteArray, 0, inputByteArray.Length);
|
| | | cs.FlushFinalBlock();
|
| | |
|
| | | StringBuilder ret = new StringBuilder();
|
| | |
|
| | | return System.Text.Encoding.Default.GetString(ms.ToArray());
|
| | | }
|
| | | var des = new System.Security.Cryptography.DESCryptoServiceProvider();
|
| | |
|
| | | byte[] inputByteArray = new byte[strPsw.Length / 2];
|
| | | for (int x = 0; x < strPsw.Length / 2; x++)
|
| | | {
|
| | | int i = (Convert.ToInt32(strPsw.Substring(x * 2, 2), 16));
|
| | | inputByteArray[x] = (byte)i;
|
| | | }
|
| | |
|
| | | des.Key = ASCIIEncoding.ASCII.GetBytes(keys);
|
| | | des.IV = ASCIIEncoding.ASCII.GetBytes(keys);
|
| | | var ms = new System.IO.MemoryStream();
|
| | | var cs = new System.Security.Cryptography.CryptoStream(ms, des.CreateDecryptor(), System.Security.Cryptography.CryptoStreamMode.Write);
|
| | | cs.Write(inputByteArray, 0, inputByteArray.Length);
|
| | | cs.FlushFinalBlock();
|
| | |
|
| | | StringBuilder ret = new StringBuilder();
|
| | |
|
| | | return System.Text.Encoding.Default.GetString(ms.ToArray());
|
| | | catch { return strPsw; }
|
| | | }
|
| | | #endregion
|
| | |
|
| | |
| | | /// <summary>
|
| | | /// 显示功能菜单的【标识文件】
|
| | | /// </summary>
|
| | | public const string ShowOptionMenuFile = "eaf5efcca1be2f4cb0ff3dea79df755f5886beb3bf7aed1b";
|
| | | public const string ShowOptionMenuFile = "ShowOptionMenuFile";
|
| | | /// <summary>
|
| | | /// 详细Log处理的【标识文件】
|
| | | /// </summary>
|
| | | public const string DetailedLogFile = "ceec8cfdbe5e8112755cba32c1b081f9";
|
| | | public const string DetailedLogFile = "DetailedLogFile";
|
| | | /// <summary>
|
| | | /// 功能备份的名字 这个东西不加密
|
| | | /// </summary>
|
| | |
| | | /// 隐匿配置
|
| | | /// </summary> |
| | | public static HideOptionInfo HideOption = new HideOptionInfo(); |
| | | /// <summary>
|
| | | /// 文件加密秘钥
|
| | | /// </summary> |
| | | public const string FileEncryptKey = "4^Olh_3f"; |
| | | } |
| | | } |
| | |
| | | frameBack.BackgroundColor = UserCenterColor.Current.White;
|
| | | frameBack.Gravity = Gravity.CenterHorizontal;
|
| | | frameBack.Y = Application.GetRealHeight(683);
|
| | | frameBack.Radius = 6;
|
| | | frameBack.Radius = (uint)Application.GetRealHeight(17);
|
| | | bodyFrameLayout.AddChidren(frameBack);
|
| | |
|
| | | //进度显示文本
|
| | |
| | | var btnProgressBar = new FrameLayout();
|
| | | btnProgressBar.Width = 0;
|
| | | btnProgressBar.Height = btnProRow.Height;
|
| | | btnProgressBar.Radius = btnProRow.Radius;
|
| | | btnProgressBar.BackgroundColor = 0xfffb744a;
|
| | | btnProgressBar.Radius = (uint)Application.GetRealHeight(29) / 2;
|
| | | btnProRow.AddChidren(btnProgressBar);
|
| | |
| | | var btnProgressPic = new PicViewControl(84, 60);
|
| | | btnProgressPic.UnSelectedImagePath = "Item/ProgressMsg.png";
|
| | | frameProgress.AddChidren(btnProgressPic);
|
| | | var btnProgressView = new NormalViewControl(84, 32, true);
|
| | | var btnProgressView = new NormalViewControl(84, 45, true);
|
| | | btnProgressView.TextSize = 10;
|
| | | btnProgressView.TextAlignment = TextAlignment.Center;
|
| | | btnProgressView.Text = "0%";
|
| | |
| | | this.btnProgressBar = new FrameLayout();
|
| | | btnProgressBar.Width = 0;
|
| | | btnProgressBar.Height = btnProRow.Height;
|
| | | btnProgressBar.Radius = btnProRow.Radius;
|
| | | btnProgressBar.BackgroundColor = 0xfffb744a;
|
| | | btnProgressBar.Radius = (uint)Application.GetRealHeight(29) / 2;
|
| | | btnProRow.AddChidren(btnProgressBar);
|
| | |
| | | private NormalViewControl InitUserSelectButton(bool select)
|
| | | {
|
| | | var btnContr = new NormalViewControl(207, 63, true);
|
| | | btnContr.Radius = 6;
|
| | | btnContr.RadiusEx = 17;
|
| | | btnContr.TextAlignment = TextAlignment.Center;
|
| | | if (select == false)
|
| | | {
|
| | |
| | | private NormalViewControl InitLockSelectButton(bool select)
|
| | | {
|
| | | var btnContr = new NormalViewControl(207, 63, true);
|
| | | btnContr.Radius = 6;
|
| | | btnContr.RadiusEx = 17;
|
| | | btnContr.TextAlignment = TextAlignment.Center;
|
| | | if (select == false)
|
| | | {
|
| | |
| | | }
|
| | | //节能模式修改(他们说随便一个回路就行)
|
| | | result = await HdlDevicePanelLogic.Current.SetDeviceEnergyConservationMode(panelDevice, energyModeInfo.enable, energyModeInfo.time, energyModeInfo.level);
|
| | | this.CloseProgressBar();
|
| | | if (result == false)
|
| | | {
|
| | | this.CloseProgressBar();
|
| | | return;
|
| | | }
|
| | | //设置按键面板指定端点的【指示灯开关颜色】的信息
|
| | | result = await HdlDevicePanelLogic.Current.SetPanelEpointColorInfo(panelDevice, this.keyColorData);
|
| | | this.CloseProgressBar();
|
| | | if (result == false)
|
| | | {
|
| | | return;
|
| | |
| | | var btnIcon = new NormalViewControl(Application.GetMinRealAverage(52), Application.GetMinRealAverage(52), false);
|
| | | btnIcon.Name = "btn" + device.DeviceEpoint;
|
| | | btnIcon.Gravity = Gravity.Center;
|
| | | btnIcon.Radius = 6;
|
| | | btnIcon.RadiusEx = 16;
|
| | | btnIcon.BorderWidth = 2;
|
| | | btnIcon.BorderColor = 0xff979797;
|
| | | frame.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly);
|
| | |
| | |
|
| | | var btnIcon = new IconViewControl(60);
|
| | | btnIcon.Gravity = Gravity.Center;
|
| | | btnIcon.Radius = (uint)btnIcon.IconSize;
|
| | | btnIcon.Radius = (uint)btnIcon.IconSize / 2;
|
| | | btnFrame.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly);
|
| | |
|
| | | if (dataColor != null)
|
| | |
| | | var btnIcon = new NormalViewControl(Application.GetMinRealAverage(52), Application.GetMinRealAverage(52), false);
|
| | | btnIcon.Name = "btn" + device.DeviceEpoint;
|
| | | btnIcon.Gravity = Gravity.Center;
|
| | | btnIcon.Radius = 6;
|
| | | btnIcon.RadiusEx = 16;
|
| | | btnIcon.BorderWidth = 2;
|
| | | btnIcon.BorderColor = 0xff979797;
|
| | | frame.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly);
|
| | |
| | | var frameBack = new FrameLayout();
|
| | | frameBack.Height = Application.GetRealHeight(204);
|
| | | bodyFrameLayout.AddChidren(frameBack);
|
| | | var scrolContr = new HorizontalScrolViewLayout();
|
| | | scrolContr.Gravity = Gravity.CenterVertical;
|
| | | scrolContr.Height = frameBack.Height;
|
| | | frameBack.AddChidren(scrolContr);
|
| | |
|
| | | //桌布控件
|
| | | this.frameTable = new FrameLayout();
|
| | |
| | | frameTable.Height = bodyFrameLayout.Height - frameBack.Height;
|
| | | bodyFrameLayout.AddChidren(frameTable);
|
| | |
|
| | | //其他
|
| | | var tempRoom = new Common.Room();
|
| | | tempRoom.Name = Language.StringByID(R.MyInternationalizationString.uOther);
|
| | | foreach (var mainKeys in this.listEsixtDevice)
|
| | | {
|
| | | var device = Common.LocalDevice.Current.GetDevice(mainKeys);
|
| | | if (device == null)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | //这个手机弄弄,那个手机弄弄的情况下,
|
| | | //采用后备操作 -> 新建一个临时房间对象出来
|
| | | if (Common.Room.CurrentRoom.GetRoomByDevice(device) == null)
|
| | | {
|
| | | tempRoom.DeviceUIList.Add(Common.LocalDevice.Current.GetDeviceUI(device));
|
| | | }
|
| | | }
|
| | |
|
| | | HdlThreadLogic.Current.RunMainInThread(() =>
|
| | | {
|
| | | if (dicRoom.ContainsKey(nowSelectFloorId) == true && dicRoom[nowSelectFloorId].Count > 0)
|
| | | {
|
| | | //初始化房间控件
|
| | | this.InitRoomControl(scrolContr, dicRoom[nowSelectFloorId]);
|
| | | var listRoom = new List<Common.Room>();
|
| | | listRoom.AddRange(dicRoom[nowSelectFloorId]);
|
| | | if (tempRoom.DeviceUIList.Count > 0)
|
| | | {
|
| | | //显示新建的临时房间对象
|
| | | listRoom.Add(tempRoom);
|
| | | }
|
| | | var roomContr = new RoomDeviceGroupMenuControl(listRoom);
|
| | | frameBack.AddChidren(roomContr);
|
| | | roomContr.SelectRoomEvent += (myRoom) =>
|
| | | {
|
| | | //初始化设备行
|
| | | this.InitDeviceControl(myRoom);
|
| | | };
|
| | | roomContr.InitControl();
|
| | |
|
| | | //确定按钮
|
| | | var btnOk = new BottomClickButton();
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | int indexTemp = 1;
|
| | | foreach (var floorId in dicRoom.Keys)
|
| | | {
|
| | | if (dicFloor.ContainsKey(floorId) == false)
|
| | | {
|
| | | //这是多台手机瞎搞之后出现的后备补救措施
|
| | | dicFloor[floorId] = Language.StringByID(R.MyInternationalizationString.uOther) + indexTemp;
|
| | | indexTemp++;
|
| | | }
|
| | | }
|
| | |
|
| | | var btnIconContr = new MostRightIconControl(69, 69);
|
| | | btnIconContr.UnSelectedImagePath = "Item/Drop_Down.png";
|
| | | topFrameLayout.AddChidren(btnIconContr);
|
| | |
| | | }
|
| | | };
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region ■ 初始化房间控件_____________________
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化房间控件
|
| | | /// </summary>
|
| | | /// <param name="scrolContr">容器</param>
|
| | | /// <param name="listRoom">房间列表</param>
|
| | | private void InitRoomControl(HorizontalScrolViewLayout scrolContr, List<Common.Room> listRoom)
|
| | | {
|
| | | string oldRoomId = listRoom[0].Id;
|
| | | FrameLayoutControl oldFrameBack = null;
|
| | | NormalViewControl oldBtnText = null;
|
| | |
|
| | | //弄个空的进去占位置
|
| | | var frameTemp = new FrameLayout();
|
| | | frameTemp.Height = scrolContr.Height;
|
| | | frameTemp.Width = ControlCommonResourse.XXLeft / 2;
|
| | | scrolContr.AddChidren(frameTemp);
|
| | |
|
| | | for (int i = 0; i < listRoom.Count; i++)
|
| | | {
|
| | | var room = listRoom[i];
|
| | | //带图片的
|
| | | var frameBack = new FrameLayoutControl();
|
| | | frameBack.UseClickStatu = false;
|
| | | frameBack.Gravity = Gravity.Center;
|
| | | frameBack.Height = Application.GetRealHeight(159);
|
| | | frameBack.Width = Application.GetRealWidth(255);
|
| | | if (i == 0)
|
| | | {
|
| | | frameBack.BackgroundImagePath = "Item/RoomIconBackgroundSelected.png";
|
| | | oldFrameBack = frameBack;
|
| | | }
|
| | | else
|
| | | {
|
| | | frameBack.BackgroundImagePath = "Item/RoomIconBackground.png";
|
| | | }
|
| | | scrolContr.AddChidren(frameBack);
|
| | | //文字
|
| | | var btnText = new NormalViewControl(frameBack.Width - (int)(frameBack.Height * 0.47), frameBack.Height, false);
|
| | | btnText.Gravity = Gravity.CenterHorizontal;
|
| | | btnText.Text = room.Name;
|
| | | btnText.TextSize = 12;
|
| | | btnText.TextAlignment = TextAlignment.Center;
|
| | | if (i == 0)
|
| | | {
|
| | | btnText.TextColor = UserCenterColor.Current.White;
|
| | | oldBtnText = btnText;
|
| | | }
|
| | | else
|
| | | {
|
| | | btnText.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | | }
|
| | | frameBack.AddChidren(btnText, ChidrenBindMode.BindEventOnly);
|
| | |
|
| | | frameBack.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | if (oldRoomId == room.Id)
|
| | | {
|
| | | //同一个东西
|
| | | return;
|
| | | }
|
| | | oldRoomId = room.Id;
|
| | |
|
| | | //状态变更
|
| | | frameBack.BackgroundImagePath = "Item/RoomIconBackgroundSelected.png";
|
| | | btnText.TextColor = UserCenterColor.Current.White;
|
| | |
|
| | | oldFrameBack.BackgroundImagePath = "Item/RoomIconBackground.png";
|
| | | oldBtnText.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | | oldFrameBack = frameBack;
|
| | | oldBtnText = btnText;
|
| | | //初始化设备行
|
| | | this.InitDeviceControl(room);
|
| | | };
|
| | | }
|
| | | //初始化设备行
|
| | | this.InitDeviceControl(listRoom[0]);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 初始化设备控件_____________________
|
| | |
| | | var btnIcon = rowDevice.AddLeftIcon(81);
|
| | | Common.LocalDevice.Current.SetDeviceIconToControl(btnIcon, device);
|
| | | //设备名称
|
| | | var btnName = rowDevice.AddLeftCaption(Common.LocalDevice.Current.GetDeviceEpointName(device), 600);
|
| | | var btnName = rowDevice.AddLeftCaption(Common.LocalDevice.Current.GetDeviceEpointName(device), 700);
|
| | | btnName.TextSize = 15;
|
| | | //选择
|
| | | var btnSelect = rowDevice.AddMostRightEmptyIcon(58, 58);
|
| | |
| | | form.AddForm();
|
| | | });
|
| | | }; |
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 菜单控件
|
| | | /// </summary>
|
| | | private class SearchWirelessMenuControl : DialogCommonForm
|
| | | {
|
| | | /// <summary>
|
| | | /// 画面显示(底层会固定调用此方法,借以完成画面创建)
|
| | | /// </summary>
|
| | | public void ShowForm()
|
| | | {
|
| | | var frameBack1 = new FrameLayoutControl();
|
| | | frameBack1.UseClickStatu = false;
|
| | | frameBack1.Y = Application.GetRealHeight(1420);
|
| | | frameBack1.Gravity = Gravity.CenterHorizontal;
|
| | | frameBack1.Radius = 12;
|
| | | frameBack1.Width = Application.GetRealWidth(1034);
|
| | | frameBack1.Height = Application.GetRealHeight(300);
|
| | | frameBack1.BackgroundColor = UserCenterColor.Current.White;
|
| | | bodyFrameLayout.AddChidren(frameBack1);
|
| | |
|
| | | //UDP模式(推荐)
|
| | | var btnUdp = new NormalViewControl(900, 156, true);
|
| | | btnUdp.Gravity = Gravity.CenterHorizontal;
|
| | | btnUdp.TextAlignment = TextAlignment.Center;
|
| | | btnUdp.TextColor = 0xff0075ff;
|
| | | btnUdp.TextSize = 17;
|
| | | btnUdp.TextID = R.MyInternationalizationString.uUdpModeRecommend;
|
| | | frameBack1.AddChidren(btnUdp, ChidrenBindMode.NotBind);
|
| | | btnUdp.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //关闭界面
|
| | | this.CloseForm();
|
| | | var form = new WirelessUdpDirectionForm();
|
| | | form.AddForm();
|
| | | };
|
| | |
|
| | | //线
|
| | | var btnLine = new NormalViewControl(frameBack1.Width, ControlCommonResourse.BottomLineHeight, false);
|
| | | btnLine.BackgroundColor = UserCenterColor.Current.ButtomLine;
|
| | | btnLine.Y = btnUdp.Bottom;
|
| | | frameBack1.AddChidren(btnLine, ChidrenBindMode.NotBind);
|
| | | //AP模式
|
| | | var btnAp = new NormalViewControl(900, 144, true);
|
| | | btnAp.Y = btnLine.Bottom;
|
| | | btnAp.Gravity = Gravity.CenterHorizontal;
|
| | | btnAp.TextAlignment = TextAlignment.Center;
|
| | | btnAp.TextColor = 0xff0075ff;
|
| | | btnAp.TextSize = 17;
|
| | | btnAp.TextID = R.MyInternationalizationString.uApMode;
|
| | | frameBack1.AddChidren(btnAp, ChidrenBindMode.NotBind);
|
| | | btnAp.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //关闭界面
|
| | | this.CloseForm();
|
| | | var form = new WirelessApDirection1Form();
|
| | | form.AddForm();
|
| | | };
|
| | |
|
| | | var frameBack2 = new FrameLayoutControl();
|
| | | frameBack2.UseClickStatu = false;
|
| | | frameBack2.Y = frameBack1.Bottom + Application.GetRealHeight(23);
|
| | | frameBack2.Gravity = Gravity.CenterHorizontal;
|
| | | frameBack2.Radius = 12;
|
| | | frameBack2.Width = Application.GetRealWidth(1034);
|
| | | frameBack2.Height = Application.GetRealHeight(156);
|
| | | frameBack2.BackgroundColor = UserCenterColor.Current.White;
|
| | | bodyFrameLayout.AddChidren(frameBack2);
|
| | | //取消
|
| | | var btnCancel = new NormalViewControl(900, 156, true);
|
| | | btnCancel.Gravity = Gravity.CenterHorizontal;
|
| | | btnCancel.TextAlignment = TextAlignment.Center;
|
| | | btnCancel.TextColor = 0xff0075ff;
|
| | | btnCancel.TextSize = 17;
|
| | | btnCancel.TextID = R.MyInternationalizationString.uCancel;
|
| | | frameBack2.AddChidren(btnCancel, ChidrenBindMode.NotBind);
|
| | | btnCancel.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //关闭界面
|
| | | this.CloseForm();
|
| | | };
|
| | | }
|
| | | } |
| | | } |
| | | } |
| | |
| | | frameback.BackgroundImagePath = "Item/BottomButtonGround.png";
|
| | | bodyFrameLayout.AddChidren(frameback);
|
| | | var btnReDo = new NormalViewControl(300, 65, true);
|
| | | btnReDo.IsBold = true;
|
| | | btnReDo.TextColor = UserCenterColor.Current.White;
|
| | | btnReDo.TextSize = 16;
|
| | | btnReDo.Y = Application.GetRealHeight(49);
|
| | |
| | | frameback.BackgroundImagePath = "Item/BottomButtonGround.png";
|
| | | bodyFrameLayout.AddChidren(frameback);
|
| | | var btnReDo = new NormalViewControl(300, 65, true);
|
| | | btnReDo.IsBold = true;
|
| | | btnReDo.TextColor = UserCenterColor.Current.White;
|
| | | btnReDo.TextSize = 16;
|
| | | btnReDo.Y = Application.GetRealHeight(49);
|
| | |
| | | frameback.BackgroundImagePath = "Item/BottomButtonGround.png";
|
| | | bodyFrameLayout.AddChidren(frameback);
|
| | | var btnReDo = new NormalViewControl(300, 65, true);
|
| | | btnReDo.IsBold = true;
|
| | | btnReDo.TextColor = UserCenterColor.Current.White;
|
| | | btnReDo.TextSize = 16;
|
| | | btnReDo.Y = Application.GetRealHeight(49);
|
| | |
| | | //计时时间
|
| | | int timeCount = 0;
|
| | | //超时时间
|
| | | int timeOut = 120;
|
| | | int timeOut = 240;
|
| | | while (btnGwImage.Parent != null)
|
| | | {
|
| | | timeCount++;
|
| | |
| | | //打开进度条
|
| | | this.ShowProgressBar();
|
| | | var ssid = HdlWifiLogic.Current.SSID;
|
| | | //关闭进度条
|
| | | this.CloseProgressBar();
|
| | | if (ssid == null)
|
| | | {
|
| | | //获取网络SSID失败
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uGetSsidFail);
|
| | | this.ShowMassage(ShowMsgType.Error, msg);
|
| | | this.ShowMassage(ShowMsgType.Tip, msg);
|
| | | //关闭进度条
|
| | | this.CloseProgressBar(ShowReLoadMode.YES);
|
| | | return;
|
| | | }
|
| | | //关闭进度条
|
| | | this.CloseProgressBar();
|
| | |
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | |
| | | return;
|
| | | }
|
| | | //开始Wi-Fi配网
|
| | | HdlWifiLogic.Current.StartSmartConnection(rowWifi.Text, btnPsw.Text, "1");
|
| | | HdlWifiLogic.Current.StartSmartConnection(rowWifi.Text, btnPsw.Text, "");
|
| | | var form = new WirelessUdpSearchForm();
|
| | | this.AddFromAndRemoveNowForm(form);
|
| | | };
|
| | |
| | |
|
| | | //添加智能网关成功
|
| | | var btnMsg = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(85), false);
|
| | | btnMsg.IsBold = true;
|
| | | btnMsg.Y = Application.GetRealHeight(732);
|
| | | btnMsg.TextAlignment = TextAlignment.Center;
|
| | | btnMsg.TextSize = 20;
|
| | |
| | | frameAdd.BackgroundImagePath = "Item/BottomButtonGround.png";
|
| | | bodyFrameLayout.AddChidren(frameAdd);
|
| | | var btnAdd = new NormalViewControl(300, 65, true);
|
| | | btnAdd.IsBold = true;
|
| | | btnAdd.TextColor = UserCenterColor.Current.White;
|
| | | btnAdd.TextSize = 16;
|
| | | btnAdd.Y = Application.GetRealHeight(49);
|
| | |
| | | frameBack.BackgroundColor = UserCenterColor.Current.White;
|
| | | frameBack.Gravity = Gravity.CenterHorizontal;
|
| | | frameBack.Y = Application.GetRealHeight(683);
|
| | | frameBack.Radius = 6;
|
| | | frameBack.Radius = (uint)Application.GetRealHeight(17);
|
| | | bodyFrameLayout.AddChidren(frameBack);
|
| | |
|
| | | //进度显示文本
|
| | |
| | | var btnProgressBar = new FrameLayout();
|
| | | btnProgressBar.Width = 0;
|
| | | btnProgressBar.Height = btnProRow.Height;
|
| | | btnProgressBar.Radius = btnProRow.Radius;
|
| | | btnProgressBar.BackgroundColor = 0xfffb744a;
|
| | | btnProgressBar.Radius = (uint)Application.GetRealHeight(29) / 2;
|
| | | btnProRow.AddChidren(btnProgressBar);
|
| | |
| | | var btnProgressPic = new PicViewControl(84, 60);
|
| | | btnProgressPic.UnSelectedImagePath = "Item/ProgressMsg.png";
|
| | | frameProgress.AddChidren(btnProgressPic);
|
| | | var btnProgressView = new NormalViewControl(84, 32, true);
|
| | | var btnProgressView = new NormalViewControl(84, 45, true);
|
| | | btnProgressView.TextSize = 10;
|
| | | btnProgressView.TextAlignment = TextAlignment.Center;
|
| | | btnProgressView.Text = "0%";
|
| | |
| | | frameback.BackgroundImagePath = "Item/BottomButtonGround.png";
|
| | | bodyFrameLayout.AddChidren(frameback);
|
| | | var btnBackup = new NormalViewControl(400, 65, true);
|
| | | btnBackup.IsBold = true;
|
| | | btnBackup.TextColor = UserCenterColor.Current.White;
|
| | | btnBackup.TextSize = 16;
|
| | | btnBackup.Y = Application.GetRealHeight(49);
|
| | |
| | | //发送定位命令
|
| | | HdlGatewayLogic.Current.SetFixedPositionCommand(i_gateway);
|
| | | };
|
| | | gatewayRow.frameTable.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new GatewayManage.GatewayInfoEditorForm();
|
| | | form.AddForm(i_gateway);
|
| | | };
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | |
|
| | | //成员ID
|
| | | var btnUserId = new NormalViewControl(800, 50, true);
|
| | | btnUserId.IsBold = true;
|
| | | btnUserId.Y = Application.GetRealHeight(472);
|
| | | btnUserId.Gravity = Gravity.CenterHorizontal;
|
| | | btnUserId.Text = memberResult.Account;
|
| | |
| | |
|
| | | //昵称
|
| | | var btnName = new NormalViewControl(800, 55, true);
|
| | | btnName.IsBold = true;
|
| | | btnName.Y = Application.GetRealHeight(541);
|
| | | btnName.Gravity = Gravity.CenterHorizontal;
|
| | | btnName.TextAlignment = TextAlignment.Center;
|
| | |
| | | strMsg = string.Format(strMsg, "\r\n");
|
| | | }
|
| | | var btnmsg = new NormalViewControl(800, 100, true);
|
| | | btnmsg.IsBold = true;
|
| | | btnmsg.Y = Application.GetRealHeight(913);
|
| | | btnmsg.TextSize = 12;
|
| | | btnmsg.Text = strMsg;
|
| | |
| | | frame.Height = Application.GetRealHeight(1097);
|
| | | frame.BackgroundColor = UserCenterColor.Current.White;
|
| | | frame.Gravity = Gravity.Center;
|
| | | frame.Radius = 6;
|
| | | frame.Radius = (uint)Application.GetRealHeight(17);
|
| | | bodyFrameLayout.AddChidren(frame);
|
| | |
|
| | | //用户图标
|
| | |
| | | var btnUserIcon = new ImageView();
|
| | | btnUserIcon.Height = Application.GetMinRealAverage(207);
|
| | | btnUserIcon.Width = Application.GetMinRealAverage(207);
|
| | | btnUserIcon.Radius = (uint)Application.GetMinRealAverage(207) / 2;
|
| | | btnUserIcon.Y = Application.GetRealHeight(104);
|
| | | btnUserIcon.Gravity = Gravity.CenterHorizontal;
|
| | | if (System.IO.File.Exists(iconPath) == true)
|
| | |
| | |
|
| | | //昵称
|
| | | var btnName = new NormalViewControl(frame.Width, Application.GetRealHeight(55), false);
|
| | | btnName.IsBold = true;
|
| | | btnName.TextAlignment = TextAlignment.Center;
|
| | | btnName.Y = Application.GetRealHeight(334);
|
| | | btnName.TextColor = UserCenterColor.Current.TextColor2;
|
| | |
| | |
|
| | | //家族成员添加成功
|
| | | var btnSuccess = new NormalViewControl(frame.Width, Application.GetRealHeight(82), false);
|
| | | btnSuccess.IsBold = true;
|
| | | btnSuccess.Y = Application.GetRealHeight(547);
|
| | | btnSuccess.TextAlignment = TextAlignment.Center;
|
| | | btnSuccess.TextID = R.MyInternationalizationString.uAddMemberSuccess;
|
| | |
| | | frame.Height = Application.GetRealHeight(1097);
|
| | | frame.BackgroundColor = UserCenterColor.Current.White;
|
| | | frame.Gravity = Gravity.Center;
|
| | | frame.Radius = 6;
|
| | | frame.Radius = (uint)Application.GetRealHeight(17);
|
| | | bodyFrameLayout.AddChidren(frame);
|
| | |
|
| | | //用户图标
|
| | | var btnUserIcon = new PicViewControl(207, 207); |
| | | string iconPath = System.IO.Path.Combine(UserCenterResourse.Option.UserPictruePath, memberInfo.DistributedMark + ".png");
|
| | | var btnUserIcon = new ImageView();
|
| | | btnUserIcon.Height = Application.GetMinRealAverage(207);
|
| | | btnUserIcon.Width = Application.GetMinRealAverage(207);
|
| | | btnUserIcon.Radius = (uint)Application.GetMinRealAverage(207) / 2; |
| | | btnUserIcon.Y = Application.GetRealHeight(104); |
| | | btnUserIcon.Gravity = Gravity.CenterHorizontal;
|
| | | btnUserIcon.UnSelectedImagePath = "Center/Admin.png"; |
| | | if (System.IO.File.Exists(iconPath) == true)
|
| | | {
|
| | | btnUserIcon.ImageBytes = Shared.IO.FileUtils.ReadFile(iconPath);
|
| | | }
|
| | | else
|
| | | {
|
| | | btnUserIcon.ImagePath = "Center/Admin.png";
|
| | | } |
| | | frame.AddChidren(btnUserIcon);
|
| | |
|
| | | //昵称
|
| | | var btnName = new NormalViewControl(frame.Width, Application.GetRealHeight(55), false);
|
| | | btnName.IsBold = true; |
| | | btnName.TextAlignment = TextAlignment.Center; |
| | | btnName.Y = Application.GetRealHeight(334); |
| | | btnName.TextColor = UserCenterColor.Current.TextColor2; |
| | |
| | |
|
| | |
|
| | | var btnMsg = new NormalViewControl(frame.Width, Application.GetRealHeight(81), false);
|
| | | btnMsg.IsBold = true;
|
| | | if (memberInfo.AccountType == 1)
|
| | | {
|
| | | //授权成功!
|
| | |
| | | btnErrorMsg.TextAlignment = TextAlignment.Center;
|
| | | btnErrorMsg.TextColor = 0xfff75858;
|
| | | btnErrorMsg.TextID = R.MyInternationalizationString.uVerificationCodeErrorInputAgain;
|
| | | btnErrorMsg.IsBold = true;
|
| | | bodyFrameLayout.AddChidren(btnErrorMsg);
|
| | | btnErrorMsg.Visible = false;
|
| | |
|
| | |
| | | btnErrorMsg.Y = Application.GetRealHeight(677);
|
| | | btnErrorMsg.TextAlignment = TextAlignment.Center;
|
| | | btnErrorMsg.TextColor = 0xfff75858;
|
| | | btnErrorMsg.IsBold = true;
|
| | | btnErrorMsg.TextID = R.MyInternationalizationString.uVerificationCodeErrorInputAgain;
|
| | | bodyFrameLayout.AddChidren(btnErrorMsg);
|
| | | btnErrorMsg.Visible = false;
|
| | |
| | | btnErrorMsg.TextAlignment = TextAlignment.Center;
|
| | | btnErrorMsg.TextColor = 0xfff75858;
|
| | | btnErrorMsg.TextID = R.MyInternationalizationString.uVerificationCodeErrorInputAgain;
|
| | | btnErrorMsg.IsBold = true;
|
| | | bodyFrameLayout.AddChidren(btnErrorMsg);
|
| | | btnErrorMsg.Visible = false;
|
| | |
|
| | |
| | | btnErrorMsg.TextAlignment = TextAlignment.Center;
|
| | | btnErrorMsg.TextColor = 0xfff75858;
|
| | | btnErrorMsg.TextID = R.MyInternationalizationString.uVerificationCodeErrorInputAgain;
|
| | | btnErrorMsg.IsBold = true;
|
| | | bodyFrameLayout.AddChidren(btnErrorMsg);
|
| | | btnErrorMsg.Visible = false;
|
| | |
|
| | |
| | | msgControl.Y = Application.GetRealHeight(582);
|
| | | msgControl.TextAlignment = TextAlignment.Center;
|
| | | msgControl.TextColor = 0xfff75858;
|
| | | msgControl.IsBold = true;
|
| | | bodyFrameLayout.AddChidren(msgControl);
|
| | |
|
| | | //确认修改
|
| | |
| | | var btnCode = new NormalViewControl(302, 127, true);
|
| | | btnCode.X = rowPhone.Right + Application.GetRealWidth(35);
|
| | | btnCode.Y = Application.GetRealHeight(23);
|
| | | btnCode.Radius = 4;
|
| | | btnCode.RadiusEx = 12;
|
| | | btnCode.TextID = R.MyInternationalizationString.uGetVerificationCode;
|
| | | btnCode.TextColor = UserCenterColor.Current.White;
|
| | | btnCode.BackgroundColor = UserCenterColor.Current.TextOrangeColor;
|
| | |
| | | var btnCode = new NormalViewControl(302, 127, true);
|
| | | btnCode.X = rowPhone.Right + Application.GetRealWidth(35);
|
| | | btnCode.Y = Application.GetRealHeight(23);
|
| | | btnCode.Radius = 4;
|
| | | btnCode.RadiusEx = 12;
|
| | | btnCode.TextID = R.MyInternationalizationString.uGetVerificationCode;
|
| | | btnCode.TextColor = UserCenterColor.Current.White;
|
| | | btnCode.BackgroundColor = UserCenterColor.Current.TextOrangeColor;
|
| | |
| | | framePic.Width = Application.GetMinRealAverage(887);
|
| | | framePic.Height = Application.GetMinRealAverage(444);
|
| | | framePic.Gravity = Gravity.CenterHorizontal;
|
| | | framePic.Radius = 8;
|
| | | framePic.Radius = (uint)Application.GetRealHeight(17);
|
| | | framePic.BackgroundColor = UserCenterColor.Current.BodyFrameLayout;
|
| | | bodyFrameLayout.AddChidren(framePic);
|
| | | var btnPic = new ImageView();
|
| | | btnPic.Radius = 8;
|
| | | btnPic.Radius = (uint)Application.GetRealHeight(17);
|
| | | btnPic.ImagePath = "RoomIcon/0.JPG";
|
| | | framePic.AddChidren(btnPic);
|
| | | btnPic.MouseUpEventHandler += (sender, e) =>
|
| | |
| | | framePic.Width = Application.GetMinRealAverage(887);
|
| | | framePic.Height = Application.GetMinRealAverage(444);
|
| | | framePic.Gravity = Gravity.CenterHorizontal;
|
| | | framePic.Radius = 8;
|
| | | framePic.Radius = (uint)Application.GetRealHeight(17);
|
| | | framePic.BackgroundColor = UserCenterColor.Current.BodyFrameLayout;
|
| | | bodyFrameLayout.AddChidren(framePic);
|
| | | var btnPic = new ImageView();
|
| | | btnPic.Radius = 8;
|
| | | btnPic.Radius = (uint)Application.GetRealHeight(17);
|
| | | framePic.AddChidren(btnPic);
|
| | | if (this.editorRoom.BackgroundImageType == 0)
|
| | | {
|
| | |
| | | /// </summary>
|
| | | private Common.Room lookRoom = null;
|
| | | /// <summary>
|
| | | /// 当前选择的分支,1:场景 2:功能
|
| | | /// </summary>
|
| | | private int nowSelectIndex = 1;
|
| | | /// <summary>
|
| | | /// 桌布控件
|
| | | /// </summary>
|
| | | private FrameLayout frameTable = null;
|
| | |
| | | //清空bodyFrame
|
| | | this.ClearBodyFrame();
|
| | |
|
| | | //初始化分支控件
|
| | | this.InitSwitchControl();
|
| | |
|
| | | //初始化桌布控件
|
| | | this.frameTable = new FrameLayout();
|
| | | frameTable.Y = Application.GetRealHeight(187);
|
| | | frameTable.Height = bodyFrameLayout.Height - Application.GetRealHeight(187);
|
| | | bodyFrameLayout.AddChidren(frameTable);
|
| | |
|
| | | //显示场景列表
|
| | | this.ShowSceneList();
|
| | | //初始化分支控件
|
| | | this.InitSwitchControl();
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | /// </summary>
|
| | | private void InitSwitchControl()
|
| | | {
|
| | | var btnTemp = new NormalViewControl(10, 10, false);
|
| | | btnTemp.TextID = R.MyInternationalizationString.uScence;
|
| | |
|
| | | //场景框(点击范围有点小,需要扩大它的点击范围)
|
| | | var frameScene = new FrameLayoutControl();
|
| | | frameScene.UseClickStatu = false;
|
| | | frameScene.Height = Application.GetRealHeight(90);
|
| | | frameScene.Width = btnTemp.GetRealWidthByText(16);
|
| | | frameScene.X = ControlCommonResourse.XXLeft;
|
| | | frameScene.Y = Application.GetRealHeight(40);
|
| | | bodyFrameLayout.AddChidren(frameScene);
|
| | | //场景
|
| | | var btnScene = new NormalViewControl(frameScene.Width, Application.GetRealHeight(63), false);
|
| | | btnScene.Text = btnTemp.Text;
|
| | | btnScene.TextSize = 16;
|
| | | btnScene.TextColor = UserCenterColor.Current.TextColor2;
|
| | | frameScene.AddChidren(btnScene, ChidrenBindMode.BindEventOnly);
|
| | | //底线
|
| | | var btnSceneLine = new NormalViewControl(40, 10, true);
|
| | | btnSceneLine.Y = btnScene.Bottom + Application.GetRealHeight(14);
|
| | | btnSceneLine.X = btnScene.X + btnScene.Width / 2 - Application.GetRealWidth(40) / 2;
|
| | | btnSceneLine.Radius = (uint)Application.GetRealHeight(10) / 2;
|
| | | btnSceneLine.BackgroundColor = UserCenterColor.Current.TextOrangeColor;
|
| | | frameScene.AddChidren(btnSceneLine, ChidrenBindMode.BindEventOnly);
|
| | |
|
| | | btnTemp.TextID = R.MyInternationalizationString.uFunction;
|
| | | //功能框(点击范围有点小,需要扩大它的点击范围)
|
| | | var frameFunc = new FrameLayoutControl();
|
| | | frameFunc.UseClickStatu = false;
|
| | | frameFunc.Height = Application.GetRealHeight(90);
|
| | | frameFunc.Width = btnTemp.GetRealWidthByText(16);
|
| | | frameFunc.X = frameScene.Right + Application.GetRealWidth(58);
|
| | | frameFunc.Y = Application.GetRealHeight(40);
|
| | | bodyFrameLayout.AddChidren(frameFunc);
|
| | | //功能
|
| | | var btnFunc = new NormalViewControl(frameFunc.Width, Application.GetRealHeight(63), false);
|
| | | btnFunc.Text = btnTemp.Text;
|
| | | btnFunc.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | frameFunc.AddChidren(btnFunc, ChidrenBindMode.BindEventOnly);
|
| | | //底线
|
| | | var btnFuncLine = new NormalViewControl(40, 10, true);
|
| | | btnFuncLine.Y = btnFunc.Bottom + Application.GetRealHeight(14);
|
| | | btnFuncLine.X = btnFunc.X + btnFunc.Width / 2 - Application.GetRealWidth(40) / 2;
|
| | | btnFuncLine.Radius = (uint)Application.GetRealHeight(10) / 2;
|
| | | btnFuncLine.BackgroundColor = UserCenterColor.Current.TextOrangeColor;
|
| | | frameFunc.AddChidren(btnFuncLine, ChidrenBindMode.BindEventOnly);
|
| | | btnFuncLine.Visible = false;
|
| | |
|
| | | frameScene.ButtonClickEvent += (sender, e) =>
|
| | | var tabControl = new SceneFunctionSwitchControl();
|
| | | tabControl.Y = Application.GetRealHeight(40);
|
| | | bodyFrameLayout.AddChidren(tabControl);
|
| | | tabControl.SelectTabEvent += (tabIndex) =>
|
| | | {
|
| | | //场景分支选择
|
| | | if (this.nowSelectIndex == 1)
|
| | | if (tabIndex == 1)
|
| | | {
|
| | | return;
|
| | | //显示场景列表
|
| | | this.ShowSceneList();
|
| | | }
|
| | | this.nowSelectIndex = 1;
|
| | |
|
| | | btnScene.TextSize = 16;
|
| | | btnScene.TextColor = UserCenterColor.Current.TextColor2;
|
| | | btnFunc.TextSize = 14;
|
| | | btnFunc.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | btnSceneLine.Visible = true;
|
| | | btnFuncLine.Visible = false;
|
| | |
|
| | | //显示场景列表
|
| | | this.ShowSceneList();
|
| | | };
|
| | |
|
| | | frameFunc.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //功能分支选择
|
| | | if (this.nowSelectIndex == 2)
|
| | | else
|
| | | {
|
| | | return;
|
| | | //显示功能列表
|
| | | this.ShowFunctionList();
|
| | | }
|
| | | this.nowSelectIndex = 2;
|
| | |
|
| | | btnScene.TextSize = 14;
|
| | | btnScene.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | btnFunc.TextSize = 16;
|
| | | btnFunc.TextColor = UserCenterColor.Current.TextColor2;
|
| | | btnFuncLine.Visible = true;
|
| | | btnSceneLine.Visible = false;
|
| | |
|
| | | //显示功能列表
|
| | | this.ShowFunctionList();
|
| | | };
|
| | | tabControl.InitControl();
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | btnPic.Width = Application.GetRealWidth(844);
|
| | | btnPic.Height = Application.GetRealHeight(420);
|
| | | btnPic.ImagePath = data.IconPath;
|
| | | btnPic.Radius = 8;
|
| | | btnPic.Radius = (uint)Application.GetRealHeight(17);
|
| | | frameContr.AddChidren(btnPic);
|
| | |
|
| | | var btnName = new NormalViewControl(251, 282, true);
|
| | | btnName.X = ControlCommonResourse.XXLeft;
|
| | | btnName.Y = Application.GetRealHeight(58);
|
| | | btnName.BackgroundColor = 0xff333333;
|
| | | btnName.Radius = 8;
|
| | | btnName.RadiusEx = 17;
|
| | | btnName.Text = data.Name;
|
| | | btnName.TextSize = 15;
|
| | | btnName.TextColor = UserCenterColor.Current.White;
|
| | |
| | | frameBack.BackgroundColor = UserCenterColor.Current.White;
|
| | | frameBack.Width = bodyFrameLayout.Width;
|
| | | frameBack.Height = Application.GetRealHeight(1650);
|
| | | frameBack.Radius = 20;
|
| | | frameBack.Radius = (uint)Application.GetRealHeight(58);
|
| | | frameTable.AddChidren(frameBack);
|
| | |
|
| | | var listView = new VerticalListControl(23);
|
| | |
| | | {
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | var listCheck = new HashSet<string>();
|
| | | for (int i = 0; i < listGwId.Count; i++)
|
| | | {
|
| | | if (listView == null)
|
| | | if (listView.Parent == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | var result = Common.LocalDevice.Current.GetDeviceListFromGateway(zbway, false, (device) =>
|
| | | {
|
| | | string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
|
| | | if (listView.Parent == null)
|
| | | if (listView.Parent == null || dicData.ContainsKey(mainkeys) == false || listCheck.Contains(mainkeys) == true)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (listView == null || dicData.ContainsKey(mainkeys) == false)
|
| | | {
|
| | | return;
|
| | | }
|
| | | listCheck.Add(mainkeys);
|
| | |
|
| | | var localDevice = Common.LocalDevice.Current.GetDevice(mainkeys);
|
| | | if (localDevice != null && localDevice.IsOnline != device.IsOnline)
|
| | | {
|
| | |
| | | listDeleteFile.Add(Common.Room.Lists[i].FileName);
|
| | | }
|
| | | }
|
| | | //删除房间
|
| | | foreach (string fileName in listDeleteFile)
|
| | | {
|
| | | Common.Room.CurrentRoom.Remove(fileName);
|
| | | }
|
| | | //如果当前选择的房间是删除对象的话
|
| | | if (Common.Room.CurrentRoom.FloorId == keys)
|
| | | {
|
| | | Common.Room.CurrentRoom = Common.Room.Lists[0];
|
| | | }
|
| | | //删除房间
|
| | | foreach (string fileName in listDeleteFile)
|
| | | {
|
| | | Common.Room.CurrentRoom.Remove(fileName);
|
| | | }
|
| | | Common.Config.Instance.Home.Save();
|
| | | //保存顺序
|
| | |
| | | }
|
| | | //请输入楼层名称
|
| | | dialogForm.SetTipText(Language.StringByID(R.MyInternationalizationString.uPleaseInputFloorName));
|
| | | dialogForm.Text = floorName;
|
| | |
|
| | | if (Common.Config.Instance.Home.FloorDics.ContainsKey(keys) == true)
|
| | | {
|
| | | dialogForm.Text = Common.Config.Instance.Home.FloorDics[keys];
|
| | | floorName = Common.Config.Instance.Home.FloorDics[keys];
|
| | | }
|
| | | else
|
| | | {
|
| | | dialogForm.Text = floorName;
|
| | | }
|
| | | //按下确认按钮
|
| | | dialogForm.ComfirmClickEvent += ((textValue) =>
|
| | | {
|
| | |
| | | btnPassword.TextSize = 24;
|
| | | btnPassword.TextColor = 0xfffc744b;
|
| | | btnPassword.Text = i_password;
|
| | | btnPassword.IsBold = true;
|
| | | frameback.AddChidren(btnPassword);
|
| | |
|
| | | //初始化列表控件
|
| | |
| | |
|
| | | //初始化【信息通知】的行
|
| | | var row4 = new FrameRowControl(listView.rowSpace / 2);
|
| | | row4.UseClickStatu = false;
|
| | | listView.AddChidren(row4);
|
| | | row4.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uInformationPush), 500);
|
| | | //开关图标
|
| | |
| | | frameBack.Height = Application.GetRealHeight(1300);
|
| | | frameBack.Y = Application.GetRealHeight(444);
|
| | | frameBack.BackgroundColor = 0xa1ffffff;
|
| | | frameBack.SetCornerWithSameRadius(20, HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
|
| | | frameBack.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
|
| | | bodyFrameLayout.AddChidren(frameBack);
|
| | |
|
| | | //桌布控件
|
| | |
| | | btnSensor.TextSize = 16;
|
| | | btnSensor.TextAlignment = TextAlignment.Center;
|
| | | btnSensor.TextColor = UserCenterColor.Current.TextColor2;
|
| | | btnSensor.IsBold = true;
|
| | | frameSensor.AddChidren(btnSensor, ChidrenBindMode.BindEventOnly);
|
| | | //底线
|
| | | var btnSensorLine = new NormalViewControl(40, 10, true);
|
| | |
| | | //字体大小和颜色变更
|
| | | btnSensor.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | btnSensor.TextSize = 14;
|
| | | btnSensor.IsBold = false;
|
| | | btnLog.TextColor = UserCenterColor.Current.TextColor2;
|
| | | btnLog.TextSize = 16;
|
| | | btnLog.IsBold = true;
|
| | |
|
| | | btnLogLine.Visible = true;
|
| | | btnSensorLine.Visible = false;
|
| | |
| | | //字体大小和颜色变更
|
| | | btnSensor.TextColor = UserCenterColor.Current.TextColor2;
|
| | | btnSensor.TextSize = 16;
|
| | | btnSensor.IsBold = true;
|
| | | btnLog.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | btnLog.TextSize = 14;
|
| | | btnLog.IsBold = false;
|
| | |
|
| | | btnLogLine.Visible = false;
|
| | | btnSensorLine.Visible = true;
|
| | |
| | | btnPic.Width = Application.GetRealWidth(844);
|
| | | btnPic.Height = Application.GetRealHeight(420);
|
| | | btnPic.ImagePath = data.IconPath;
|
| | | btnPic.Radius = 8;
|
| | | btnPic.Radius = (uint)Application.GetRealHeight(17);
|
| | | frameContr.AddChidren(btnPic, ChidrenBindMode.BindEventOnly);
|
| | |
|
| | | var btnName = new NormalViewControl(251, 282, true);
|
| | | btnName.X = ControlCommonResourse.XXLeft;
|
| | | btnName.Y = Application.GetRealHeight(58);
|
| | | btnName.BackgroundColor = 0xff333333;
|
| | | btnName.Radius = 8;
|
| | | btnName.RadiusEx = 17;
|
| | | btnName.Text = data.Name;
|
| | | btnName.TextSize = 15;
|
| | | btnName.TextColor = UserCenterColor.Current.White;
|
| | |
| | | }
|
| | | };
|
| | | }
|
| | | //调整一下高度
|
| | | listView.AdjustRealHeightByBottomButton(Application.GetRealHeight(185));
|
| | | });
|
| | | }
|
| | |
|
| | |
| | | frameBack.BackgroundColor = UserCenterColor.Current.White;
|
| | | frameBack.Width = bodyFrameLayout.Width;
|
| | | frameBack.Height = Application.GetRealHeight(1650);
|
| | | frameBack.Radius = 20;
|
| | | frameBack.Radius = (uint)Application.GetRealHeight(58);
|
| | | frameDeviceTable.AddChidren(frameBack);
|
| | |
|
| | | var listView = new VerticalListControl(23);
|
| | |
| | | }
|
| | | };
|
| | | }
|
| | |
|
| | | //列表自己有个23的Y轴坐标
|
| | | listView.AdjustRealHeightByBottomButton(Application.GetRealHeight(23), Application.GetRealHeight(300 - 23));
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | btnPic.Width = Application.GetRealWidth(844);
|
| | | btnPic.Height = Application.GetRealHeight(420);
|
| | | btnPic.ImagePath = data.IconPath;
|
| | | btnPic.Radius = 8;
|
| | | btnPic.Radius = (uint)Application.GetRealHeight(17);
|
| | | frameContr.AddChidren(btnPic);
|
| | |
|
| | | var btnName = new NormalViewControl(251, 282, true);
|
| | | btnName.X = ControlCommonResourse.XXLeft;
|
| | | btnName.Y = Application.GetRealHeight(58);
|
| | | btnName.BackgroundColor = 0xff333333;
|
| | | btnName.Radius = 8;
|
| | | btnName.RadiusEx = 17;
|
| | | btnName.Text = data.Name;
|
| | | btnName.TextSize = 15;
|
| | | btnName.TextColor = UserCenterColor.Current.White;
|
| | |
| | | frameBack.BackgroundColor = UserCenterColor.Current.White;
|
| | | frameBack.Width = bodyFrameLayout.Width;
|
| | | frameBack.Height = Application.GetRealHeight(1650);
|
| | | frameBack.Radius = 20;
|
| | | frameBack.Radius = (uint)Application.GetRealHeight(58);
|
| | | frameDeviceTable.AddChidren(frameBack);
|
| | |
|
| | | var listView = new VerticalListControl(23);
|
| | |
| | | /// </summary> |
| | | private void InitMiddleFrame() |
| | | {
|
| | | uint roundHeigth = 6;
|
| | | uint roundHeigth = (uint)Application.GetRealHeight(17);
|
| | |
|
| | | //背景框
|
| | | var frameBack = new FrameLayout();
|
| | |
| | | frameBack.AddChidren(btnIcon);
|
| | | //用户名
|
| | | var btnUser = new NormalViewControl(frameBack.Width, Application.GetRealHeight(46), false);
|
| | | btnUser.IsBold = true;
|
| | | btnUser.Y = Application.GetRealHeight(147);
|
| | | btnUser.Text = UserCenterResourse.UserInfo.UserName;
|
| | | btnUser.TextAlignment = TextAlignment.Center;
|
| | |
| | | /// </summary>
|
| | | public class UserInformationForm : EditorCommonForm
|
| | | {
|
| | | /// <summary>
|
| | | /// 中部桌布控件
|
| | | /// </summary>
|
| | | private FrameLayout frameMiddleBack = null;
|
| | |
|
| | | #region ■ 初始化_____________________________
|
| | |
|
| | | /// <summary>
|
| | |
| | | /// </summary>
|
| | | private void InitMiddleBodyFrame()
|
| | | {
|
| | | var frameBack = new FrameLayout();
|
| | | frameBack.Y = Application.GetRealHeight(363);
|
| | | frameBack.Height = Application.GetRealHeight(1008);
|
| | | frameBack.BackgroundColor = UserCenterColor.Current.White;
|
| | | bodyFrameLayout.AddChidren(frameBack);
|
| | | if (this.frameMiddleBack == null)
|
| | | {
|
| | | frameMiddleBack = new FrameLayout();
|
| | | frameMiddleBack.Y = Application.GetRealHeight(363);
|
| | | frameMiddleBack.Height = Application.GetRealHeight(1008);
|
| | | frameMiddleBack.BackgroundColor = UserCenterColor.Current.White;
|
| | | bodyFrameLayout.AddChidren(frameMiddleBack);
|
| | | }
|
| | | else
|
| | | {
|
| | | frameMiddleBack.RemoveAll();
|
| | | }
|
| | |
|
| | | var listMidFrame = new FrameListControl(12);
|
| | | listMidFrame.Y = Application.GetRealHeight(11);
|
| | | listMidFrame.Height = Application.GetRealHeight(1008 - 11);
|
| | | frameBack.AddChidren(listMidFrame);
|
| | | frameMiddleBack.AddChidren(listMidFrame);
|
| | |
|
| | | var rowName = new FrameRowControl(listMidFrame.rowSpace / 2);
|
| | | //关闭点击状态
|
| | |
| | | rowEmail.AddRightArrow();
|
| | | //邮箱
|
| | | var btnEmail = rowEmail.AddMostRightView(UserCenterResourse.UserInfo.Email, 500);
|
| | | btnEmail.IsBold = true;
|
| | | if (string.IsNullOrEmpty(UserCenterResourse.UserInfo.Email) == true)
|
| | | {
|
| | | //未设置,请绑定
|
| | |
| | | rowPhone.AddRightArrow();
|
| | | //手机号
|
| | | var btnPhone = rowPhone.AddMostRightView(UserCenterResourse.UserInfo.Phone, 500);
|
| | | btnPhone.IsBold = true;
|
| | | if (string.IsNullOrEmpty(UserCenterResourse.UserInfo.Phone) == true)
|
| | | {
|
| | | //未设置,请绑定
|
| | |
| | | //添加向右图标
|
| | | rowOther.AddRightArrow();
|
| | | //微信、QQ
|
| | | rowOther.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uWebChatAndQQ), 500);
|
| | | var btnQQ = rowOther.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uWebChatAndQQ), 500);
|
| | | btnQQ.IsBold = true;
|
| | | rowOther.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new OtherParty.OtherPartyAccountMenuForm();
|
| | |
| | | //添加向右图标
|
| | | rowSysPsw.AddRightArrow();
|
| | | //去修改
|
| | | rowSysPsw.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uGotoEditor), 350);
|
| | | var btnPsw = rowSysPsw.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uGotoEditor), 350);
|
| | | btnPsw.IsBold = true;
|
| | | rowSysPsw.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new Password.EditorAccountPasswordForm();
|
| | |
| | | //添加向右图标
|
| | | rowSecond.AddRightArrow();
|
| | | //密码、手势、指纹
|
| | | rowSecond.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uPasswordGestureFingerPrint), 400);
|
| | | var btnSecand = rowSecond.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uPasswordGestureFingerPrint), 400);
|
| | | btnSecand.IsBold = true;
|
| | | rowSecond.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new SecondAuthenticationForm();
|
| | |
| | | /// </summary>
|
| | | public override int FormActionAgainEvent()
|
| | | {
|
| | | //重新刷新界面
|
| | | this.ShowForm();
|
| | | //初始化中部的信息
|
| | | this.InitMiddleBodyFrame();
|
| | |
|
| | | return 1;
|
| | | }
|
| | |
| | | frameBack.BackgroundColor = UserCenterColor.Current.BodyFrameLayout;
|
| | | frameBack.Y = Application.GetRealHeight(380);
|
| | | frameBack.Gravity = Gravity.CenterHorizontal;
|
| | | frameBack.Radius = 12;
|
| | | frameBack.Radius = (uint)Application.GetRealHeight(29);
|
| | | frameBack.Width = bodyFrameLayout.Width - Application.GetRealWidth(29 * 2);
|
| | | frameBack.Height = bodyFrameLayout.Height - Application.GetRealHeight(380) + Application.GetRealHeight(100);
|
| | | bodyFrameLayout.AddChidren(frameBack);
|
| | |
| | |
|
| | | //用户昵称
|
| | | this.btnUserName = new NormalViewControl(605, 60, true);
|
| | | btnUserName.IsBold = true;
|
| | | btnUserName.X = btnUserIcon.Right + Application.GetRealWidth(5);
|
| | | btnUserName.Y = Application.GetRealHeight(43);
|
| | | if (UserCenterResourse.UserInfo != null)
|
| | |
| | | frameMainMenuBack.Gravity = Gravity.CenterHorizontal;
|
| | | frameMainMenuBack.Height = Application.GetRealHeight(371);
|
| | | frameMainMenuBack.Width = frameWhite.Width - Application.GetRealWidth(29 * 2);
|
| | | frameMainMenuBack.Radius = 10;
|
| | | frameMainMenuBack.Radius = (uint)Application.GetRealHeight(17);
|
| | | frameMainMenuBack.BackgroundColor = UserCenterColor.Current.White;
|
| | | frameWhite.AddChidren(frameMainMenuBack);
|
| | | }
|
| | |
| | | new System.Threading.Thread(async () => |
| | | { |
| | | //登录成功 |
| | | var homes = await House.GetHomeLists();
|
| | | var homes = await House.GetHomeLists(); |
| | | //刷新个人中心的内存及线程 |
| | | await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread();
|
| | | //启动ZigBee
|
| | | ZigBee.Common.Application.Init(); |
| | | //刷新个人中心的内存及线程 |
| | | await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread(); |
| | | |
| | | Room.InitAllRoom(); |
| | | |
| | |
| | | new System.Threading.Thread(async () => |
| | | { |
| | | //登录成功 |
| | | var homes = await House.GetHomeLists();
|
| | | var homes = await House.GetHomeLists(); |
| | | //刷新个人中心的内存及线程 |
| | | await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread();
|
| | | //启动ZigBee
|
| | | ZigBee.Common.Application.Init(); |
| | | |
| | | //刷新个人中心的内存及线程 |
| | | await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread(); |
| | | |
| | | Room.InitAllRoom(); |
| | | |
| | |
| | | Gravity = Gravity.CenterVertical, |
| | | UnSelectedImagePath = "Item/Floor.png" |
| | | }; |
| | | topFrameLayout.AddChidren(floor); |
| | | |
| | | floorBtn = new Button |
| | | { |
| | |
| | | TextColor = ZigbeeColor.Current.GXCTextColor, |
| | | Text = Config.Instance.Home.GetCurrentFloorName |
| | | }; |
| | | topFrameLayout.AddChidren(floorBtn); |
| | | |
| | | if(Config.Instance.Home.FloorDics.Count>0) |
| | | { |
| | | topFrameLayout.AddChidren(floor); |
| | | topFrameLayout.AddChidren(floorBtn); |
| | | } |
| | | |
| | | |
| | | var messageBtn = new Button() |
| | | { |
| | |
| | | }; |
| | | AddChidren(roomPageView); |
| | | //与屏幕边框的边距 |
| | | roomPageView.RowPadding = Application.GetRealWidth(181); |
| | | roomPageView.TCBJ = Application.GetRealWidth(181); |
| | | //两个page之间的间距 |
| | | roomPageView.PagePadding = Application.GetRealWidth(69); |
| | | roomPageView.JMBJ = Application.GetRealWidth(69); |
| | | |
| | | //当前房间 |
| | | //Room.CurrentRoom = Room.CurrentRoom == null ? Room.Lists[0] : Room.CurrentRoom; |
| | |
| | | var home = new UserHomeView { }; |
| | | Instance.BodyView.AddChidren(home); |
| | | home.Show(); |
| | | |
| | | |
| | | } |
| | | else if (sender == Instance.categoryIMG || sender==Instance.categoryName) |
| | | { |
| | |
| | | /// 新发现的网关通知 |
| | | /// </summary> |
| | | public static Action<ZigBee.Device.ZbGateway> NewGateWayAction; |
| | | /// <summary>
|
| | | /// 上一次的住宅ID
|
| | | /// </summary> |
| | | private static string oldHomeID = string.Empty; |
| | | |
| | | public static void Init() |
| | | { |
| | |
| | | { |
| | | var gateWayList = new List<ZbGateway> { }; |
| | | var searchCount = 6; |
| | | var oldHomeID = string.Empty; |
| | | var broadBytes = new byte[44];// byteHomeId[0] ,//H |
| | | broadBytes[0] = 0xfe; |
| | | broadBytes[1] = 0x29; |
| | |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | |
| | | /// <summary>
|
| | | /// 重新搜索,注意:调用该方法,则促使全部网关的mqtt全部断开,然后重新搜索(可能会有1秒延迟)
|
| | | /// </summary> |
| | | public static void ReSearch()
|
| | | {
|
| | | //为了那么多少万分之一的几率,这里设置成别的另一类的值
|
| | | oldHomeID = "**";
|
| | | } |
| | | |
| | | /// <summary> |
| | | /// 接收处理UDP数据包 |
| | |
| | | public List<string> HomeFilePathList = new List<string> { }; |
| | | |
| | | public string HomeId = string.Empty;
|
| | | |
| | |
|
| | | [Newtonsoft.Json.JsonIgnore] |
| | | private House m_Home = null; |
| | | /// <summary> |
| | |
| | | /// 0:移除成功(该状态只适用用于跨网关绑定、绑定场景、失效设备(设备已经从网关的设备列表中删除)。同网关设备间的解除绑定需要节点设备的确认成功信息,不会直接反馈成功。) |
| | | ///<para>1:失败,设备不在绑定列表中</para> |
| | | ///<para>3:失败,在等待节点设备确认是否解除绑定成功(当网关还在等待某节点设备确认是否解除绑定成功的反馈信息时,客户端再次发送解除绑定该节点设备的指令,将反馈该状态。)</para> |
| | | ///<para>4:未知,由节点设备反馈发送“Bind/RemoveBindResult”主题消息确定是否成功。</para> |
| | | ///<para>2:未知,由节点设备反馈发送“Bind/RemoveBindResult”主题消息确定是否成功。</para> |
| | | /// </summary> |
| | | public int Result; |
| | | |
old mode 100644
new mode 100755
| | |
| | | public const int Favorite = 10001; |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 手机号 |
| | | /// </summary> |
| | |
| | | /// 确定 |
| | | /// </summary> |
| | | public const int Confrim = 10115; |
| | | /// <summary> |
| | | /// 该账号已注册,可直接登录 |
| | | /// </summary> |
| | | public const int AccountHasBeenRegistered = 10116; |
| | | /// <summary> |
| | | /// 该用户已存在,可直接登录 |
| | | /// </summary> |
| | | public const int AccountHasBeenRegistered = 10116; |
| | | /// <summary> |
| | | /// 提供的参数错误 |
| | | /// </summary> |
| | | public const int PARAMETEROREMPTY = 10117; |
| | | /// <summary> |
| | | /// 确认密码不一致,请重新输入 |
| | | /// </summary> |
| | | public const int TwoPasswordInconsistency = 10118; |
| | | /// <summary> |
| | | /// 两次密码不一致 |
| | | /// </summary> |
| | | public const int TwoPasswordInconsistency = 10118; |
| | | /// <summary> |
| | | /// 验证码错误 |
| | | /// 验证码错误,请重新输入 |
| | | /// </summary> |
| | | public const int VALIDCODEANDPHONENOEQUAL = 10119; |
| | | /// <summary> |
| | |
| | | /// <summary> |
| | | /// 手机号错误,请重新输入 |
| | | /// </summary> |
| | | public const int ThePhoneError = 10139; |
| | | public const int ThePhoneError = 10139;
|
| | | /// <summary> |
| | | /// 请输入长度为6-13个字符的密码 |
| | | /// </summary> |
| | | public const int ThePWDLengthError = 10140; |
| | | /// <summary> |
| | | /// 你已被强制下线! |
| | | /// </summary> |