| | |
| | | 226=确认删除按键模式及{0}清空所有目标 |
| | | 227=清空所有目标 |
| | | 228=确认 |
| | | 229=分享成功 |
| | | 229=分配成功 |
| | | 230=确定要将该账户解冻? |
| | | 548=提醒设置 |
| | | 550=新增用户 |
| | |
| | | |
| | | |
| | | 5097=取消 |
| | | 5098=确认 |
| | | 5098=确定 |
| | | 5099=提示 |
| | | 5100=逻辑列表 |
| | | 5101=无 |
| | |
| | | 5138=时间条件 |
| | | 5139=条件 |
| | | 5140=推送设置 |
| | | 5141=推送开关 |
| | | 5141=推送消息 |
| | | 5142=自定义推送 |
| | | 5143=日出前 |
| | | 5144=日出后 |
| | |
| | | 5266=布防 |
| | | 5267=请选择布防或撤防为条件 |
| | | 5268=请选择安防类型 |
| | | 5269=有人 |
| | | 5269=检测有人时 |
| | | 5270=无人 |
| | | 5271=开启 |
| | | 5272=关闭 |
| | |
| | | 5280=立即执行 |
| | | 5281=时间范围 |
| | | 5282=自定义房间 |
| | | 5283=设置周期 |
| | | 5283=生效时间 |
| | | 5284=自动化 |
| | | 5285=自动化名称 |
| | | 5286=如果 |
| | |
| | | 5370=请选择用户,否则无法执行下一步. |
| | | 5371=请选择场景,否则无法执行下一步. |
| | | 5372=请选择安防模式,否则无法执行下一步. |
| | | 5373=自动化已执行. |
| | | 5373=已执行. |
| | | 5374=添加传感器 |
| | | 5375=添加开关/灯光 |
| | | 5376=应用 |
| | | 5377=没有自动化{\r\n} 请点击右上角添加 |
| | | 5378=推送内容不能为空. |
| | | 5379=暂无门锁联动事件{\r\n} 请点击右上角添加 |
| | | |
| | | |
| | | |
| | |
| | | 11001=场景 |
| | | 11002=自动化 |
| | | |
| | | 11010=没有功能 {\r\n} 请在个人中心中--设备管理处添加 |
| | | 11010=没有功能 {\r\n} 请在个人中心--设备管理处添加 |
| | | 11011=编辑 |
| | | 11012=设置功能 |
| | | 11013=信息编辑 |
| | |
| | | 15920=邮箱地址 |
| | | 15921=请输入您的邮箱地址 |
| | | 15922=提交 |
| | | 15923=提交成功,感谢您的意见 |
| | | 15923=您的反馈已成功提交 |
| | | 15924=上传 |
| | | 15925=自动备份 |
| | | 15926=今日提交次数已上限 |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="2019123101" android:installLocation="auto" android:versionName="1.0.19123101"> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="2020010601" android:installLocation="auto" android:versionName="1.0.20010601"> |
| | | <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" /> |
| | |
| | | 226=确认删除按键模式及{0}清空所有目标 |
| | | 227=清空所有目标 |
| | | 228=确认 |
| | | 229=分享成功 |
| | | 229=分配成功 |
| | | 230=确定要将该账户解冻? |
| | | 548=提醒设置 |
| | | 550=新增用户 |
| | |
| | | |
| | | |
| | | 5097=取消 |
| | | 5098=确认 |
| | | 5098=确定 |
| | | 5099=提示 |
| | | 5100=逻辑列表 |
| | | 5101=无 |
| | |
| | | 5138=时间条件 |
| | | 5139=条件 |
| | | 5140=推送设置 |
| | | 5141=推送开关 |
| | | 5141=推送消息 |
| | | 5142=自定义推送 |
| | | 5143=日出前 |
| | | 5144=日出后 |
| | |
| | | 5266=布防 |
| | | 5267=请选择布防或撤防为条件 |
| | | 5268=请选择安防类型 |
| | | 5269=有人 |
| | | 5269=检测有人时 |
| | | 5270=无人 |
| | | 5271=开启 |
| | | 5272=关闭 |
| | |
| | | 5280=立即执行 |
| | | 5281=时间范围 |
| | | 5282=自定义房间 |
| | | 5283=设置周期 |
| | | 5283=生效时间 |
| | | 5284=自动化 |
| | | 5285=自动化名称 |
| | | 5286=如果 |
| | |
| | | 5370=请选择用户,否则无法执行下一步. |
| | | 5371=请选择场景,否则无法执行下一步. |
| | | 5372=请选择安防模式,否则无法执行下一步. |
| | | 5373=自动化已执行. |
| | | 5373=已执行. |
| | | 5374=添加传感器 |
| | | 5375=添加开关/灯光 |
| | | 5376=应用 |
| | | 5377=没有自动化{\r\n} 请点击右上角添加 |
| | | 5378=推送内容不能为空. |
| | | 5379=暂无门锁联动事件{\r\n} 请点击右上角添加 |
| | | |
| | | |
| | | |
| | |
| | | 11001=场景 |
| | | 11002=自动化 |
| | | |
| | | 11010=没有功能 {\r\n} 请在个人中心中--设备管理处添加 |
| | | 11010=没有功能 {\r\n} 请在个人中心--设备管理处添加 |
| | | 11011=编辑 |
| | | 11012=设置功能 |
| | | 11013=信息编辑 |
| | |
| | | 15920=邮箱地址 |
| | | 15921=请输入您的邮箱地址 |
| | | 15922=提交 |
| | | 15923=提交成功,感谢您的意见 |
| | | 15923=您的反馈已成功提交 |
| | | 15924=上传 |
| | | 15925=自动备份 |
| | | 15926=今日提交次数已上限 |
| | |
| | | /// <summary> |
| | | /// 版本号 |
| | | /// </summary> |
| | | public static string CodeIDString = "1.0.19123101"; |
| | | public static string CodeIDString = "1.0.20010601"; |
| | | /// <summary> |
| | | /// 注册来源(0:HDL On 1:Zigbee) |
| | | /// </summary> |
| | |
| | | } |
| | | return null; |
| | | } |
| | | else if (device.Type == DeviceType.TemperatureSensor) |
| | | { |
| | | var tempera = CommonDevice as TemperatureSensor; |
| | | if(tempera.SensorDiv==1) |
| | | { |
| | | if (tempera.Temperatrue == 0) |
| | | { |
| | | return "--℃"; |
| | | } |
| | | return $"{tempera.Temperatrue}℃"; |
| | | } |
| | | else if(tempera.SensorDiv==2) |
| | | { |
| | | if (tempera.Humidity == 0) |
| | | { |
| | | return "--%"; |
| | | } |
| | | return $"{tempera.Humidity}%"; |
| | | } |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | return null; |
| | |
| | | /// </summary> |
| | | public Dictionary<string,string> FloorDics = new Dictionary<string,string> { }; |
| | | /// <summary> |
| | | /// 当前楼层 |
| | | /// 当前楼层Id |
| | | /// </summary> |
| | | public string CurrentFloorId; |
| | | |
| | |
| | | |
| | | /// <summary>
|
| | | /// 温度传感器(设备主键)
|
| | | /// </summary> |
| | | /// </summary> |
| | | public string TemperatrueDevice = string.Empty; |
| | | /// <summary>
|
| | | /// 湿度传感器(设备主键)
|
| | |
| | | /// <summary> |
| | | /// 温度 |
| | | /// </summary> |
| | | public double Temperatrue; |
| | | public decimal Temperatrue; |
| | | /// <summary> |
| | | /// 湿度 |
| | | /// </summary> |
| | | public double Humidity; |
| | | public decimal Humidity; |
| | | |
| | | /// <summary>
|
| | | /// 当前选择的房间
|
| | |
| | | room.Name = $"{room.Name}"; |
| | | } |
| | | Lists.Add(room); |
| | | |
| | | |
| | | } |
| | | } |
| | | Config.Instance.Home.InitFloor(); |
| | |
| | | /// <param name="addCommons">Add commons.</param> |
| | | public async System.Threading.Tasks.Task<int> ModifyScene(SceneUI sceneUI, Scene.SceneRemoveMemberData sceneRemoveMemberData, List<Scene.AddSceneMemberData> addCommons) |
| | | { |
| | | if (AllRoomSceneUIList.Find(s => s.Name == sceneUI.Name) == null) |
| | | { |
| | | return 0; |
| | | } |
| | | //if (AllRoomSceneUIList.Find(s => s.Name == sceneUI.Name) == null) |
| | | //{ |
| | | // return 0; |
| | | //} |
| | | |
| | | bool result = true; |
| | | //移除成员 返回结果 |
| | |
| | | SceneUIList.Remove(sceneUI); |
| | | SceneUIFilePathList.Remove(sceneUI.FileName); |
| | | Save(); |
| | | if (IsLove == false) |
| | | { |
| | | if (CurrentRoom.GetLoveRoom().SceneUIList.Find((obj) => obj.Id == sceneUI.Id) != null) |
| | | { |
| | | CurrentRoom.GetLoveRoom().DeleteScene(sceneUI); |
| | | } |
| | | } |
| | | Global.DeleteFilebyHomeId(sceneUI.FileName); |
| | | HdlAutoBackupLogic.DeleteFile(sceneUI.FileName); |
| | | } |
| | |
| | | /// </summary> |
| | | public uint GXCSeekBarBackground = 0xFFF5F5F5; |
| | | /// <summary> |
| | | /// 用于空调的选中文字颜色 |
| | | /// 用于空调风速的选中文字颜色 |
| | | /// 0xFF99D619 |
| | | /// </summary> |
| | | public uint GXCACSelectedTextColor = 0xFF99D619; |
| | | public uint GXCACSelectedTextColor_FanModel = 0xFF99D619; |
| | | /// <summary> |
| | | /// 开始颜色 |
| | | /// 用于空调扫风的选中文字颜色 |
| | | /// 0xFF8162FE |
| | | /// </summary> |
| | | public uint GXCACSelectedTextColor2 = 0xFF8162FE; |
| | | /// <summary> |
| | | /// 用于空调模式的选中文字颜色 |
| | | /// 0xFF445BF9 |
| | | /// </summary> |
| | | public uint GXCACSelectedTextColor_Cool = 0xFF445BF9; |
| | | /// <summary> |
| | | /// 用于空调模式的选中文字颜色 |
| | | /// 0xFFFB744A |
| | | /// </summary> |
| | | public uint GXCACSelectedTextColor_Heat = 0xFFFB744A; |
| | | /// <summary> |
| | | /// 用于空调模式的选中文字颜色 |
| | | /// 0xFFFFB400 |
| | | /// </summary> |
| | | public uint GXCACSelectedTextColor_Dry = 0xFFFFB400; |
| | | /// <summary> |
| | | /// 用于空调模式的选中文字颜色 |
| | | /// 0xFF99D619 |
| | | /// </summary> |
| | | public uint GXCACSelectedTextColor_Fan = 0xFF99D619; |
| | | |
| | | /// <summary> |
| | | /// 开始颜色 0xFF495AF4 |
| | | /// </summary> |
| | | public uint GXCArcScaleSeekBarStartColor = 0xFF495AF4; |
| | | /// <summary> |
| | | /// 结束颜色 |
| | | /// 结束颜色 0xFFAE50A8 |
| | | /// </summary> |
| | | public uint GXCArcScaleSeekBarEndColor = 0xFFAE50A8; |
| | | |
| | | |
| | | |
| | | public uint GXCButtonBlueColor = 0xFF00AAF0; |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region --Logic定义的颜色-- |
| | |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Text = device.CommonDevice.DeviceEpointName, |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextSize = 15 |
| | | TextSize = 15, |
| | | IsBold=true |
| | | }; |
| | | itemView.AddChidren(deviceNameBtn); |
| | | |
| | |
| | | Height = Application.GetRealHeight(60), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | TextColor = ZigbeeColor.Current.GXCTextGrayColor, |
| | | Text = $"{Language.StringByID(R.MyInternationalizationString.Current)} {ac.currentLocalTemperature} ℃" |
| | | Text = $"{Language.StringByID(R.MyInternationalizationString.Current)} {ac.currentLocalTemperature} ℃", |
| | | TextSize=10 |
| | | }; |
| | | itemView.AddChidren(indoorTemperatureBtn); |
| | | |
| | |
| | | Width = Application.GetRealWidth(200), |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Text = ACControlBase.GetModeNameByModeId(ac.currentSystemMode) |
| | | Text = ACControlBase.GetModeNameByModeId(ac.currentSystemMode), |
| | | TextSize=12 |
| | | }; |
| | | itemView.AddChidren(currentModeBtn); |
| | | |
| | |
| | | Height = Application.GetRealHeight(50), |
| | | Text = room.Name, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.GXCTextWhiteColor |
| | | TextColor = ZigbeeColor.Current.GXCTextWhiteColor, |
| | | TextSize=12 |
| | | }; |
| | | itemView.AddChidren(roomName); |
| | | } |
| | |
| | | }; |
| | | closeBGview.AddChidren(changeFanModeBG); |
| | | |
| | | var changeFanModeFL = new FrameLayout() |
| | | var changeFanModeFL = new VerticalScrolViewLayout() |
| | | { |
| | | X = Application.GetRealWidth(600), |
| | | Y = Application.GetRealHeight(750), |
| | | Height = Application.GetRealHeight(600), |
| | | Width = Application.GetRealWidth(fanItem_Width), |
| | | Radius = CommonPage.BigFormRadius, |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor, |
| | | ScrollEnabled=false, |
| | | VerticalScrollBarEnabled=false |
| | | }; |
| | | closeBGview.AddChidren(changeFanModeFL); |
| | | |
| | |
| | | Height = Application.GetRealHeight(fanItem_Height), |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextID = R.MyInternationalizationString.SelectFanMode, |
| | | TextAlignment = TextAlignment.CenterLeft |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize=14, |
| | | IsBold=true |
| | | }; |
| | | changeFanModeFL.AddChidren(changeFanBtn); |
| | | |
| | | var fan_Low = new CommonForm.ACLeftIconButtonRowLayout() |
| | | { |
| | | Y = changeFanBtn.Bottom, |
| | | Width = Application.GetRealWidth(fanItem_Width), |
| | | Height = Application.GetRealHeight(fanItem_Height), |
| | | Tag = ZigBee.Device.AC.FanMode.Low |
| | | }; |
| | | changeFanModeFL.AddChidren(fan_Low); |
| | | var fan_Low = new LeftIconButtonRow(); |
| | | fan_Low.Tag = ZigBee.Device.AC.FanMode.Low; |
| | | fan_Low.Init("AC/Fan_Low.png", "AC/Fan_LowSelected.png", Language.StringByID(R.MyInternationalizationString.Fan_Low)); |
| | | fan_Low.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor, ZigbeeColor.Current.GXCACSelectedTextColor_FanModel); |
| | | changeFanModeFL.AddChidren(fan_Low); |
| | | |
| | | var fan_Middle = new CommonForm.ACLeftIconButtonRowLayout() |
| | | { |
| | | Y = fan_Low.Bottom, |
| | | Width = Application.GetRealWidth(fanItem_Width), |
| | | Height = Application.GetRealHeight(fanItem_Height), |
| | | Tag = ZigBee.Device.AC.FanMode.Medium |
| | | }; |
| | | changeFanModeFL.AddChidren(fan_Middle); |
| | | var fan_Middle = new LeftIconButtonRow(); |
| | | fan_Middle.Tag = ZigBee.Device.AC.FanMode.Medium; |
| | | fan_Middle.Init("AC/Fan_Middle.png", "AC/Fan_MiddleSelected.png", Language.StringByID(R.MyInternationalizationString.Fan_Middle)); |
| | | fan_Middle.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor, ZigbeeColor.Current.GXCACSelectedTextColor_FanModel); |
| | | changeFanModeFL.AddChidren(fan_Middle); |
| | | |
| | | var fan_Height = new CommonForm.ACLeftIconButtonRowLayout() |
| | | { |
| | | Y = fan_Middle.Bottom, |
| | | Width = Application.GetRealWidth(fanItem_Width), |
| | | Height = Application.GetRealHeight(fanItem_Height), |
| | | Tag = ZigBee.Device.AC.FanMode.High |
| | | }; |
| | | changeFanModeFL.AddChidren(fan_Height); |
| | | var fan_Height = new LeftIconButtonRow(); |
| | | fan_Height.Tag = ZigBee.Device.AC.FanMode.High; |
| | | fan_Height.Init("AC/Fan_Height.png", "AC/Fan_HeightSelected.png", Language.StringByID(R.MyInternationalizationString.Fan_Height), false); |
| | | fan_Height.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor, ZigbeeColor.Current.GXCACSelectedTextColor_FanModel); |
| | | changeFanModeFL.AddChidren(fan_Height); |
| | | |
| | | fan_Low.TitleButton.MouseUpEventHandler += ChangeFan_MouseUpEvent; |
| | | fan_Low.IconButton.MouseUpEventHandler += ChangeFan_MouseUpEvent; |
| | | |
| | | fan_Middle.TitleButton.MouseUpEventHandler += ChangeFan_MouseUpEvent; |
| | | fan_Middle.IconButton.MouseUpEventHandler += ChangeFan_MouseUpEvent; |
| | | |
| | | fan_Height.TitleButton.MouseUpEventHandler += ChangeFan_MouseUpEvent; |
| | | fan_Height.IconButton.MouseUpEventHandler += ChangeFan_MouseUpEvent; |
| | | fan_Low.ButtonClickEvent += ChangeFan_MouseUpEvent; |
| | | fan_Middle.ButtonClickEvent += ChangeFan_MouseUpEvent; |
| | | fan_Height.ButtonClickEvent += ChangeFan_MouseUpEvent; |
| | | |
| | | if (ACControlBase.IsOpen(ac)) |
| | | { |
| | | if (ac.currentFanMode == 1) |
| | | { |
| | | fan_Low.SetSelectedStatu(); |
| | | fan_Low.IsSelected=true; |
| | | } |
| | | else if (ac.currentFanMode == 2) |
| | | { |
| | | fan_Middle.SetSelectedStatu(); |
| | | fan_Middle.IsSelected=true; |
| | | } |
| | | else |
| | | { |
| | | fan_Height.SetSelectedStatu(); |
| | | fan_Height.IsSelected=true; |
| | | } |
| | | } |
| | | } |
| | |
| | | /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param> |
| | | private void ChangeFan_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs) |
| | | { |
| | | var tag = (sender as Button).Tag.ToString(); |
| | | var tag = (sender as LeftIconButtonRow).Tag.ToString(); |
| | | ZigBee.Device.AC.FanMode mode = ZigBee.Device.AC.FanMode.Low; |
| | | if (tag == "Low") |
| | | { |
| | |
| | | Y = Application.GetRealHeight(450), |
| | | Height = Application.GetRealHeight(900), |
| | | Width = Application.GetRealWidth(modeItem_Width), |
| | | Radius = CommonFormResouce.BigFormRadius, |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor, |
| | | //BackgroundIagePath="AC/SelectedModeBG.png" |
| | | ScrollEnabled = false, |
| | | VerticalScrollBarEnabled = false |
| | | }; |
| | | closeBGview.AddChidren(changeModeFL); |
| | | |
| | |
| | | Height = Application.GetRealHeight(modeItem_Height), |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextID = R.MyInternationalizationString.SelectMode, |
| | | TextAlignment = TextAlignment.CenterLeft |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 14, |
| | | IsBold = true |
| | | }; |
| | | changeModeFL.AddChidren(changeModeBtn); |
| | | |
| | | var mode_Auto = new CommonForm.ACLeftIconButtonRowLayout() |
| | | { |
| | | Y = changeModeBtn.Bottom, |
| | | Width = Application.GetRealWidth(modeItem_Width), |
| | | Height = Application.GetRealHeight(modeItem_Height), |
| | | Tag = ZigBee.Device.AC.AcMode.Auto |
| | | }; |
| | | var mode_Auto = new LeftIconButtonRow(); |
| | | mode_Auto.Tag = ZigBee.Device.AC.AcMode.Auto; |
| | | mode_Auto.Init("AC/Mode_Auto.png", "AC/Mode_AutoSelected.png", Language.StringByID(R.MyInternationalizationString.Mode_Auto)); |
| | | mode_Auto.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor, ZigbeeColor.Current.GXCTextBlackColor); |
| | | if (ac.listSupportMode[4] == 1) |
| | | { |
| | | changeModeFL.AddChidren(mode_Auto); |
| | | } |
| | | mode_Auto.Init("AC/Mode_Auto.png", "AC/Mode_AutoSelected.png", Language.StringByID(R.MyInternationalizationString.Mode_Auto)); |
| | | |
| | | var mode_Cool = new CommonForm.ACLeftIconButtonRowLayout() |
| | | { |
| | | Y = mode_Auto.Bottom, |
| | | Width = Application.GetRealWidth(modeItem_Width), |
| | | Height = Application.GetRealHeight(modeItem_Height), |
| | | Tag = ZigBee.Device.AC.AcMode.Cool |
| | | }; |
| | | var mode_Cool = new LeftIconButtonRow(); |
| | | mode_Cool.Tag = ZigBee.Device.AC.AcMode.Cool; |
| | | mode_Cool.Init("AC/Mode_Cool.png", "AC/Mode_CoolSelected.png", Language.StringByID(R.MyInternationalizationString.Mode_Cool)); |
| | | mode_Cool.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor, ZigbeeColor.Current.GXCACSelectedTextColor_Cool); |
| | | if (ac.listSupportMode[0] == 1) |
| | | { |
| | | changeModeFL.AddChidren(mode_Cool); |
| | | } |
| | | mode_Cool.Init("AC/Mode_Cool.png", "AC/Mode_CoolSelected.png", Language.StringByID(R.MyInternationalizationString.Mode_Cool)); |
| | | |
| | | var mode_Heat = new CommonForm.ACLeftIconButtonRowLayout() |
| | | { |
| | | Y = mode_Cool.Bottom, |
| | | Width = Application.GetRealWidth(modeItem_Width), |
| | | Height = Application.GetRealHeight(modeItem_Height), |
| | | Tag = ZigBee.Device.AC.AcMode.Heat |
| | | }; |
| | | var mode_Heat = new LeftIconButtonRow(); |
| | | mode_Heat.Tag = ZigBee.Device.AC.AcMode.Heat; |
| | | mode_Heat.Init("AC/Mode_Heat.png", "AC/Mode_HeatSelected.png", Language.StringByID(R.MyInternationalizationString.Mode_Heat)); |
| | | mode_Heat.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor, ZigbeeColor.Current.GXCACSelectedTextColor_Heat); |
| | | if (ac.listSupportMode[1] == 1) |
| | | { |
| | | changeModeFL.AddChidren(mode_Heat); |
| | | } |
| | | mode_Heat.Init("AC/Mode_Heat.png", "AC/Mode_HeatSelected.png", Language.StringByID(R.MyInternationalizationString.Mode_Heat)); |
| | | |
| | | var mode_Dry = new CommonForm.ACLeftIconButtonRowLayout() |
| | | { |
| | | Y = mode_Heat.Bottom, |
| | | Width = Application.GetRealWidth(modeItem_Width), |
| | | Height = Application.GetRealHeight(modeItem_Height), |
| | | Tag = ZigBee.Device.AC.AcMode.Dry |
| | | }; |
| | | var mode_Dry = new LeftIconButtonRow(); |
| | | mode_Dry.Tag = ZigBee.Device.AC.AcMode.Dry; |
| | | mode_Dry.Init("AC/Mode_Dry.png", "AC/Mode_DrySelected.png", Language.StringByID(R.MyInternationalizationString.Mode_Dry)); |
| | | mode_Dry.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor, ZigbeeColor.Current.GXCACSelectedTextColor_Dry); |
| | | if (ac.listSupportMode[3] == 1) |
| | | { |
| | | changeModeFL.AddChidren(mode_Dry); |
| | | } |
| | | mode_Dry.Init("AC/Mode_Dry.png", "AC/Mode_DrySelected.png", Language.StringByID(R.MyInternationalizationString.Mode_Dry)); |
| | | |
| | | var mode_Fan = new CommonForm.ACLeftIconButtonRowLayout() |
| | | { |
| | | Y = mode_Dry.Bottom, |
| | | Width = Application.GetRealWidth(modeItem_Width), |
| | | Height = Application.GetRealHeight(modeItem_Height), |
| | | Tag = ZigBee.Device.AC.AcMode.FanOnly |
| | | }; |
| | | var mode_Fan = new LeftIconButtonRow(); |
| | | mode_Fan.Tag = ZigBee.Device.AC.AcMode.FanOnly; |
| | | mode_Fan.Init("AC/Mode_Fan.png", "AC/Mode_FanSelected.png", Language.StringByID(R.MyInternationalizationString.Mode_FanOnly), false); |
| | | mode_Fan.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor, ZigbeeColor.Current.GXCACSelectedTextColor_Fan); |
| | | if (ac.listSupportMode[2] == 1) |
| | | { |
| | | changeModeFL.AddChidren(mode_Fan); |
| | | } |
| | | mode_Fan.Init("AC/Mode_Fan.png", "AC/Mode_FanSelected.png", Language.StringByID(R.MyInternationalizationString.Mode_FanOnly), false); |
| | | |
| | | |
| | | mode_Auto.TitleButton.MouseUpEventHandler += ChangeMode_MouseUpEvent; |
| | | mode_Auto.IconButton.MouseUpEventHandler += ChangeMode_MouseUpEvent; |
| | | |
| | | mode_Cool.TitleButton.MouseUpEventHandler += ChangeMode_MouseUpEvent; |
| | | mode_Cool.IconButton.MouseUpEventHandler += ChangeMode_MouseUpEvent; |
| | | |
| | | mode_Heat.TitleButton.MouseUpEventHandler += ChangeMode_MouseUpEvent; |
| | | mode_Heat.IconButton.MouseUpEventHandler += ChangeMode_MouseUpEvent; |
| | | |
| | | mode_Dry.TitleButton.MouseUpEventHandler += ChangeMode_MouseUpEvent; |
| | | mode_Dry.IconButton.MouseUpEventHandler += ChangeMode_MouseUpEvent; |
| | | |
| | | mode_Fan.TitleButton.MouseUpEventHandler += ChangeMode_MouseUpEvent; |
| | | mode_Fan.IconButton.MouseUpEventHandler += ChangeMode_MouseUpEvent; |
| | | mode_Auto.ButtonClickEvent += ChangeMode_MouseUpEvent; |
| | | mode_Cool.ButtonClickEvent += ChangeMode_MouseUpEvent; |
| | | mode_Heat.ButtonClickEvent += ChangeMode_MouseUpEvent; |
| | | mode_Dry.ButtonClickEvent += ChangeMode_MouseUpEvent; |
| | | mode_Fan.ButtonClickEvent += ChangeMode_MouseUpEvent; |
| | | |
| | | if (ACControlBase.IsOpen(ac)) |
| | | { |
| | | if (ac.currentSystemMode == 1) |
| | | { |
| | | mode_Auto.SetSelectedStatu(); |
| | | mode_Auto.IsSelected = true; |
| | | } |
| | | else if (ac.currentSystemMode == 3) |
| | | { |
| | | mode_Cool.SetSelectedStatu(); |
| | | mode_Cool.IsSelected = true; |
| | | } |
| | | else if (ac.currentSystemMode == 4) |
| | | { |
| | | mode_Heat.SetSelectedStatu(); |
| | | mode_Heat.IsSelected = true; |
| | | } |
| | | else if (ac.currentSystemMode == 8) |
| | | { |
| | | mode_Dry.SetSelectedStatu(); |
| | | mode_Dry.IsSelected = true; |
| | | } |
| | | else if (ac.currentSystemMode == 7) |
| | | { |
| | | mode_Fan.SetSelectedStatu(); |
| | | mode_Fan.IsSelected = true; |
| | | } |
| | | } |
| | | } |
| | |
| | | /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param> |
| | | private void ChangeMode_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs) |
| | | { |
| | | var tag = (sender as Button).Tag.ToString(); |
| | | var tag = (sender as LeftIconButtonRow).Tag.ToString(); |
| | | ZigBee.Device.AC.AcMode mode = ZigBee.Device.AC.AcMode.Cool; |
| | | |
| | | if (tag == "Auto") |
| | |
| | | }; |
| | | closeBGview.AddChidren(changeFanModeBG); |
| | | |
| | | var changeFanModeFL = new FrameLayout() |
| | | var changeFanModeFL = new VerticalScrolViewLayout() |
| | | { |
| | | X = Application.GetRealWidth(35), |
| | | Y = Application.GetRealHeight(297), |
| | | Height = Application.GetRealHeight(1050), |
| | | Width = Application.GetRealWidth(fanItem_Width), |
| | | Radius = CommonPage.BigFormRadius, |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor, |
| | | VerticalScrollBarEnabled = false, |
| | | ScrollEnabled = false |
| | | }; |
| | | closeBGview.AddChidren(changeFanModeFL); |
| | | |
| | |
| | | Height = Application.GetRealHeight(fanItem_Height), |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextID = R.MyInternationalizationString.SelectSwing, |
| | | TextAlignment = TextAlignment.CenterLeft |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 14, |
| | | IsBold = true |
| | | }; |
| | | changeFanModeFL.AddChidren(changeFanBtn); |
| | | |
| | | var swing_First = new CommonForm.ACLeftIconButtonRowLayout() |
| | | { |
| | | Y = changeFanBtn.Bottom, |
| | | Width = Application.GetRealWidth(fanItem_Width), |
| | | Height = Application.GetRealHeight(fanItem_Height), |
| | | Tag = ZigBee.Device.AC.FanSwingMode.First |
| | | }; |
| | | changeFanModeFL.AddChidren(swing_First); |
| | | var swing_First = new LeftIconButtonRow { }; |
| | | swing_First.Tag = ZigBee.Device.AC.FanSwingMode.First; |
| | | swing_First.Init("AC/Swing_1.png", "AC/Swing_1Selected.png", Language.StringByID(R.MyInternationalizationString.Swing_First)); |
| | | swing_First.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor, ZigbeeColor.Current.GXCACSelectedTextColor2); |
| | | changeFanModeFL.AddChidren(swing_First); |
| | | |
| | | var swing_Second = new CommonForm.ACLeftIconButtonRowLayout() |
| | | { |
| | | Y = swing_First.Bottom, |
| | | Width = Application.GetRealWidth(fanItem_Width), |
| | | Height = Application.GetRealHeight(fanItem_Height), |
| | | Tag = ZigBee.Device.AC.FanSwingMode.Second |
| | | }; |
| | | changeFanModeFL.AddChidren(swing_Second); |
| | | var swing_Second = new LeftIconButtonRow(); |
| | | swing_Second.Tag = ZigBee.Device.AC.FanSwingMode.Second; |
| | | swing_Second.Init("AC/Swing_2.png", "AC/Swing_2Selected.png", Language.StringByID(R.MyInternationalizationString.Swing_Second)); |
| | | swing_Second.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor, ZigbeeColor.Current.GXCACSelectedTextColor2); |
| | | changeFanModeFL.AddChidren(swing_Second); |
| | | |
| | | var swing_Thrid = new CommonForm.ACLeftIconButtonRowLayout() |
| | | { |
| | | Y = swing_Second.Bottom, |
| | | Width = Application.GetRealWidth(fanItem_Width), |
| | | Height = Application.GetRealHeight(fanItem_Height), |
| | | Tag = ZigBee.Device.AC.FanSwingMode.Thrid |
| | | }; |
| | | changeFanModeFL.AddChidren(swing_Thrid); |
| | | var swing_Thrid = new LeftIconButtonRow(); |
| | | swing_Thrid.Tag = ZigBee.Device.AC.FanSwingMode.Thrid; |
| | | swing_Thrid.Init("AC/Swing_3.png", "AC/Swing_3Selected.png", Language.StringByID(R.MyInternationalizationString.Swing_Thrid)); |
| | | swing_Thrid.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor, ZigbeeColor.Current.GXCACSelectedTextColor2); |
| | | changeFanModeFL.AddChidren(swing_Thrid); |
| | | |
| | | var swing_Fourth = new CommonForm.ACLeftIconButtonRowLayout() |
| | | { |
| | | Y = swing_Thrid.Bottom, |
| | | Width = Application.GetRealWidth(fanItem_Width), |
| | | Height = Application.GetRealHeight(fanItem_Height), |
| | | Tag = ZigBee.Device.AC.FanSwingMode.Fourth |
| | | }; |
| | | changeFanModeFL.AddChidren(swing_Fourth); |
| | | var swing_Fourth = new LeftIconButtonRow(); |
| | | swing_Fourth.Tag = ZigBee.Device.AC.FanSwingMode.Fourth; |
| | | swing_Fourth.Init("AC/Swing_4.png", "AC/Swing_4Selected.png", Language.StringByID(R.MyInternationalizationString.Swing_Fourth)); |
| | | swing_Fourth.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor, ZigbeeColor.Current.GXCACSelectedTextColor2); |
| | | changeFanModeFL.AddChidren(swing_Fourth); |
| | | |
| | | var swing_Fifth = new CommonForm.ACLeftIconButtonRowLayout() |
| | | { |
| | | Y = swing_Fourth.Bottom, |
| | | Width = Application.GetRealWidth(fanItem_Width), |
| | | Height = Application.GetRealHeight(fanItem_Height), |
| | | Tag = ZigBee.Device.AC.FanSwingMode.Fifth |
| | | }; |
| | | changeFanModeFL.AddChidren(swing_Fifth); |
| | | var swing_Fifth = new LeftIconButtonRow(); |
| | | swing_Fifth.Tag = ZigBee.Device.AC.FanSwingMode.Fifth; |
| | | swing_Fifth.Init("AC/Swing_5.png", "AC/Swing_5Selected.png", Language.StringByID(R.MyInternationalizationString.Swing_Fifth)); |
| | | swing_Fifth.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor, ZigbeeColor.Current.GXCACSelectedTextColor2); |
| | | changeFanModeFL.AddChidren(swing_Fifth); |
| | | |
| | | var swing_Auto = new CommonForm.ACLeftIconButtonRowLayout() |
| | | { |
| | | Y = swing_Fifth.Bottom, |
| | | Width = Application.GetRealWidth(fanItem_Width), |
| | | Height = Application.GetRealHeight(fanItem_Height), |
| | | Tag = ZigBee.Device.AC.FanSwingMode.Auto |
| | | }; |
| | | var swing_Auto = new LeftIconButtonRow(); |
| | | swing_Auto.Tag = ZigBee.Device.AC.FanSwingMode.Auto; |
| | | swing_Auto.Init("AC/Swing_Auto.png", "AC/Swing_AutoSelected.png", Language.StringByID(R.MyInternationalizationString.Swing_Auto), false); |
| | | swing_Auto.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor, ZigbeeColor.Current.GXCACSelectedTextColor2); |
| | | changeFanModeFL.AddChidren(swing_Auto); |
| | | swing_Auto.Init("AC/Swing_Auto.png", "AC/Swing_AutoSelected.png", Language.StringByID(R.MyInternationalizationString.Swing_Auto),false); |
| | | |
| | | |
| | | swing_First.TitleButton.MouseUpEventHandler += ChangeFanSwing_MouseUpEvent; |
| | | swing_First.IconButton.MouseUpEventHandler += ChangeFanSwing_MouseUpEvent; |
| | | |
| | | swing_Second.TitleButton.MouseUpEventHandler += ChangeFanSwing_MouseUpEvent; |
| | | swing_Second.IconButton.MouseUpEventHandler += ChangeFanSwing_MouseUpEvent; |
| | | |
| | | swing_Thrid.TitleButton.MouseUpEventHandler += ChangeFanSwing_MouseUpEvent; |
| | | swing_Thrid.IconButton.MouseUpEventHandler += ChangeFanSwing_MouseUpEvent; |
| | | |
| | | swing_Fourth.TitleButton.MouseUpEventHandler += ChangeFanSwing_MouseUpEvent; |
| | | swing_Fourth.IconButton.MouseUpEventHandler += ChangeFanSwing_MouseUpEvent; |
| | | |
| | | swing_Fifth.TitleButton.MouseUpEventHandler += ChangeFanSwing_MouseUpEvent; |
| | | swing_Fifth.IconButton.MouseUpEventHandler += ChangeFanSwing_MouseUpEvent; |
| | | |
| | | swing_Auto.TitleButton.MouseUpEventHandler += ChangeFanSwing_MouseUpEvent; |
| | | swing_Auto.IconButton.MouseUpEventHandler += ChangeFanSwing_MouseUpEvent; |
| | | swing_First.ButtonClickEvent += ChangeFanSwing_MouseUpEvent; |
| | | swing_Second.ButtonClickEvent += ChangeFanSwing_MouseUpEvent; |
| | | swing_Thrid.ButtonClickEvent += ChangeFanSwing_MouseUpEvent; |
| | | swing_Fourth.ButtonClickEvent += ChangeFanSwing_MouseUpEvent; |
| | | swing_Fifth.ButtonClickEvent += ChangeFanSwing_MouseUpEvent; |
| | | swing_Auto.ButtonClickEvent += ChangeFanSwing_MouseUpEvent; |
| | | |
| | | if (ACControlBase.IsOpen(ac)) |
| | | { |
| | | if (ac.currentFanSwingMode == 0) |
| | | { |
| | | swing_First.SetSelectedStatu(); |
| | | swing_First.IsSelected = true; |
| | | } |
| | | else if (ac.currentFanSwingMode == 1) |
| | | { |
| | | swing_Second.SetSelectedStatu(); |
| | | swing_Second.IsSelected = true; |
| | | } |
| | | else if (ac.currentFanSwingMode == 2) |
| | | { |
| | | swing_Thrid.SetSelectedStatu(); |
| | | swing_Thrid.IsSelected = true; |
| | | } |
| | | else if (ac.currentFanSwingMode == 3) |
| | | { |
| | | swing_Fourth.SetSelectedStatu(); |
| | | swing_Fourth.IsSelected = true; |
| | | } |
| | | else if (ac.currentFanSwingMode == 4) |
| | | { |
| | | swing_Fifth.SetSelectedStatu(); |
| | | swing_Fifth.IsSelected = true; |
| | | } |
| | | else if (ac.currentFanSwingMode == 7) |
| | | { |
| | | swing_Auto.SetSelectedStatu(); |
| | | swing_Auto.IsSelected = true; |
| | | } |
| | | } |
| | | } |
| | |
| | | /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param> |
| | | private void ChangeFanSwing_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs) |
| | | { |
| | | var tag = (sender as Button).Tag.ToString(); |
| | | var tag = (sender as LeftIconButtonRow).Tag.ToString(); |
| | | ZigBee.Device.AC.FanSwingMode mode = ZigBee.Device.AC.FanSwingMode.Auto; |
| | | if (tag == "First") |
| | | { |
| | |
| | | UserView.HomePage.Instance.AddChidren(detailInfo); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | detailInfo.Show(device, room); |
| | | detailInfo.action = () => |
| | | detailInfo.EditAction = (d,r) => |
| | | { |
| | | Show(device, room); |
| | | }; |
| | |
| | | |
| | | phoneEmailForm = new PhoneEmailForm(); |
| | | phoneEmailForm.Init(midFrameLayout); |
| | | |
| | | |
| | | |
| | | //错误提示Btn |
| | | loginErrorBtn = new Button() |
| | |
| | | if (string.IsNullOrEmpty(account) == false && AccountLogic.Instance.CheckEmail(account) == true) |
| | | { |
| | | SelectPhoneOrEmail_MouseUpEvent(phoneEmailForm.SelectedEmail, null); |
| | | this.account = string.Empty; |
| | | } |
| | | else |
| | | { |
| | | this.account = string.Empty; |
| | | } |
| | | } |
| | | |
| | |
| | | private void Pwd_TextChange(object sender,string mouseEventArgs) |
| | | { |
| | | loginErrorBtn.Text = string.Empty; |
| | | if (1 <= pwdRow.PasswrodET.Text.Trim().Length && pwdRow.PasswrodET.Text.Trim().Length <= 16 && (phoneRow.AccountET.Text.Trim().Length > 0 || emailRow.AccountET.Text.Trim().Length>0)) |
| | | if (1 <= pwdRow.PasswrodET.Text.Trim().Length && pwdRow.PasswrodET.Text.Trim().Length <= 16 && (phoneRow.AccountET.Text.Trim().Length > 0 || emailRow?.AccountET.Text.Trim().Length>0)) |
| | | { |
| | | loginBtn.Enable = loginBtn.IsSelected = true; |
| | | } |
| | |
| | | { |
| | | pwdRow.PasswrodET.Text = mouseEventArgs.Remove(16); |
| | | } |
| | | else if (pwdRow.PasswrodET.Text.Trim().Length > 16 && phoneRow.AccountET.Text.Trim().Length > 0) |
| | | else if (pwdRow.PasswrodET.Text.Trim().Length > 16 && (phoneRow.AccountET.Text.Trim().Length > 0 || emailRow?.AccountET.Text.Trim().Length > 0)) |
| | | { |
| | | loginBtn.Enable = loginBtn.IsSelected = true; |
| | | pwdRow.PasswrodET.Text = mouseEventArgs.Remove(16); |
| | |
| | | accountFL.AddChidren(accountLine); |
| | | |
| | | AccountET.FoucsChanged += Text_FoucesChangeEvent; |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | using Shared.Phone.Device.AC; |
| | | using Shared.Phone.UserCenter.DoorLock; |
| | | using Shared.Phone.Device.DeviceLogic; |
| | | using Shared.Phone.UserCenter; |
| | | |
| | | namespace Shared.Phone.Device.Category |
| | | { |
| | |
| | | /// <summary> |
| | | /// low_High |
| | | /// </summary> |
| | | private const int low_High= 127; |
| | | private const int low_High = 127; |
| | | /// <summary> |
| | | /// 功能 |
| | | /// </summary> |
| | |
| | | /// sceneList |
| | | /// </summary> |
| | | private List<SceneUI> sceneList; |
| | | /// <summary> |
| | | /// 当前选中房间 |
| | | /// </summary> |
| | | private Common.Room curRoom; |
| | | #endregion |
| | | |
| | | #region ◆ 接口____________________________ |
| | |
| | | var attriButeList = common.DeviceStatusReport.AttriBute; |
| | | var ac = deviceUI.CommonDevice as ZigBee.Device.AC; |
| | | ac.DeviceStatusReport = common.DeviceStatusReport; |
| | | foreach(var attList in attriButeList) |
| | | foreach (var attList in attriButeList) |
| | | { |
| | | var curTemp = (attList.AttriButeData / 100 < ACControlBase.Temperature_High && attList.AttriButeData / 100 > ACControlBase.Temperature_Low) ? attList.AttriButeData / 100 : ACControlBase.Temperature_Default; |
| | | switch (attList.AttributeId) |
| | |
| | | var ac = deviceUI.CommonDevice as ZigBee.Device.AC; |
| | | var attriButeList = common.DeviceStatusReport.AttriBute; |
| | | ac.DeviceStatusReport = common.DeviceStatusReport; |
| | | foreach(var attList in attriButeList) |
| | | foreach (var attList in attriButeList) |
| | | { |
| | | switch (attList.AttributeId) |
| | | { |
| | |
| | | { |
| | | deviceUI.CommonDevice.IsOnline = 1; |
| | | deviceUI.CommonDevice.LastDateTime = DateTime.Now; |
| | | } |
| | | break; |
| | | |
| | | case DeviceType.TemperatureSensor: |
| | | //温度 |
| | | if (common.DeviceStatusReport.CluterID == 1026) |
| | | { |
| | | var tempera = deviceUI.CommonDevice as TemperatureSensor; |
| | | foreach (var data in common.DeviceStatusReport.AttriBute) |
| | | { |
| | | if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue) |
| | | { |
| | | if (data.AttriButeData == 0) |
| | | { |
| | | tempera.Temperatrue = 0; |
| | | } |
| | | else if (data.AttriButeData > 32767) |
| | | { |
| | | //负数(特殊处理) |
| | | string strValue = (data.AttriButeData - 65536).ToString(); |
| | | //小数点需要一位 |
| | | strValue = strValue.Substring(0, strValue.Length - 1); |
| | | tempera.Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); |
| | | } |
| | | else |
| | | { |
| | | //小数点需要一位 |
| | | string strValue = data.AttriButeData.ToString(); |
| | | strValue = strValue.Substring(0, strValue.Length - 1); |
| | | tempera.Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); |
| | | } |
| | | var row = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | } |
| | | } |
| | | } |
| | | //湿度 |
| | | if (common.DeviceStatusReport.CluterID == 1029) |
| | | { |
| | | var tempera = deviceUI.CommonDevice as TemperatureSensor; |
| | | foreach (var data in common.DeviceStatusReport.AttriBute) |
| | | { |
| | | if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue) |
| | | { |
| | | if (data.AttriButeData == 0) |
| | | { |
| | | tempera.Humidity = 0; |
| | | } |
| | | else |
| | | { |
| | | //小数点需要一位(湿度没有负数) |
| | | string strValue = data.AttriButeData.ToString(); |
| | | strValue = strValue.Substring(0, strValue.Length - 1); |
| | | tempera.Humidity = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); |
| | | tempera.LastDateTime = DateTime.Now; |
| | | } |
| | | var row = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | } |
| | | } |
| | | } |
| | | break; |
| | | } |
| | |
| | | TextID = R.MyInternationalizationString.Category, |
| | | TextSize = 24, |
| | | TextColor = ZigbeeColor.Current.GXCTextDeepBlackColor, |
| | | IsBold=true |
| | | IsBold = true |
| | | }; |
| | | topView.AddChidren(title); |
| | | |
| | |
| | | functionBtn.SetTitle(R.MyInternationalizationString.Function); |
| | | functionBtn.X = sceneBtn.Right; |
| | | //自动化 |
| | | automationBtn = new ButtonLineForm(CommonFormResouce.X_Left + 150 * 2 + 20+50, 34); |
| | | automationBtn = new ButtonLineForm(CommonFormResouce.X_Left + 150 * 2 + 20 + 50, 34); |
| | | automationBtn.Init(); |
| | | automationBtn.SetTitle(R.MyInternationalizationString.Automation); |
| | | automationBtn.X = functionBtn.Right; |
| | |
| | | Gravity = Gravity.CenterVertical, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextSize=14, |
| | | IsBold=true |
| | | TextSize = 14, |
| | | IsBold = true |
| | | }; |
| | | |
| | | selectFloorBtn = new Button() |
| | |
| | | addBtn.MouseUpEventHandler += AddBtn_MouseUpEventHandler; |
| | | |
| | | selectFloorBtn.MouseUpEventHandler += SelectedFloor_MouseUpEventHandler; |
| | | floorBtn.MouseUpEventHandler+= SelectedFloor_MouseUpEventHandler; |
| | | floorBtn.MouseUpEventHandler += SelectedFloor_MouseUpEventHandler; |
| | | |
| | | } |
| | | |
| | |
| | | /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param> |
| | | private void SelectedFloor_MouseUpEventHandler(object sender, MouseEventArgs mouseEventArgs) |
| | | { |
| | | var floors = new SelectFloor (); |
| | | var floors = new SelectFloor(); |
| | | AddChidren(floors); |
| | | floors.Init(580,330,Direction.Right); |
| | | floors.Init(580, 330, Direction.Right); |
| | | floors.changeFloor = true; |
| | | floors.FloorAction += (floorId) => |
| | | { |
| | | floorBtn.Text = Config.Instance.Home.GetFloorNameById(floorId); |
| | | Common.Room.CurrentRoom = Common.Room.CurrentRoom.GetLoveRoom(); |
| | | RefreshBodyView(); |
| | | }; |
| | | } |
| | |
| | | UserView.HomePage.Instance.AddChidren(scene); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | scene.Show(); |
| | | scene.AddAction = () => |
| | | { |
| | | ShowScene(); |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | var noFunction = new Button() |
| | | { |
| | | Y=Application.GetRealHeight(320), |
| | | Width=Application.GetMinRealAverage(757), |
| | | Y = Application.GetRealHeight(320), |
| | | Width = Application.GetMinRealAverage(757), |
| | | Height = Application.GetMinRealAverage(435), |
| | | UnSelectedImagePath="Item/NoFunction.png", |
| | | UnSelectedImagePath = "Item/NoFunction.png", |
| | | Gravity = Gravity.CenterHorizontal |
| | | }; |
| | | functionSceneBodyView.AddChidren(noFunction); |
| | |
| | | Height = Application.GetRealHeight(200), |
| | | Width = Application.GetRealWidth(700), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Text = Language.StringByID(R.MyInternationalizationString.NoFunction).Replace("{\\r\\n}","\r\n"), |
| | | Text = Language.StringByID(R.MyInternationalizationString.NoFunction).Replace("{\\r\\n}", "\r\n"), |
| | | TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | IsMoreLines=true |
| | | IsMoreLines = true |
| | | }; |
| | | functionSceneBodyView.AddChidren(noFunctionTip); |
| | | } |
| | |
| | | deviceListScrolView = new VerticalScrolViewLayout |
| | | { |
| | | X = Application.GetRealWidth(CommonFormResouce.X_Left), |
| | | Y = Application.GetRealHeight(35+279), |
| | | Y = Application.GetRealHeight(35 + 279), |
| | | Width = Application.GetRealWidth(1028), |
| | | Height = Application.GetRealHeight(942), |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor |
| | |
| | | deviceListScrolView.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft); |
| | | |
| | | tempFunctionTypeBtn = new FunctionButton(); |
| | | tempFunctionTypeBtn.Init("",""); |
| | | tempFunctionTypeBtn.Init("", ""); |
| | | |
| | | foreach (var deviceType in typeIdDic) |
| | | { |
| | |
| | | { |
| | | try |
| | | { |
| | | //删除设备 |
| | | EventHandler<MouseEventArgs> delEvent = (delSender, delE) => |
| | | var deviceTypeRowLayout = new RowLayout() |
| | | { |
| | | var alert = new CustomAlert(); |
| | | AddChidren(alert); |
| | | alert.Show(Language.StringByID(R.MyInternationalizationString.DeleteFunction)); |
| | | alert.ResultEventHandler += (e2) => |
| | | { |
| | | if (e2) |
| | | { |
| | | if(curRoom.IsLove) |
| | | { |
| | | Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName); |
| | | deviceListScrolView.RemoveViewByTag((delSender as Button).Tag); |
| | | sameTypeList.Remove(deviceUI); |
| | | } |
| | | else |
| | | { |
| | | Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.CommonDevice); |
| | | deviceListScrolView.RemoveViewByTag((delSender as Button).Tag); |
| | | sameTypeList.Remove(deviceUI); |
| | | } |
| | | //if (sameTypeList.Count == 0) |
| | | //{ |
| | | // RefreshBodyView(); |
| | | //} |
| | | } |
| | | }; |
| | | Height = Application.GetRealHeight(127 + 35), |
| | | LineColor = ZigbeeColor.Current.GXCClearColor, |
| | | Tag = deviceUI, |
| | | SubViewWidth=Application.GetRealWidth(184) |
| | | }; |
| | | EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) => |
| | | { |
| | | var detailInfo = new Device.CommonForm.DeviceDetailInfo { }; |
| | | UserView.HomePage.Instance.AddChidren(detailInfo); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom); |
| | | detailInfo.action = RefreshBodyView; |
| | | }; |
| | | deviceListScrolView.AddChidren(deviceTypeRowLayout); |
| | | |
| | | if (deviceUI.CommonDevice.Type == DeviceType.OnOffOutput) |
| | | { |
| | |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | var deviceTypeRowLayout = new RowLayout() |
| | | { |
| | | Height = Application.GetRealHeight(129 + 35), |
| | | LineColor = ZigbeeColor.Current.GXCBackgroundColor, |
| | | Tag = deviceUI |
| | | }; |
| | | deviceListScrolView.AddChidren(deviceTypeRowLayout); |
| | | |
| | | |
| | | var deviceRow = new CategoryFunctionRow(0, 35); |
| | | deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath); |
| | | deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); |
| | | //deviceRow.SetOnLineStatu(light.IsOnline == 1); |
| | | deviceRow.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | deviceRow.IsSelected = light.OnOffStatus == 1; |
| | | deviceTypeRowLayout.AddChidren(deviceRow); |
| | |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) => |
| | | { |
| | | if (deviceUI.CommonDevice.DfunctionType == DeviceFunctionType.A开关) |
| | |
| | | UserView.HomePage.Instance.AddChidren(lightControl); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | //lightControl.action = RefreshBodyView; |
| | | lightControl.Show(deviceUI, curRoom); |
| | | lightControl.Show(deviceUI, Common.Room.CurrentRoom); |
| | | } |
| | | else if (deviceUI.CommonDevice.DfunctionType == DeviceFunctionType.A插座) |
| | | { |
| | |
| | | UserView.HomePage.Instance.AddChidren(lightControl); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | //lightControl.action = RefreshBodyView; |
| | | lightControl.Show(deviceUI, curRoom); |
| | | lightControl.Show(deviceUI, Common.Room.CurrentRoom); |
| | | } |
| | | else |
| | | { |
| | |
| | | UserView.HomePage.Instance.AddChidren(lightControl); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | //lightControl.action = RefreshBodyView; |
| | | lightControl.Show(deviceUI, curRoom); |
| | | lightControl.Show(deviceUI, Common.Room.CurrentRoom); |
| | | } |
| | | }; |
| | | |
| | | EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) => |
| | | { |
| | | var detailInfo = new Device.CommonForm.DeviceDetailInfo { }; |
| | | UserView.HomePage.Instance.AddChidren(detailInfo); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom); |
| | | detailInfo.EditAction += (curDevice, curRoom) => |
| | | { |
| | | if (curRoom.Id != Common.Room.CurrentRoom.Id) |
| | | { |
| | | Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName); |
| | | deviceRow.RemoveFromParent(); |
| | | sameTypeList.Remove(deviceUI); |
| | | if (sameTypeList.Count == 0) |
| | | { |
| | | RefreshFunction(Common.Room.CurrentRoom); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath); |
| | | deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); |
| | | } |
| | | }; |
| | | }; |
| | | var editBtn = new CommonForm.RowLayoutEditButton() |
| | | { |
| | | Tag = deviceUI, |
| | | Radius = 0 |
| | | Tag = deviceUI |
| | | }; |
| | | var delBtn = new CommonForm.RowLayoutDeleteButton() |
| | | { |
| | | Tag = deviceUI, |
| | | Radius = 0 |
| | | }; |
| | | if (curRoom.IsSharedRoom == false) |
| | | if (Common.Room.CurrentRoom.IsSharedRoom == false) |
| | | { |
| | | deviceTypeRowLayout.AddRightView(editBtn); |
| | | editBtn.MouseUpEventHandler += deviceDetailHandler; |
| | | deviceTypeRowLayout.AddRightView(delBtn); |
| | | delBtn.MouseUpEventHandler += delEvent; |
| | | } |
| | | } |
| | | } |
| | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | var deviceTypeRowLayout = new RowLayout() |
| | | { |
| | | Height = Application.GetRealHeight(129 + 35), |
| | | LineColor = ZigbeeColor.Current.GXCBackgroundColor, |
| | | Tag = deviceUI |
| | | }; |
| | | deviceListScrolView.AddChidren(deviceTypeRowLayout); |
| | | |
| | | var deviceRow = new CategoryFunctionRow(0, 35); |
| | | deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath); |
| | | deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); |
| | | //deviceRow.SetOnLineStatu(airSwitch.IsOnline == 1); |
| | | deviceRow.IsSelected = airSwitch.OnOffStatus == 1; |
| | | deviceRow.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | deviceTypeRowLayout.AddChidren(deviceRow); |
| | | |
| | | deviceRow.SwitchBtn.MouseUpEventHandler += (send2, e2) => |
| | | { |
| | | zbGateway = deviceUI.CommonDevice.Gateway; |
| | |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) => |
| | | { |
| | | |
| | |
| | | UserView.HomePage.Instance.AddChidren(lightControl); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | //lightControl.action = RefreshBodyView; |
| | | lightControl.Show(deviceUI, curRoom); |
| | | lightControl.Show(deviceUI, Common.Room.CurrentRoom); |
| | | }; |
| | | |
| | | EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) => |
| | | { |
| | | var detailInfo = new Device.CommonForm.DeviceDetailInfo { }; |
| | | UserView.HomePage.Instance.AddChidren(detailInfo); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom); |
| | | detailInfo.EditAction += (curDevice, curRoom) => |
| | | { |
| | | if (curRoom.Id != Common.Room.CurrentRoom.Id) |
| | | { |
| | | Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName); |
| | | deviceRow.RemoveFromParent(); |
| | | sameTypeList.Remove(deviceUI); |
| | | if (sameTypeList.Count == 0) |
| | | { |
| | | RefreshFunction(Common.Room.CurrentRoom); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath); |
| | | deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); |
| | | } |
| | | }; |
| | | }; |
| | | var editBtn = new CommonForm.RowLayoutEditButton() |
| | | { |
| | | Tag = deviceUI, |
| | | Radius = 0 |
| | | Tag = deviceUI |
| | | }; |
| | | var delBtn = new CommonForm.RowLayoutDeleteButton() |
| | | { |
| | | Tag = deviceUI, |
| | | Radius = 0 |
| | | }; |
| | | if (curRoom.IsSharedRoom == false) |
| | | if (Common.Room.CurrentRoom.IsSharedRoom == false) |
| | | { |
| | | deviceTypeRowLayout.AddRightView(editBtn); |
| | | editBtn.MouseUpEventHandler += deviceDetailHandler; |
| | | deviceTypeRowLayout.AddRightView(delBtn); |
| | | delBtn.MouseUpEventHandler += delEvent; |
| | | } |
| | | } |
| | | } |
| | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | var deviceTypeRowLayout = new RowLayout() |
| | | { |
| | | Height = Application.GetRealHeight(129 + 35), |
| | | LineColor = ZigbeeColor.Current.GXCBackgroundColor, |
| | | Tag = deviceUI |
| | | }; |
| | | deviceListScrolView.AddChidren(deviceTypeRowLayout); |
| | | |
| | | var deviceRow = new CategoryFunctionRow(0, 35); |
| | | deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath); |
| | | deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); |
| | | //deviceRow.SetOnLineStatu(dimmableLight.IsOnline == 1); |
| | | deviceRow.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | deviceRow.IsSelected = dimmableLight.OnOffStatus == 1; |
| | | deviceTypeRowLayout.AddChidren(deviceRow); |
| | |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | UserView.HomePage.Instance.ScrollEnabled = false; |
| | | //dimmableLightControl.action = RefreshBodyView; |
| | | dimmableLightControl.Show(deviceUI, curRoom); |
| | | dimmableLightControl.Show(deviceUI, Common.Room.CurrentRoom); |
| | | }; |
| | | |
| | | EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) => |
| | | { |
| | | var detailInfo = new Device.CommonForm.DeviceDetailInfo { }; |
| | | UserView.HomePage.Instance.AddChidren(detailInfo); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom); |
| | | detailInfo.EditAction += (curDevice, curRoom) => |
| | | { |
| | | if (curRoom.Id != Common.Room.CurrentRoom.Id) |
| | | { |
| | | Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName); |
| | | deviceRow.RemoveFromParent(); |
| | | sameTypeList.Remove(deviceUI); |
| | | if (sameTypeList.Count == 0) |
| | | { |
| | | RefreshFunction(Common.Room.CurrentRoom); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath); |
| | | deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); |
| | | } |
| | | }; |
| | | }; |
| | | var editBtn = new CommonForm.RowLayoutEditButton() |
| | | { |
| | | Tag = deviceUI, |
| | | Radius = 0 |
| | | Tag = deviceUI |
| | | }; |
| | | var delBtn = new Device.CommonForm.RowLayoutDeleteButton() |
| | | { |
| | | Tag = deviceUI, |
| | | Radius = 0 |
| | | }; |
| | | if (curRoom.IsSharedRoom == false) |
| | | if (Common.Room.CurrentRoom.IsSharedRoom == false) |
| | | { |
| | | deviceTypeRowLayout.AddRightView(editBtn); |
| | | editBtn.MouseUpEventHandler += deviceDetailHandler; |
| | | deviceTypeRowLayout.AddRightView(delBtn); |
| | | delBtn.MouseUpEventHandler += delEvent; |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | var deviceTypeRowLayout = new RowLayout() |
| | | { |
| | | Height = Application.GetRealHeight(129 + 35), |
| | | LineColor = ZigbeeColor.Current.GXCBackgroundColor, |
| | | Tag = deviceUI |
| | | }; |
| | | deviceListScrolView.AddChidren(deviceTypeRowLayout); |
| | | |
| | | var deviceRow = new CategoryFunctionRow(0, 35); |
| | | deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath); |
| | |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | var editBtn = new CommonForm.RowLayoutEditButton() |
| | | { |
| | | Tag = deviceUI, |
| | | Radius = 0 |
| | | }; |
| | | var delBtn = new CommonForm.RowLayoutDeleteButton() |
| | | { |
| | | Tag = deviceUI, |
| | | Radius = 0 |
| | | }; |
| | | if (curRoom.IsSharedRoom == false) |
| | | { |
| | | deviceTypeRowLayout.AddRightView(editBtn); |
| | | editBtn.MouseUpEventHandler += deviceDetailHandler; |
| | | deviceTypeRowLayout.AddRightView(delBtn); |
| | | delBtn.MouseUpEventHandler += delEvent; |
| | | } |
| | | |
| | | deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) => |
| | | { |
| | | var acControl = new Phone.Device.AC.ACControl(); |
| | |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | UserView.HomePage.Instance.ScrollEnabled = false; |
| | | //rollerShadeControl.action = RefreshBodyView; |
| | | acControl.Show(deviceUI, curRoom); |
| | | acControl.Show(deviceUI, Common.Room.CurrentRoom); |
| | | }; |
| | | |
| | | EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) => |
| | | { |
| | | var detailInfo = new Device.CommonForm.DeviceDetailInfo { }; |
| | | UserView.HomePage.Instance.AddChidren(detailInfo); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom); |
| | | detailInfo.EditAction += (curDevice, curRoom) => |
| | | { |
| | | if (curRoom.Id != Common.Room.CurrentRoom.Id) |
| | | { |
| | | Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName); |
| | | deviceRow.RemoveFromParent(); |
| | | sameTypeList.Remove(deviceUI); |
| | | if (sameTypeList.Count == 0) |
| | | { |
| | | RefreshFunction(Common.Room.CurrentRoom); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath); |
| | | deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); |
| | | } |
| | | }; |
| | | }; |
| | | var editBtn = new CommonForm.RowLayoutEditButton() |
| | | { |
| | | Tag = deviceUI |
| | | }; |
| | | if (Common.Room.CurrentRoom.IsSharedRoom == false) |
| | | { |
| | | deviceTypeRowLayout.AddRightView(editBtn); |
| | | editBtn.MouseUpEventHandler += deviceDetailHandler; |
| | | } |
| | | } |
| | | } |
| | | else if (deviceUI.CommonDevice.Type == DeviceType.WindowCoveringDevice) |
| | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | var deviceTypeRowLayout = new RowLayout() |
| | | { |
| | | Height = Application.GetRealHeight(129 + 35), |
| | | LineColor = ZigbeeColor.Current.GXCBackgroundColor, |
| | | Tag = deviceUI |
| | | }; |
| | | deviceListScrolView.AddChidren(deviceTypeRowLayout); |
| | | |
| | | var deviceRow = new CategoryFunctionForWinRow(0, 35); |
| | | deviceRow.Init(deviceUI); |
| | | deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); |
| | | //deviceRow.SetOnLineStatu(rollerShade.IsOnline == 1); |
| | | deviceRow.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | deviceRow.IsSelected = rollerShade.WcdCurrentPositionLiftPercentage != 0; |
| | | deviceRow.SetRollerShadeIcon(rollerShade.WcdType); |
| | |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | |
| | | var editBtn = new CommonForm.RowLayoutEditButton() |
| | | { |
| | | Tag = deviceUI, |
| | | Radius = 0 |
| | | }; |
| | | var delBtn = new Device.CommonForm.RowLayoutDeleteButton() |
| | | { |
| | | Tag = deviceUI, |
| | | Radius = 0 |
| | | }; |
| | | if (curRoom.IsSharedRoom == false) |
| | | { |
| | | deviceTypeRowLayout.AddRightView(editBtn); |
| | | editBtn.MouseUpEventHandler += deviceDetailHandler; |
| | | deviceTypeRowLayout.AddRightView(delBtn); |
| | | delBtn.MouseUpEventHandler += delEvent; |
| | | } |
| | | |
| | | deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) => |
| | | { |
| | | var rollerShadeControl = new Phone.Device.Curtain.RollerShadeControl(); |
| | |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | UserView.HomePage.Instance.ScrollEnabled = false; |
| | | //rollerShadeControl.action = RefreshBodyView; |
| | | rollerShadeControl.Show(deviceUI, curRoom); |
| | | rollerShadeControl.Show(deviceUI, Common.Room.CurrentRoom); |
| | | }; |
| | | |
| | | EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) => |
| | | { |
| | | var detailInfo = new Device.CommonForm.DeviceDetailInfo { }; |
| | | UserView.HomePage.Instance.AddChidren(detailInfo); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom); |
| | | detailInfo.EditAction += (curDevice, curRoom) => |
| | | { |
| | | if (curRoom.Id != Common.Room.CurrentRoom.Id) |
| | | { |
| | | Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName); |
| | | deviceRow.RemoveFromParent(); |
| | | sameTypeList.Remove(deviceUI); |
| | | if (sameTypeList.Count == 0) |
| | | { |
| | | RefreshFunction(Common.Room.CurrentRoom); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath); |
| | | deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); |
| | | } |
| | | }; |
| | | }; |
| | | var editBtn = new CommonForm.RowLayoutEditButton() |
| | | { |
| | | Tag = deviceUI |
| | | }; |
| | | if (Common.Room.CurrentRoom.IsSharedRoom == false) |
| | | { |
| | | deviceTypeRowLayout.AddRightView(editBtn); |
| | | editBtn.MouseUpEventHandler += deviceDetailHandler; |
| | | } |
| | | |
| | | } |
| | | } |
| | | else if (deviceUI.CommonDevice.Type == DeviceType.DoorLock) |
| | | { |
| | | var deviceTypeRowLayout = new RowLayout() |
| | | { |
| | | Height = Application.GetRealHeight(129 + 35), |
| | | LineColor = ZigbeeColor.Current.GXCBackgroundColor, |
| | | Tag = deviceUI |
| | | }; |
| | | deviceListScrolView.AddChidren(deviceTypeRowLayout); |
| | | |
| | | var deviceRow = new CategoryFunctionRow(0, 35); |
| | | deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath); |
| | | deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); |
| | | //deviceRow.SetOnLineStatu(deviceUI.CommonDevice.IsOnline == 1); |
| | | deviceRow.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | deviceRow.HideSwitchBtn(true); |
| | | deviceTypeRowLayout.AddChidren(deviceRow); |
| | | |
| | | deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) => |
| | | { |
| | | var userDoorLockPage = new UserDoorLockPage(curRoom, deviceUI); |
| | | var userDoorLockPage = new UserDoorLockPage(Common.Room.CurrentRoom, deviceUI); |
| | | HomePage.Instance.AddChidren(userDoorLockPage); |
| | | HomePage.Instance.PageIndex += 1; |
| | | userDoorLockPage.Show(); |
| | | }; |
| | | |
| | | EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) => |
| | | { |
| | | var detailInfo = new Device.CommonForm.DeviceDetailInfo { }; |
| | | UserView.HomePage.Instance.AddChidren(detailInfo); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom); |
| | | detailInfo.EditAction += (curDevice, curRoom) => |
| | | { |
| | | if (curRoom.Id != Common.Room.CurrentRoom.Id) |
| | | { |
| | | Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName); |
| | | deviceRow.RemoveFromParent(); |
| | | sameTypeList.Remove(deviceUI); |
| | | if (sameTypeList.Count == 0) |
| | | { |
| | | RefreshFunction(Common.Room.CurrentRoom); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath); |
| | | deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); |
| | | } |
| | | }; |
| | | }; |
| | | var editBtn = new CommonForm.RowLayoutEditButton() |
| | | { |
| | | Tag = deviceUI |
| | | }; |
| | | var delBtn = new Device.CommonForm.RowLayoutDeleteButton() |
| | | { |
| | | Tag = deviceUI |
| | | }; |
| | | if (curRoom.IsSharedRoom == false) |
| | | if (Common.Room.CurrentRoom.IsSharedRoom == false) |
| | | { |
| | | deviceTypeRowLayout.AddRightView(editBtn); |
| | | editBtn.MouseUpEventHandler += deviceDetailHandler; |
| | | deviceTypeRowLayout.AddRightView(delBtn); |
| | | delBtn.MouseUpEventHandler += delEvent; |
| | | } |
| | | } |
| | | else if (deviceUI.CommonDevice.Type == DeviceType.IASZone) |
| | | { |
| | | var deviceTypeRowLayout = new RowLayout() |
| | | { |
| | | Height = Application.GetRealHeight(129 + 35), |
| | | LineColor = ZigbeeColor.Current.GXCBackgroundColor, |
| | | Tag = deviceUI |
| | | }; |
| | | deviceListScrolView.AddChidren(deviceTypeRowLayout); |
| | | |
| | | var deviceRow = new CategoryFunctionRow(0, 35); |
| | | deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath); |
| | | deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); |
| | |
| | | deviceRow.HideSwitchBtn(true); |
| | | deviceTypeRowLayout.AddChidren(deviceRow); |
| | | |
| | | EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) => |
| | | { |
| | | var detailInfo = new Device.CommonForm.DeviceDetailInfo { }; |
| | | UserView.HomePage.Instance.AddChidren(detailInfo); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom); |
| | | detailInfo.EditAction += (curDevice, curRoom) => |
| | | { |
| | | if (curRoom.Id != Common.Room.CurrentRoom.Id) |
| | | { |
| | | Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName); |
| | | deviceRow.RemoveFromParent(); |
| | | sameTypeList.Remove(deviceUI); |
| | | if (sameTypeList.Count == 0) |
| | | { |
| | | RefreshFunction(Common.Room.CurrentRoom); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath); |
| | | deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); |
| | | } |
| | | }; |
| | | }; |
| | | var editBtn = new CommonForm.RowLayoutEditButton() |
| | | { |
| | | Tag = deviceUI |
| | | }; |
| | | var delBtn = new Device.CommonForm.RowLayoutDeleteButton() |
| | | { |
| | | Tag = deviceUI |
| | | }; |
| | | if (curRoom.IsSharedRoom == false) |
| | | if (Common.Room.CurrentRoom.IsSharedRoom == false) |
| | | { |
| | | deviceTypeRowLayout.AddRightView(editBtn); |
| | | editBtn.MouseUpEventHandler += deviceDetailHandler; |
| | | deviceTypeRowLayout.AddRightView(delBtn); |
| | | delBtn.MouseUpEventHandler += delEvent; |
| | | } |
| | | } |
| | | else if (deviceUI.CommonDevice.Type == DeviceType.TemperatureSensor) |
| | | { |
| | | var tempera = deviceUI.CommonDevice as TemperatureSensor; |
| | | if (tempera.Gateway != null) |
| | | { |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(100 * i); |
| | | if (tempera.Gateway.IsVirtual) |
| | | { |
| | | UserHomeView.ReadStatus(tempera, () => |
| | | { |
| | | if (tempera.SensorDiv == 1) |
| | | { |
| | | ReadDeviceAttributeLogic.Instance.SendTemperatureStatuComand(deviceUI.CommonDevice); |
| | | } |
| | | else if (tempera.SensorDiv == 2) |
| | | { |
| | | ReadDeviceAttributeLogic.Instance.SendHumidityStatuComand(deviceUI.CommonDevice); |
| | | } |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | if (CommonPage.ReadDeviceStatuSpan < (DateTime.Now - tempera.LastDateTime).TotalSeconds) |
| | | { |
| | | if (tempera.SensorDiv == 1) |
| | | { |
| | | ReadDeviceAttributeLogic.Instance.SendTemperatureStatuComand(deviceUI.CommonDevice); |
| | | } |
| | | else if (tempera.SensorDiv == 2) |
| | | { |
| | | ReadDeviceAttributeLogic.Instance.SendHumidityStatuComand(deviceUI.CommonDevice); |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | var deviceRow = new CategoryFunctionRow(0, 35); |
| | | deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath); |
| | | deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); |
| | | deviceRow.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | deviceRow.IsSelected = false; |
| | | deviceRow.HideSwitchBtn(true); |
| | | deviceTypeRowLayout.AddChidren(deviceRow); |
| | | |
| | | EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) => |
| | | { |
| | | var detailInfo = new Device.CommonForm.DeviceDetailInfo { }; |
| | | UserView.HomePage.Instance.AddChidren(detailInfo); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom); |
| | | detailInfo.EditAction += (curDevice, curRoom) => |
| | | { |
| | | if (curRoom.Id != Common.Room.CurrentRoom.Id) |
| | | { |
| | | Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName); |
| | | deviceRow.RemoveFromParent(); |
| | | sameTypeList.Remove(deviceUI); |
| | | if (sameTypeList.Count == 0) |
| | | { |
| | | RefreshFunction(Common.Room.CurrentRoom); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath); |
| | | deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); |
| | | } |
| | | }; |
| | | }; |
| | | var editBtn = new CommonForm.RowLayoutEditButton() |
| | | { |
| | | Tag = deviceUI |
| | | }; |
| | | if (Common.Room.CurrentRoom.IsSharedRoom == false) |
| | | { |
| | | deviceTypeRowLayout.AddRightView(editBtn); |
| | | editBtn.MouseUpEventHandler += deviceDetailHandler; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | var deviceTypeRowLayout = new RowLayout() |
| | | { |
| | | Height = Application.GetRealHeight(129 + 35), |
| | | LineColor = ZigbeeColor.Current.GXCBackgroundColor, |
| | | Tag = deviceUI |
| | | }; |
| | | deviceListScrolView.AddChidren(deviceTypeRowLayout); |
| | | |
| | | var deviceRow = new CategoryFunctionRow(0, 35); |
| | | deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath); |
| | | deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); |
| | | //deviceRow.SetOnLineStatu(deviceUI.CommonDevice.IsOnline == 1); |
| | | deviceRow.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | deviceRow.HideSwitchBtn(true); |
| | | deviceTypeRowLayout.AddChidren(deviceRow); |
| | | |
| | | EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) => |
| | | { |
| | | var detailInfo = new Device.CommonForm.DeviceDetailInfo { }; |
| | | UserView.HomePage.Instance.AddChidren(detailInfo); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom); |
| | | detailInfo.EditAction += (curDevice, curRoom) => |
| | | { |
| | | if (curRoom.Id != Common.Room.CurrentRoom.Id) |
| | | { |
| | | Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName); |
| | | deviceRow.RemoveFromParent(); |
| | | sameTypeList.Remove(deviceUI); |
| | | if (sameTypeList.Count == 0) |
| | | { |
| | | RefreshFunction(Common.Room.CurrentRoom); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath); |
| | | deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); |
| | | } |
| | | }; |
| | | }; |
| | | var editBtn = new CommonForm.RowLayoutEditButton() |
| | | { |
| | | Tag = deviceUI |
| | | }; |
| | | var delBtn = new Device.CommonForm.RowLayoutDeleteButton() |
| | | { |
| | | Tag = deviceUI |
| | | }; |
| | | if (curRoom.IsSharedRoom == false) |
| | | if (Common.Room.CurrentRoom.IsSharedRoom == false) |
| | | { |
| | | deviceTypeRowLayout.AddRightView(editBtn); |
| | | editBtn.MouseUpEventHandler += deviceDetailHandler; |
| | | deviceTypeRowLayout.AddRightView(delBtn); |
| | | delBtn.MouseUpEventHandler += delEvent; |
| | | } |
| | | } |
| | | } |
| | | catch |
| | | { |
| | | |
| | | |
| | | //删除设备 |
| | | EventHandler<MouseEventArgs> delEvent = (delSender, delE) => |
| | | { |
| | | var alert = new UserCenter.ShowMsgControl(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.DeleteFunction)); |
| | | alert.Show(); |
| | | alert.ConfirmClickEvent += () => |
| | | { |
| | | if (Common.Room.CurrentRoom.IsLove) |
| | | { |
| | | Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName); |
| | | deviceListScrolView.RemoveViewByTag((delSender as Button).Tag); |
| | | sameTypeList.Remove(deviceUI); |
| | | } |
| | | else |
| | | { |
| | | Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.CommonDevice); |
| | | deviceListScrolView.RemoveViewByTag((delSender as Button).Tag); |
| | | sameTypeList.Remove(deviceUI); |
| | | if (Common.Room.CurrentRoom.GetLoveRoom().DeviceUIList.Find((obj) => obj.FileName == deviceUI.FileName) != null) |
| | | { |
| | | Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName); |
| | | } |
| | | } |
| | | if (sameTypeList.Count == 0) |
| | | { |
| | | RefreshBodyView(); |
| | | } |
| | | }; |
| | | }; |
| | | var delBtn = new CommonForm.RowLayoutDeleteButton() |
| | | { |
| | | Tag = deviceUI |
| | | }; |
| | | if (Common.Room.CurrentRoom.IsSharedRoom == false) |
| | | { |
| | | deviceTypeRowLayout.AddRightView(delBtn); |
| | | delBtn.MouseUpEventHandler += delEvent; |
| | | } |
| | | } |
| | | catch { } |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | |
| | | functionSceneBodyView = new FrameLayout() |
| | | { |
| | | Y = roomFL.Bottom, |
| | | Height = Application.GetRealHeight(973+279), |
| | | Height = Application.GetRealHeight(973 + 279), |
| | | BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor |
| | | }; |
| | | functionSceneAutoBodyView.AddChidren(functionSceneBodyView); |
| | | |
| | | RoomButton curBtn = new RoomButton(0,0); |
| | | RoomButton curBtn = new RoomButton(0, 0); |
| | | foreach (var room in Common.Room.CurrentRoom.GetRoomsByCurrentFloorIdAppendLoveRoom()) |
| | | { |
| | | var row = new FrameLayout() |
| | |
| | | roomBtn.SetTitle(room.Name); |
| | | row.AddChidren(roomBtn); |
| | | |
| | | if (room.IsLove) |
| | | if (room.Id == Common.Room.CurrentRoom.Id) |
| | | { |
| | | roomBtn.IsSelected = true; |
| | | this.curRoom = room; |
| | | curBtn = roomBtn; |
| | | if(sceneBtn.IsSelected) |
| | | if (sceneBtn.IsSelected) |
| | | { |
| | | RefreshScene(room); |
| | | } |
| | |
| | | RefreshFunction(room); |
| | | } |
| | | } |
| | | |
| | | roomBtn.ButtonClickEvent += (sender, e) => |
| | | { |
| | | if (sender == curBtn) |
| | | if (sender == curBtn) |
| | | { |
| | | return; |
| | | } |
| | | sender.IsSelected = true; |
| | | curBtn.IsSelected = false; |
| | | curBtn = sender; |
| | | this.curRoom = room; |
| | | Common.Room.CurrentRoom = room; |
| | | if (sceneBtn.IsSelected) |
| | | { |
| | | RefreshScene(room); |
| | |
| | | Height = Application.GetRealHeight(200), |
| | | Width = Application.GetRealWidth(700), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Text = Language.StringByID(R.MyInternationalizationString.NoScene).Replace("{\\r\\n}","\r\n"), |
| | | Text = Language.StringByID(R.MyInternationalizationString.NoScene).Replace("{\\r\\n}", "\r\n"), |
| | | TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | IsMoreLines = true |
| | |
| | | if (delayScenesListResponseInfo.ScenesId == sceneView.scene.Id) |
| | | { |
| | | sceneView.scene.RemainTime = delayScenesListResponseInfo.RemainTime; |
| | | var remainTime= delayScenesListResponseInfo.RemainTime; |
| | | var remainTime = delayScenesListResponseInfo.RemainTime; |
| | | if (remainTime > 0) |
| | | { |
| | | new System.Threading.Thread(() => |
| | |
| | | Common.Logic.CurrentLogic.IsEnable = 1;//默认为开 |
| | | if (logiciocnBtn.Tag.ToString() == "3") |
| | | { |
| | | Common.Logic.CurrentLogic.LogicName = logicnameBtn.Text;// Language.StringByID(MyInternationalizationString.automation1); |
| | | Common.Logic.CurrentLogic.LogicName = logicnameBtn.Text; |
| | | Common.Logic.CurrentLogic.LogicCustomPushText = Common.Logic.CurrentLogic.LogicName + Language.StringByID(MyInternationalizationString.defaulttext); |
| | | var addLogicPage = new Logic.AddLogicPage(); |
| | | HomePage.Instance.AddChidren(addLogicPage); |
| | | HomePage.Instance.PageIndex += 1; |
| | |
| | | { |
| | | |
| | | Common.Logic.CurrentLogic.LogicName = logicnameBtn.Text; |
| | | Common.Logic.CurrentLogic.LogicCustomPushText = Common.Logic.CurrentLogic.LogicName + Language.StringByID(MyInternationalizationString.defaulttext); |
| | | Logic.TemplatePage templatePage = new Logic.TemplatePage(); |
| | | Logic.TemplatePage.s = logiciocnBtn.Tag.ToString(); |
| | | HomePage.Instance.AddChidren(templatePage); |
| | |
| | | using Shared.Common; |
| | | using Shared.Phone.Device.CommonForm; |
| | | using Shared.Phone.Device.Room; |
| | | using Shared.Phone.UserCenter; |
| | | using static ZigBee.Device.Scene; |
| | | |
| | | namespace Shared.Phone.Device.Category |
| | |
| | | /// <summary> |
| | | /// 添加目标后的展示列表 |
| | | /// </summary> |
| | | public VerticalScrolViewLayout TargetListScrolView; |
| | | public FrameLayout TargetListScrolView; |
| | | /// <summary> |
| | | /// The confirm button. |
| | | /// </summary> |
| | |
| | | /// <summary> |
| | | /// selectedTimeAction |
| | | /// </summary> |
| | | public Action<SceneTargetDeviceUI> selectedAction; |
| | | |
| | | |
| | | private Action<SceneTargetDeviceUI> selectedAction; |
| | | /// <summary> |
| | | /// 修改场景action |
| | | /// </summary> |
| | | public Action<SceneUI, Common.Room> EditorAction; |
| | | /// <summary> |
| | | /// 添加场景action |
| | | /// </summary> |
| | | public Action AddAction; |
| | | |
| | | #endregion |
| | | |
| | |
| | | /// </summary> |
| | | public override void RemoveFromParent() |
| | | { |
| | | Category.instance?.RefreshBodyView(); |
| | | UserView.HomePage.Instance.ScrollEnabled = true; |
| | | base.RemoveFromParent(); |
| | | } |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public void RefreshTargetListView() |
| | | { |
| | | UserView.HomePage.Instance.ScrollEnabled = false; |
| | | TargetListScrolView.RemoveAll(); |
| | | TargetListScrolView.Height = Application.GetRealHeight(173); |
| | | var TargetListScrolBackView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(173), |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor |
| | | }; |
| | | TargetListScrolView.AddChidren(TargetListScrolBackView); |
| | | |
| | | if (sceneTargetDevicesList.Count > 0) |
| | | { |
| | | foreach (var targetDevice in sceneTargetDevicesList) |
| | | if (sceneTargetDevicesList.Count > 1) |
| | | { |
| | | TargetListScrolView.Height = Application.GetRealHeight(140 * sceneTargetDevicesList.Count) + Application.GetRealHeight(200); |
| | | TargetListScrolBackView.Height = Application.GetRealHeight(140 * sceneTargetDevicesList.Count + 13); |
| | | } |
| | | |
| | | for (int i = 0; i < sceneTargetDevicesList.Count; i++) |
| | | { |
| | | var targetDevice = sceneTargetDevicesList[i]; |
| | | var targetRowLayout = new RowLayout() |
| | | { |
| | | Height = Application.GetRealHeight(160), |
| | | LineColor = ZigbeeColor.Current.GXCBackgroundColor, |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor |
| | | Y = Application.GetRealHeight(i * 140), |
| | | Height = Application.GetRealHeight(140), |
| | | LineColor = ZigbeeColor.Current.GXCClearColor, |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor, |
| | | SubViewWidth = Application.GetRealWidth(184) |
| | | }; |
| | | TargetListScrolView.AddChidren(targetRowLayout); |
| | | string devImgPath = string.Empty; |
| | |
| | | devImgPath = targetDevice.DeviceUI.IconPath; |
| | | devNameText = targetDevice.DeviceUI.CommonDevice.DeviceEpointName; |
| | | |
| | | var targetRow = new SceneTargetFunctionRow(23); |
| | | targetRowLayout.AddChidren(targetRow); |
| | | var targetRow = new SceneTargetFunctionRow(13); |
| | | targetRow.Init(); |
| | | targetRow.SetIcon(devImgPath); |
| | | targetRow.SetNameText(devNameText); |
| | | targetRow.SetZoneText(targetDevice.DeviceUI.GetZone()); |
| | | targetRow.SetStatuText(targetDevice.GetDeviceStatu()); |
| | | targetRowLayout.AddChidren(targetRow); |
| | | if (i == sceneTargetDevicesList.Count - 1) |
| | | { |
| | | targetRow.HideLine(true); |
| | | } |
| | | } |
| | | else if (targetDevice.Type == 2) |
| | | { |
| | | devNameText = CommonFormResouce.GetTimeString(targetDevice.DelayTime); |
| | | devNameText += Language.StringByID(R.MyInternationalizationString.Later); |
| | | var targetRow = new SceneTargetTimeRow(23); |
| | | targetRowLayout.AddChidren(targetRow); |
| | | var targetRow = new SceneTargetTimeRow(13); |
| | | targetRow.Init(); |
| | | targetRow.SetTitle(devNameText); |
| | | targetRowLayout.AddChidren(targetRow); |
| | | if (i == sceneTargetDevicesList.Count - 1) |
| | | { |
| | | targetRow.HideLine(true); |
| | | } |
| | | } |
| | | else if (targetDevice.Type == 1) |
| | | { |
| | | devImgPath = "Scene/SceneIcon.png"; |
| | | devNameText = targetDevice.SceneName; |
| | | |
| | | var targetRow = new SceneTargetFunctionRow(23); |
| | | targetRowLayout.AddChidren(targetRow); |
| | | var targetRow = new SceneTargetFunctionRow(13); |
| | | targetRow.Init(); |
| | | targetRow.SetIcon(devImgPath); |
| | | targetRow.SetNameText(devNameText); |
| | | targetRow.SetZoneText(targetDevice.SceneUI.GetZone()); |
| | | targetRowLayout.AddChidren(targetRow); |
| | | if (i == sceneTargetDevicesList.Count - 1) |
| | | { |
| | | targetRow.HideLine(true); |
| | | } |
| | | } |
| | | |
| | | var editBtn = new Button() |
| | | { |
| | | BackgroundColor = ZigbeeColor.Current.GXCEditBackGroundColor, |
| | | TextID = R.MyInternationalizationString.Edit, |
| | | TextColor = ZigbeeColor.Current.GXCTextWhiteColor |
| | | }; |
| | | var editBtn = new RowLayoutEditButton(); |
| | | targetRowLayout.AddRightView(editBtn); |
| | | //编辑设备 |
| | | editBtn.MouseUpEventHandler += detailMouseUpEventHandler; |
| | | var delBtn = new Button() |
| | | { |
| | | BackgroundColor = ZigbeeColor.Current.GXCRedColor, |
| | | TextID = R.MyInternationalizationString.Delete, |
| | | TextColor = ZigbeeColor.Current.GXCTextWhiteColor |
| | | }; |
| | | var delBtn = new RowLayoutDeleteButton(); |
| | | targetRowLayout.AddRightView(delBtn); |
| | | //删除设备 |
| | | delBtn.MouseUpEventHandler += (sender, e) => |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (sceneTargetDevicesList.Count > 1) |
| | | { |
| | | var targetRowLayout = new RowLayout() |
| | | { |
| | | Height = Application.GetRealHeight(300), |
| | | LineColor = ZigbeeColor.Current.GXCBackgroundColor, |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor |
| | | }; |
| | | TargetListScrolView.AddChidren(targetRowLayout); |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | private void AddBodyView() |
| | | { |
| | | bodyFrameLayout = new FrameLayout() |
| | | var bodyScrolView=new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(184), |
| | | Height = Application.GetRealHeight(1737), |
| | | BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor, |
| | | }; |
| | | AddChidren(bodyFrameLayout); |
| | | AddChidren(bodyScrolView); |
| | | |
| | | bodyFrameLayout = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(1086+127), |
| | | BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor, |
| | | }; |
| | | bodyScrolView.AddChidren(bodyFrameLayout); |
| | | |
| | | var imgFL = new FrameLayout |
| | | { |
| | |
| | | |
| | | var infoFL = new FrameLayout |
| | | { |
| | | Y = imgFL.Bottom + Application.GetRealHeight(23), |
| | | Height = Application.GetRealHeight(418), |
| | | Y = Application.GetRealHeight(588), |
| | | Height = Application.GetRealHeight(429), |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor |
| | | }; |
| | | bodyFrameLayout.AddChidren(infoFL); |
| | |
| | | TextColor = ZigbeeColor.Current.GXCTextDeepBlackColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 15, |
| | | IsBold=true |
| | | //IsBold=true |
| | | }; |
| | | infoFL.AddChidren(infoEdit); |
| | | |
| | |
| | | |
| | | var targetFL = new FrameLayout() |
| | | { |
| | | Y = infoFL.Bottom + Application.GetRealHeight(23), |
| | | Height = Application.GetRealHeight(730) |
| | | Y = Application.GetRealHeight(1040), |
| | | Height = Application.GetRealHeight(346) |
| | | }; |
| | | bodyFrameLayout.AddChidren(targetFL); |
| | | |
| | |
| | | }; |
| | | addTargetFL.AddChidren(targetLine); |
| | | |
| | | TargetListScrolView = new VerticalScrolViewLayout() |
| | | TargetListScrolView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(49+127), |
| | | Height = Application.GetRealHeight(730-127-49), |
| | | Height = Application.GetRealHeight(173) |
| | | }; |
| | | targetFL.AddChidren(TargetListScrolView); |
| | | bodyScrolView.AddChidren(TargetListScrolView); |
| | | |
| | | |
| | | |
| | | confirmBtn = new CommonForm.CompleteButton(1656, 907, 127); |
| | | confirmBtn.TextID = R.MyInternationalizationString.Next; |
| | |
| | | { |
| | | selectFL.RemoveFromParent(); |
| | | var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo); |
| | | var fileName = $"SceneIcon_{tradeTime}"; |
| | | var fileName = $"SceneIcon_{tradeTime}.png"; |
| | | //通过相机拍照裁剪 |
| | | CropImage.TakePicture((imagePath) => |
| | | {
|
| | |
| | | if (IconPathType != 0) |
| | | { |
| | | Global.DeleteFilebyHomeId(backGround.ImagePath); |
| | | HdlAutoBackupLogic.DeleteFile(backGround.ImagePath); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | selectFL.RemoveFromParent(); |
| | | var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo); |
| | | var fileName = $"SceneIcon_{tradeTime}"; |
| | | var fileName = $"SceneIcon_{tradeTime}.png"; |
| | | //从相册选择图片裁剪 |
| | | CropImage.SelectPicture((imagePath) => |
| | | {
|
| | |
| | | if (IconPathType != 0) |
| | | { |
| | | Global.DeleteFilebyHomeId(backGround.ImagePath); |
| | | HdlAutoBackupLogic.DeleteFile(backGround.ImagePath); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | if (curRoom.IsSharedRoom) |
| | | { |
| | | RemoveFromParent(); |
| | | RoomCommon.ShowTipRoomIsShared(); |
| | | return; |
| | | } |
| | | |
| | |
| | | { |
| | | if (string.IsNullOrEmpty(nameRow.NameText.Text)) |
| | | { |
| | | var alert = new Alert(Language.StringByID(R.MyInternationalizationString.TIP), Language.StringByID(R.MyInternationalizationString.SceneNameCannotBeNull), Language.StringByID(R.MyInternationalizationString.Close)); |
| | | alert.Show(); |
| | | alert.ResultEventHandler += (sendAlert, eAlert) => |
| | | { |
| | | return; |
| | | }; |
| | | CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.SceneNameCannotBeNull)); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | try |
| | | { |
| | | var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo); |
| | | var fileName = $"SceneIcon_{tradeTime}"; |
| | | var fileName = $"SceneIcon_{tradeTime}.png"; |
| | | if (modifySceneUI.Name != nameRow.NameText.Text.Trim()) |
| | | { |
| | | if (Common.Room.CurrentRoom.GetSameFloorScenes(curRoom.FloorId).Find(s => s.Name == nameRow.NameText.Text.Trim()) != null) |
| | |
| | | if (OldIconPathType != 0) |
| | | { |
| | | Shared.IO.FileUtils.DeleteFile(System.IO.Path.Combine(Config.Instance.FullPath, OldBackgroundImagePath)); |
| | | HdlAutoBackupLogic.DeleteFile(System.IO.Path.Combine(Config.Instance.FullPath, OldBackgroundImagePath)); |
| | | |
| | | } |
| | | if (IconPathType == 1 || IconPathType == 2) |
| | | { |
| | | Shared.IO.FileUtils.WriteFileByBytes(System.IO.Path.Combine(Config.Instance.FullPath, fileName), backGround.ImageBytes); |
| | | HdlAutoBackupLogic.AddOrEditorFile(System.IO.Path.Combine(Config.Instance.FullPath, fileName)); |
| | | modifySceneUI.IconPath = fileName; |
| | | } |
| | | else |
| | |
| | | Epoint = sceneTarget.DeviceUI.CommonDevice.DeviceEpoint, |
| | | TaskList = sceneTarget.TaskList, |
| | | DelayTime = 0, |
| | | MemberNumber = i+1 |
| | | MemberNumber = i + 1 |
| | | }; |
| | | memberDataList.Add(memberData); |
| | | } |
| | |
| | | ScenesId = 0, |
| | | ElseScenesId = sceneTarget.ElseScenesId, |
| | | DelayTime = 0, |
| | | MemberNumber = i+1 |
| | | MemberNumber = i + 1 |
| | | }; |
| | | memberDataList.Add(memberData); |
| | | } |
| | |
| | | Type = 2, |
| | | ScenesId = 0, |
| | | DelayTime = sceneTarget.DelayTime, |
| | | MemberNumber = i+1 |
| | | MemberNumber = i + 1 |
| | | }; |
| | | memberDataList.Add(memberData); |
| | | } |
| | |
| | | var removeDevice = new ZigBee.Device.Scene.RemoveSceneDeviceListInfo |
| | | { |
| | | Type = 2, |
| | | DelayTime=sceneTarget.DelayTime, |
| | | MemberNumber=sceneTarget.DelayTimeSerialNumber |
| | | DelayTime = sceneTarget.DelayTime, |
| | | MemberNumber = sceneTarget.DelayTimeSerialNumber |
| | | }; |
| | | removeSceneDeviceListInfoList.Add(removeDevice); |
| | | } |
| | |
| | | modifyRoom.Save(); |
| | | curRoom.Save(); |
| | | } |
| | | EditorAction?.Invoke(modifySceneUI, curRoom); |
| | | RemoveFromParent(); |
| | | } |
| | | else if (result == 0) |
| | | { |
| | | Common.CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.FailedPleaseTryAgain); |
| | | CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.FailedPleaseTryAgain)); |
| | | } |
| | | else if (result == -1) |
| | | { |
| | | Common.CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.TheSceneHadExist); |
| | | CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.TheSceneHadExist)); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | //新增 |
| | | if (string.IsNullOrEmpty(nameRow.NameText.Text)) |
| | | { |
| | | var alert = new Alert(Language.StringByID(R.MyInternationalizationString.TIP), Language.StringByID(R.MyInternationalizationString.SceneNameCannotBeNull), Language.StringByID(R.MyInternationalizationString.Close)); |
| | | alert.Show(); |
| | | alert.ResultEventHandler += (sendAlert, eAlert) => |
| | | { |
| | | return; |
| | | }; |
| | | CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.SceneNameCannotBeNull)); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | imgPath = backGround.ImagePath; |
| | | } |
| | | if (Common.Room.CurrentRoom.GetSameFloorScenes(curRoom.FloorId).Find(s => s.Name == nameRow.NameText.Text.Trim()) != null) |
| | | { |
| | | Common.CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.TheSceneHadExist); |
| | | return; |
| | | } |
| | | //if (Common.Room.CurrentRoom.GetSameFloorScenes(curRoom.FloorId).Find(s => s.Name == nameRow.NameText.Text.Trim()) != null) |
| | | //{ |
| | | // CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.TheSceneHadExist)); |
| | | // return; |
| | | //} |
| | | CommonPage.Loading.Start(); |
| | | var memberDataList = new List<ZigBee.Device.Scene.AddSceneMemberData>(); |
| | | for (int i = 0; i < sceneTargetDevicesList.Count; i++) |
| | |
| | | var result = await curRoom.AddScene(nameRow.NameText.Text, imgPath, memberDataList); |
| | | if (result == 1) |
| | | { |
| | | AddAction?.Invoke(); |
| | | RemoveFromParent(); |
| | | } |
| | | else if (result == 0) |
| | | { |
| | | CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.AddSceneFail); |
| | | CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.AddSceneFail)); |
| | | } |
| | | else if (result == -1) |
| | | { |
| | | CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.TheSceneHadExist); |
| | | CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.TheSceneHadExist)); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | private Button floorBtn; |
| | | /// <summary> |
| | | /// 当前楼层id |
| | | /// </summary> |
| | | private string curFloorId; |
| | | /// <summary> |
| | | /// 选择楼层 |
| | | /// </summary> |
| | | private Button selectFloorBtn; |
| | |
| | | { |
| | | var floors = new SelectFloor(); |
| | | AddChidren(floors); |
| | | floors.changeFloor = false; |
| | | floors.CurFloorId = curFloorId; |
| | | floors.Init(580, 184, Direction.Right); |
| | | floors.FloorAction += (floorId) => |
| | | { |
| | | curFloorId = floorId; |
| | | floorBtn.Text = Config.Instance.Home.GetFloorNameById(floorId); |
| | | RefreshBodyView(floorId); |
| | | }; |
| | |
| | | |
| | | var sameTypeList = new List<DeviceUI> { }; |
| | | sameTypeList = typeDeviceDic[int.Parse((typeSender as Button).Tag.ToString())]; |
| | | |
| | | |
| | | foreach (var device in sameTypeList) |
| | | { |
| | | if (beforeSceneTargetDeviceUIs.Find((obj) => obj.DeviceUI.DeviceEpoint == device.DeviceEpoint && obj.DeviceUI.DeviceAddr == device.DeviceAddr) != null) |
| | |
| | | { |
| | | |
| | | public Action<string> FloorAction; |
| | | /// <summary> |
| | | /// 是否切换为当前楼层 |
| | | /// </summary> |
| | | public bool changeFloor = true; |
| | | /// <summary> |
| | | /// 当前传过来的floorid |
| | | /// </summary> |
| | | public string CurFloorId = string.Empty; |
| | | |
| | | public bool changeFloor; |
| | | Dialog dialogBackground; |
| | | |
| | | /// <summary> |
| | | /// Init |
| | | /// </summary> |
| | | public void Init(int x,int y,CommonForm.Direction direction=CommonForm.Direction.Left) |
| | | { |
| | | var dialog = new FrameLayout() |
| | | dialogBackground = new Dialog |
| | | { |
| | | BackgroundColor = ZigbeeColor.Current.GXCDailogBackGroundColor |
| | | }; |
| | | AddChidren(dialog); |
| | | dialogBackground.Show(); |
| | | var dialog = new FrameLayout() |
| | | { |
| | | }; |
| | | dialogBackground.AddChidren(dialog); |
| | | |
| | | dialog.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | RemoveFromParent(); |
| | | RemoveView(); |
| | | }; |
| | | |
| | | var bg = new Button |
| | |
| | | frow.Tag = floor.Key; |
| | | frow.Init("Floor/Floor.png", "Floor/FloorSelected.png", floor.Value); |
| | | verticalScrolView.AddChidren(frow); |
| | | if (Config.Instance.Home.CurrentFloorId == floor.Key) |
| | | |
| | | if(string.IsNullOrEmpty(CurFloorId)) |
| | | { |
| | | frow.IsSelected = true; |
| | | if (Config.Instance.Home.CurrentFloorId == floor.Key) |
| | | { |
| | | frow.IsSelected = true; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (CurFloorId == floor.Key) |
| | | { |
| | | frow.IsSelected = true; |
| | | } |
| | | } |
| | | |
| | | frow.ClickBtn.MouseUpEventHandler += SelectFloor_MouseUpEvent; |
| | | frow.ButtonClickEvent += SelectFloor_MouseUpEvent; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="mouseEventArgs"></param> |
| | | private void SelectFloor_MouseUpEvent(object sender,MouseEventArgs mouseEventArgs) |
| | | { |
| | | ((sender as Button).Parent as CommonForm.LeftIconButtonRow).IsSelected = true; |
| | | (sender as CommonForm.LeftIconButtonRow).IsSelected = true; |
| | | if(changeFloor) |
| | | { |
| | | Config.Instance.Home.CurrentFloorId = (sender as Button).Tag.ToString(); |
| | | Config.Instance.Home.CurrentFloorId = (sender as CommonForm.LeftIconButtonRow).Tag.ToString(); |
| | | Config.Instance.Home.Save(); |
| | | Common.Room.RefreshRoomListView(); |
| | | } |
| | | |
| | | FloorAction?.Invoke((sender as Button).Tag.ToString()); |
| | | RemoveView(); |
| | | FloorAction?.Invoke((sender as CommonForm.LeftIconButtonRow).Tag.ToString()); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// RemoveView |
| | | /// </summary> |
| | | private void RemoveView() |
| | | { |
| | | dialogBackground.Close(); |
| | | RemoveFromParent(); |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using Shared.Common; |
| | | |
| | | namespace Shared.Phone.Device.Category |
| | | { |
| | | public class SelectHouse : FrameLayout |
| | | { |
| | | public Action<string> HouseAction; |
| | | |
| | | Dialog dialogBackground; |
| | | /// <summary> |
| | | /// Init |
| | | /// </summary> |
| | | public void Init() |
| | | { |
| | | dialogBackground = new Dialog |
| | | { |
| | | BackgroundColor = ZigbeeColor.Current.GXCDailogBackGroundColor |
| | | }; |
| | | dialogBackground.Show(); |
| | | var dialog = new FrameLayout() |
| | | { |
| | | }; |
| | | dialogBackground.AddChidren(dialog); |
| | | |
| | | dialog.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | RemoveView(); |
| | | }; |
| | | |
| | | var bg = new Button |
| | | { |
| | | X = Application.GetRealWidth(35), |
| | | Y = Application.GetRealHeight(256), |
| | | Width = Application.GetMinRealAverage(449), |
| | | Height = Application.GetMinRealAverage(475), |
| | | UnSelectedImagePath = "Item/SelectHouse.png" |
| | | }; |
| | | dialog.AddChidren(bg); |
| | | |
| | | var changeHomeFL = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(35), |
| | | Y = Application.GetRealHeight(256), |
| | | Height = Application.GetMinRealAverage(449), |
| | | Width = Application.GetMinRealAverage(475), |
| | | Radius = CommonPage.BigFormRadius, |
| | | //BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor |
| | | }; |
| | | dialog.AddChidren(changeHomeFL); |
| | | |
| | | var changeHomeBtn = new Button() |
| | | { |
| | | X = Application.GetRealWidth(80), |
| | | Y=Application.GetRealHeight(20), |
| | | Width = Application.GetRealWidth(350), |
| | | Height = Application.GetMinRealAverage(150), |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextID = R.MyInternationalizationString.ChangeHome, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 14, |
| | | IsBold = true |
| | | }; |
| | | changeHomeFL.AddChidren(changeHomeBtn); |
| | | |
| | | var scrolView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = changeHomeBtn.Bottom, |
| | | Height = Application.GetMinRealAverage(300), |
| | | VerticalScrollBarEnabled = false |
| | | }; |
| | | changeHomeFL.AddChidren(scrolView); |
| | | |
| | | if (Config.Instance.HomeFilePathList.Count > 0) |
| | | { |
| | | foreach (var housePath in Config.Instance.HomeFilePathList) |
| | | { |
| | | var home = House.GetHouseByFilePath(housePath); |
| | | if (home == null) |
| | | { |
| | | continue; |
| | | } |
| | | AddFloor(scrolView, home); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// AddFloor |
| | | /// </summary> |
| | | /// <param name="verticalScrolView"></param> |
| | | private void AddFloor(VerticalScrolViewLayout verticalScrolView, House house) |
| | | { |
| | | var frow = new CommonForm.LeftIconButtonRow(449, 150); |
| | | frow.Tag = house.FileName; |
| | | frow.Init("Item/House.png", "Item/HouseSelected.png", house.Name); |
| | | verticalScrolView.AddChidren(frow); |
| | | if (Config.Instance.HomeId == house.Id) |
| | | { |
| | | frow.IsSelected = true; |
| | | } |
| | | |
| | | frow.ButtonClickEvent += SelectFloor_MouseUpEvent; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// SelectFloor_MouseUpEvent |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="mouseEventArgs"></param> |
| | | private void SelectFloor_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs) |
| | | { |
| | | (sender as CommonForm.LeftIconButtonRow).IsSelected = true; |
| | | var home = House.GetHouseByFilePath((sender as CommonForm.LeftIconButtonRow).Tag.ToString()); |
| | | RemoveView(); |
| | | HouseAction?.Invoke(home.Id); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// RemoveView |
| | | /// </summary> |
| | | private void RemoveView() |
| | | { |
| | | dialogBackground.Close(); |
| | | RemoveFromParent(); |
| | | } |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | private Button floorBtn; |
| | | /// <summary> |
| | | /// 当前楼层id |
| | | /// </summary> |
| | | private string curFloorId; |
| | | /// <summary> |
| | | /// 选择楼层 |
| | | /// </summary> |
| | | private Button selectFloorBtn; |
| | |
| | | { |
| | | var floors = new SelectFloor(); |
| | | AddChidren(floors); |
| | | floors.changeFloor = false; |
| | | floors.CurFloorId = curFloorId; |
| | | floors.Init(580, 184, Direction.Right); |
| | | floors.FloorAction += (floorId) => |
| | | { |
| | | curFloorId = floorId; |
| | | floorBtn.Text = Config.Instance.Home.GetFloorNameById(floorId); |
| | | RefreshBodyView(floorId); |
| | | }; |
| | |
| | | Height = Application.GetRealHeight(80), |
| | | Width = this.Width - Application.GetRealWidth(80 + 80 + 30), |
| | | TextColor = Shared.Common.ZigbeeColor.Current.GXCPlaceHolderTextColor, |
| | | SelectedTextColor = Common.ZigbeeColor.Current.GXCACSelectedTextColor, |
| | | SelectedTextColor = Common.ZigbeeColor.Current.GXCACSelectedTextColor_FanModel, |
| | | Text = title, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Gravity = Gravity.CenterVertical, |
| | |
| | | X = Application.GetRealWidth(x); |
| | | Y = Application.GetRealHeight(y); |
| | | Width = Application.GetRealWidth(1022); |
| | | Height = Application.GetRealHeight(127); |
| | | Height = Application.GetRealHeight(127-2); |
| | | //BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; |
| | | } |
| | | |
| | |
| | | |
| | | var line = new Button() |
| | | { |
| | | X = Application.GetRealWidth(200), |
| | | Y = Height - 2, |
| | | X = Application.GetRealWidth(181), |
| | | Y = Height - 1, |
| | | Width = Application.GetRealWidth(821), |
| | | Height = 2, |
| | | BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor, |
| | | Height = 1, |
| | | BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2, |
| | | Tag = Tag |
| | | }; |
| | | AddChidren(line); |
| | |
| | | CloseOrDownBtn.SelectedImagePath = "RollerShade/CloseSelected.png"; |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// SetDeviceIcon |
| | | /// </summary> |
| | | /// <param name="imagePath"></param> |
| | | /// <param name="selectedImagePath"></param> |
| | | public void SetDeviceIcon(string imagePath, string selectedImagePath) |
| | | { |
| | | ImageBtn.UnSelectedImagePath = imagePath; |
| | | ImageBtn.SelectedImagePath = selectedImagePath; |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | X = Application.GetRealWidth(x); |
| | | Y = Application.GetRealHeight(y); |
| | | Width = Application.GetRealWidth(1022); |
| | | Height = Application.GetRealHeight(127); |
| | | Height = Application.GetRealHeight(127-2); |
| | | //BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; |
| | | } |
| | | |
| | |
| | | |
| | | var line = new Button() |
| | | { |
| | | X = Application.GetRealWidth(200), |
| | | X = Application.GetRealWidth(181), |
| | | Y = Height - 1, |
| | | Width = Application.GetRealWidth(821), |
| | | Height = 1, |
| | |
| | | { |
| | | SwitchBtn.Visible = !statu; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// SetDeviceIcon |
| | | /// </summary> |
| | | /// <param name="imagePath"></param> |
| | | /// <param name="selectedImagePath"></param> |
| | | public void SetDeviceIcon(string imagePath, string selectedImagePath) |
| | | { |
| | | ImageBtn.UnSelectedImagePath = imagePath; |
| | | ImageBtn.SelectedImagePath = selectedImagePath; |
| | | } |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | /// action |
| | | /// </summary> |
| | | public Action action; |
| | | public Action<DeviceUI,Common.Room> EditAction; |
| | | /// <summary> |
| | | /// curRoom |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | private DeviceInfoRow functionTypeRow; |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region ◆ 移除____________________________ |
| | |
| | | /// </summary> |
| | | public override void RemoveFromParent() |
| | | { |
| | | action(); |
| | | base.RemoveFromParent(); |
| | | } |
| | | #endregion |
| | |
| | | Height = Application.GetMinRealAverage(207), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor, |
| | | Radius = (uint)Application.GetMinRealAverage(207) |
| | | Radius = (uint)Application.GetMinRealAverage(207/2) |
| | | }; |
| | | bodyFrameLayout.AddChidren(deviceBG); |
| | | |
| | |
| | | Height = Application.GetMinRealAverage(184), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | BackgroundColor = ZigbeeColor.Current.GXCSelectedBackgroundColor, |
| | | Radius = (uint)Application.GetMinRealAverage(184) |
| | | Radius = (uint)Application.GetMinRealAverage(184/2) |
| | | }; |
| | | bodyFrameLayout.AddChidren(deviceBG2); |
| | | |
| | |
| | | }; |
| | | bodyFrameLayout.AddChidren(deviceIMG); |
| | | |
| | | var info = Common.LocalDevice.Current.GetDeviceBelongEnumInfo(device.CommonDevice); |
| | | |
| | | var deviceTypeName = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(360), |
| | | Width = Application.GetRealWidth(900), |
| | | Height = Application.GetRealHeight(80), |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | Text = DeviceUI.GetDeviceTypeName(device.CommonDevice.Type), |
| | | Gravity = Gravity.CenterHorizontal |
| | | TextID = info.BeloneTextId, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | TextSize = 15 |
| | | }; |
| | | bodyFrameLayout.AddChidren(deviceTypeName); |
| | | |
| | |
| | | { |
| | | curRoom = rooms[index1][index2]; |
| | | zoneRow.SetTitle($"{Config.Instance.Home.GetFloorNameById(floorIds[index1])} , {rooms[index1][index2].Name}"); |
| | | }, 0, 0, Language.StringByID(R.MyInternationalizationString.BelongFloor), |
| | | }, 0, 0, Language.StringByID(R.MyInternationalizationString.BelongZone), |
| | | Language.StringByID(R.MyInternationalizationString.Confrim), |
| | | Language.StringByID(R.MyInternationalizationString.Cancel)); |
| | | } |
| | |
| | | { |
| | | curRoom = rs[index1]; |
| | | zoneRow.SetTitle(rs[index1].Name); |
| | | }, 0,Language.StringByID(R.MyInternationalizationString.BelongFloor), |
| | | }, 0,Language.StringByID(R.MyInternationalizationString.BelongZone), |
| | | Language.StringByID(R.MyInternationalizationString.Confrim), |
| | | Language.StringByID(R.MyInternationalizationString.Cancel)); |
| | | } |
| | |
| | | CommonPage.Loading.Hide(); |
| | | if (result) |
| | | { |
| | | //var alertSuccess = new Alert(Language.StringByID(R.MyInternationalizationString.TIP), Language.StringByID(R.MyInternationalizationString.Success), Language.StringByID(R.MyInternationalizationString.Confrim)); |
| | | //alertSuccess.Show(); |
| | | //alertSuccess.ResultEventHandler += (senderSuccess, eSuccess) => |
| | | //{ |
| | | //改房间 |
| | | Shared.Common.Room.CurrentRoom.ChangedRoom(device.CommonDevice, curRoom.Id); |
| | | device.CommonDevice.ReSave(); |
| | | RemoveFromParent(); |
| | | //}; |
| | | //改房间 |
| | | Shared.Common.Room.CurrentRoom.ChangedRoom(device.CommonDevice, curRoom.Id); |
| | | device.CommonDevice.ReSave(); |
| | | EditAction?.Invoke(device, curRoom); |
| | | RemoveFromParent(); |
| | | } |
| | | else |
| | | { |
| | | CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.FailedPleaseTryAgain); |
| | | CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.FailedPleaseTryAgain)); |
| | | } |
| | | }); |
| | | }) |
| | |
| | | bodyFrameLayout.AddChidren(confirmBtn); |
| | | confirmBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | action(tempIcon.ImageBtn.UnSelectedImagePath, tempIcon.ImageBtn.SelectedImagePath); |
| | | if (tempIcon.ImageBtn != null) |
| | | { |
| | | action(tempIcon.ImageBtn.UnSelectedImagePath, tempIcon.ImageBtn.SelectedImagePath); |
| | | } |
| | | RemoveFromParent(); |
| | | }; |
| | | } |
| | |
| | | /// </summary> |
| | | public FrameLayout Line; |
| | | /// <summary> |
| | | /// 点击事件 |
| | | /// </summary> |
| | | public Action<LeftIconButtonRow, MouseEventArgs> ButtonClickEvent; |
| | | /// <summary> |
| | | /// ClickBtn |
| | | /// </summary> |
| | | public Button ClickBtn; |
| | |
| | | |
| | | #endregion |
| | | |
| | | public LeftIconButtonRow(int width,int height, int x = 0, int y = 0) |
| | | public LeftIconButtonRow(int width = 449, int height = 150, int x = 0, int y = 0) |
| | | { |
| | | X = x; |
| | | Y = y; |
| | |
| | | AddChidren(Line); |
| | | } |
| | | |
| | | ClickBtn = new Button { Tag = this.Tag }; |
| | | AddChidren(ClickBtn); |
| | | |
| | | IconButton.MouseUpEventHandler += Button_MouseUpEventHandler; |
| | | TitleButton.MouseUpEventHandler += Button_MouseUpEventHandler; |
| | | } |
| | | #endregion |
| | | |
| | |
| | | /// 设置状态 |
| | | /// </summary> |
| | | /// <param name="statu"></param> |
| | | public void SetStatu(bool statu) |
| | | private void SetStatu(bool statu) |
| | | { |
| | | IconButton.IsSelected = statu; |
| | | TitleButton.IsSelected = statu; |
| | | TitleButton.IsBold = statu; |
| | | ClickBtn.IsSelected = statu; |
| | | } |
| | | /// <summary> |
| | | /// 选中 |
| | |
| | | { |
| | | Line.Visible = !statu; |
| | | } |
| | | /// <summary> |
| | | /// 设置标题颜色 |
| | | /// </summary> |
| | | /// <param name="color"></param> |
| | | /// <param name="selectedColor"></param> |
| | | public void SetTitleColor(uint color,uint selectedColor) |
| | | { |
| | | TitleButton.TextColor = color; |
| | | TitleButton.SelectedTextColor = selectedColor; |
| | | } |
| | | #endregion |
| | | |
| | | #region ◆ 点击事件_________________________ |
| | | |
| | | /// <summary> |
| | | /// 点击事件 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void Button_MouseUpEventHandler(object sender, MouseEventArgs e) |
| | | { |
| | | try |
| | | { |
| | | this.ButtonClickEvent?.Invoke(this, e); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | |
| | | Button roomListBtn; |
| | | |
| | | Button temperatureText; |
| | | Button temperatureText; |
| | | |
| | | Button humidityText; |
| | | |
| | |
| | | { |
| | | //return; |
| | | } |
| | | |
| | | |
| | | //if (common.Type == DeviceType.TemperatureSensor) |
| | | //{ |
| | | if (common.DeviceStatusReport.CluterID == 1026) |
| | | if (common.DeviceStatusReport.CluterID == 1026) |
| | | { |
| | | foreach (var data in common.DeviceStatusReport.AttriBute) |
| | | { |
| | | foreach (var data in common.DeviceStatusReport.AttriBute) |
| | | if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue) |
| | | { |
| | | if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue) |
| | | if (data.AttriButeData == 0) |
| | | { |
| | | if (data.AttriButeData == 0) |
| | | { |
| | | //0 |
| | | humidityText.Text = "--%"; |
| | | room.Humidity = 0; |
| | | } |
| | | else |
| | | { |
| | | //小数点需要一位(湿度没有负数) |
| | | string strValue = data.AttriButeData.ToString(); |
| | | strValue = strValue.Substring(0, strValue.Length - 1); |
| | | humidityText.Text = strValue.Insert(strValue.Length - 1, ".") + "%"; |
| | | room.Humidity = int.Parse(strValue) * 0.1; |
| | | } |
| | | //0℃ |
| | | temperatureText.Text = "0.0℃"; |
| | | room.Temperatrue = 0; |
| | | } |
| | | else if (data.AttriButeData > 32767) |
| | | { |
| | | //负数(特殊处理) |
| | | string strValue = (data.AttriButeData - 65536).ToString(); |
| | | //小数点需要一位 |
| | | strValue = strValue.Substring(0, strValue.Length - 1); |
| | | temperatureText.Text = strValue.Insert(strValue.Length - 1, ".") + "℃"; |
| | | room.Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); |
| | | } |
| | | else |
| | | { |
| | | //小数点需要一位 |
| | | string strValue = data.AttriButeData.ToString(); |
| | | strValue = strValue.Substring(0, strValue.Length - 1); |
| | | temperatureText.Text = strValue.Insert(strValue.Length - 1, ".") + "℃"; |
| | | room.Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); |
| | | } |
| | | } |
| | | } |
| | | else if (common.DeviceStatusReport.CluterID == 1029) |
| | | } |
| | | else if (common.DeviceStatusReport.CluterID == 1029) |
| | | { |
| | | foreach (var data in common.DeviceStatusReport.AttriBute) |
| | | { |
| | | foreach (var data in common.DeviceStatusReport.AttriBute) |
| | | if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue) |
| | | { |
| | | if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue) |
| | | if (data.AttriButeData == 0) |
| | | { |
| | | if (data.AttriButeData == 0) |
| | | { |
| | | //0 |
| | | humidityText.Text = "--%"; |
| | | room.Humidity = 0; |
| | | } |
| | | else |
| | | { |
| | | //小数点需要一位(湿度没有负数) |
| | | string strValue = data.AttriButeData.ToString(); |
| | | strValue = strValue.Substring(0, strValue.Length - 1); |
| | | humidityText.Text = strValue.Insert(strValue.Length - 1, ".") + "%"; |
| | | room.Humidity = int.Parse(strValue) * 0.1; |
| | | } |
| | | //0 |
| | | humidityText.Text = "--%"; |
| | | room.Humidity = 0; |
| | | } |
| | | else |
| | | { |
| | | //小数点需要一位(湿度没有负数) |
| | | string strValue = data.AttriButeData.ToString(); |
| | | strValue = strValue.Substring(0, strValue.Length - 1); |
| | | humidityText.Text = strValue.Insert(strValue.Length - 1, ".") + "%"; |
| | | room.Humidity = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //} |
| | | } |
| | | catch (Exception ex) |
| | |
| | | |
| | | var roomName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(5), |
| | | X = Application.GetRealWidth(29), |
| | | Width = Application.GetRealWidth(190), |
| | | Text = room.Name, |
| | | TextColor = ZigbeeColor.Current.GXCTextWhiteColor, |
| | | TextSize=10, |
| | | IsBold=true |
| | | TextSize = 10, |
| | | TextAlignment=TextAlignment.CenterLeft, |
| | | IsBold = true |
| | | }; |
| | | roomNameBackground.AddChidren(roomName); |
| | | |
| | | roomNameBackground.Width = (roomName.GetTextWidth() + Application.GetRealWidth(100)) > Application.GetRealWidth(600) ? Application.GetRealWidth(600) : roomName.GetTextWidth() + Application.GetRealWidth(100); |
| | | roomName.Width = roomNameBackground.Width - Application.GetRealWidth(40); |
| | | |
| | | roomTemperatureBackground = new FrameLayout |
| | | { |
| | |
| | | { |
| | | X = Application.GetRealWidth(69), |
| | | Width = Application.GetRealWidth(120), |
| | | Height = Application.GetRealHeight(58), |
| | | Gravity = Gravity.CenterVertical, |
| | | Text = Math.Abs(room.Temperatrue) <= 0 ? "--℃" : $"{room.Temperatrue}℃", |
| | | TextSize=14 |
| | | Text = room.Temperatrue == 0 ? "--℃" : $"{room.Temperatrue}℃", |
| | | TextSize = 14, |
| | | TextAlignment=TextAlignment.CenterLeft |
| | | }; |
| | | roomTemperatureBackground.AddChidren(temperatureText); |
| | | temperatureText.Width = temperatureText.GetTextWidth() + Application.GetRealWidth(60); |
| | | |
| | | var humidityIcon = new Button |
| | | { |
| | | X = Application.GetRealWidth(200), |
| | | X = temperatureText.Right, |
| | | Width = Application.GetMinRealAverage(58), |
| | | Height = Application.GetMinRealAverage(58), |
| | | Gravity = Gravity.CenterVertical, |
| | |
| | | |
| | | humidityText = new Button |
| | | { |
| | | X = Application.GetRealWidth(260), |
| | | X = humidityIcon.Right, |
| | | Width = Application.GetRealWidth(120), |
| | | Height = Application.GetRealHeight(58), |
| | | Gravity = Gravity.CenterVertical, |
| | | Text = Math.Abs(room.Temperatrue) <= 0 ? "--%" : $"{room.Humidity}%", |
| | | TextSize=14 |
| | | Text = room.Humidity == 0 ? "--%" : $"{room.Humidity}%", |
| | | TextSize = 14, |
| | | TextAlignment = TextAlignment.CenterLeft |
| | | }; |
| | | roomTemperatureBackground.AddChidren(humidityText); |
| | | |
| | | humidityText.Width = humidityText.GetTextWidth() + Application.GetRealWidth(60); |
| | | roomTemperatureBackground.Width = (humidityText.Width + temperatureText.Width + Application.GetRealWidth(150)) > Application.GetRealWidth(600) ? Application.GetRealWidth(600) : (humidityText.Width + temperatureText.Width + Application.GetRealWidth(150)); |
| | | |
| | | if (string.IsNullOrEmpty(room.TemperatrueDevice) == false) |
| | | { |
| | |
| | | var dev = Common.LocalDevice.Current.GetDevice(room.HumidityDevice); |
| | | ReadDeviceAttributeLogic.Instance.SendHumidityStatuComand(dev); |
| | | } |
| | | |
| | | |
| | | roomListBtn = new Button() |
| | | { |
| | |
| | | TextID = R.MyInternationalizationString.Delete; |
| | | TextColor = ZigbeeColor.Current.GXCTextWhiteColor; |
| | | TextAlignment = TextAlignment.Center; |
| | | Radius = CommonPage.BigFormRadius; |
| | | TextSize = 14; |
| | | //Radius = CommonPage.BigFormRadius; |
| | | } |
| | | } |
| | | } |
| | |
| | | TextID = R.MyInternationalizationString.Edit; |
| | | TextColor = ZigbeeColor.Current.GXCTextWhiteColor; |
| | | TextAlignment = TextAlignment.Center; |
| | | Radius = CommonPage.BigFormRadius; |
| | | TextSize = 14; |
| | | //Radius = CommonPage.BigFormRadius; |
| | | } |
| | | } |
| | | } |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using Shared.Common; |
| | | using Shared.Phone.Device.Category; |
| | | using Shared.Phone.UserCenter; |
| | | |
| | | namespace Shared.Phone.Device.CommonForm |
| | | { |
| | | public class SceneCategoryView : FrameLayout |
| | |
| | | /// </summary> |
| | | private void InitFrame() |
| | | { |
| | | RemoveAll(); |
| | | var sceneRowLayout = new RowLayout |
| | | { |
| | | Y = Application.GetRealHeight(46), |
| | |
| | | Tag= scene |
| | | }; |
| | | AddChidren(sceneRowLayout); |
| | | sceneRowLayout.SubViewWidth = Application.GetRealWidth(199); |
| | | |
| | | sceneImg = new ImageView() |
| | | { |
| | |
| | | var delayBtn = new RowLayoutDeleteButton |
| | | { |
| | | TextID = R.MyInternationalizationString.Delay, |
| | | Tag = scene.SceneDelayTime |
| | | Tag = scene.SceneDelayTime, |
| | | BackgroundColor=ZigbeeColor.Current.GXCTextSelectedColor, |
| | | }; |
| | | delayBtn.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerBottomLeft | HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight | HDLUtils.RectCornerBottomRight); |
| | | sceneRowLayout.AddLeftView(delayBtn); |
| | | //编辑 |
| | | var settingBtn = new Device.CommonForm.RowLayoutEditButton() |
| | |
| | | TextID = R.MyInternationalizationString.Editor, |
| | | Tag = scene.SceneDelayTime |
| | | }; |
| | | settingBtn.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerBottomLeft | HDLUtils.RectCornerTopLeft); |
| | | //删除 |
| | | var deleteBtn = new Device.CommonForm.RowLayoutDeleteButton |
| | | { |
| | | Tag = scene |
| | | }; |
| | | |
| | | deleteBtn.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerTopRight | HDLUtils.RectCornerBottomRight); |
| | | if (room.IsSharedRoom) |
| | | { |
| | | |
| | |
| | | { |
| | | sceneRowLayout.AddRightView(settingBtn); |
| | | sceneRowLayout.AddRightView(deleteBtn); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | var tip = new CustomAlert { }; |
| | | Common.CommonPage.Instance.AddChidren(tip); |
| | | tip.Show(Language.StringByID(R.MyInternationalizationString.ConfirmDelete)); |
| | | |
| | | tip.ResultEventHandler += async (e1) => |
| | | var alert = new UserCenter.ShowMsgControl(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.ConfirmDelete)); |
| | | alert.Show(); |
| | | alert.ConfirmClickEvent += async () => |
| | | { |
| | | if (e1) |
| | | //0 移除失败 1 移除成功 2 没有该场景 |
| | | var removeSceneAllData = await ZigBee.Device.Scene.DeleteSceneAsync(scene.Id); |
| | | if (removeSceneAllData == null || removeSceneAllData.removeSceneData == null) |
| | | { |
| | | //0 移除失败 1 移除成功 2 没有该场景 |
| | | var removeSceneAllData = await ZigBee.Device.Scene.DeleteSceneAsync(scene.Id); |
| | | if (removeSceneAllData == null || removeSceneAllData.removeSceneData == null) |
| | | { |
| | | CommonPage.Instance.FailureToServer(); |
| | | return; |
| | | } |
| | | //1成功 |
| | | if (removeSceneAllData.removeSceneData.Result == 1) |
| | | { |
| | | room.RemoveScene(scene); |
| | | //RefreshBodyView(); |
| | | RemoveFromParent(); |
| | | } |
| | | //0 移除失败 |
| | | else if (removeSceneAllData.removeSceneData.Result == 0) |
| | | { |
| | | CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.FailedPleaseTryAgain); |
| | | return; |
| | | } |
| | | //2 没有该场景 |
| | | else if (removeSceneAllData.removeSceneData.Result == 2) |
| | | { |
| | | room.RemoveScene(scene); |
| | | //RefreshBodyView(); |
| | | RemoveFromParent(); |
| | | CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.TheSceneIsNull); |
| | | return; |
| | | } |
| | | CommonPage.Instance.FailureToServer(); |
| | | return; |
| | | } |
| | | //1成功 |
| | | if (removeSceneAllData.removeSceneData.Result == 1) |
| | | { |
| | | room.RemoveScene(scene); |
| | | //RefreshBodyView(); |
| | | RemoveFromParent(); |
| | | } |
| | | //0 移除失败 |
| | | else if (removeSceneAllData.removeSceneData.Result == 0) |
| | | { |
| | | CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.FailedPleaseTryAgain); |
| | | return; |
| | | } |
| | | //2 没有该场景 |
| | | else if (removeSceneAllData.removeSceneData.Result == 2) |
| | | { |
| | | room.RemoveScene(scene); |
| | | //RefreshBodyView(); |
| | | RemoveFromParent(); |
| | | CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.TheSceneIsNull); |
| | | return; |
| | | } |
| | | }; |
| | | } |
| | | }; |
| | | deleteBtn.MouseUpEventHandler += delEvent; |
| | | //编辑场景 |
| | | settingBtn.MouseUpEventHandler += (sender, e) => |
| | | settingBtn.MouseUpEventHandler += async (sender, e) => |
| | | { |
| | | SceneUI.EditScene(scene, room); |
| | | try |
| | | { |
| | | var targetList = new List<SceneTargetDeviceUI> { }; |
| | | CommonPage.Loading.Start(); |
| | | //从网关中反序列化出对应的房间设备 |
| | | var sceneDeviceList = await ZigBee.Device.Scene.GetSceneDeviceListAsync(scene.Id); |
| | | if (sceneDeviceList == null) |
| | | { |
| | | CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.TheMainGatewayIsNotOnLine)); |
| | | return; |
| | | } |
| | | |
| | | if (sceneDeviceList.getSceneDeviceListInfo != null) |
| | | { |
| | | var deviceList = sceneDeviceList.getSceneDeviceListInfo.DeviceList; |
| | | var allDevice = Common.Room.AllRoomDeviceUIList; |
| | | var allScene = Common.Room.AllRoomSceneUIList; |
| | | |
| | | if (deviceList != null && allDevice.Count != 0) |
| | | { |
| | | foreach (var sceneDev in deviceList) |
| | | { |
| | | if (sceneDev.Type == 0) |
| | | { |
| | | var dev = allDevice.Find((obj) => obj.DeviceEpoint == sceneDev.Epoint && obj.DeviceAddr == sceneDev.DeviceAddr); |
| | | if (dev != null) |
| | | { |
| | | var sceneTargetDevice = new SceneTargetDeviceUI |
| | | { |
| | | Type = 0, |
| | | DeviceUI = dev, |
| | | TaskList = sceneDev.TaskList, |
| | | DelayTimeSerialNumber = deviceList.IndexOf(sceneDev) + 1 |
| | | }; |
| | | |
| | | targetList.Add(sceneTargetDevice); |
| | | } |
| | | } |
| | | else if (sceneDev.Type == 1) |
| | | { |
| | | var localScene = allScene.Find((obj) => obj.Id == sceneDev.ElseScenesId); |
| | | if (localScene != null) |
| | | { |
| | | var sceneTargetDeviceScene = new SceneTargetDeviceUI |
| | | { |
| | | Type = 1, |
| | | ElseScenesId = sceneDev.ElseScenesId, |
| | | SceneName = localScene.Name, |
| | | SceneUI = localScene, |
| | | DelayTimeSerialNumber = deviceList.IndexOf(sceneDev) + 1 |
| | | }; |
| | | targetList.Add(sceneTargetDeviceScene); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | var sceneTargetDeviceScene = new SceneTargetDeviceUI |
| | | { |
| | | Type = 2, |
| | | DelayTime = sceneDev.DelayTime, |
| | | DelayTimeSerialNumber = deviceList.IndexOf(sceneDev) + 1 |
| | | }; |
| | | targetList.Add(sceneTargetDeviceScene); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.FailedPleaseTryAgain)); |
| | | } |
| | | |
| | | var sceneView = new CategoryAddScene(); |
| | | Phone.UserView.HomePage.Instance.AddChidren(sceneView); |
| | | Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | sceneView.isModify = true; |
| | | sceneView.modifyRoom = room; |
| | | sceneView.modifySceneUI = scene; |
| | | sceneView.modifySceneTargetDevicesList = targetList; |
| | | sceneView.Show(); |
| | | sceneView.EditorAction = (s, r) => |
| | | { |
| | | if(r.Id!=room.Id) |
| | | { |
| | | RemoveFromParent(); |
| | | } |
| | | else |
| | | { |
| | | Init(s, r); |
| | | } |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | System.Console.WriteLine($"编辑场景出错---{ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | } |
| | | }; |
| | | //编辑延时 |
| | | delayBtn.MouseUpEventHandler += (sender, e) => |
| | |
| | | TextColor = ZigbeeColor.Current.GXCTextWhiteColor, |
| | | SelectedTextColor = ZigbeeColor.Current.GXCTextSelectedColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize=14, |
| | | IsBold=true |
| | | TextSize = 14, |
| | | IsBold = true |
| | | }; |
| | | AddChidren(SceneNameButton); |
| | | } |
| | |
| | | TimeButton.Height = Application.GetMinRealAverage(63); |
| | | TimeButton.UnSelectedImagePath = string.Empty; |
| | | TimeButton.Text = name; |
| | | TimeButton.TextSize = 14; |
| | | TimeButton.IsBold = true; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | } |
| | | var timeSelect = new SelectTime(); |
| | | CommonPage.Instance.AddChidren(timeSelect); |
| | | timeSelect.TempTime = scene.DelayTime; |
| | | timeSelect.TempTime = scene.SceneDelayTime; |
| | | timeSelect.Init(); |
| | | timeSelect.TimeAction = (t) => |
| | | { |
| | |
| | | X = Application.GetRealWidth(0); |
| | | Y = Application.GetRealHeight(y); |
| | | Width = Application.GetRealWidth(1080); |
| | | Height = Application.GetRealHeight(127); |
| | | Height = Application.GetRealHeight(127 - 2); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | X = Application.GetRealWidth(219), |
| | | Y = Application.GetRealHeight(14), |
| | | Width = Application.GetRealWidth(500), |
| | | Width = Application.GetRealWidth(400), |
| | | Height = Application.GetRealHeight(58), |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextID = R.MyInternationalizationString.Delay |
| | | TextID = R.MyInternationalizationString.Delay, |
| | | TextSize = 14 |
| | | }; |
| | | AddChidren(NameBtn); |
| | | |
| | |
| | | { |
| | | X = Application.GetRealWidth(219), |
| | | Y = Application.GetRealHeight(72), |
| | | Width = Application.GetRealWidth(200), |
| | | Width = Application.GetRealWidth(400), |
| | | Height = Application.GetRealHeight(49), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor2 |
| | | TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor2, |
| | | TextSize = 12 |
| | | }; |
| | | AddChidren(ZoneBtn); |
| | | |
| | | StatuBtn = new Button |
| | | { |
| | | X = Application.GetRealWidth(510), |
| | | Width = Application.GetRealWidth(500), |
| | | X = Application.GetRealWidth(650), |
| | | Width = Application.GetRealWidth(350), |
| | | Height = Application.GetRealHeight(100), |
| | | Gravity = Gravity.CenterVertical, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor2 |
| | | TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor2, |
| | | TextSize = 14 |
| | | }; |
| | | AddChidren(StatuBtn); |
| | | |
| | | line = new Button() |
| | | { |
| | | X = Application.GetRealWidth(222), |
| | | Y = Height - 2, |
| | | Y = Height - 1, |
| | | Width = Application.GetRealWidth(800), |
| | | Height = 2, |
| | | Height = 1, |
| | | BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2, |
| | | }; |
| | | AddChidren(line); |
| | |
| | | /// <param name="hiden"></param> |
| | | public void HideLine(bool hiden) |
| | | { |
| | | line.Visible = hiden; |
| | | line.Visible = !hiden; |
| | | } |
| | | } |
| | | } |
| | |
| | | using Shared.Common; |
| | | namespace Shared.Phone.Device.CommonForm |
| | | { |
| | | public class SceneTargetTimeRow:FrameLayout |
| | | public class SceneTargetTimeRow : FrameLayout |
| | | { |
| | | /// <summary> |
| | | /// TipBtn |
| | |
| | | X = Application.GetRealWidth(0); |
| | | Y = Application.GetRealHeight(y); |
| | | Width = Application.GetRealWidth(1080); |
| | | Height = Application.GetRealHeight(127); |
| | | Height = Application.GetRealHeight(127-2); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | Width = Application.GetMinRealAverage(80), |
| | | Height = Application.GetMinRealAverage(80), |
| | | Gravity = Gravity.CenterVertical, |
| | | UnSelectedImagePath="Item/Timer.png" |
| | | UnSelectedImagePath = "Item/Timer.png" |
| | | }; |
| | | AddChidren(Icon); |
| | | |
| | |
| | | Gravity = Gravity.CenterVertical, |
| | | TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor2, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextID=R.MyInternationalizationString.Delay |
| | | TextID = R.MyInternationalizationString.Delay, |
| | | TextSize = 14 |
| | | }; |
| | | AddChidren(TipBtn); |
| | | |
| | |
| | | Width = Application.GetRealWidth(500), |
| | | Height = Application.GetRealHeight(100), |
| | | Gravity = Gravity.CenterVertical, |
| | | TextAlignment=TextAlignment.CenterRight, |
| | | TextColor= ZigbeeColor.Current.GXCPlaceHolderTextColor2 |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor2, |
| | | TextSize = 14 |
| | | }; |
| | | AddChidren(TitleBtn); |
| | | |
| | | line = new Button() |
| | | { |
| | | X = Application.GetRealWidth(222), |
| | | Y = Height - 2, |
| | | Y = Height - 1, |
| | | Width = Application.GetRealWidth(800), |
| | | Height = 2, |
| | | Height = 1, |
| | | BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2, |
| | | }; |
| | | AddChidren(line); |
| | |
| | | /// <param name="hiden"></param> |
| | | public void HideLine(bool hiden) |
| | | { |
| | | line.Visible = hiden; |
| | | line.Visible = !hiden; |
| | | } |
| | | } |
| | | } |
| | |
| | | var backgroundFL = new FrameLayout |
| | | { |
| | | Y = Application.GetRealHeight(596), |
| | | Height = Application.GetRealHeight(1425), |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor, |
| | | Radius=(uint)Application.GetRealHeight(20) |
| | | Height = Application.GetRealHeight(1325), |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor |
| | | }; |
| | | backgroundFL.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight); |
| | | dialog.AddChidren(backgroundFL); |
| | | |
| | | var topView = new FrameLayout |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.GXCTextGrayColor, |
| | | TextID=R.MyInternationalizationString.Cancel, |
| | | TextSize=16 |
| | | TextSize=14 |
| | | }; |
| | | topView.AddChidren(cancle); |
| | | |
| | |
| | | Width = Application.GetRealWidth(300), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor2, |
| | | TextID = R.MyInternationalizationString.Confrim, |
| | | TextSize = 16 |
| | | TextID = R.MyInternationalizationString.Complete, |
| | | TextSize = 14 |
| | | }; |
| | | topView.AddChidren(confrim); |
| | | |
| | | var Line = new FrameLayout() |
| | | { |
| | | Y = topView.Height - 1, |
| | | Height = 1, |
| | | BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2 |
| | | }; |
| | | topView.AddChidren(Line); |
| | | |
| | | var timeLayout = new VerticalScrolViewLayout |
| | | { |
| | | Y = Application.GetRealHeight(207), |
| | | Height = Application.GetRealHeight(703+127*2+12*2) |
| | | Height = Application.GetRealHeight(703 + 127 * 2 + 12+12), |
| | | ScrollEnabled = false, |
| | | VerticalScrollBarEnabled = false, |
| | | }; |
| | | backgroundFL.AddChidren(timeLayout); |
| | | |
| | | TempSelectBtn = new Button(); |
| | | TempTimeBtn = new Button(); |
| | | |
| | | var unKe = new FrameLayout |
| | | { |
| | | Y = timeLayout.Bottom, |
| | | Height = Application.GetRealHeight(161), |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor |
| | | }; |
| | | backgroundFL.AddChidren(unKe); |
| | | |
| | | var notOpen = new Button |
| | | { |
| | | X = Application.GetRealWidth(80), |
| | | Y=Application.GetRealHeight(1200), |
| | | Width=Application.GetRealWidth(400), |
| | | Height=Application.GetRealHeight(80), |
| | | TextColor = ZigbeeColor.Current.GXCTextGrayColor4, |
| | | TextID = R.MyInternationalizationString.NotOpen, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Gravity = Gravity.CenterVertical, |
| | | TextSize=16 |
| | | TextSize=14 |
| | | }; |
| | | unKe.AddChidren(notOpen); |
| | | backgroundFL.AddChidren(notOpen); |
| | | |
| | | cancle.MouseUpEventHandler += Close; |
| | | confrim.MouseUpEventHandler += Confrim_MouseEvent; |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.GXCTextGrayColor4, |
| | | SelectedTextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | IsSelected=false |
| | | IsSelected=false, |
| | | TextSize=14 |
| | | }; |
| | | trow.AddChidren(timeBtn); |
| | | |
| | |
| | | |
| | | var Line = new FrameLayout() |
| | | { |
| | | Y = trow.Height - 1, |
| | | Y = row.Height - 1, |
| | | Width = Application.GetRealWidth(919), |
| | | Height = 1, |
| | | Gravity=Gravity.CenterHorizontal, |
| | | BackgroundColor = Common.ZigbeeColor.Current.GXCGrayLineColor2 |
| | | }; |
| | | trow.AddChidren(Line); |
| | | row.AddChidren(Line); |
| | | |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | |
| | | |
| | | namespace Shared.Phone.Device.CommonForm |
| | | { |
| | | public class SelectZone : FrameLayout |
| | | public class SelectZone |
| | | { |
| | | public Action<Common.Room> ZoneAction; |
| | | |
| | |
| | | { |
| | | curRoom = rooms[index1][index2]; |
| | | ZoneAction?.Invoke(curRoom); |
| | | RemoveFromParent(); |
| | | //RemoveFromParent(); |
| | | }, 0, 0, Language.StringByID(R.MyInternationalizationString.BelongFloor), |
| | | Language.StringByID(R.MyInternationalizationString.Confrim), |
| | | Language.StringByID(R.MyInternationalizationString.Cancel)); |
| | |
| | | { |
| | | curRoom = rs[index1]; |
| | | ZoneAction?.Invoke(curRoom); |
| | | RemoveFromParent(); |
| | | }, 0, Language.StringByID(R.MyInternationalizationString.BelongFloor), |
| | | //RemoveFromParent(); |
| | | }, 0, Language.StringByID(R.MyInternationalizationString.AddTo), |
| | | Language.StringByID(R.MyInternationalizationString.Confrim), |
| | | Language.StringByID(R.MyInternationalizationString.Cancel)); |
| | | } |
| | |
| | | roomList.Add(room.Name); |
| | | roomIdList.Add(room.Id); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="mouseEventArgs"></param> |
| | | private void Close(object sender, MouseEventArgs mouseEventArgs) |
| | | { |
| | | RemoveFromParent(); |
| | | //RemoveFromParent(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="mouseEventArgs"></param> |
| | | private void Confrim_MouseEvent(object sender, MouseEventArgs mouseEventArgs) |
| | | { |
| | | ZoneAction?.Invoke(curRoom); |
| | | RemoveFromParent(); |
| | | //ZoneAction?.Invoke(curRoom); |
| | | //RemoveFromParent(); |
| | | } |
| | | } |
| | | } |
| | |
| | | /// ProgressBtnY |
| | | /// </summary> |
| | | int ProgressBtnY; |
| | | /// <summary> |
| | | /// ProgressBtnX |
| | | /// </summary> |
| | | int ProgressBtnX; |
| | | |
| | | #endregion |
| | | |
| | |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Text = device.CommonDevice.DeviceEpointName, |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextSize = 15 |
| | | TextSize = 15, |
| | | IsBold=true |
| | | }; |
| | | itemView.AddChidren(deviceNameBtn); |
| | | |
| | |
| | | Height = Application.GetRealHeight(60), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | TextColor = ZigbeeColor.Current.GXCTextGrayColor, |
| | | Text = $"{Language.StringByID(R.MyInternationalizationString.Current)} {device.GetDeviceStatu()}" |
| | | Text = $"{Language.StringByID(R.MyInternationalizationString.Current)} {device.GetDeviceStatu()}", |
| | | TextSize = 10 |
| | | }; |
| | | itemView.AddChidren(StatuBtn); |
| | | |
| | |
| | | } |
| | | |
| | | SetCurtainType(itemView, (device.CommonDevice as Rollershade).WcdType); |
| | | |
| | | |
| | | var roomBG = new Button |
| | | { |
| | | Y = Application.GetRealHeight(1178 - 50), |
| | |
| | | Height = Application.GetRealHeight(50), |
| | | Text = room.Name, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.GXCTextWhiteColor |
| | | TextColor = ZigbeeColor.Current.GXCTextWhiteColor, |
| | | TextSize = 12 |
| | | }; |
| | | itemView.AddChidren(roomName); |
| | | } |
| | |
| | | UserView.HomePage.Instance.AddChidren(detailInfo); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | detailInfo.Show(device, room); |
| | | detailInfo.action = () => |
| | | detailInfo.EditAction = (d,r) => |
| | | { |
| | | Show(device, room); |
| | | }; |
| | |
| | | curtainSeekBar.Width = Application.GetRealWidth(570); |
| | | curtainSeekBar.Height = Application.GetRealHeight(513); |
| | | curtainSeekBar.Gravity = Gravity.CenterHorizontal; |
| | | curtainSeekBar.IsProgressTextShow = false; |
| | | curtainSeekBar.Progress = (device.CommonDevice as Rollershade).WcdCurrentPositionLiftPercentage; |
| | | layout.AddChidren(curtainSeekBar); |
| | | |
| | |
| | | { |
| | | (device.CommonDevice as Rollershade).WcdGoToTiltValue(curtainSeekBar.Progress); |
| | | }; |
| | | |
| | | curtainSeekBar.OnStartTrackingTouchEvent += (sender, e) => |
| | | { |
| | | OnProgressButtonMoveForCurtain(curtainSeekBar.Progress); |
| | | ProgressBtn.Visible = true; |
| | | }; |
| | | |
| | | curtainSeekBar.OnStopTrackingTouchEvent += (sender, e) => |
| | | { |
| | | ProgressBtn.Visible = false; |
| | | }; |
| | | |
| | | curtainSeekBar.OnProgressChangedEvent += (send2, e2) => |
| | | { |
| | | |
| | | OnProgressButtonMoveForCurtain(e2); |
| | | |
| | | //判断是否300ms屏蔽 |
| | | //if (curtainRollSeekBar.IsProgressChangeDelay()) return; |
| | | |
| | | //(device.CommonDevice as Rollershade).WcdGoToTiltValue(curtainRollSeekBar.Progress); |
| | | }; |
| | | InitProgressBtnForCurtain(layout); |
| | | } |
| | | } |
| | | |
| | |
| | | Height = Application.GetMinReal(104), |
| | | UnSelectedImagePath = "Item/ProgressBubbles.png", |
| | | Visible = false, |
| | | Gravity = Gravity.CenterHorizontal |
| | | Gravity = Gravity.CenterHorizontal, |
| | | TextSize=14, |
| | | IsBold=true, |
| | | TextColor=ZigbeeColor.Current.GXCTextWhiteColor |
| | | }; |
| | | layout.AddChidren(ProgressBtn); |
| | | } |
| | |
| | | ProgressBtn.Text = mProgress + "%"; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 添加进度按钮 |
| | | /// </summary> |
| | | private void InitProgressBtnForCurtain(FrameLayout layout) |
| | | { |
| | | ProgressBtnX = curtainSeekBar.X - Application.GetMinReal(20); |
| | | ProgressBtn = new Button() |
| | | { |
| | | X = ProgressBtnX, |
| | | Y = curtainSeekBar.Y + curtainSeekBar.Height / 2 - Application.GetMinReal(180), |
| | | Width = Application.GetMinReal(135), |
| | | Height = Application.GetMinReal(104), |
| | | UnSelectedImagePath = "Item/ProgressBubbles.png", |
| | | Visible = false, |
| | | TextSize = 14, |
| | | IsBold = true, |
| | | TextColor = ZigbeeColor.Current.GXCTextWhiteColor |
| | | }; |
| | | layout.AddChidren(ProgressBtn); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// OnProgressButtonMove |
| | | /// </summary> |
| | | private void OnProgressButtonMoveForCurtain(int mProgress) |
| | | { |
| | | ProgressBtn.X = ProgressBtnX + curtainSeekBar.NowProgressX- Application.GetMinReal(5); |
| | | ProgressBtn.Text = mProgress + "%"; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ◆ 收藏到主页_______________________ |
| | |
| | | UserView.HomePage.Instance.AddChidren(detailInfo); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | detailInfo.Show(device, room); |
| | | detailInfo.action = () => |
| | | detailInfo.EditAction = (d,r) => |
| | | { |
| | | Show(device, room); |
| | | }; |
| | |
| | | /// 收藏按钮 |
| | | /// </summary> |
| | | private Button collectionBtn; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 开关 |
| | | /// </summary> |
| | |
| | | /// 滑条 |
| | | /// </summary> |
| | | private WaveSeekBar levelSeekBar; |
| | | |
| | | |
| | | |
| | | private Button StatuBtn; |
| | | /// <summary> |
| | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | } |
| | | else if (typeTag == "OnlineStatusChange") |
| | | { |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | UserView.HomePage.Instance.AddChidren(detailInfo); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | detailInfo.Show(device, room); |
| | | detailInfo.action = () => |
| | | detailInfo.EditAction = (d,r) => |
| | | { |
| | | Show(device, room); |
| | | }; |
| | |
| | | |
| | | InitProgressBtn(itemView); |
| | | |
| | | InitProgressBtn(itemView); |
| | | |
| | | switchBtn = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(1005), |
| | |
| | | UserView.HomePage.Instance.AddChidren(detailInfo); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | detailInfo.Show(device, room); |
| | | detailInfo.action = () => |
| | | detailInfo.EditAction = (d,r) => |
| | | { |
| | | Show(device, room); |
| | | }; |
| | |
| | | UserView.HomePage.Instance.AddChidren(detailInfo); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | detailInfo.Show(device, room); |
| | | detailInfo.action = () => |
| | | detailInfo.EditAction = (d,r) => |
| | | { |
| | | Show(device, room); |
| | | }; |
| | |
| | | UserView.HomePage.Instance.AddChidren(detailInfo); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | detailInfo.Show(device, room); |
| | | detailInfo.action = () => |
| | | detailInfo.EditAction = (d,r) => |
| | | { |
| | | Show(device, room); |
| | | }; |
| | |
| | | middle.AddChidren(textBox); |
| | | textBox.HideSoftInput(); |
| | | |
| | | var textBtn = new Button |
| | | { |
| | | Width = Application.GetRealWidth(80), |
| | | Height = Application.GetRealHeight(50), |
| | | X = Application.GetRealWidth(1080 - 80 - 50), |
| | | Y = Application.GetRealHeight(550 - 25), |
| | | TextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | | Text = "50", |
| | | }; |
| | | middle.AddChidren(textBtn); |
| | | string s1 = ""; |
| | | string s2 = ""; |
| | | textBox.TextChangeEventHandler += (sender, e) => |
| | | { |
| | | var leng = e.Length; |
| | | if (leng > 50) |
| | | { |
| | | var substring = e.Substring(0, 50); |
| | | s1 = substring; |
| | | if (s1 == s2) |
| | | { |
| | | s2 = s1; |
| | | } |
| | | else |
| | | { |
| | | if (s2 == "") |
| | | { |
| | | s2 = s1; |
| | | } |
| | | else |
| | | { |
| | | s1 = s2; |
| | | } |
| | | } |
| | | textBox.Text = s2; |
| | | } |
| | | else |
| | | { |
| | | if (leng == 50) |
| | | { |
| | | s2 = e.Substring(0, 50); |
| | | } |
| | | else |
| | | { |
| | | s1 = ""; |
| | | s2 = ""; |
| | | } |
| | | textBtn.Text = (50 - leng).ToString(); |
| | | } |
| | | }; |
| | | |
| | | var btnsave = new Button |
| | | { |
| | | Y = middle.Height - Application.GetRealHeight(260), |
| | |
| | | alert.Show(); |
| | | return; |
| | | } |
| | | if (Common.Logic.CurrentLogic.LogicId != 0) |
| | | { |
| | | ///只改推送内容; |
| | | Send.LogicControlSwitch(Common.Logic.CurrentLogic); |
| | | Send.Data("添加/更新", "/App/HomeLogicConfig", "POST"); |
| | | } |
| | | Send.Zj(true, Common.Logic.CurrentLogic); |
| | | RemoveFromParent(); |
| | | |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | lockcolorfra1.Y = Application.GetRealHeight(1920 - 140 - (160 * membershipIfon.UserIdMode.Count) - 20 - 50); |
| | | lockcolorfra1.Height = Application.GetRealHeight(140 + (160 * membershipIfon.UserIdMode.Count) + 20 + 50); |
| | | if (membershipIfon.UserIdMode.Count > 10) |
| | | if (membershipIfon.UserIdMode.Count > 9) |
| | | { |
| | | ///元素超出10个,暂时默认显示10; |
| | | lockcolorfra1.Y = Application.GetRealHeight(1920 - 140 - (160 * 10) - 20 - 50); |
| | | lockcolorfra1.Height = Application.GetRealHeight(140 + (160 * 10) + 20 + 50); |
| | | lockcolorfra1.Y = Application.GetRealHeight(1920 - 140 - (160 * 9) - 20 - 50); |
| | | lockcolorfra1.Height = Application.GetRealHeight(140 + (160 * 9) + 20 + 50); |
| | | } |
| | | string SelectedLockStatus = ""; |
| | | ///定义两个变量记录选中状态; |
| | |
| | | tag = true; |
| | | custompushFrameLayout.Height = Application.GetRealHeight(160); |
| | | Common.Logic.CurrentLogic.LogicIsCustomPushText = 1; |
| | | if (Common.Logic.CurrentLogic.LogicId != 0) |
| | | { |
| | | Send.Data("添加/更新", "/App/HomeLogicConfig", "POST"); |
| | | } |
| | | |
| | | } |
| | | else |
| | |
| | | tag = false; |
| | | custompushFrameLayout.Height = Application.GetRealHeight(0); |
| | | Common.Logic.CurrentLogic.LogicIsCustomPushText = 0; |
| | | if (Common.Logic.CurrentLogic.LogicId != 0) |
| | | { |
| | | Send.Data("删除", "/App/DelHomeLogicConfig", "POST"); |
| | | } |
| | | |
| | | } |
| | | Send.Zj(tag, Common.Logic.CurrentLogic); |
| | | }; |
| | | if (Common.Logic.CurrentLogic.LogicIsCustomPushText == 0) |
| | | { |
| | | tag = false; |
| | | btnswitch.IsSelected = false; |
| | | custompushFrameLayout.Height = Application.GetRealHeight(0); |
| | | } |
| | | else |
| | | { |
| | | tag = true; |
| | | btnswitch.IsSelected = true; |
| | | custompushFrameLayout.Height = Application.GetRealHeight(160); |
| | | } |
| | | var saveFrameLayout = new FrameLayout |
| | | { |
| | |
| | | Common.Logic.LockLogicList.Add(Common.Logic.CurrentLogic); |
| | | if (tag) |
| | | { |
| | | Send.Data("添加/更新", "/App/HomeLogicConfig", "POST"); |
| | | Send.Zj(tag, Common.Logic.CurrentLogic); |
| | | } |
| | | } |
| | | } |
| | |
| | | Common.Logic.CurrentLogic.LogicType = 1; |
| | | Common.Logic.CurrentLogic.Relationship = 1; |
| | | Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.automation1); |
| | | Common.Logic.CurrentLogic.LogicCustomPushText = Common.Logic.CurrentLogic.LogicName + Language.StringByID(MyInternationalizationString.defaulttext); |
| | | var lockLogicCommunalPage = new LockLogicCommunalPage(); |
| | | UserView.HomePage.Instance.AddChidren(lockLogicCommunalPage); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | |
| | | Height = Application.GetRealHeight(200) + Application.GetRealHeight(32), |
| | | Width = Application.GetRealWidth(700), |
| | | //Gravity = Gravity.CenterHorizontal, |
| | | Text = Language.StringByID(MyInternationalizationString.automationaddtext).Replace("{\\r\\n}", "\r\n"), |
| | | Text = Language.StringByID(MyInternationalizationString.tiplocktextnull).Replace("{\\r\\n}", "\r\n"), |
| | | TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | IsMoreLines = true, |
| | |
| | | custompushback.MouseUpEventHandler += customclick; |
| | | custompushRowLayout.MouseUpEventHandler += customclick; |
| | | bool tag = false;//标记开关状态; |
| | | btnswitch.MouseUpEventHandler += (sender1, e1) => |
| | | btnswitch.MouseUpEventHandler +=(sender1, e1) => |
| | | { |
| | | btnswitch.IsSelected = !btnswitch.IsSelected; |
| | | if (btnswitch.IsSelected) |
| | |
| | | tag = true; |
| | | custompushFrameLayout.Height = Application.GetRealHeight(160); |
| | | Common.Logic.CurrentLogic.LogicIsCustomPushText = 1; |
| | | if (Common.Logic.CurrentLogic.LogicId != 0) |
| | | { |
| | | Send.Data("添加/更新", "/App/HomeLogicConfig", "POST"); |
| | | } |
| | | |
| | | } |
| | | else |
| | |
| | | tag = false; |
| | | custompushFrameLayout.Height = Application.GetRealHeight(0); |
| | | Common.Logic.CurrentLogic.LogicIsCustomPushText = 0; |
| | | if (Common.Logic.CurrentLogic.LogicId != 0) |
| | | { |
| | | Send.Data("删除", "/App/DelHomeLogicConfig", "POST"); |
| | | } |
| | | |
| | | } |
| | | Send.Zj(tag,Common.Logic.CurrentLogic); |
| | | }; |
| | | |
| | | if (Common.Logic.CurrentLogic.LogicIsCustomPushText == 0) |
| | | { |
| | | tag = false; |
| | | btnswitch.IsSelected = false; |
| | | custompushFrameLayout.Height = Application.GetRealHeight(0); |
| | | } |
| | | else |
| | | { |
| | | tag = true; |
| | | btnswitch.IsSelected = true; |
| | | custompushFrameLayout.Height = Application.GetRealHeight(160); |
| | | } |
| | | #endregion |
| | | |
| | |
| | | Common.Logic.LogicList.Add(Common.Logic.CurrentLogic); |
| | | if (tag) |
| | | { |
| | | Send.Data("添加/更新", "/App/HomeLogicConfig", "POST"); |
| | | Send.Zj(tag, Common.Logic.CurrentLogic); |
| | | } |
| | | } |
| | | } |
| | |
| | | string SelectedDeviceStatuscondition = ""; |
| | | lockcolorfra1.Y = Application.GetRealHeight(1920 - 140 - (160 * user.UserIdMode.Count) - 20 - 50); |
| | | lockcolorfra1.Height = Application.GetRealHeight(140 + (160 * user.UserIdMode.Count) + 20 + 50); |
| | | if (user.UserIdMode.Count > 10) |
| | | if (user.UserIdMode.Count > 9) |
| | | { |
| | | ///元素超出10个,暂时默认显示10; |
| | | lockcolorfra1.Y = Application.GetRealHeight(1920 - 140 - (160 * 10) - 20 - 50); |
| | | lockcolorfra1.Height = Application.GetRealHeight(140 + (160 * 10) + 20 + 50); |
| | | lockcolorfra1.Y = Application.GetRealHeight(1920 - 140 - (160 * 9) - 20 - 50); |
| | | lockcolorfra1.Height = Application.GetRealHeight(140 + (160 * 9) + 20 + 50); |
| | | } |
| | | |
| | | for (int i = 0; i < user.UserIdMode.Count; i++) |
| | |
| | | /// </summary> |
| | | public static UserCenter.MemberInfoRes UserMemberInfoRes = null; |
| | | #endregion |
| | | /// <summary> |
| | | /// 自己用 |
| | | /// </summary> |
| | | public static void Zj(bool tag, Common.Logic logic) |
| | | { |
| | | new System.Threading.Thread(() => |
| | | { |
| | | if (logic.LogicId != 0) |
| | | { |
| | | if (tag) |
| | | { |
| | | Data("添加/更新", "/App/HomeLogicConfig", "POST"); |
| | | } |
| | | else |
| | | { |
| | | Data("删除", "/App/DelHomeLogicConfig", "POST"); |
| | | } |
| | | ///只改推送内容; |
| | | LogicControlSwitch(logic); |
| | | } |
| | | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | #region 请求服务器方法--- |
| | | /// <summary> |
| | | /// 请求数据的封装方法 |
| | |
| | | /// <param name="method">请求方式为POST/GET</param> |
| | | /// <param name="obj">存储发送数据的对象</param> |
| | | /// <returns></returns> |
| | | public static async System.Threading.Tasks.Task<string>Data(string command, string url, string method, object obj = null) |
| | | public static async System.Threading.Tasks.Task<string> Data(string command, string url, string method, object obj = null) |
| | | { |
| | | var getUrl =""; |
| | | var getUrl = ""; |
| | | var jObject = new JObject(); |
| | | if (UserCenter.UserCenterResourse.UserInfo.AuthorityNo == 1) |
| | | { |
| | |
| | | Width = Application.GetRealWidth(600), |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.devicestate, |
| | | TextID = MyInternationalizationString.addsensor, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | |
| | | tag = true; |
| | | custompushFrameLayout.Height = Application.GetRealHeight(160); |
| | | Common.Logic.CurrentLogic.LogicIsCustomPushText = 1; |
| | | if (Common.Logic.CurrentLogic.LogicId != 0) |
| | | { |
| | | Send.Data("添加/更新", "/App/HomeLogicConfig", "POST"); |
| | | } |
| | | |
| | | } |
| | | else |
| | |
| | | tag = false; |
| | | custompushFrameLayout.Height = Application.GetRealHeight(0); |
| | | Common.Logic.CurrentLogic.LogicIsCustomPushText = 0; |
| | | if (Common.Logic.CurrentLogic.LogicId != 0) |
| | | { |
| | | Send.Data("删除", "/App/DelHomeLogicConfig", "POST"); |
| | | } |
| | | |
| | | } |
| | | Send.Zj(tag, Common.Logic.CurrentLogic); |
| | | }; |
| | | if (Common.Logic.CurrentLogic.LogicIsCustomPushText == 0) |
| | | { |
| | | tag = false; |
| | | btnswitch.IsSelected = false; |
| | | custompushFrameLayout.Height = Application.GetRealHeight(0); |
| | | } |
| | | else |
| | | { |
| | | tag = true; |
| | | btnswitch.IsSelected = true; |
| | | custompushFrameLayout.Height = Application.GetRealHeight(160); |
| | | } |
| | | var saveFrameLayout = new FrameLayout |
| | | { |
| | |
| | | Common.Logic.LogicList.Add(Common.Logic.CurrentLogic); |
| | | if (tag) |
| | | { |
| | | Send.Data("添加/更新", "/App/HomeLogicConfig", "POST"); |
| | | Send.Zj(tag, Common.Logic.CurrentLogic); |
| | | } |
| | | } |
| | | } |
| | |
| | | //小数点需要一位 |
| | | strValue = strValue.Substring(0, strValue.Length - 1); |
| | | temperatureRow.NameText.Text = strValue.Insert(strValue.Length - 1, ".") + "℃"; |
| | | room.Temperatrue = int.Parse(strValue) * 0.1; |
| | | room.Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); |
| | | } |
| | | else |
| | | { |
| | |
| | | string strValue = data.AttriButeData.ToString(); |
| | | strValue = strValue.Substring(0, strValue.Length - 1); |
| | | temperatureRow.NameText.Text = strValue.Insert(strValue.Length - 1, ".") + "℃"; |
| | | room.Temperatrue = int.Parse(strValue) * 0.1; |
| | | room.Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); |
| | | } |
| | | } |
| | | } |
| | |
| | | string strValue = data.AttriButeData.ToString(); |
| | | strValue = strValue.Substring(0, strValue.Length - 1); |
| | | humidityRow.NameText.Text = strValue.Insert(strValue.Length - 1, ".") + "%"; |
| | | room.Humidity = int.Parse(strValue) * 0.1; |
| | | room.Humidity = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | room = r; |
| | | IconPathType = r.BackgroundImageType; |
| | | OldIconPathType= r.BackgroundImageType; |
| | | OldIconPathType = r.BackgroundImageType; |
| | | if (IconPathType != 0) |
| | | { |
| | | OldBackgroundImagePath = r.BackgroundImage; |
| | |
| | | }; |
| | | AddChidren(bodyFrameLayout); |
| | | |
| | | var backGround1 = new ImageView() |
| | | { |
| | | Y = Application.GetRealHeight(60), |
| | | Width = Application.GetMinRealAverage(916), |
| | | Height = Application.GetMinRealAverage(487), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | ImagePath = "Room/Room_Rectangle.png" |
| | | }; |
| | | bodyFrameLayout.AddChidren(backGround1); |
| | | |
| | | |
| | | backGround = new ImageView() |
| | | { |
| | | Y = Application.GetRealHeight(60), |
| | | Width = Application.GetMinRealAverage(887), |
| | | Height = Application.GetMinRealAverage(444), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Radius = (uint)Application.GetRealHeight(CommonFormResouce.BigFormRadius), |
| | | Radius = (uint)Application.GetMinRealAverage(CommonFormResouce.BigFormRadius), |
| | | ImagePath = room.BackgroundImageType == 0 ? room.BackgroundImage : System.IO.Path.Combine(Config.Instance.FullPath, room.BackgroundImage) |
| | | }; |
| | | bodyFrameLayout.AddChidren(backGround); |
| | | backGround.SetViewShadow(true); |
| | | |
| | | if (room.BackgroundImageType != 0) |
| | | { |
| | | backGround.ImageBytes = Shared.IO.FileUtils.ReadFile(backGround.ImagePath); |
| | |
| | | nameRow.SetTipTitle($"{Language.StringByID(R.MyInternationalizationString.RoomName)} :"); |
| | | nameRow.SetTitle(room.Name); |
| | | infoFL.AddChidren(nameRow); |
| | | if(room.IsLove) |
| | | if (room.IsLove) |
| | | { |
| | | nameRow.NameText.Enable = false; |
| | | } |
| | |
| | | }; |
| | | if (string.IsNullOrEmpty(room.TemperatrueDevice) == false) |
| | | { |
| | | temperatureRow.SetTitle(R.MyInternationalizationString.Getting); |
| | | temperatureRow.SetTitle(room.Temperatrue == 0 ? "--℃" : $"{room.Temperatrue}℃"); |
| | | //发送获取温度的命令 |
| | | var dev = Common.LocalDevice.Current.GetDevice(room.TemperatrueDevice); |
| | | ReadDeviceAttributeLogic.Instance.SendTemperatureStatuComand(dev); |
| | |
| | | }; |
| | | if (string.IsNullOrEmpty(room.HumidityDevice) == false) |
| | | { |
| | | humidityRow.SetTitle(R.MyInternationalizationString.Getting); |
| | | humidityRow.SetTitle(room.Humidity == 0 ? "--%" : $"{room.Humidity}%"); |
| | | //发送获取湿度的命令 |
| | | var dev = Common.LocalDevice.Current.GetDevice(room.HumidityDevice); |
| | | ReadDeviceAttributeLogic.Instance.SendHumidityStatuComand(dev); |
| | |
| | | } |
| | | |
| | | var confirm = new Device.CommonForm.CompleteButton(1700, 900, 127); |
| | | confirm.SetTitle(R.MyInternationalizationString.Confrim); |
| | | confirm.SetTitle(R.MyInternationalizationString.Save); |
| | | AddChidren(confirm); |
| | | confirm.MouseUpEventHandler += (sender, e) => |
| | | { |
| | |
| | | room.Name = nameRow.NameText.Text.Trim(); |
| | | if (OldIconPathType != 0) |
| | | { |
| | | Shared.IO.FileUtils.DeleteFile(System.IO.Path.Combine(Config.Instance.FullPath,OldBackgroundImagePath)); |
| | | Shared.IO.FileUtils.DeleteFile(System.IO.Path.Combine(Config.Instance.FullPath, OldBackgroundImagePath)); |
| | | HdlAutoBackupLogic.DeleteFile(OldBackgroundImagePath); |
| | | } |
| | | if (IconPathType == 0) |
| | | { |
| | |
| | | else |
| | | { |
| | | Shared.IO.FileUtils.WriteFileByBytes(System.IO.Path.Combine(Config.Instance.FullPath, fileName), backGround.ImageBytes); |
| | | HdlAutoBackupLogic.AddOrEditorFile(fileName); |
| | | room.BackgroundImage = fileName; |
| | | } |
| | | room.BackgroundImageType = IconPathType; |
| | |
| | | using System; |
| | | using Shared.Phone.Device.CommonForm; |
| | | |
| | | namespace Shared.Phone.Device.Room |
| | | { |
| | | public class RoomCommon |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | var alert = new Alert(Language.StringByID(R.MyInternationalizationString.TIP), Language.StringByID(R.MyInternationalizationString.TheRoomIsSharedNotAllowedToOperate), Language.StringByID(R.MyInternationalizationString.Close)); |
| | | alert.Show(); |
| | | CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.TheRoomIsSharedNotAllowedToOperate)); |
| | | }); |
| | | } |
| | | |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | var alert = new Alert(Language.StringByID(R.MyInternationalizationString.TIP), Language.StringByID(R.MyInternationalizationString.NotSelectZone), Language.StringByID(R.MyInternationalizationString.Close)); |
| | | alert.Show(); |
| | | CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.NotSelectZone)); |
| | | }); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | private FrameLayout bodyFrameLayout; |
| | | |
| | | private Button floorBtn; |
| | | /// <summary> |
| | | /// 当前楼层id |
| | | /// </summary> |
| | | private string curFloorId; |
| | | |
| | | public FrameLayout itemView; |
| | | |
| | |
| | | floorBtn.Text = Config.Instance.Home.GetCurrentFloorName; |
| | | if(Config.Instance.Home.FloorDics.Count>0) |
| | | { |
| | | curFloorId = Config.Instance.Home.CurrentFloorId; |
| | | top.topView.AddChidren(floorBtn); |
| | | top.topView.AddChidren(selectFloorBtn); |
| | | } |
| | |
| | | { |
| | | var floors = new SelectFloor(); |
| | | AddChidren(floors); |
| | | floors.changeFloor = false; |
| | | floors.CurFloorId = curFloorId; |
| | | floors.Init(599, 161,Direction.Right); |
| | | floors.FloorAction += (floorId) => |
| | | { |
| | | curFloorId = floorId; |
| | | floorBtn.Text = Config.Instance.Home.GetFloorNameById(floorId); |
| | | AddBodyView(floorId); |
| | | }; |
| | |
| | | var roomScrolView = new VerticalScrolViewLayout { }; |
| | | bodyFrameLayout.AddChidren(roomScrolView); |
| | | var roomList = Common.Room.CurrentRoom.GetRoomsByFloorId(floorId); |
| | | if (roomList == null) |
| | | { |
| | | return; |
| | | } |
| | | for (int i = 0; i < roomList.Count+1; i++) |
| | | { |
| | | int xx = 43 + i % 2 * (20 + 487); |
| | |
| | | InitData(); |
| | | AddTop(); |
| | | AddBodyView(); |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | public void RefreshBodyView() |
| | | { |
| | | functionSceneBodyView.RemoveAll(); |
| | | |
| | | |
| | | if (functionBtn.IsSelected) |
| | | { |
| | | ShowFunction(); |
| | |
| | | Width = Application.GetRealWidth(1028) |
| | | }; |
| | | functionSceneBodyView.AddChidren(functionTypeScrowView); |
| | | |
| | | |
| | | deviceListScrolView = new VerticalScrolViewLayout |
| | | { |
| | | X = Application.GetRealWidth(CommonFormResouce.X_Left), |
| | |
| | | add.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | var selectZone = new SelectZone(); |
| | | AddChidren(selectZone); |
| | | //AddChidren(selectZone); |
| | | selectZone.Init(); |
| | | selectZone.ZoneAction = (r) => |
| | | { |
| | |
| | | r.AddDevice(d.CommonDevice, true); |
| | | deviceListScrolView.RemoveViewByTag(d); |
| | | } |
| | | |
| | | |
| | | if (sameTypeList.Count == selectedList.Count) |
| | | { |
| | | RefreshData(); |
| | |
| | | var frame = sceneScrolView.GetChildren(i) as FrameLayout; |
| | | (frame.GetChildren(1) as Button).IsSelected = (sender as Button).IsSelected; |
| | | } |
| | | |
| | | |
| | | if ((sender as Button).IsSelected) |
| | | { |
| | | (sender as Button).TextID = R.MyInternationalizationString.Cancel; |
| | |
| | | add.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | var selectZone = new SelectZone(); |
| | | CommonPage.Instance.AddChidren(selectZone); |
| | | //CommonPage.Instance.AddChidren(selectZone); |
| | | selectZone.Init(); |
| | | selectZone.ZoneAction = (r) => |
| | | { |
| | |
| | | /// </summary>
|
| | | public AbountForm()
|
| | | {
|
| | | |
| | |
|
| | | }
|
| | | /// <summary>
|
| | | /// 画面显示(底层会固定调用此方法,借以完成画面创建)
|
| | |
| | | UpdateVersion();
|
| | | };
|
| | |
|
| | | |
| | |
|
| | | updatingBtn = new Button()
|
| | | {
|
| | | Y = Application.GetRealHeight(994),
|
| | |
| | | Gravity=Gravity.CenterHorizontal
|
| | | };
|
| | | bodyFrameLayout.AddChidren(updatingBtn);
|
| | | |
| | |
|
| | | SetDownLoadBtnNoVisible();
|
| | | CheckVersion();
|
| | | }
|
| | |
| | | #if iOS
|
| | | try
|
| | | {
|
| | | CommonPage.Loading.Start();
|
| | | var versionResult = await RequestHttpsiOSAppVersionAsync();
|
| | | if (versionResult == null || versionResult.Results == null)
|
| | | {
|
| | |
| | | {
|
| | | return true;
|
| | | }
|
| | | retuun false;
|
| | | return false;
|
| | | }
|
| | | catch
|
| | | {
|
| | | return false;
|
| | |
|
| | | return false;
|
| | | }
|
| | | |
| | |
|
| | | #elif Android
|
| | | try
|
| | | {
|
| | |
| | | private async void UpdateVersion()
|
| | | {
|
| | | #if iOS
|
| | | CommonPage.Instance.OpenUrl();
|
| | | OpenUrl();
|
| | | #elif Android
|
| | | try
|
| | | {
|
| | |
| | | /// 获取iOS-APP版本信息
|
| | | /// </summary>
|
| | | /// <returns>The https app version async.</returns>
|
| | | public async System.Threading.Tasks.Task<ResponseEntity.ResultPack> RequestHttpsiOSAppVersionAsync()
|
| | | public async System.Threading.Tasks.Task<Common.ResponseEntity.ResultPack> RequestHttpsiOSAppVersionAsync()
|
| | | {
|
| | | try
|
| | | {
|
| | |
| | | {
|
| | | return null;
|
| | | }
|
| | | return Newtonsoft.Json.JsonConvert.DeserializeObject<ResponseEntity.ResultPack>(Encoding.UTF8.GetString(result));
|
| | | return Newtonsoft.Json.JsonConvert.DeserializeObject<Common.ResponseEntity.ResultPack>(Encoding.UTF8.GetString(result));
|
| | | }
|
| | | catch
|
| | | {
|
| | |
| | | /// </summary>
|
| | | A干接点节能模式 = 6,
|
| | | /// <summary>
|
| | | /// 干接点私有属性
|
| | | /// 干接点第三级别私有属性
|
| | | /// </summary>
|
| | | A干接点私有属性 = 7,
|
| | | A干接点第三级别私有属性 = 7,
|
| | | /// <summary>
|
| | | /// 窗帘上下限位(这个东西需要在第一)
|
| | | /// </summary>
|
| | |
| | | /// <summary>
|
| | | /// 空调自定义模式
|
| | | /// </summary>
|
| | | A空调自定义模式 = 11
|
| | | A空调自定义模式 = 11,
|
| | | /// <summary>
|
| | | /// 简约面板震动功能
|
| | | /// </summary>
|
| | | A简约面板震动功能 = 12
|
| | | }
|
| | | }
|
old mode 100755
new mode 100644
| | |
| | |
|
| | | public MessageInfoPra()
|
| | | {
|
| | | PageSetting.PageSize = 10;
|
| | | PageSetting.PageSize = 50;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | /// 是否出力详细Log 1 -> 出力
|
| | | /// </summary>
|
| | | public int DetailedLog = 0;
|
| | | /// <summary>
|
| | | /// 显示设备历史版本 1 -> 显示
|
| | | /// </summary>
|
| | | public int DeviceHistory = 0;
|
| | | }
|
| | | #endregion
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 添加底线___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// <para>添加底线(如果左边有图标,则先添加图标,再添加底线)</para>
|
| | | /// <para>它的长度为:当前控件宽度-左右固定间距-左边图片宽度(如果有)-右边的偏移量</para>
|
| | | /// </summary>
|
| | | public override NormalViewControl AddBottomLine()
|
| | | {
|
| | | var btnLine = base.AddBottomLine();
|
| | | //联动线的状态
|
| | | txtInput.btnLine = btnLine;
|
| | |
|
| | | return btnLine;
|
| | | }
|
| | |
|
| | | #endregion
|
| | | }
|
| | | }
|
| | |
| | | /// <para>添加底线(如果左边有图标,则先添加图标,再添加底线)</para>
|
| | | /// <para>它的长度为:当前控件宽度-左右固定间距-左边图片宽度(如果有)-右边的偏移量</para>
|
| | | /// </summary> |
| | | public NormalViewControl AddBottomLine()
|
| | | public virtual NormalViewControl AddBottomLine()
|
| | | {
|
| | | int lineWidth = this.Width - ControlCommonResourse.XXLeft * 2 - LeftOffset - RightOffset;
|
| | | int XX = ControlCommonResourse.XXLeft + LeftOffset;
|
| | |
| | | IMessageCommon.Current.IgnoreError = false;
|
| | | return false;
|
| | | }
|
| | | if (listFile.Count == 0)
|
| | | {
|
| | | //恢复
|
| | | IMessageCommon.Current.IgnoreError = false;
|
| | | return true;
|
| | | }
|
| | |
|
| | | //检测
|
| | | string checkKeys = UserCenterLogic.EncryptPassword(UserCenterResourse.FileEncryptKey, DirNameResourse.ShowOptionMenuFile + UserCenterResourse.UserInfo.Account);
|
| | |
| | | //出力详细Log(Debug用)
|
| | | UserCenterResourse.HideOption.DetailedLog = 1;
|
| | | }
|
| | | checkKeys = UserCenterLogic.EncryptPassword(UserCenterResourse.FileEncryptKey, DirNameResourse.DeviceHistoryFile + UserCenterResourse.UserInfo.Account);
|
| | | if (listFile.Contains(checkKeys) == true)
|
| | | {
|
| | | //显示设备历史版本(Debug用)
|
| | | UserCenterResourse.HideOption.DeviceHistory = 1;
|
| | | }
|
| | |
|
| | | //恢复
|
| | | IMessageCommon.Current.IgnoreError = false;
|
| | |
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 打开空调___________________________
|
| | | #region ■ 关闭空调___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 打开空调
|
| | | /// 关闭空调
|
| | | /// </summary>
|
| | | /// <param name="device">空调对象</param>
|
| | | /// <returns></returns>
|
| | |
| | | /// <returns></returns>
|
| | | public async Task<bool> SetAcModeSupport(AC device, int data)
|
| | | {
|
| | | var result = await HdlDeviceAttributeLogic.Current.WriteDeviceAttribute(device, 513, 4099, 25, data);
|
| | | var result = await HdlDeviceAttributeLogic.Current.WriteDeviceAttribute(device, 513, 4099, 25, data.ToString());
|
| | | //检测网关返回的共通错误状态码
|
| | | string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
|
| | | if (error != null)
|
| | |
| | | /// <param name="attributeDataType">数据类型</param>
|
| | | /// <param name="attributeData">需要写入的数据</param>
|
| | | /// <returns></returns>
|
| | | public async System.Threading.Tasks.Task<CommonDevice.SetWritableValueResponAllData> WriteDeviceAttribute(CommonDevice device, int clusterId, int attributeId, int attributeDataType, int attributeData)
|
| | | public async System.Threading.Tasks.Task<CommonDevice.SetWritableValueResponAllData> WriteDeviceAttribute(CommonDevice device, int clusterId, int attributeId, int attributeDataType, string attributeData)
|
| | | {
|
| | | var MyGateway = device.Gateway;
|
| | | if (MyGateway == null)
|
| | |
| | | /// <returns></returns>
|
| | | public async Task<bool> CommitCurtainLimitPoint(Rollershade rollershade, Rollershade.CurtainPrivateInstalledLimi limiType, int upLimit, int downLimit)
|
| | | {
|
| | | var result = await rollershade.SetCurtainInstalledLimitAsync(limiType);
|
| | | CommonDevice.SetWritableValueResponAllData result = null;
|
| | | if (upLimit == -1 && upLimit == -1)
|
| | | {
|
| | | //这个是卷帘
|
| | | result = await rollershade.SetCurtainInstalledLimitAsync(limiType);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (upLimit < 0) { upLimit = 0; }
|
| | | if (downLimit < 0) { downLimit = 100; }
|
| | |
|
| | | //这个是开合帘 "2,0x00ff,0x00ff"格式
|
| | | string convertData = "\"2,0x" + Convert.ToString(upLimit, 16).PadLeft(4, '0');
|
| | | convertData += ",0x" + Convert.ToString(downLimit, 16).PadLeft(4, '0') + "\"";
|
| | | //然后将它们转为ASK码数值,然后再转为16进制
|
| | | //总计长度为17(这里是16进制)
|
| | | string sendData = "11";
|
| | | foreach (char c in convertData)
|
| | | {
|
| | | sendData += Convert.ToString((int)c, 16).PadLeft(2, '0');
|
| | | }
|
| | | result = await HdlDeviceAttributeLogic.Current.WriteDeviceAttribute(rollershade, 258, 24, 65, sendData);
|
| | | }
|
| | | //检测网关返回的共通错误状态码
|
| | | string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
|
| | | if (error != null)
|
| | |
| | | #region ■ 修改干接点私有属性_________________
|
| | |
|
| | | /// <summary>
|
| | | /// 修改干接点私有属性
|
| | | /// 修改干接点第三级别的私有属性
|
| | | /// </summary>
|
| | | /// <param name="panel">干接点对象</param>
|
| | | /// <param name="i_value">干接点的第三级别属性的值,具体请参照第三级别属性</param>
|
| | | /// <returns></returns>
|
| | | public async Task<bool> EditorDryContactFunction(Panel panel, int i_value)
|
| | | public async Task<bool> EditorDryContactThirdFunction(Panel panel, int i_value)
|
| | | {
|
| | | var result = await panel.ConfigureHdlKeyValueAsync((Panel.KeyMode)i_value);
|
| | | //共通错误检测
|
| | |
| | | return false;
|
| | | }
|
| | | //备份设备
|
| | | await HdlGatewayLogic.Current.UpLoadDeviceBackupDataToGateway(panel, GatewayBackupEnum.A干接点私有属性, i_value);
|
| | | await HdlGatewayLogic.Current.UpLoadDeviceBackupDataToGateway(panel, GatewayBackupEnum.A干接点第三级别私有属性, i_value);
|
| | |
|
| | | return true;
|
| | | }
|
| | |
| | | errorMsg = UserCenterLogic.CombineGatewayTimeOutMsg(errorMsg, null, "回复超时", false);
|
| | | }
|
| | | this.ShowTipMsg(errorMsg);
|
| | | return false;
|
| | | }
|
| | | //备份设备
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | {
|
| | | await HdlGatewayLogic.Current.UpLoadDeviceBackupDataToGateway(device, GatewayBackupEnum.A简约面板震动功能, datainfo);
|
| | | }, ShowErrorMode.NO);
|
| | |
|
| | | return success;
|
| | | }
|
| | |
| | | return data.configureParamates;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 获取配置信息_______________________
|
| | |
|
| | | /// <summary>
|
| | | /// 获取PIR传感器的【lux值】,错误时返回-1
|
| | | /// </summary>
|
| | | /// <param name="iASZone"></param>
|
| | | /// <param name="mode"></param>
|
| | | /// <returns></returns>
|
| | | public async Task<int> GetPirSensorLux(IASZone iASZone)
|
| | | public async Task<int> GetPirSensorLux(IASZone iASZone, ShowErrorMode mode = ShowErrorMode.YES)
|
| | | {
|
| | | var data = await iASZone.GetPirLuxAbilitySizeAsync();
|
| | | if (data == null || data.pirLux == -1)
|
| | |
| | | string msg = Language.StringByID(R.MyInternationalizationString.uGetPirSensorLuxFail);
|
| | | //拼接上【网关回复超时】的Msg
|
| | | msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, data);
|
| | |
|
| | | this.ShowErrorMsg(msg);
|
| | | if (mode == ShowErrorMode.YES)
|
| | | {
|
| | | this.ShowErrorMsg(msg);
|
| | | }
|
| | | return -1;
|
| | | }
|
| | | return data.pirLux;
|
| | |
| | | /// <returns></returns>
|
| | | public async Task<bool> UpLoadDeviceBackupDataToGateway(CommonDevice device, GatewayBackupEnum backupEnum, object upLaodData)
|
| | | {
|
| | | //ZbGateway realWay = null;
|
| | | //if (HdlGatewayLogic.Current.GetRealGateway(ref realWay, device.CurrentGateWayId) == false)
|
| | | //{
|
| | | // //没有找到真实物理网关
|
| | | // return false;
|
| | | //}
|
| | | //string fileName = device.FilePath + ((int)backupEnum).ToString().PadLeft(5, '0');
|
| | | ////创建文件对象
|
| | | //var result = await realWay.CreateFileAsync(fileName);
|
| | | //if (result == null || result.Result != 0)
|
| | | //{
|
| | | // return false;
|
| | | //}
|
| | | ////发送数据流
|
| | | //var data = Newtonsoft.Json.JsonConvert.SerializeObject(upLaodData);
|
| | | //var byteData = System.Text.Encoding.UTF8.GetBytes(data);
|
| | | //var result2 = await realWay.SendFileAsync(byteData);
|
| | | //if (result2 == null || result2.Result != 0)
|
| | | //{
|
| | | // return false;
|
| | | //}
|
| | | ZbGateway realWay = null;
|
| | | if (HdlGatewayLogic.Current.GetRealGateway(ref realWay, device.CurrentGateWayId) == false)
|
| | | {
|
| | | //没有找到真实物理网关
|
| | | return false;
|
| | | }
|
| | | string fileName = device.FilePath + ((int)backupEnum).ToString().PadLeft(5, '0');
|
| | | //创建文件对象
|
| | | var result = await realWay.CreateFileAsync(fileName);
|
| | | if (result == null || result.Result != 0)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | //发送数据流
|
| | | var data = Newtonsoft.Json.JsonConvert.SerializeObject(upLaodData);
|
| | | var byteData = System.Text.Encoding.UTF8.GetBytes(data);
|
| | | var result2 = await realWay.SendFileAsync(byteData);
|
| | | if (result2 == null || result2.Result != 0)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | |
| | | int level = Convert.ToInt32(recoverData["level"]);
|
| | | result = await HdlDevicePanelLogic.Current.SetDeviceEnergyConservationMode((Panel)device, modeEnable, modeTime, level);
|
| | | }
|
| | | else if (backType == GatewayBackupEnum.A干接点私有属性)
|
| | | else if (backType == GatewayBackupEnum.A干接点第三级别私有属性)
|
| | | {
|
| | | var recoverData = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(System.Text.Encoding.UTF8.GetString(byteData));
|
| | | result = await HdlDevicePanelLogic.Current.EditorDryContactFunction((Panel)device, recoverData);
|
| | | result = await HdlDevicePanelLogic.Current.EditorDryContactThirdFunction((Panel)device, recoverData);
|
| | | }
|
| | | else if (backType == GatewayBackupEnum.A窗帘方向)
|
| | | {
|
| | |
| | | /// <param name="gatewayId">网关ID</param>
|
| | | /// <param name="topic">整个主题</param>
|
| | | /// <param name="reportTopic">上报数据的主题</param>
|
| | | /// <param name="receiveData">接收的数据</param>
|
| | | public void GatewayOverallMsgReceive(string gatewayId, string topic, string reportTopic, JObject receiveData)
|
| | | /// <param name="msgData">接收的数据</param>
|
| | | public void GatewayOverallMsgReceive(string gatewayId, string topic, string reportTopic, string msgData)
|
| | | {
|
| | | if (topic == "AppNoLogin")
|
| | | {
|
| | |
| | | });
|
| | | return;
|
| | | }
|
| | | else if (topic == "BeingSqueezedOffline")
|
| | | else if (topic == "ZigbeeGateWayToClient/" + Common.Config.Instance.ConnEmqClientId + "/Push/NotifySqueeze")
|
| | | {
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | |
| | | });
|
| | | return;
|
| | | }
|
| | | else if (topic == "/ZigbeeGateWayToClient/" + Common.Config.Instance.Guid + "/Push/Deleted"
|
| | | || topic == "/ZigbeeGateWayToClient/" + Common.Config.Instance.Guid + "/Push/DeletedShareData")
|
| | | else if (topic == "ZigbeeGateWayToClient/" + Common.Config.Instance.Guid + "/Push/Deleted"
|
| | | || topic == "ZigbeeGateWayToClient/" + Common.Config.Instance.Guid + "/Push/DeletedShareData")
|
| | | {
|
| | | if (UserCenterResourse.UserInfo.AuthorityNo == 3)
|
| | | {
|
| | |
| | | //不是自己绑定的网关,则不处理
|
| | | return;
|
| | | }
|
| | |
|
| | | //设备属性上报
|
| | | if (reportTopic == "DeviceStatusReport")
|
| | | {
|
| | | //设备属性上报
|
| | | this.DeviceAttributeReportPush(receiveData);
|
| | | this.DeviceAttributeReportPush(JObject.Parse(msgData));
|
| | | }
|
| | | //传感器上报
|
| | | else if (reportTopic == "IASInfoReport")
|
| | | {
|
| | | this.SensorDeviceReportPush(receiveData);
|
| | | this.SensorDeviceReportPush(JObject.Parse(msgData));
|
| | | }
|
| | | //门锁上报
|
| | | else if (topic == gatewayId + "/Alarms/SendAlarmInform")
|
| | | {
|
| | | this.DoorLockDeviceReportPush(receiveData);
|
| | | this.DoorLockDeviceReportPush(null);
|
| | | }
|
| | | //通过外部方式布防撤防成功时报告
|
| | | else if (topic == gatewayId + "/Security/EnOrWithdrawSucceedReport")
|
| | | {
|
| | | this.SecurityEnOrWithdrawSucceedReport(receiveData);
|
| | | this.SecurityEnOrWithdrawSucceedReport(JObject.Parse(msgData));
|
| | | }
|
| | | //设备在线状态更新反馈
|
| | | else if (reportTopic == "OnlineStatusChange_Respon")
|
| | | {
|
| | | this.DeviceOnlineChangePush(receiveData);
|
| | | this.DeviceOnlineChangePush(JObject.Parse(msgData));
|
| | | }
|
| | | //撤防
|
| | | else if (topic == gatewayId + "/Security/WithdrawMode_Respon")
|
| | | {
|
| | | this.RemoveSafetyGarrisonPush(receiveData);
|
| | | this.RemoveSafetyGarrisonPush(JObject.Parse(msgData));
|
| | | }
|
| | | //布防
|
| | | else if (topic == gatewayId + "/Security/EnableMode_Respon")
|
| | | {
|
| | | this.SetSafetyGarrisonPush(receiveData);
|
| | | this.SetSafetyGarrisonPush(JObject.Parse(msgData));
|
| | | }
|
| | | //逻辑触发上报
|
| | | else if (topic == gatewayId + "/Logic/Execute_Respon")
|
| | | {
|
| | | this.LogicExecutePush(receiveData);
|
| | | this.LogicExecutePush(null);
|
| | | }
|
| | | //场景触发上报
|
| | | else if (topic == gatewayId + "/Scene/Exec_Respon")
|
| | | {
|
| | | this.SceneExecPush(receiveData);
|
| | | this.SceneExecPush(null);
|
| | | }
|
| | | }
|
| | | catch (Exception ex)
|
| | |
| | | private void DoorLockDeviceReportPush(JObject receiveData)
|
| | | {
|
| | | //保存门锁信息到本地
|
| | | HdlAlarmsLogic.Current.SaveDoorLockAlarmInfo(receiveData);
|
| | | //HdlAlarmsLogic.Current.SaveDoorLockAlarmInfo(receiveData);
|
| | |
|
| | | //显示有新消息的特效
|
| | | this.ShowHadNewMessageAppeal();
|
| | |
| | |
|
| | | //消息记录重新读取及检测
|
| | | ControlCommonResourse.ReadMessageAgain = true;
|
| | | ControlCommonResourse.HadNewMessage = false;
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | for (int i = 0; i < ControlCommonResourse.listMessageManaContr.Count; i++)
|
| | | {
|
| | | //显示角标特效
|
| | | ControlCommonResourse.listMessageManaContr[i].IsSelected = false;
|
| | | }
|
| | | });
|
| | |
|
| | | //加载账号配置信息
|
| | | var optionInfo = UserCenterResourse.Option.Load();
|
| | | UserCenterResourse.Option = optionInfo;
|
| | |
| | | /// </summary>
|
| | | public const string DetailedLogFile = "DetailedLogFile";
|
| | | /// <summary>
|
| | | /// 显示设备历史版本的【标识文件】,不加密
|
| | | /// </summary>
|
| | | public const string DeviceHistoryFile = "DeviceHistoryFile";
|
| | | /// <summary>
|
| | | /// 功能备份的名字 这个东西不加密
|
| | | /// </summary>
|
| | | public const string OptionBackupName = "##Option##";
|
| | |
| | | FrameLayout blankFrameLayout;//空数据显示布局 |
| | | List<int> typeModeList;//动态获取按键支持的模式大类型 |
| | | public List<ScenesListInfo> gwScenesList = new List<ScenesListInfo>();//网关中的场景列表 |
| | | bool IsRead = false; |
| | | |
| | | #endregion |
| | | |
| | | //初始化按键数据 |
| | | private void InitListInfo() |
| | | void InitListInfo() |
| | | { |
| | | System.Threading.Tasks.Task.Run(async () => |
| | | { |
| | | try |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | }); |
| | | localDeviceList.Clear(); |
| | | scList.Clear(); |
| | | //获取本地设备列表 |
| | |
| | | { |
| | | gwScenesList = gwSceneObj.getSceneInfo.ScenesList; |
| | | } |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | }); |
| | | } |
| | | //动态获取按键支持的大类 |
| | | typeModeList = await GetTypeMode(); |
| | | #region 读取面板当前模式 |
| | | //读取按键当前模式 |
| | | var tempDeata = await currentKey.ReadPanelConfigureInfoAsync(); |
| | |
| | | } |
| | | currentKey.ReSave(); |
| | | //读取按键当前绑定目标 |
| | | var getBindList = await currentKey.GetDeviceBindAsync(); |
| | | var bindDeviceListTemp = new System.Collections.Generic.List<BindListResponseObj> { }; |
| | | var bindSceneListTemp = new System.Collections.Generic.List<BindListResponseObj> { }; |
| | | if (getBindList != null && getBindList.getAllBindResponseData != null) |
| | | GetDeviceBindResponseAllData getBindList = null; |
| | | if (IsRead) |
| | | { |
| | | currentKey.bindList.Clear(); |
| | | foreach (var b in getBindList.getAllBindResponseData.BindList) |
| | | getBindList = await currentKey.GetDeviceBindAsync(); |
| | | var bindDeviceListTemp = new System.Collections.Generic.List<BindListResponseObj> { }; |
| | | var bindSceneListTemp = new System.Collections.Generic.List<BindListResponseObj> { }; |
| | | if (getBindList != null && getBindList.getAllBindResponseData != null) |
| | | { |
| | | if (b.BindCluster == currentClusterID) |
| | | currentKey.bindList.Clear(); |
| | | foreach (var b in getBindList.getAllBindResponseData.BindList) |
| | | { |
| | | if (b.BindCluster == 6) |
| | | if (b.BindCluster == currentClusterID) |
| | | { |
| | | if (b.BindCluster == 6) |
| | | { |
| | | |
| | | if (b.BindType == 2) |
| | | { |
| | | bindSceneListTemp.Add(b); |
| | | } |
| | | else |
| | | { |
| | | bindDeviceListTemp.Add(b); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (currentClusterID == 8) |
| | | { |
| | | if (b.BindCluster == 8) |
| | | if (b.BindType == 2) |
| | | { |
| | | currentKey.bindList.Add(b); |
| | | bindSceneListTemp.Add(b); |
| | | } |
| | | else |
| | | { |
| | | bindDeviceListTemp.Add(b); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | currentKey.bindList.Add(b); |
| | | if (currentClusterID == 8) |
| | | { |
| | | if (b.BindCluster == 8) |
| | | { |
| | | currentKey.bindList.Add(b); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | currentKey.bindList.Add(b); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | else |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | }); |
| | | } |
| | | |
| | | if (currentKey.panelMode == 1) |
| | | { |
| | | currentKey.bindList = bindSceneListTemp; |
| | | currentKey.currentKeySelectModeText = Language.StringByID(R.MyInternationalizationString.AddScene); |
| | | } |
| | | else if (currentKey.panelMode == 100 || currentKey.panelMode == 101 || currentKey.panelMode == 102) |
| | | { |
| | | currentKey.bindList = bindDeviceListTemp; |
| | | currentKey.currentKeySelectModeText = Language.StringByID(R.MyInternationalizationString.AddSwitch); |
| | | } |
| | | else if (currentKey.panelMode == 200 || currentKey.panelMode == 201 || currentKey.panelMode == 203 || currentKey.panelMode == 204 || currentKey.panelMode == 205) |
| | | { |
| | | currentKey.currentKeySelectModeText = Language.StringByID(R.MyInternationalizationString.AddDimmer); |
| | | } |
| | | else if (currentKey.panelMode == 300 || currentKey.panelMode == 301 || currentKey.panelMode == 302 || currentKey.panelMode == 303 || currentKey.panelMode == 304) |
| | | { |
| | | currentKey.currentKeySelectModeText = Language.StringByID(R.MyInternationalizationString.AddCurtain); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | return; |
| | | }); |
| | | } |
| | | if (currentKey.panelMode == 1) |
| | | { |
| | | currentKey.bindList = bindSceneListTemp; |
| | | currentKey.currentKeySelectModeText = Language.StringByID(R.MyInternationalizationString.AddScene); |
| | | } |
| | | else if (currentKey.panelMode == 100 || currentKey.panelMode == 101 || currentKey.panelMode == 102) |
| | | { |
| | | currentKey.bindList = bindDeviceListTemp; |
| | | currentKey.currentKeySelectModeText = Language.StringByID(R.MyInternationalizationString.AddSwitch); |
| | | } |
| | | else if (currentKey.panelMode == 200 || currentKey.panelMode == 201 || currentKey.panelMode == 203 || currentKey.panelMode == 204 || currentKey.panelMode == 205) |
| | | { |
| | | currentKey.currentKeySelectModeText = Language.StringByID(R.MyInternationalizationString.AddDimmer); |
| | | } |
| | | else if (currentKey.panelMode == 300 || currentKey.panelMode == 301 || currentKey.panelMode == 302 || currentKey.panelMode == 303 || currentKey.panelMode == 304) |
| | | { |
| | | currentKey.currentKeySelectModeText = Language.StringByID(R.MyInternationalizationString.AddCurtain); |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | //动态获取按键支持的大类 |
| | | typeModeList = await GetTypeMode(); |
| | | #endregion |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | RefreshList(); |
| | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | }); |
| | | return; |
| | |
| | | #endregion |
| | | CommonPage.Loading.Start(""); |
| | | middleFrameLayout(); |
| | | if (currentKey.bindList.Count == 0) |
| | | { |
| | | IsRead = true; |
| | | } |
| | | else |
| | | { |
| | | IsRead = false; |
| | | } |
| | | InitListInfo(); |
| | | |
| | | } |
| | |
| | | midVerticalRefreshLayout.BeginHeaderRefreshingAction += () => |
| | | { |
| | | midVerticalRefreshLayout.BeginHeaderRefreshing(); |
| | | IsRead = true; |
| | | InitListInfo(); |
| | | midVerticalRefreshLayout.EndHeaderRefreshing(); |
| | | }; |
| | |
| | | } |
| | | CommonPage.Loading.Hide(); |
| | | } |
| | | }; |
| | | }; |
| | | }; |
| | | } |
| | | |
| | |
| | | currentKey.currentKeySelectModeText = oldKeySelectModeText; |
| | | dialog.Close(); |
| | | } |
| | | }; |
| | | }; |
| | | } |
| | | } |
| | | else |
| | |
| | | currentKey.currentKeySelectModeText = oldKeySelectModeText; |
| | | dialog.Close(); |
| | | } |
| | | }; |
| | | }; |
| | | } |
| | | } |
| | | else |
| | |
| | | HdlLogLogic.Current.WriteLog(ex, msg);
|
| | | //出现未知错误
|
| | | this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnKnownError));
|
| | | this.listView.RemoveAll();
|
| | | //设备异常补救 -> 添加重置电机行
|
| | | this.AddElectricalMachineryRow();
|
| | | try
|
| | | {
|
| | | this.listView.RemoveAll();
|
| | | //设备异常补救 -> 添加重置电机行
|
| | | this.AddElectricalMachineryRow();
|
| | | }
|
| | | catch (Exception ex2) { HdlLogLogic.Current.WriteLog(ex2, "开合帘补救异常"); }
|
| | | }
|
| | | });
|
| | | }
|
| | |
| | | //选择的是传感器输入
|
| | | value = 65535;
|
| | | }
|
| | | var result = await HdlDevicePanelLogic.Current.EditorDryContactFunction((Panel)nowSelectDevice, value);
|
| | | var result = await HdlDevicePanelLogic.Current.EditorDryContactThirdFunction((Panel)nowSelectDevice, value);
|
| | | if (result == true)
|
| | | {
|
| | | //重新初始化菜单行,隐藏或者开放绑定目标菜单
|
| | |
| | | /// </summary> |
| | | private void InitTopRightMenu()
|
| | | {
|
| | | if (UserCenterResourse.HideOption.DeviceHistory != 1)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var btnIcon = new MostRightIconControl(69, 69);
|
| | | btnIcon.UnSelectedImagePath = "Item/More.png";
|
| | | topFrameLayout.AddChidren(btnIcon);
|
| | |
| | | this.ClearBodyFrame();
|
| | |
|
| | | //当前亮度值
|
| | | string txtValue = Language.StringByID(R.MyInternationalizationString.uNowBrightnessValue);
|
| | | var frameNowLinght = new FrameRowControl();
|
| | | frameNowLinght.UseClickStatu = false;
|
| | | frameNowLinght.BackgroundColor = UserCenterColor.Current.White;
|
| | | bodyFrameLayout.AddChidren(frameNowLinght);
|
| | | frameNowLinght.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uNowBrightnessValue) + ":" + pirLuxValue + "lux", 900);
|
| | | var btnLux = frameNowLinght.AddLeftCaption(txtValue + ":" + pirLuxValue + "lux", 900);
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | {
|
| | | while (this.Parent != null)
|
| | | {
|
| | | //他们说这个东西要2秒刷新一次 获取PIR传感器的【lux值】
|
| | | this.pirLuxValue = await HdlDevicePirSensorLogic.Current.GetPirSensorLux(deviceIASZone, ShowErrorMode.NO);
|
| | | if (pirLuxValue != -1)
|
| | | {
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | btnLux.Text = txtValue + ":" + pirLuxValue + "lux";
|
| | | }, ShowErrorMode.NO);
|
| | | }
|
| | | await Task.Delay(2000);
|
| | | }
|
| | | }, ShowErrorMode.NO);
|
| | |
|
| | |
|
| | | var listView = new VerticalListControl(0);
|
| | | listView.Y = Application.GetRealHeight(150);
|
| | |
| | | var doorLock = tempDevice as ZigBee.Device.DoorLock; |
| | | if (doorLock.doorLockProgrammingEventNotificationCommand != null) |
| | | { |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | }); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | //开关图标 |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser); |
| | | //开关图标 |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser); |
| | | } |
| | | } |
| | | else |
| | |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | } |
| | | }; |
| | | }; |
| | | }; |
| | | #endregion |
| | | |
| | |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser); |
| | | } |
| | | }; |
| | | btnDoorlockUser.EditorEnterAction += action; |
| | | btnDoorlockUser.EditorEnterAction += action; |
| | | #endregion |
| | | i++; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | public UserManagement(ZigBee.Device.DoorLock doorLock) |
| | | { |
| | | this.doorLock = doorLock; |
| | | localAllAccountListTemp = doorLock.localAllAccountList; |
| | | localDoorLockUserListTemp = doorLock.localDoorLockUserList; |
| | | } |
| | | |
| | | #region ◆ 变量申明__________________________ |
| | | ZigBee.Device.DoorLock doorLock; |
| | | VerticalRefreshLayout midVerticalScrolViewLayout; |
| | | public List<Shared.Phone.UserCenter.MemberInfoRes> localAllAccountListTemp = new List<Shared.Phone.UserCenter.MemberInfoRes> { }; |
| | | public Dictionary<int, DoorLockCommonInfo.LocaDoorLockObj> localDoorLockUserListTemp = new Dictionary<int, DoorLockCommonInfo.LocaDoorLockObj>(); |
| | | |
| | | |
| | | #endregion |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | doorLock.localAllAccountList.Clear(); |
| | | doorLock.localAllAccountList = localAccountListTemp; |
| | | localAllAccountListTemp = doorLock.localAllAccountList; |
| | | |
| | | //初始化权限信息 |
| | | foreach (var sub in localAccountListTemp) |
| | |
| | | } |
| | | |
| | | //获取本地门锁列表 |
| | | var list = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockAllAcountUserlist(doorLock); |
| | | if (localDoorLockUserListTemp.Count == 0) |
| | | { |
| | | var list = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockAllAcountUserlist(doorLock); |
| | | localDoorLockUserListTemp = doorLock.localDoorLockUserList; |
| | | } |
| | | doorLock.ReSave(); |
| | | } |
| | | else |
| | |
| | | TextID = R.MyInternationalizationString.Undistributed, |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMTopTitleText, |
| | | X = btnUndistributeIcon.Right, |
| | | IsBold =true, |
| | | TextSize =13, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | IsBold = true, |
| | | TextSize = 13, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | btnAddFrameLayout.AddChidren(btnUndistributeText); |
| | | if (UserCenterResourse.UserInfo.AuthorityNo != 1) |
| | | { |
| | |
| | | }; |
| | | this.midFrameLayout.AddChidren(midVerticalScrolViewLayout); |
| | | |
| | | CommonPage.Loading.Start("Loading..."); |
| | | ReadAccountDoorLockInfoList(); |
| | | if (localAllAccountListTemp.Count == 0) |
| | | { |
| | | CommonPage.Loading.Start("Loading..."); |
| | | ReadAccountDoorLockInfoList(); |
| | | } |
| | | else |
| | | { |
| | | MidFrameLayoutContent(); |
| | | } |
| | | |
| | | midVerticalScrolViewLayout.BeginHeaderRefreshingAction += () => |
| | | { |
| | |
| | | /// </summary> |
| | | private void InitTopRightMenu()
|
| | | {
|
| | | if (UserCenterResourse.HideOption.DeviceHistory != 1)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var btnIcon = new MostRightIconControl(69, 69);
|
| | | btnIcon.UnSelectedImagePath = "Item/More.png";
|
| | | topFrameLayout.AddChidren(btnIcon);
|
| | |
| | | |
| | | //字数
|
| | | var btnFild = new NormalViewControl(120, 60, true);
|
| | | btnFild.X = frameInput.Width - ControlCommonResourse.XXLeft - Application.GetRealWidth(80);
|
| | | btnFild.X = frameInput.Width - ControlCommonResourse.XXLeft - Application.GetRealWidth(120);
|
| | | btnFild.Y = Application.GetRealHeight(503);
|
| | | btnFild.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | | btnFild.TextSize = 12;
|
| | |
| | |
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.uSubmitSuccessMsg));
|
| | | //关闭界面
|
| | | this.CloseForm();
|
| | | //显示成功的界面
|
| | | this.ShowSuccessMsg();
|
| | | });
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 显示成功的界面
|
| | | /// </summary>
|
| | | private void ShowSuccessMsg()
|
| | | {
|
| | | var frameBack = new FrameLayout();
|
| | | frameBack.BackgroundColor = 0x80000000;
|
| | | this.AddChidren(frameBack);
|
| | |
|
| | | var frameMsg = new FrameLayout();
|
| | | frameMsg.BackgroundColor = UserCenterColor.Current.White;
|
| | | frameMsg.Width = Application.GetRealWidth(622);
|
| | | frameMsg.Height = Application.GetRealHeight(317);
|
| | | frameMsg.Radius = (uint)Application.GetRealHeight(17);
|
| | | frameMsg.Gravity = Gravity.CenterHorizontal;
|
| | | frameMsg.Y = Application.GetRealHeight(792);
|
| | | frameBack.AddChidren(frameMsg);
|
| | |
|
| | | //提示
|
| | | var btnTitle = new NormalViewControl(492, 65, true);
|
| | | btnTitle.Y = Application.GetRealHeight(68);
|
| | | btnTitle.Gravity = Gravity.CenterHorizontal;
|
| | | btnTitle.TextID = R.MyInternationalizationString.NormalTip;
|
| | | btnTitle.TextAlignment = TextAlignment.Center;
|
| | | btnTitle.TextColor = 0xFF333443;
|
| | | frameMsg.AddChidren(btnTitle);
|
| | |
|
| | | //您的反馈已成功提交
|
| | | var btnSuccess = new NormalViewControl(frameMsg.Width, Application.GetRealHeight(60), false);
|
| | | btnSuccess.Y = Application.GetRealHeight(166);
|
| | | btnSuccess.TextAlignment = TextAlignment.Center;
|
| | | btnSuccess.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | | btnSuccess.TextID = R.MyInternationalizationString.uSubmitSuccessMsg;
|
| | | frameMsg.AddChidren(btnSuccess);
|
| | |
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | System.Threading.Thread.Sleep(2000);
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | this.CloseForm();
|
| | | });
|
| | | });
|
| | | }
|
| | |
|
| | | #endregion
|
| | | }
|
| | | }
|
old mode 100755
new mode 100644
| | |
| | | //数据异常
|
| | | return;
|
| | | }
|
| | |
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | //清空
|
| | | listView.RemoveAll();
|
| | | }); |
| | | if (dicData.Count == 0) |
| | | { |
| | | //关闭进度条 |
| | | this.CloseProgressBar(); |
| | | HdlThreadLogic.Current.RunMain(() => |
| | | { |
| | | //关闭刷新特效 |
| | | listView.EndHeaderRefreshing(); |
| | | listView.frameTable.Height = listView.Height; |
| | | }); |
| | | return; |
| | | }
|
| | | //初始化中部控件
|
| | | this.InitMiddleFrame(dicData);
|
| | | }
|
| | |
| | | maxCount += data.Count;
|
| | | }
|
| | |
|
| | | int waiTime = 1000;
|
| | | int waiTime = 500;
|
| | | foreach (var keys in dicData.Keys)
|
| | | {
|
| | | var listGroup = dicData[keys];
|
| | |
| | | });
|
| | | //第一次的时候,等待的时候久一点
|
| | | System.Threading.Thread.Sleep(waiTime);
|
| | | waiTime = 500;
|
| | | waiTime = 300;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | |
| | | var bg = new Button |
| | | { |
| | | X = Application.GetRealWidth(485), |
| | | X = Application.GetRealWidth(495), |
| | | Y = Application.GetRealHeight(161), |
| | | Width = Application.GetRealWidth(449), |
| | | Height = Application.GetRealHeight(495), |
| | |
| | | |
| | | var bg1 = new FrameLayout |
| | | { |
| | | X = Application.GetRealWidth(485), |
| | | X = Application.GetRealWidth(495), |
| | | Y = Application.GetRealHeight(161), |
| | | Width = Application.GetRealWidth(449), |
| | | Height = Application.GetRealHeight(495), |
| | |
| | | atHome.IsSelected = true; |
| | | tempRow = atHome; |
| | | } |
| | | atHome.ClickBtn.MouseUpEventHandler += (sender, e) => |
| | | atHome.ButtonClickEvent += (sender, e) => |
| | | { |
| | | if((sender as Button).IsSelected) |
| | | if(sender.IsSelected) |
| | | { |
| | | dialog.Close(); |
| | | return; |
| | |
| | | dialog.Close(); |
| | | if(result == GarrisonMode.AtHome) |
| | | { |
| | | |
| | | |
| | | } |
| | | }); |
| | | |
| | | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | |
| | | withdrawGarriso.IsSelected = true; |
| | | tempRow = withdrawGarriso; |
| | | } |
| | | withdrawGarriso.ClickBtn.MouseUpEventHandler += (sender, e) => |
| | | withdrawGarriso.ButtonClickEvent += (sender, e) => |
| | | { |
| | | if ((sender as Button).IsSelected) |
| | | if (sender.IsSelected) |
| | | { |
| | | dialog.Close(); |
| | | return; |
| | |
| | | { |
| | | atHome.IsSelected = true; |
| | | } |
| | | atHome.ClickBtn.MouseUpEventHandler += (sender, e) => |
| | | atHome.ButtonClickEvent += (sender, e) => |
| | | { |
| | | if ((sender as Button).IsSelected) |
| | | if (sender.IsSelected) |
| | | { |
| | | dialog.Close(); |
| | | return; |
| | |
| | | { |
| | | removeHome.IsSelected = true; |
| | | } |
| | | removeHome.ClickBtn.MouseUpEventHandler += (sender, e) => |
| | | removeHome.ButtonClickEvent += (sender, e) => |
| | | { |
| | | if ((sender as Button).IsSelected) |
| | | if (sender.IsSelected) |
| | | { |
| | | dialog.Close(); |
| | | return; |
| | |
| | | { |
| | | withdrawGarriso.IsSelected = true; |
| | | } |
| | | withdrawGarriso.ClickBtn.MouseUpEventHandler += (sender, e) => |
| | | withdrawGarriso.ButtonClickEvent += (sender, e) => |
| | | { |
| | | if ((sender as Button).IsSelected) |
| | | if (sender.IsSelected) |
| | | { |
| | | dialog.Close(); |
| | | return; |
| | |
| | | } |
| | | } |
| | | break; |
| | | case DeviceType.TemperatureSensor: |
| | | //温度 |
| | | if (common.DeviceStatusReport.CluterID == 1026) |
| | | { |
| | | var tempera = deviceUI.CommonDevice as TemperatureSensor; |
| | | foreach (var data in common.DeviceStatusReport.AttriBute) |
| | | { |
| | | if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue) |
| | | { |
| | | if (data.AttriButeData == 0) |
| | | { |
| | | tempera.Temperatrue = 0; |
| | | } |
| | | else if (data.AttriButeData > 32767) |
| | | { |
| | | //负数(特殊处理) |
| | | string strValue = (data.AttriButeData - 65536).ToString(); |
| | | //小数点需要一位 |
| | | strValue = strValue.Substring(0, strValue.Length - 1); |
| | | tempera.Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); |
| | | } |
| | | else |
| | | { |
| | | //小数点需要一位 |
| | | string strValue = data.AttriButeData.ToString(); |
| | | strValue = strValue.Substring(0, strValue.Length - 1); |
| | | tempera.Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); |
| | | } |
| | | |
| | | tempera.LastDateTime = DateTime.Now; |
| | | (rowFL.GetChildren(j) as FunctionMainView).StatuButton.Text = deviceUI.GetDeviceStatu(); |
| | | } |
| | | } |
| | | } |
| | | //湿度 |
| | | if (common.DeviceStatusReport.CluterID == 1029) |
| | | { |
| | | var tempera = deviceUI.CommonDevice as TemperatureSensor; |
| | | foreach (var data in common.DeviceStatusReport.AttriBute) |
| | | { |
| | | if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue) |
| | | { |
| | | if (data.AttriButeData == 0) |
| | | { |
| | | tempera.Humidity = 0; |
| | | } |
| | | else |
| | | { |
| | | //小数点需要一位(湿度没有负数) |
| | | string strValue = data.AttriButeData.ToString(); |
| | | strValue = strValue.Substring(0, strValue.Length - 1); |
| | | tempera.Humidity = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); |
| | | } |
| | | tempera.LastDateTime = DateTime.Now; |
| | | (rowFL.GetChildren(j) as FunctionMainView).StatuButton.Text = deviceUI.GetDeviceStatu(); |
| | | } |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | }
|
| | | }
|
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.GXCTextColor, |
| | | Text = Config.Instance.Home.GetCurrentFloorName, |
| | | IsBold=true |
| | | IsBold = true, |
| | | TextSize = 14 |
| | | }; |
| | | if (Config.Instance.Home.FloorDics.Count > 0) |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | var residenceListView = new Dialog(); |
| | | residenceListView.Show(); |
| | | var closeBGview = new FrameLayout(); |
| | | residenceListView.AddChidren(closeBGview); |
| | | closeBGview.MouseUpEventHandler += (send1, e1) => |
| | | var selectHouse = new Device.Category.SelectHouse(); |
| | | selectHouse.Init(); |
| | | selectHouse.HouseAction = (houseId) => |
| | | { |
| | | residenceListView.Close(); |
| | | ChangeResidence(House.GetHouseByHouseId(houseId)); |
| | | }; |
| | | |
| | | var bg = new Button |
| | | { |
| | | X = Application.GetRealWidth(35), |
| | | Y = Application.GetRealHeight(248), |
| | | Width = Application.GetMinRealAverage(449), |
| | | Height = Application.GetMinRealAverage(478), |
| | | UnSelectedImagePath = "Item/SelectHouse.png" |
| | | }; |
| | | closeBGview.AddChidren(bg); |
| | | |
| | | var changeHomeFL = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(35), |
| | | Y = Application.GetRealHeight(271), |
| | | Height = Application.GetMinRealAverage(449), |
| | | Width = Application.GetMinRealAverage(440), |
| | | Radius = CommonPage.BigFormRadius, |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor |
| | | }; |
| | | closeBGview.AddChidren(changeHomeFL); |
| | | |
| | | var changeHomeBtn = new Button() |
| | | { |
| | | X = Application.GetRealWidth(80), |
| | | Width = Application.GetRealWidth(350), |
| | | Height = Application.GetRealHeight(150), |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextID = R.MyInternationalizationString.ChangeHome, |
| | | TextAlignment = TextAlignment.CenterLeft |
| | | }; |
| | | changeHomeFL.AddChidren(changeHomeBtn); |
| | | |
| | | var scrolView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = changeHomeBtn.Bottom, |
| | | Height = Application.GetMinRealAverage(305 - 10) |
| | | }; |
| | | changeHomeFL.AddChidren(scrolView); |
| | | |
| | | var clickCheckBtn = new Device.CommonForm.SelectedStatuButton(); |
| | | var clickNameBtn = new Device.CommonForm.SelectedStatuButton(); |
| | | foreach (var homeFilePath in Config.Instance.HomeFilePathList) |
| | | { |
| | | var home = House.GetHouseByFilePath(homeFilePath); |
| | | if (home == null) |
| | | { |
| | | continue; |
| | | } |
| | | var rowView = new RowLayout() |
| | | { |
| | | Height = Application.GetRealHeight(150) |
| | | }; |
| | | scrolView.AddChidren(rowView); |
| | | var pointBtn = new Device.CommonForm.SelectedStatuButton() |
| | | { |
| | | X = Application.GetRealWidth(80), |
| | | Width = Application.GetMinRealAverage(80), |
| | | Height = Application.GetMinRealAverage(80), |
| | | Gravity = Gravity.CenterVertical, |
| | | UnSelectedImagePath = "Item/House.png", |
| | | SelectedImagePath = "Item/HouseSelected.png", |
| | | IsSelected = home.Id == Config.Instance.Home.Id |
| | | }; |
| | | rowView.AddChidren(pointBtn); |
| | | var nameBtn = new Device.CommonForm.SelectedStatuButton() |
| | | { |
| | | X = Application.GetRealWidth(173), |
| | | Width = Application.GetRealWidth(280), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = home.Name, |
| | | TextColor = ZigbeeColor.Current.GXCTextGrayColor, |
| | | SelectedTextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | IsSelected = home.Id == Config.Instance.Home.Id |
| | | }; |
| | | if (home.IsOthreShare) |
| | | { |
| | | nameBtn.Text = $"{home.Name}"; |
| | | } |
| | | rowView.AddChidren(nameBtn); |
| | | |
| | | EventHandler<MouseEventArgs> selectedResidenceHandler = (send1, e1) => |
| | | { |
| | | if (Config.Instance.Home.FileName == homeFilePath) |
| | | { |
| | | return; |
| | | } |
| | | clickCheckBtn.IsSelected = false; |
| | | clickNameBtn.IsSelected = false; |
| | | pointBtn.IsSelected = true; |
| | | nameBtn.IsSelected = true; |
| | | |
| | | residecneName.Text = home.Name; |
| | | if (home.IsOthreShare) |
| | | { |
| | | nameBtn.Text = $"{home.Name}"; |
| | | } |
| | | clickCheckBtn = pointBtn; |
| | | clickNameBtn = nameBtn; |
| | | residenceListView.Close(); |
| | | ChangeResidence(home); |
| | | }; |
| | | nameBtn.MouseUpEventHandler += selectedResidenceHandler; |
| | | pointBtn.MouseUpEventHandler += selectedResidenceHandler; |
| | | rowView.MouseUpEventHandler += selectedResidenceHandler; |
| | | if (home.Id == Config.Instance.Home.Id) |
| | | { |
| | | pointBtn.IsSelected = true; |
| | | nameBtn.IsSelected = true; |
| | | clickCheckBtn = pointBtn; |
| | | clickNameBtn = nameBtn; |
| | | residecneName.Text = home.Name; |
| | | if (home.IsOthreShare) |
| | | { |
| | | residecneName.Text = nameBtn.Text = $"{home.Name}"; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | pointBtn.IsSelected = false; |
| | | nameBtn.IsSelected = false; |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | //消息 |
| | | messageBtn.MouseUpEventHandler += (send, e) => |
| | | { |
| | | |
| | | }; |
| | | |
| | | #endregion |
| | |
| | | if (roomPageView.GetChildren(roomPageView.PageIndex) != null) |
| | | { |
| | | (roomPageView.GetChildren(roomPageView.PageIndex) as RoomView).HideName(false); |
| | | |
| | | |
| | | } |
| | | |
| | | var functionSceneView = new FrameLayout() |
| | |
| | | //切换当前房间 |
| | | Room.CurrentRoom = rList[roomPageView.PageIndex]; |
| | | RefreshBodyView(); |
| | | |
| | | |
| | | }; |
| | | } |
| | | else |
| | |
| | | floorFL.FloorAction = (floorId) => |
| | | { |
| | | floorBtn.Text = Config.Instance.Home.GetFloorNameById(floorId); |
| | | Common.Room.CurrentRoom = Common.Room.CurrentRoom?.GetLoveRoom(); |
| | | Show(); |
| | | }; |
| | | } |
| | |
| | | |
| | | (device.CommonDevice as Rollershade).CurtainUpDownStopControl(0); |
| | | |
| | | ((sender as Button).Parent as FunctionMainView).SetStatuText(CommonFormResouce.GetSwitchStatu(true)); |
| | | ((sender as Button).Parent as FunctionMainView).SetStatuText(Language.StringByID(R.MyInternationalizationString.Open)); |
| | | ((sender as Button).Parent as FunctionMainView).IsSelected = true; |
| | | |
| | | //控制延时回调 |
| | |
| | | |
| | | (device.CommonDevice as Rollershade).CurtainUpDownStopControl(1); |
| | | |
| | | ((sender as Button).Parent as FunctionMainView).SetStatuText(CommonFormResouce.GetSwitchStatu(false)); |
| | | ((sender as Button).Parent as FunctionMainView).SetStatuText(Language.StringByID(R.MyInternationalizationString.Close)); |
| | | ((sender as Button).Parent as FunctionMainView).IsSelected = false; |
| | | |
| | | //控制延时回调 |
| | |
| | | } |
| | | lightView.CollectButton.MouseUpEventHandler += collectionEvent; |
| | | } |
| | | else if (device.CommonDevice.Type == DeviceType.TemperatureSensor) |
| | | { |
| | | var tempera = device.CommonDevice as TemperatureSensor; |
| | | |
| | | if (tempera.Gateway != null) |
| | | { |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(100 * i); |
| | | if (tempera.Gateway.IsVirtual) |
| | | { |
| | | ReadStatus(tempera, () => |
| | | { |
| | | if (tempera.SensorDiv == 1) |
| | | { |
| | | ReadDeviceAttributeLogic.Instance.SendTemperatureStatuComand(device.CommonDevice); |
| | | } |
| | | else if (tempera.SensorDiv == 2) |
| | | { |
| | | ReadDeviceAttributeLogic.Instance.SendHumidityStatuComand(device.CommonDevice); |
| | | } |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | if (CommonPage.ReadDeviceStatuSpan < (DateTime.Now - tempera.LastDateTime).TotalSeconds) |
| | | { |
| | | if (tempera.SensorDiv == 1) |
| | | { |
| | | ReadDeviceAttributeLogic.Instance.SendTemperatureStatuComand(device.CommonDevice); |
| | | } |
| | | else if (tempera.SensorDiv == 2) |
| | | { |
| | | ReadDeviceAttributeLogic.Instance.SendHumidityStatuComand(device.CommonDevice); |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | var lightView = new FunctionMainView(xx, yy); |
| | | itemView.AddChidren(lightView); |
| | | lightView.Init(); |
| | | lightView.Tag = device; |
| | | lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath); |
| | | lightView.SetStatuText(device.GetDeviceStatu()); |
| | | lightView.SetDeviceName(device.CommonDevice.DeviceEpointName); |
| | | lightView.IsSelected = false; |
| | | lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(Room.CurrentRoom, device.FileName)); |
| | | lightView.CanControl(false); |
| | | var dev = Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName); |
| | | if (dev == null) |
| | | { |
| | | lightView.CollectButton.IsSelected = false; |
| | | } |
| | | else |
| | | { |
| | | lightView.CollectButton.IsSelected = true; |
| | | } |
| | | lightView.CollectButton.MouseUpEventHandler += collectionEvent; |
| | | } |
| | | } |
| | | else if (device.CommonDevice.Type == DeviceType.DoorLock) |
| | | { |
| | | //门锁 |
| | |
| | | myDevice.LastDateTime = DateTime.Now;
|
| | | }
|
| | | break;
|
| | | |
| | | case DeviceType.TemperatureSensor: |
| | | //温度 |
| | | if (common.DeviceStatusReport.CluterID == 1026) |
| | | { |
| | | var tempera = (TemperatureSensor)myDevice; |
| | | foreach (var data in common.DeviceStatusReport.AttriBute) |
| | | { |
| | | if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue) |
| | | { |
| | | if (data.AttriButeData == 0) |
| | | { |
| | | tempera.Temperatrue = 0; |
| | | } |
| | | else if (data.AttriButeData > 32767) |
| | | { |
| | | //负数(特殊处理) |
| | | string strValue = (data.AttriButeData - 65536).ToString(); |
| | | //小数点需要一位 |
| | | strValue = strValue.Substring(0, strValue.Length - 1); |
| | | tempera.Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); |
| | | } |
| | | else |
| | | { |
| | | //小数点需要一位 |
| | | string strValue = data.AttriButeData.ToString(); |
| | | strValue = strValue.Substring(0, strValue.Length - 1); |
| | | tempera.Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //湿度 |
| | | if (common.DeviceStatusReport.CluterID == 1029) |
| | | { |
| | | var tempera = (TemperatureSensor)myDevice; |
| | | foreach (var data in common.DeviceStatusReport.AttriBute) |
| | | { |
| | | if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue) |
| | | { |
| | | if (data.AttriButeData == 0) |
| | | { |
| | | tempera.Humidity = 0; |
| | | } |
| | | else |
| | | { |
| | | //小数点需要一位(湿度没有负数) |
| | | string strValue = data.AttriButeData.ToString(); |
| | | strValue = strValue.Substring(0, strValue.Length - 1); |
| | | tempera.Humidity = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); |
| | | tempera.LastDateTime = DateTime.Now; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | /// 成员请求控制主帐号此住宅时请求基地址的LoginAccessToken的值
|
| | | /// </summary> |
| | | public string AdminRequestToken = string.Empty; |
| | | /// <summary>
|
| | | /// 远程连接的Mqtt的客户端ID
|
| | | /// </summary> |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public string ConnEmqClientId = string.Empty; |
| | | |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | /// <summary> |
| | |
| | | else if (topic == gatewayID + "/" + "Bind/SetBind_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID }; |
| | | //var tempBindList = Newtonsoft.Json.Linq.JArray.Parse(jobject["Data"]["BindList"].ToString()); |
| | | var tempResult = Newtonsoft.Json.JsonConvert.DeserializeObject<AddedDeviceBindResponseData>(jobject["Data"].ToString()); |
| | | if (tempResult == null) |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | //var dataBindRes = new AddedDeviceBindResponseData(); |
| | | //for (int m = 0; tempBindList != null && m < tempBindList.Count; m++) |
| | | //{ |
| | | // var tempBind = tempBindList[m]; |
| | | // dataBindRes.BindList.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<AddBindListResponseObj>(tempBind.ToString())); |
| | | //} |
| | | //if (dataBindRes != null) |
| | | //{ |
| | | result = new AddedDeviceBindResponseAllData { addedDeviceBindResponseData = tempResult }; |
| | | DebugPrintLog($"UI收到通知后的主题_{topic}"); |
| | | //} |
| | | } |
| | | } |
| | | //else if (topic == gatewayID + "/" + "Bind/BindResult") |
| | | //{ |
| | | // var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID }; |
| | | // var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<AddBindResultResponseData>(jobject["Data"].ToString()); |
| | | |
| | | // if (tempData != null) |
| | | // { |
| | | // result = new AddedDeviceBindResponseAllData { addBindResultResponseData = tempData }; |
| | | // } |
| | | // DebugPrintLog($"UI收到通知后的主题_{topic}"); |
| | | //} |
| | | }; |
| | | mainGateway.Actions += action; |
| | | DebugPrintLog("Bind/SetBind_Actions 启动" + "_" + System.DateTime.Now.ToLongTimeString() + " " + System.DateTime.Now.Millisecond); |
| | |
| | | break; |
| | | } |
| | | } |
| | | if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime) |
| | | { |
| | | result = new AddedDeviceBindResponseAllData { errorMessageBase = " 回复超时,请重新操作" }; |
| | | } |
| | | //while ((DateTime.Now - dateTime).TotalMilliseconds < 20*1000) |
| | | //{ |
| | | //await System.Threading.Tasks.Task.Delay(100); |
| | | //if (result == null || result.addedDeviceBindResponseData == null) |
| | | //{ |
| | | // continue; |
| | | //} |
| | | //if (0 < result.addedDeviceBindResponseData.BindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 1).Count) |
| | | //{ |
| | | // if (result.addBindResultResponseData != null) |
| | | // { |
| | | // break; |
| | | // } |
| | | //} |
| | | //else if (0 < result.addedDeviceBindResponseData.BindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 2).Count) |
| | | //{ |
| | | // if (result.addBindResultResponseData != null) |
| | | // { |
| | | // break; |
| | | // } |
| | | //} |
| | | //else if (0 < result.addedDeviceBindResponseData.BindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 3).Count) |
| | | //{ |
| | | // if (result.addBindResultResponseData != null) |
| | | // { |
| | | // break; |
| | | // } |
| | | //} |
| | | //else |
| | | //{ |
| | | // break; |
| | | //} |
| | | //} |
| | | if ((DateTime.Now - dateTime).TotalMilliseconds > 20 * 1000) |
| | | { |
| | | result = new AddedDeviceBindResponseAllData { errorMessageBase = " 回复超时,请重新操作" }; |
| | |
| | | /// </summary> |
| | | public int SensorDiv = 1; |
| | | |
| | | /// <summary> |
| | | /// 温度 |
| | | /// </summary> |
| | | public decimal Temperatrue; |
| | | /// <summary> |
| | | /// 湿度 |
| | | /// </summary> |
| | | public decimal Humidity; |
| | | |
| | | public TemperatureSensor() |
| | | { |
| | | this.Type = DeviceType.TemperatureSensor ; |
| | |
| | | //订阅一个分享数据已经变更的主题
|
| | | await RemoteMqttClient.SubscribeAsync("/ZigbeeGateWayToClient/" + myGuid + "/Push/DeletedShareData");
|
| | | }
|
| | | //订阅一个挤下线的主题
|
| | | await RemoteMqttClient.SubscribeAsync("/ZigbeeGateWayToClient/" + Config.Instance.ConnEmqClientId + "/Push/NotifySqueeze");
|
| | |
|
| | | await initGateWayBaseInfomation(); |
| | | Shared.Phone.UserCenter.HdlGatewayLogic.Current.CheckGatewayByConnectChanged(Shared.Phone.UserCenter.GatewayConnectMode.Remote);
|
| | |
| | | var connEmqClientId = responseData["ConnEmqClientId"]?.ToString(); |
| | | var connEmqUserName = responseData["ConnEmqUserName"]?.ToString(); |
| | | var connEmqPwd = responseData["ConnEmqPwd"]?.ToString(); |
| | | //记录起当前的客户端ID |
| | | Config.Instance.ConnEmqClientId = connEmqClientId; |
| | | |
| | | var connEmqDomainPorts = connEmqDomainPort.Replace("//", "").Split(':'); |
| | | var domain = connEmqDomainPorts[1]; |
| | |
| | | epoint = topic.Split('/')[3]; |
| | | cluID = topic.Split('/')[4]; |
| | | attrId = topic.Split('/')[5]; |
| | | } |
| | | }
|
| | |
|
| | | //全局接收网关推送的的逻辑(为了执行速度,尽可能的别加耗时的操作)
|
| | | Shared.Phone.UserCenter.HdlGatewayReceiveLogic.Current.GatewayOverallMsgReceive(gatewayID, topic, reportStatus, message); |
| | | |
| | | var gwa = GateWayList.Find(obj => obj.getGatewayBaseInfo.gwID == gatewayID); |
| | | if (gwa == null) |
| | |
| | | { |
| | | jobject = Newtonsoft.Json.Linq.JObject.Parse(message); |
| | | }
|
| | |
|
| | | //全局接收网关推送的的逻辑(为了执行速度,尽可能的别加耗时的操作)
|
| | | Shared.Phone.UserCenter.HdlGatewayReceiveLogic.Current.GatewayOverallMsgReceive(gatewayID, topic, reportStatus, jobject);
|
| | |
|
| | | #region 远程,主网关上报通知 |
| | | if (IsRemote) |
| | |
| | | public readonly static int Sunrisesunset = 5134; |
| | | public readonly static int cycle = 5135; |
| | | public readonly static int completeNext = 5136; |
| | | public readonly static int Selectedtimetype = 5137; |
| | | public readonly static int Selectedtimetype= 5137; |
| | | public readonly static int Timecondition = 5138; |
| | | public readonly static int condition = 5139; |
| | | public readonly static int pushset = 5140; |
| | |
| | | public readonly static int application = 5376; |
| | | public readonly static int automationaddtext = 5377; |
| | | public readonly static int tiptextnull = 5378; |
| | | public readonly static int tiplocktextnull = 5379; |
| | | |
| | | #region 登录注册 |
| | | /// <summary> |
| | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 没有功能 请在个人中心中--设备管理处添加 |
| | | /// 没有功能 请在个人中心--设备管理处添加 |
| | | /// </summary> |
| | | public const int NoFunction = 11010; |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public const int uSubmit = 15922; |
| | | /// <summary> |
| | | /// 提交成功,感谢您的意见 |
| | | /// 您的反馈已成功提交 |
| | | /// </summary> |
| | | public const int uSubmitSuccessMsg = 15923; |
| | | /// <summary> |
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Category\SelectDelayTime.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Category\SelectDevice.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Category\SelectFloor.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Category\SelectHouse.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Category\SelectScene.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\ACLeftIconButtonRowLayout.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\BackButton.cs" />
|