| | |
| | | |
| | | public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) |
| | | { |
| | | Shared.Application.IsGpsEnable = false; |
| | | Shared.Application.IsMusicEnable = false; |
| | | base.FinishedLaunching(application, launchOptions); |
| | | Shared.Application.FontSize = 12; |
| | |
| | | 231=接近感应 |
| | | 232=接近感应功能设置置失败 |
| | | 233=获取接近感应功能失败 |
| | | 235=按住面板模式(Mode)和风速(Fan)按键{0}绿色指示灯亮起。则配网成功 |
| | | 235=按住面板模式按键5秒,绿色指示灯闪烁{0}进入配网状态;闪烁停止{0}指示灯变白色表示配网成功 |
| | | 236=绿色指示灯闪烁 |
| | | 237=指示灯 |
| | | 238=长按5秒(按键) |
| | | 239=长按图示按键5秒以上,指示灯变绿、闪烁{0}进入配网状态。绿灯熄灭则配网成功 |
| | | ;三按键面板入网操作指示 |
| | | 241=设置常开模式后,您的门锁将始终{0}处于打开状态,确认开启? |
| | | 242=电量 |
| | | 243=常开模式已开启 |
| | |
| | | 311=手动 |
| | | 312= 背光灯颜色 |
| | | 313=长按图示按键5秒以上,信号图标{0}快闪, 进入配网状态。信号图标常亮则配网成功 |
| | | 314=自动模式不支持操作 |
| | | |
| | | 5097=取消 |
| | | 5098=确定 |
| | |
| | | ;温湿度传感器入网操作指示
|
| | | 21017=长按图示按键5秒以上,信号图标{0}快闪, 进入配网状态。图标常亮则配网成功
|
| | | ;方悦2按键轻触式面板入网操作指示
|
| | | 21018=按住面板左上角按键,所有按键指示灯{0}亮起,则配网成功
|
| | | 21018=长按BUTTON1按键5秒,所有指示灯{0}变为绿色并闪烁,进入配网状态 |
| | | ;方悦4按键轻触式面板入网操作指示
|
| | | 21019=按住面板左上角按键,所有按键指示灯{0}亮起,则配网成功
|
| | | 21019=长按BUTTON1按键5秒,所有指示灯{0}变为绿色并闪烁,进入配网状态 |
| | | ;方悦8按键轻触式面板入网操作指示
|
| | | 21020=按住面板左上角按键,所有按键指示灯{0}亮起,则配网成功
|
| | | 21020=长按BUTTON1按键5秒,所有指示灯{0}变为绿色并闪烁,进入配网状态 |
| | | ;方悦环境面板入网操作指示
|
| | | 21021=按住面板功能(function)按键,所有按键{0}指示灯亮起,则配网成功
|
| | | ;窗帘面板的入网操作指示
|
| | |
| | | 30037=S-one |
| | | 30038=方悦新风小模块 |
| | | 30039=Zigbee吸顶燃气传感器 |
| | | 30040=PM2.5空气质量传感器 |
| | | |
| | | ;★★★★下面这些是设备所属种类的翻译名字,从40000开始★★★★ |
| | | 40000=遮阳 |
| | |
| | | 50037=Zigbee智能门锁 |
| | | 50038=新风控制小模块 |
| | | 50039=Zigbee吸顶燃气传感器 |
| | | 30040=PM2.5空气质量传感器 |
| | | |
| | | ;★★★★下面这些是模块ID的设备类型名字,从60000开始.注:它并不需要再R.cs文件中定义★★★★
|
| | | 60000=传感器 |
| | |
| | | /// <summary> |
| | | /// 版本号 |
| | | /// </summary> |
| | | public static string CodeIDString = "1.0.20050601"; |
| | | public static string CodeIDString = "1.0.20050701"; |
| | | /// <summary> |
| | | /// 注册来源(0:HDL On 1:Zigbee) |
| | | /// </summary> |
| | |
| | | this.dicDeviceModelIdEnum["MBU01/M-ZB.10"] = "1305-1200-60000";//紧急按键
|
| | | this.dicDeviceModelIdEnum["MGCD01/ZB.10"] = "1306-1200-60000";//吸顶燃气传感器
|
| | |
|
| | | //PM2.5空气质量传感器 【该设备属于第三方设备,没有镜像ID】
|
| | | this.dicDeviceModelIdEnum["SZ_PM100"] = "1307-1200-60000";//PM2.5空气质量传感器 |
| | |
|
| | | //=========★★继电器类(2300-2499)★★=========
|
| | | this.dicDeviceModelIdEnum["MPR0310-ZB.10"] = "2300-2300-60001";//3路继电器小模块
|
| | | this.dicDeviceModelIdEnum["MFA01-ZB.10"] = "2310-2300-60011";//方悦新风小模块
|
| | |
| | | /// </summary>
|
| | | Sensor_CeilingGas = 1306,
|
| | | /// <summary>
|
| | | /// PM2.5空气质量传感器 |
| | | /// </summary> |
| | | Sensor_PMTwoPointFive = 1307,
|
| | | |
| | | /// <summary>
|
| | | /// 运动传感器
|
| | | /// </summary>
|
| | | Sensor_Motion = -1306,
|
old mode 100755
new mode 100644
| | |
| | | //应该是body吧
|
| | | this.bodyFrameLayout = new FrameLayout();
|
| | | bodyFrameLayout.Y = topFrameLayout.Bottom;
|
| | | bodyFrameLayout.Height = Application.GetRealHeight(1549);
|
| | | bodyFrameLayout.Height = this.Height - topFrameLayout.Bottom;
|
| | | bodyFrameLayout.BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor;
|
| | | this.AddChidren(bodyFrameLayout);
|
| | |
|
| | |
| | | {
|
| | | cardContr = new Controls.DeviceFreshAirRowControl();
|
| | | }
|
| | | // PM2.5
|
| | | else if (device.Type == DeviceType.PMSensor)
|
| | | { |
| | | } |
| | | //彩灯(调光器)
|
| | | else if (device.Type == DeviceType.DimmableLight)
|
| | | {
|
| | |
| | | { |
| | | if (string.IsNullOrEmpty(editTime.Text)) |
| | | { |
| | | ShowTip(Language.StringByID(R.MyInternationalizationString.timeNull),true); |
| | | ShowErrorTip(Language.StringByID(R.MyInternationalizationString.timeNull),true); |
| | | return; |
| | | } |
| | | if (int.Parse(editTime.Text) < 1 || int.Parse(editTime.Text) > 12) |
| | | { ///限制输入数字范围; |
| | | string str = Language.StringByID(R.MyInternationalizationString.less) + Language.StringByID(R.MyInternationalizationString.or) + Language.StringByID(R.MyInternationalizationString.more); |
| | | ShowTip(str, true); |
| | | ShowErrorTip(str, true); |
| | | return; |
| | | |
| | | |
| | | } |
| | | dialog.Close(); |
| | | action(editTime.Text); |
| | | |
| | | }; |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 提示框 |
| | | /// 错误提示框 |
| | | /// </summary> |
| | | public static void ShowTip(string tipText,bool _if ) |
| | | public static void ShowErrorTip(string tipText,bool _if ) |
| | | { |
| | | ///主控件 |
| | | Dialog dialog = new Dialog(); |
| | |
| | | dialog.Close(); |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 闪错提示框 |
| | | /// </summary> |
| | | public static void ShowFlashTip(string tipText,int timeValue=1) |
| | | { |
| | | ///主控件 |
| | | Dialog dialog = new Dialog(); |
| | | dialog.Show(); |
| | | ///背景的父控件 |
| | | FrameLayout fLayout = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicTranslucentColor }; |
| | | dialog.AddChidren(fLayout); |
| | | fLayout.MouseUpEventHandler += (sender,e) => { |
| | | dialog.Close(); |
| | | |
| | | }; |
| | | ///弹框父控件 |
| | | FrameLayout tipFLayout = new FrameLayout |
| | | { |
| | | X = Application.GetRealWidth(230), |
| | | Y = Application.GetRealHeight(717), |
| | | Width = Application.GetRealWidth(622), |
| | | Height = Application.GetRealHeight(317), |
| | | BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, |
| | | Radius = (uint)Application.GetRealHeight(17) |
| | | }; |
| | | fLayout.AddChidren(tipFLayout); |
| | | |
| | | ///提示控件 |
| | | Button tipBtn = new Button |
| | | { |
| | | Y = Application.GetRealHeight(58), |
| | | X = Application.GetRealWidth(150), |
| | | Height = Application.GetRealHeight(63), |
| | | Width = Application.GetRealWidth(622 - 300), |
| | | TextID = R.MyInternationalizationString.tip, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = ZigbeeColor.Current.LogicTipColor, |
| | | TextSize = 16, |
| | | |
| | | }; |
| | | tipFLayout.AddChidren(tipBtn); |
| | | ///文本控件 |
| | | Button Text1Btn = new Button |
| | | { |
| | | Y = Application.GetRealHeight(156), |
| | | X = Application.GetRealWidth(50), |
| | | Height = Application.GetRealHeight(58), |
| | | Width = Application.GetRealWidth(622 - 100), |
| | | Text = tipText, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | | TextSize = 14, |
| | | }; |
| | | tipFLayout.AddChidren(Text1Btn); |
| | | |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(timeValue*1000); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | dialog.Close(); |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | } |
| | | } |
| | |
| | | Common.Logic.CurrentLogic.LogicIsCustomPushText = 0; |
| | | pushview.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor; |
| | | } |
| | | if (!Config.Instance.Home.IsVirtually) |
| | | { |
| | | Send.Zj(LogicView.IfString.Tag, Common.Logic.CurrentLogic); |
| | | |
| | | } |
| | | }; |
| | | |
| | | if (Common.Logic.CurrentLogic.LogicIsCustomPushText == 0) |
| | |
| | | bool succeed = false; |
| | | //判断是新添加逻辑(默认0)还是修改逻辑 |
| | | CommonPage.Loading.Start(); |
| | | |
| | | if (Config.Instance.Home.IsVirtually) |
| | | { |
| | | if (Common.Logic.LogicList.Count == 0) |
| | | { |
| | | CurrentLogic.LogicId = 1; |
| | | Common.Logic.LogicList.Add(CurrentLogic); |
| | | } |
| | | |
| | | if (CurrentLogic.LogicId == 0) |
| | | { |
| | | bool d = false; |
| | | for (int i = 1; i < 50; i++) |
| | | { |
| | | |
| | | for (int j = 0; j < Common.Logic.LogicList.Count; j++) |
| | | { |
| | | if (i != Common.Logic.LogicList[j].LogicId) |
| | | { |
| | | CurrentLogic.LogicId = i; |
| | | Common.Logic.LogicList.Add(CurrentLogic); |
| | | d = true; |
| | | break; |
| | | } |
| | | } |
| | | if (d) |
| | | { |
| | | break; |
| | | } |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | for (int j = 0; j < Common.Logic.LogicList.Count; j++) |
| | | { |
| | | if (CurrentLogic.LogicId == Common.Logic.LogicList[j].LogicId) |
| | | { |
| | | Common.Logic.LogicList.RemoveAt(j); |
| | | Common.Logic.LogicList.Insert(j,CurrentLogic); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | //自动化逻辑列表 |
| | | } |
| | | else |
| | | { |
| | | if (CurrentLogic.LogicId == 0) |
| | | { |
| | | //发送添加逻辑命令 |
| | |
| | | //编辑默认成功(不考虑网络情况); |
| | | succeed = true; |
| | | } |
| | | } |
| | | CommonPage.Loading.Hide(); |
| | | |
| | | if (!succeed)//succeed标记是添加成功还是失败 |
| | |
| | | { |
| | | case 0: |
| | | { |
| | | |
| | | |
| | | ////new一个新逻辑对象; |
| | | ////新增正常自动化入口 |
| | | //new一个新逻辑对象; |
| | | //新增正常自动化入口 |
| | | Common.Logic.CurrentLogic = new Common.Logic(); |
| | | Common.Logic.CurrentLogic.IsEnable = 1;//默认为开 |
| | | Common.Logic.CurrentLogic.LogicType = 0;//标记逻辑类型 |
| | |
| | | CommonPage.Loading.Start(); |
| | | try |
| | | { |
| | | if (!Config.Instance.Home.IsVirtually)//虚拟的不获取网关逻辑列表 |
| | | { |
| | | if (Common.Logic.LogicList.Count == 0) |
| | | { |
| | | var Idlist1 = await Send.GetLogicId(0);// |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | var dd = e.Message; |
| | |
| | | /// <param name="refresview">Refresview.</param> |
| | | private static async void Automationview(VerticalRefreshLayout refresview, bool no) |
| | | { |
| | | |
| | | refresview.RemoveAll(); |
| | | if (Common.Logic.LogicList.Count == 0 && no == false) |
| | | { |
| | |
| | | logic.IsEnable = 0; |
| | | StatusColor(logic, logicRowlayout, 0); |
| | | } |
| | | if (!Config.Instance.Home.IsVirtually) |
| | | { |
| | | Send.LogicControlSwitch(logic); |
| | | } |
| | | //Logic.Send.AddModifyLogic(logic); |
| | | }; |
| | | if (logic.IsEnable == 1) |
| | |
| | | { |
| | | Common.Logic.LogicList.Remove(logic); |
| | | Automationview(refresview, no); |
| | | if (!Config.Instance.Home.IsVirtually) |
| | | { |
| | | Send.DelLogic(logic.LogicId); |
| | | } |
| | | }; |
| | | |
| | | }; |
| | |
| | | |
| | | } |
| | | } |
| | | |
old mode 100755
new mode 100644
| | |
| | | { |
| | | Tag = "SoneLogic"; |
| | | } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="action">给徐梅刷新界面用的</param> |
| | | /// <param name="bool_If"></param> |
| | | /// 给徐梅刷新界面用的 |
| | | public Action<bool> action; |
| | | public async void Show() |
| | | { |
| | |
| | | view.clickBtn.MouseDownEventHandler += (sender, e) => |
| | | { |
| | | UserView.HomePage.Instance.ScrollEnabled = true; |
| | | RemoveFromParent(); |
| | | if (action != null) |
| | | { |
| | | action(Send.CurrentDoorLock.IsDoorLockNormallyMode); |
| | | } |
| | | |
| | | RemoveFromParent(); |
| | | |
| | | }; |
| | | |
| | | var middle = new FrameLayout |
| | |
| | | Y = Application.GetRealHeight(92), |
| | | Width = Application.GetMinRealAverage(294), |
| | | Height = Application.GetMinRealAverage(294), |
| | | UnSelectedImagePath = "ZigeeLogic/noMode.png", |
| | | SelectedImagePath = "ZigeeLogic/openMode.png", |
| | | }; |
| | | fLayout.AddChidren(modeIconBtn); |
| | | |
| | |
| | | var logic = await SkipView.GetLogicIfon(); |
| | | |
| | | fLayout.Height = Application.GetRealHeight(780);//改变高度 |
| | | modeIconBtn.IsSelected = true;//改变图标状态 |
| | | modeIconBtn.UnSelectedImagePath = "ZigeeLogic/openMode.png";//改变图标状态 |
| | | ///第二级父控件 |
| | | var openModeFl = new FrameLayout |
| | | { |
| | |
| | | UserView.HomePage.Instance.AddChidren(soneLogicList); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | soneLogicList.Show();
|
| | | soneLogicList.action = action;
|
| | | } |
| | | else |
| | | { |
| | | ///提示失败 |
| | | LogicView.TipView.ShowFlashTip("关闭失败"); |
| | | } |
| | | |
| | | }; |
| | |
| | | var timeTextBtn = new Button |
| | | { |
| | | Y = Application.GetRealHeight(127 + 69), |
| | | X = Application.GetRealWidth(225), |
| | | Width = Application.GetRealWidth(634), |
| | | X = Application.GetRealWidth(125), |
| | | Width = Application.GetRealWidth(634 + 200), |
| | | Height = Application.GetRealHeight(60), |
| | | TextSize = 15, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | |
| | | var timeInt = int.Parse(logic.Conditions[0]["DoorLockOpenDelayTime"]); |
| | | int dayInt = (h + timeInt) / 24;//算出几天后执行 |
| | | int hour = (h + timeInt) % 24;//算出几天后那个时间执行 |
| | | timeTextBtn.Text = "时效性常开设置" + y + "年" + m + "月" + d + dayInt + "号" + timeInt + "时" + "执行"; |
| | | int days = int.Parse(d) + dayInt; |
| | | timeTextBtn.Text = "时效性常开设置" + y + "年" + m + "月" + days.ToString() + "号" + hour.ToString() + "时" + "执行"; |
| | | } |
| | | catch { } |
| | | |
| | |
| | | else |
| | | { |
| | | fLayout.Height = Application.GetRealHeight(645);//改变高度 |
| | | modeIconBtn.IsSelected = false;//改变图标状态 |
| | | modeIconBtn.UnSelectedImagePath = "ZigeeLogic/noMode.png";//改变图标状态 |
| | | ///第二级父控件 |
| | | var modeFl = new FrameLayout |
| | | { |
| | |
| | | Height = Application.GetMinRealAverage(104), |
| | | X = Application.GetRealWidth(861), |
| | | Y = Application.GetRealHeight(17), |
| | | UnSelectedImagePath = "ZigeeLogic/next.png", |
| | | UnSelectedImagePath = "ZigeeLogic/nextIconSone.png", |
| | | }; |
| | | modeFl.AddChidren(nextIconBtn); |
| | | |
| | |
| | | |
| | | nextIconBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | |
| | | LogicView.TipView.ShowConfrimTip(() => |
| | | |
| | | {///再次确认 |
| | | LogicView.TipView.ShowInputTip(true, async (str) => |
| | | {///确认发送命令 |
| | |
| | | var result = await UserCenter.DoorLock.DoorLockCommonInfo.SetNormallyOpenModeFuncAsync(Send.CurrentDoorLock); |
| | | if (!result) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | ///提示失败 |
| | | }); |
| | | LogicView.TipView.ShowFlashTip("开启失败"); |
| | | return; |
| | | } |
| | | else |
| | |
| | | if (!addResult) |
| | | { |
| | | ///提示失败 |
| | | LogicView.TipView.ShowFlashTip("添加失败"); |
| | | return; |
| | | }
|
| | | Send.CurrentDoorLock.IsDoorLockNormallyMode = true; |
| | |
| | | UserView.HomePage.Instance.AddChidren(soneLogicList); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | soneLogicList.Show(); |
| | | soneLogicList.action = action; |
| | | //soneLogicList.action += (c) => { |
| | | // if (action != null) |
| | | // { |
| | | // action(Send.CurrentDoorLock.IsDoorLockNormallyMode); |
| | | // } |
| | | //}; |
| | | |
| | | } |
| | | } |
| | |
| | | /// 加载自动化列表 |
| | | /// </summary> |
| | | /// <param name="verticalRefresh"></param> |
| | | RowLayout selectedRow = new RowLayout() { Tag = "0" };//记录左滑状态 |
| | | int a = 1; |
| | | private void RefreshView(VerticalRefreshLayout verticalRefresh) |
| | | { |
| | | verticalRefresh.RemoveAll(); |
| | | |
| | | foreach (var logic in Common.Logic.SoneLogicList) |
| | | { |
| | | #region 自动化布局View |
| | |
| | | LineColor = ZigbeeColor.Current.LogicBackgroundColor, |
| | | BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor, |
| | | SubViewWidth = Application.GetRealWidth(184),//改变编辑控件宽度多少; |
| | | Tag = a.ToString(), |
| | | }; |
| | | fLayout.AddChidren(logicRow); |
| | | //左滑菜单事件 |
| | | logicRow.OpenMenuAction += () => |
| | | { |
| | | //if (selectedRow.Tag.ToString() != logicRowlayout.Tag.ToString()) |
| | | //{ //保留左滑只有一个; |
| | | // selectedRow.HideMenu();// |
| | | //} |
| | | //selectedRow = logicRowlayout; |
| | | if (selectedRow.Tag.ToString() != logicRow.Tag.ToString()) |
| | | { //保留左滑只有一个; |
| | | selectedRow.HideMenu();// |
| | | } |
| | | selectedRow = logicRow; |
| | | }; |
| | | a++; |
| | | ///显示逻辑名称的控件
|
| | | var nameBtn = new Button |
| | | { |
| | |
| | |
|
| | | #endregion |
| | | |
| | | |
| | | #region ■ 初始化_____________________________ |
| | | public override void InitMiddleFrameAfter(FrameLayout frameWhiteBack) |
| | | { |
| | |
| | | this.listControl.Add(btnHighSpeed);
|
| | | btnHighSpeed.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | if (FreshAirDev.currentFanMode == 15) |
| | | { |
| | | var msgContr = new ShowMsgControl(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.AutoModeForbiddenOperate)); |
| | | msgContr.Show(); |
| | | return; |
| | | } |
| | | |
| | | if (!btnHighSpeed.IsSelected) |
| | | { |
| | | this.SetFanComand(3); |
| | |
| | | this.listControl.Add(btnLowSpeed);
|
| | | btnLowSpeed.ButtonClickEvent += (sender, e) =>
|
| | | { |
| | | if (FreshAirDev.currentFanMode == 15) |
| | | { |
| | | var msgContr = new ShowMsgControl(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.AutoModeForbiddenOperate)); |
| | | msgContr.Show(); |
| | | return; |
| | | } |
| | | if (!btnLowSpeed.IsSelected) |
| | | { |
| | | this.SetFanComand(1); |
old mode 100644
new mode 100755
old mode 100644
new mode 100755
old mode 100644
new mode 100755
old mode 100644
new mode 100755
| | |
| | | //1个传感器
|
| | | var device = new IASZone() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 };
|
| | | device.IasDeviceType = 13;
|
| | | device.DeviceID = 1026;
|
| | | //设置设备的基本信息
|
| | | this.SetBaseDataToDevice(device, 1200, 1200, "MSPIR01-ZB.10", i_RoomId);
|
| | |
|
| | |
| | | {
|
| | | var device = new IASZone() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 };
|
| | | device.IasDeviceType = 43;
|
| | | device.DeviceID = 1026;
|
| | | //设置设备的基本信息
|
| | | this.SetBaseDataToDevice(device, 1300, 1300, "MSG01/M-ZB.10", i_RoomId);
|
| | |
|
| | |
| | | {
|
| | | var device = new IASZone() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 };
|
| | | device.IasDeviceType = 43;
|
| | | device.DeviceID = 1026;
|
| | | //设置设备的基本信息
|
| | | this.SetBaseDataToDevice(device, 1300, 1300, "MGCD01/ZB.10", i_RoomId);
|
| | |
|
| | |
| | | {
|
| | | var device = new IASZone() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 };
|
| | | device.IasDeviceType = 21;
|
| | | device.DeviceID = 1026;
|
| | | //设置设备的基本信息
|
| | | this.SetBaseDataToDevice(device, 1301, 1301, "MSDC01/M-ZB.10", i_RoomId);
|
| | |
|
| | |
| | | {
|
| | | var device = new IASZone() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 };
|
| | | device.IasDeviceType = 40;
|
| | | device.DeviceID = 1026;
|
| | | //设置设备的基本信息
|
| | | this.SetBaseDataToDevice(device, 1301, 1301, "MSS01/M-ZB.10", i_RoomId);
|
| | |
|
| | |
| | | {
|
| | | var device = new IASZone() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 };
|
| | | device.IasDeviceType = 13;
|
| | | device.DeviceID = 1026;
|
| | | //设置设备的基本信息
|
| | | this.SetBaseDataToDevice(device, 1303, 1303, "MSPIR01/M-ZB.10", i_RoomId);
|
| | |
|
| | |
| | | {
|
| | | var device = new IASZone() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 };
|
| | | device.IasDeviceType = 42;
|
| | | device.DeviceID = 1026;
|
| | | //设置设备的基本信息
|
| | | this.SetBaseDataToDevice(device, 1304, 1304, "MSW01/M-ZB.10", i_RoomId);
|
| | |
|
| | |
| | | {
|
| | | var device = new IASZone() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 };
|
| | | device.IasDeviceType = 44;
|
| | | device.DeviceID = 1026;
|
| | | //设置设备的基本信息
|
| | | this.SetBaseDataToDevice(device, 1305, 1305, "MBU01/M-ZB.10", i_RoomId);
|
| | |
|
old mode 100644
new mode 100755
| | |
| | | /// </summary>
|
| | | private static void InitUserCenterMenmoryByVirtualHome()
|
| | | {
|
| | | UserCenterResourse.AccountOption.OldHomeStringId = Common.Config.Instance.Home.Id;
|
| | | //清空所有成员缓存
|
| | | ClearAllMemberMemory();
|
| | | //预创建个人中心全部的文件夹
|
| | |
| | | UserCenterResourse.ResidenceOption.HomeMainPageSwitchIndex = 1;
|
| | | //当前分类,场景和功能所选择的分支 0:场景 1:功能 2:自动化
|
| | | UserCenterResourse.ResidenceOption.CategoryPageSwitchIndex = 0;
|
| | |
|
| | | //切换住宅清除之前逻辑缓存数据;
|
| | | Common.Logic.LogicList.Clear();
|
| | | Common.Logic.LockLogicList.Clear();
|
| | | Common.Logic.SoneLogicList.Clear();
|
| | | }
|
| | |
|
| | | #endregion
|
old mode 100644
new mode 100755
old mode 100644
new mode 100755
| | |
| | | localDeviceList.Clear(); |
| | | scList.Clear(); |
| | | //获取本地设备列表 |
| | | localDeviceList = Shared.Common.LocalDevice.Current.listAllDevice; |
| | | foreach (var dev in Shared.Common.LocalDevice.Current.listAllDevice) |
| | | { |
| | | localDeviceList.Add(dev); |
| | | } |
| | | //获取本地场景列表 |
| | | scList = HdlSceneLogic.Current.GetAllRoomSceneList(); |
| | | //获取网关场景表 |
old mode 100644
new mode 100755
| | |
| | | unSelectPic = "Device/SensorPMTwoPointFive.png"; |
| | | this.AddMenuRow(objectText, unSelectPic, "SensorPMTwoPointFiveForm"); |
| | |
|
| | | //PM2.5空气质量传感器
|
| | | objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName26); |
| | | unSelectPic = "Device/SensorPMTwoPointFive.png"; |
| | | this.AddMenuRow(objectText, unSelectPic, "SensorPMTwoPointFiveForm");
|
| | |
|
| | | //中继器
|
| | | objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName24); |
| | | unSelectPic = "Device/RepeaterZigbee.png"; |
old mode 100755
new mode 100644
| | |
| | | btnSecond.TextID = R.MyInternationalizationString.uPressAndHoldThisKey; |
| | | framePic.AddChidren(btnSecond); |
| | | |
| | | //长按图示按键5秒以上,指示灯变绿、闪烁 |
| | | //进入配网状态。绿灯快闪3秒则配网成功 |
| | | //按住面板模式按键5秒,绿色指示灯闪烁 |
| | | //进入配网状态;闪烁停止 |
| | | //指示灯变白色表示配网成功 |
| | | string[] msgArry = Language.StringByID(R.MyInternationalizationString.AddFreshAirPanelMsg).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries); |
| | | |
| | | var msg1 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false); |
| | |
| | | msg1.TextColor = UserCenterColor.Current.TextGrayColor3; |
| | | msg1.TextAlignment = TextAlignment.Center; |
| | | bodyFrameLayout.AddChidren(msg1); |
| | | |
| | | var msg2 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false); |
| | | msg2.Y = msg1.Bottom; |
| | | if (msgArry.Length > 1) |
| | |
| | | msg2.TextColor = UserCenterColor.Current.TextGrayColor3; |
| | | msg2.TextAlignment = TextAlignment.Center; |
| | | bodyFrameLayout.AddChidren(msg2); |
| | | |
| | | var msg3 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false); |
| | | msg3.Y = msg2.Bottom; |
| | | if (msgArry.Length > 1) |
| | | { |
| | | msg3.Text = msgArry[2]; |
| | | } |
| | | msg3.TextColor = UserCenterColor.Current.TextGrayColor3; |
| | | msg3.TextAlignment = TextAlignment.Center; |
| | | bodyFrameLayout.AddChidren(msg3); |
| | | |
| | | } |
| | | #endregion |
| | | } |
old mode 100644
new mode 100755
old mode 100644
new mode 100755
| | |
| | | {
|
| | | continue;
|
| | | }
|
| | | if (data.CloudAccountId == null)
|
| | | {
|
| | | data.CloudAccountId = string.Empty;
|
| | | }
|
| | | listLog.Add(data);
|
| | | }
|
| | |
|
old mode 100644
new mode 100755
old mode 100644
new mode 100755
| | |
| | | /// PM目标名字 |
| | | /// </summary> |
| | | private string bindPmName = string.Empty; |
| | | /// <summary> |
| | | /// 被绑目标是新风 |
| | | /// </summary> |
| | | private CommonDevice bindFreshAirDev; |
| | | /// <summary> |
| | | /// 被绑目标是温度 |
| | | /// </summary> |
| | | private CommonDevice bindTemperatureDev; |
| | | /// <summary> |
| | | /// 被绑目标是湿度 |
| | | /// </summary> |
| | | private CommonDevice bindHumidityDev; |
| | | /// <summary> |
| | | /// 被绑目标是PM2.5 |
| | | /// </summary> |
| | | private CommonDevice bindPMDev; |
| | | |
| | | #endregion |
| | | |
| | |
| | | |
| | | rowNewWind.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, 1); |
| | | var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, bindFreshAirDev, 1); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | addDevicePage.Show(); |
| | |
| | | }); |
| | | }; |
| | | |
| | | //var form = new PanelFangyueFreshAirTargetForm(); |
| | | //form.AddForm(this.deviceObj, string.Empty, 3); |
| | | }; |
| | | } |
| | | #endregion |
| | |
| | | continue; |
| | | } |
| | | bindFreshAirName = device.DeviceEpointName; |
| | | bindFreshAirDev = device; |
| | | } |
| | | if (device.Type == DeviceType.TemperatureSensor) |
| | | { |
| | | var bD = device as TemperatureSensor; |
| | | if (bD.SensorDiv == 1) |
| | | { |
| | | bindTemperatureName = device.DeviceEpointName; |
| | | bindTemperatureDev = device; |
| | | } |
| | | if (bD.SensorDiv == 2) |
| | | { |
| | | bindHumidityName = device.DeviceEpointName; |
| | | bindHumidityDev = device; |
| | | } |
| | | } |
| | | if (device.Type == DeviceType.FreshAirHumiditySensor) |
| | | { |
| | | bindHumidityName = device.DeviceEpointName; |
| | | bindHumidityDev = device; |
| | | } |
| | | //if (device.Type == DeviceType.FreshAir) |
| | | //{ |
| | | // bindPmName = device.DeviceEpointName; |
| | | //} |
| | | if (device.Type == DeviceType.PMSensor) |
| | | { |
| | | bindPmName = device.DeviceEpointName; |
| | | bindPMDev = device; |
| | | } |
| | | } |
| | | result = true; |
| | | } |
| | |
| | | var btnPMStatu = rowPM.AddMostRightView(msg, 700); |
| | | rowPM.ButtonClickEvent += (sender, e) => |
| | | { |
| | | var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, 4); |
| | | var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, bindPMDev, 4); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | addDevicePage.Show(); |
| | |
| | | var btnTemperatureStatu = rowTemPerature.AddMostRightView(msg, 700); |
| | | rowTemPerature.ButtonClickEvent += (sender, e) => |
| | | { |
| | | var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, 2); |
| | | var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, bindTemperatureDev, 2); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | addDevicePage.Show(); |
| | |
| | | var btnHumidityStatu = rowHumidity.AddMostRightView(msg, 700); |
| | | rowHumidity.ButtonClickEvent += (sender, e) => |
| | | { |
| | | var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, 3); |
| | | var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, bindHumidityDev, 3); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | addDevicePage.Show(); |
| | |
| | | /// 构造函数 |
| | | /// </summary> |
| | | /// <param name="device"></param> |
| | | /// <param name="deviceBindType">1:新风;2:温度传感器;3:湿度传感器</param> |
| | | public PanelFangyueFreshAirTargetsForm(CommonDevice device, int deviceBindType) |
| | | /// <param name="deviceBindType">1:新风;2:温度传感器;3:湿度传感器;4:PM2.5传感器</param> |
| | | /// <param name="bindDev">绑定目标 </param> |
| | | public PanelFangyueFreshAirTargetsForm(CommonDevice device, CommonDevice bindDev, int deviceBindType) |
| | | { |
| | | this.curControlDev = device as FreshAir; |
| | | this.curBindDevice = bindDev; |
| | | this.curDeviceBindType = deviceBindType; |
| | | } |
| | | #endregion |
| | | |
| | | #region 变量申明 |
| | | /// <summary> |
| | | /// 当前控制设备 |
| | | /// </summary> |
| | | //CommonDevice currentControlDevice; |
| | | /// <summary> |
| | | /// 当前新风面板【控制设备】 |
| | | /// </summary> |
| | | FreshAir curControlDev; |
| | | /// <summary> |
| | | /// 当前被绑设备 |
| | | /// </summary> |
| | | CommonDevice curBindDevice; |
| | | /// <summary> |
| | | /// 显示被绑定设备或场景的view |
| | | /// </summary> |
| | |
| | | curentOldRoom = btnRoom; |
| | | curentOldRoomFrameLayout = btnRoomFrameLayout; |
| | | } |
| | | |
| | | //被绑定的目标还未分配区域,默认是第一个 |
| | | if (string.IsNullOrEmpty(curControlDev.currentSelectRoomId)) |
| | | { |
| | | if (index == 0) |
| | | { |
| | | btnRoomFrameLayout.BackgroundImagePath = "Item/RoomIconBackgroundSelected.png"; |
| | | btnRoom.TextColor = Shared.Common.ZigbeeColor.Current.XMWhite; |
| | | curentOldRoom = btnRoom; |
| | | curentOldRoomFrameLayout = btnRoomFrameLayout; |
| | | } |
| | | } |
| | | |
| | | EventHandler<MouseEventArgs> eHandlerRoom = (sender, e) => |
| | | { |
| | | if (!btnRoom.IsSelected) |
| | |
| | | line2.Visible = false; |
| | | } |
| | | |
| | | switch (curDeviceBindType) |
| | | { |
| | | case 1: |
| | | devicePic.UnSelectedImagePath = "Device/FreshAirEpoint.png"; |
| | | break; |
| | | case 2: |
| | | devicePic.UnSelectedImagePath = "Device/SensorTemperature.png"; |
| | | break; |
| | | case 3: |
| | | devicePic.UnSelectedImagePath = "Device/SensorHumidity.png"; |
| | | break; |
| | | case 4: |
| | | devicePic.UnSelectedImagePath = "Device/FreshAirEpoint.png"; |
| | | break; |
| | | } |
| | | #endregion |
| | | |
| | | string mianKey = device.DeviceAddr + device.DeviceEpoint; |
| | |
| | | btnFloorText.Text = dicFloorList[floorId]; |
| | | |
| | | //获取楼层中房间列表 |
| | | supportRoomList = GetFloorRoomList(curFloorId); |
| | | supportRoomList = GetFloorRoomList(); |
| | | if (!btnMethodText.IsSelected) |
| | | { |
| | | if (oldbutton != null) |
| | |
| | | { |
| | | CommonPage.Loading.Start(""); |
| | | }); |
| | | //获取被绑目标等信息 |
| | | BindDevInfo(curBindDevice); |
| | | |
| | | //获取楼层 |
| | | dicFloorList = HdlRoomLogic.Current.GetFloorSortList(); |
| | | //获取楼层中房间列表 |
| | | supportRoomList = GetFloorRoomList(curControlDev.currentSelectFloorId); |
| | | supportRoomList = GetFloorRoomList(); |
| | | |
| | | //获取所有房间中匹配的能绑的目标 |
| | | currentPanelSupportBindDeviceList = GetAllRoomSupportDeviceList(); |
| | |
| | | case 2: |
| | | if (device.Type == DeviceType.TemperatureSensor) |
| | | { |
| | | var bDev = device as TemperatureSensor; |
| | | if (bDev.SensorDiv == 1) |
| | | { |
| | | targetList.Add(device); |
| | | oldTargetList.Add(device); |
| | | } |
| | | } |
| | | break; |
| | | case 3: |
| | | if (device.Type == DeviceType.TemperatureSensor) |
| | | { |
| | | var bDev = device as TemperatureSensor; |
| | | if (bDev.SensorDiv == 2) |
| | | { |
| | | targetList.Add(device); |
| | | oldTargetList.Add(device); |
| | | } |
| | | } |
| | | if (device.Type == DeviceType.FreshAirHumiditySensor) |
| | | { |
| | | targetList.Add(device); |
| | |
| | | if (targetList.Count == 0) |
| | | { |
| | | curControlDev.currentSelectFloorId = BindInfo.GetCurrentSelectFloorId(); |
| | | curControlDev.currentSelectRoomId = null; |
| | | if (BindInfo.GetCurrentSelectFloorIdName() != null) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 当前被绑定设备所属楼层和房间 |
| | | /// </summary> |
| | | /// <param name="bindDev"></param> |
| | | void BindDevInfo(CommonDevice bindDev) |
| | | { |
| | | if (bindDev == null) |
| | | { |
| | | return; |
| | | } |
| | | //获取本地设备列表 |
| | | var localDeviceList = Shared.Common.LocalDevice.Current.listAllDevice; |
| | | var tempDev = localDeviceList.Find(obj => obj.DeviceAddr == bindDev.DeviceAddr && obj.DeviceEpoint == bindDev.DeviceEpoint); |
| | | if (tempDev != null) |
| | | { |
| | | //获取设备所属房间 |
| | | var tempDevRoom = HdlRoomLogic.Current.GetRoomByDevice(tempDev); |
| | | if (tempDevRoom != null) |
| | | { |
| | | curControlDev.currentSelectRoomId = tempDevRoom.Id; |
| | | curControlDev.currentSelectFloorId = tempDevRoom.FloorId; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 检测目标是否被绑定过 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | |
| | | } |
| | | break; |
| | | case 2: |
| | | foreach (var de in room.ListDevice) |
| | | { |
| | | var device = LocalDevice.Current.GetDevice(de); |
| | | if (device != null) |
| | | { |
| | | if (device.Type == DeviceType.TemperatureSensor) |
| | | { |
| | | roomIncludeMatchDevice.Add(device); |
| | | } |
| | | } |
| | | } |
| | | roomIncludeMatchDevice = GetMatchTemperatureSensorDevice(room); |
| | | break; |
| | | case 3: |
| | | roomIncludeMatchDevice = GetMatchHumiditySensorDevice(room); |
| | | foreach (var de in room.ListDevice) |
| | | { |
| | | var device = LocalDevice.Current.GetDevice(de); |
| | |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | if (!string.IsNullOrEmpty(room.FloorId)) |
| | | { |
| | |
| | | roomTempList.Add(room); |
| | | } |
| | | } |
| | | } |
| | | return roomTempList; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 匹配温度传感器 |
| | | /// </summary> |
| | | /// <param name="room"></param> |
| | | List<CommonDevice> GetMatchTemperatureSensorDevice(Room room) |
| | | { |
| | | List<CommonDevice> roomIncludeMatchTempDevice = new List<CommonDevice>(); |
| | | foreach (var de in room.ListDevice) |
| | | { |
| | | var device = LocalDevice.Current.GetDevice(de); |
| | | if (device != null) |
| | | { |
| | | if (device.Type == DeviceType.TemperatureSensor) |
| | | { |
| | | var dev = device as TemperatureSensor; |
| | | if (dev.SensorDiv == 1) |
| | | { |
| | | roomIncludeMatchTempDevice.Add(device); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return roomIncludeMatchTempDevice; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 匹配湿度传感器 |
| | | /// </summary> |
| | | /// <param name="room"></param> |
| | | List<CommonDevice> GetMatchHumiditySensorDevice(Room room) |
| | | { |
| | | List<CommonDevice> roomIncludeMatchHumpDevice = new List<CommonDevice>(); |
| | | foreach (var de in room.ListDevice) |
| | | { |
| | | var device = LocalDevice.Current.GetDevice(de); |
| | | if (device != null) |
| | | { |
| | | if (device.Type == DeviceType.TemperatureSensor) |
| | | { |
| | | var dev = device as TemperatureSensor; |
| | | if (dev.SensorDiv == 2) |
| | | { |
| | | roomIncludeMatchHumpDevice.Add(device); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return roomIncludeMatchHumpDevice; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取楼层对应的房间列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | private List<Room> GetFloorRoomList(string floorId) |
| | | private List<Room> GetFloorRoomList() |
| | | { |
| | | supportRoomList.Clear(); |
| | | var supportRoomListTemp = new List<Room>(); |
| | |
| | | { |
| | | if (string.IsNullOrEmpty(room.FloorId)) |
| | | { |
| | | if (room.FloorId != floorId) |
| | | { |
| | | continue; |
| | | } |
| | | if (room.IsLove) |
| | | { |
| | | continue; |
| | |
| | | { |
| | | continue; |
| | | } |
| | | foreach (var deviceKeys in r.ListDevice) |
| | | var deviceListTemp = GetMatchTemperatureSensorDevice(r); |
| | | foreach (var dev in deviceListTemp) |
| | | { |
| | | var device = LocalDevice.Current.GetDevice(deviceKeys); |
| | | if (device != null) |
| | | { |
| | | if (device.Type == DeviceType.TemperatureSensor) |
| | | { |
| | | currentPanelBindSupportDeviceListTemp.Add(device); |
| | | } |
| | | } |
| | | currentPanelBindSupportDeviceListTemp.Add(dev); |
| | | } |
| | | } |
| | | break; |
| | |
| | | if (r.ListDevice.Count == 0) |
| | | { |
| | | continue; |
| | | } |
| | | var deviceListTemp = GetMatchHumiditySensorDevice(r); |
| | | foreach (var dev in deviceListTemp) |
| | | { |
| | | currentPanelBindSupportDeviceListTemp.Add(dev); |
| | | } |
| | | foreach (var deviceKeys in r.ListDevice) |
| | | { |
| | |
| | | } |
| | | break; |
| | | case 2: |
| | | foreach (var deviceKeys in curRoom.ListDevice) |
| | | { |
| | | var device = LocalDevice.Current.GetDevice(deviceKeys); |
| | | if (device != null) |
| | | { |
| | | if (device.Type == DeviceType.TemperatureSensor) |
| | | { |
| | | curRoomDeviceListTemp.Add(device); |
| | | } |
| | | } |
| | | } |
| | | curRoomDeviceListTemp = GetMatchTemperatureSensorDevice(curRoom); |
| | | break; |
| | | case 3: |
| | | curRoomDeviceListTemp = GetMatchHumiditySensorDevice(curRoom); |
| | | foreach (var deviceKeys in curRoom.ListDevice) |
| | | { |
| | | var device = LocalDevice.Current.GetDevice(deviceKeys); |
| | |
| | | /// <param name="doorLockMessType">导致门锁失效的操作类型</param> |
| | | /// <param name="haveLogic">网关中是否存在逻辑常开模式</param> |
| | | /// <param name="action">回调处理更新内容</param> |
| | | public static async void NomallyOpenModeInvalidDialog(ZigBee.Device.DoorLock doorLock, DoorLockMessType doorLockMessType, bool haveLogic, Action action = null) |
| | | public static async void NomallyOpenModeInvalidDialog(ZigBee.Device.DoorLock doorLock, DoorLockMessType doorLockMessType, bool haveLogic, Action<bool> action = null) |
| | | { |
| | | //常开模式只能主人操作 |
| | | if (UserCenterResourse.UserInfo.AuthorityNo != 1) |
| | |
| | | //保持常开 |
| | | NormallyOpenModeValue(doorLock, true); |
| | | } |
| | | action?.Invoke(); |
| | | action?.Invoke(doorLock.IsDoorLockNormallyMode); |
| | | action = null; |
| | | }; |
| | | |
| | | alert.CancelClickEvent += async () => |
| | |
| | | NormallyOpenModeValue(doorLock, false); |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | action?.Invoke(); |
| | | action?.Invoke(doorLock.IsDoorLockNormallyMode); |
| | | action = null; |
| | | return; |
| | | } |
| | | if (result.defaultControlResponseData.status != 0) |
| | |
| | | NormallyOpenModeValue(doorLock, false); |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | action?.Invoke(); |
| | | action?.Invoke(doorLock.IsDoorLockNormallyMode); |
| | | action = null; |
| | | return; |
| | | } |
| | | else |
| | |
| | | //app操作不取消“常开模式” |
| | | DoorLockCommonInfo.NormallyOpenModeValue(doorLock, true); |
| | | } |
| | | action?.Invoke(); |
| | | action?.Invoke(doorLock.IsDoorLockNormallyMode); |
| | | action = null; |
| | | }; |
| | | |
| | | alert.ConfirmClickEvent += async () => |
| | |
| | | ShowTipMsg(Language.StringByID(R.MyInternationalizationString.GwResponseOvertime)); |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | action?.Invoke(); |
| | | action?.Invoke(doorLock.IsDoorLockNormallyMode); |
| | | action = null; |
| | | return; |
| | | } |
| | | if (result.defaultControlResponseData.status != 0) |
| | |
| | | ShowTipMsg(msg1); |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | action?.Invoke(); |
| | | action?.Invoke(doorLock.IsDoorLockNormallyMode); |
| | | action = null; |
| | | return; |
| | | } |
| | | else |
| | |
| | | }); |
| | | } |
| | | } |
| | | action?.Invoke(); |
| | | action?.Invoke(doorLock.IsDoorLockNormallyMode); |
| | | action = null; |
| | | }; |
| | | } |
| | | |
| | |
| | | public static async System.Threading.Tasks.Task<bool> SetNormallyOpenModeFuncAsync(ZigBee.Device.DoorLock doorLock)
|
| | | {
|
| | | //app设置“常开模式”失败
|
| | | var result = await doorLock.SetNormallyOpenModeFuncAsync(false);
|
| | | var result = await doorLock.SetNormallyOpenModeFuncAsync(true);
|
| | | if (result == null || result.defaultControlResponseData == null || result.defaultControlResponseData.status != 0)
|
| | | {
|
| | | return false;
|
old mode 100755
new mode 100644
| | |
| | | EventHandler<MouseEventArgs> eHandlerBack = (sender, e) => |
| | | { |
| | | RemoveFromParent(); |
| | | |
| | | UserDoorLockPage.canShowDialog = true; |
| | | //暂时不考虑下级界面等推送导致常开模式失效的问题 |
| | | //var userDoorLockPage = new UserDoorLockPage(currentRoom, deviceUI); |
| | | //HomePage.Instance.AddChidren(userDoorLockPage); |
old mode 100644
new mode 100755
| | |
| | | /// <summary> |
| | | /// 逻辑中是否有常开模式
|
| | | /// </summary> |
| | | private bool HaveLogicNormallyOpenMode = false;
|
| | | private bool haveLogicNormallyOpenMode = false;
|
| | |
|
| | | /// <summary> |
| | | /// 门锁深度控制上报窗口是否弹出
|
| | | /// </summary> |
| | | public static bool canShowDialog = true;
|
| | |
|
| | | /// <summary> |
| | | /// 当前电量 |
| | | /// </summary> |
| | |
| | | {
|
| | | if (canOpenNormallyMode) |
| | | { |
| | | Application.RunOnMainThread(() => { NomallyOpenModeInvalidDialog(true); }); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | Action<bool> action = (obj) => |
| | | { |
| | | UpdateNomallyOpenStatus(); |
| | | }; |
| | | DoorLockCommonInfo.NomallyOpenModeInvalidDialog(doorLock, DoorLockCommonInfo.DoorLockMessType.ServicePush, haveLogicNormallyOpenMode, action); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | |
| | | var resTemp = await Shared.Phone.Device.Logic.SkipView.Exist(2); |
| | | if (resTemp == 1) |
| | | { |
| | | HaveLogicNormallyOpenMode = true; |
| | | haveLogicNormallyOpenMode = true; |
| | | } |
| | | else if (resTemp == 0) |
| | | { |
| | | HaveLogicNormallyOpenMode = false; |
| | | haveLogicNormallyOpenMode = false; |
| | | } |
| | | }); |
| | | } |
| | |
| | | //设置 |
| | | EventHandler<MouseEventArgs> btnFuncSetHander = (sender, e) => |
| | | { |
| | | //打开其他界面时前移除【暂时不移除】 |
| | | //RemoveFromParent(); |
| | | |
| | | var functionSetting = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(currentRoom, doorLock); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSetting); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | functionSetting.Show(); |
| | | |
| | | canShowDialog = false; |
| | | functionSetting.devicNameAction += (deviceRename) => |
| | | { |
| | | if (!string.IsNullOrEmpty(deviceRename)) |
| | |
| | | //历史记录 ---- stan |
| | | var form = new DeviceDoorLock.DoorLockHistoryLogForm(); |
| | | form.AddForm(this.doorLock.DeviceAddr); |
| | | canShowDialog = false; |
| | | }; |
| | | btnRecordFrameLayout.MouseDownEventHandler += handerRecord; |
| | | btnRecord.MouseDownEventHandler += handerRecord; |
| | |
| | | { |
| | | if (canOpenNormallyMode)
|
| | | {
|
| | | NomallyOpenModeInvalidDialog(false);
|
| | | Application.RunOnMainThread(() => |
| | | { |
| | | Action<bool> action = (obj) => |
| | | { |
| | | UpdateNomallyOpenStatus(); |
| | | }; |
| | | DoorLockCommonInfo.NomallyOpenModeInvalidDialog(doorLock, DoorLockCommonInfo.DoorLockMessType.AppOperate, haveLogicNormallyOpenMode, action); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | if (doorLock.IsDoorLockNormallyMode) |
| | | { |
| | | NomallyOpenModeInvalidDialog(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | Action<bool> action = (obj) => |
| | | { |
| | | UpdateNomallyOpenStatus(); |
| | | }; |
| | | DoorLockCommonInfo.NomallyOpenModeInvalidDialog(doorLock, DoorLockCommonInfo.DoorLockMessType.AppOperate, haveLogicNormallyOpenMode, action); |
| | | }); |
| | | } |
| | | } |
| | | else |
| | |
| | | action = () => |
| | | { |
| | | //系统密码支持操作门锁后,调用温居城的界面【常开自动化】 |
| | | var functionSetting = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(currentRoom, doorLock); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSetting); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | functionSetting.Show(); |
| | | // functionSetting.aaaAction = () => |
| | | //{ |
| | | // UpdateNomallyOpenStatus(); |
| | | //}; |
| | | }; |
| | | HdlCheckLogic.Current.CheckSecondarySecurity(action); |
| | | #endregion |
| | | |
| | | #region 暂时版本 (最终去掉) |
| | | if (!btnNormallyOpen.IsSelected) |
| | | if (doorLock == null)
|
| | | { |
| | | if (UserCenterResourse.UserInfo.AuthorityNo != 1) |
| | | { |
| | | this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.OnlyMasterOperate)); |
| | | ///防止抛异常 |
| | | return; |
| | | } |
| | | |
| | | if (!UserCenterResourse.AccountOption.DoorUnLockByRemote) |
| | | ///备注:WJC的
|
| | | Shared.Phone.Device.Logic.Send.CurrentDoorLock = doorLock;
|
| | | ///进来刷新一次设备列表;
|
| | | Common.Logic.LogicDviceList.Clear();
|
| | | if (Common.Logic.LogicDviceList.Count == 0)
|
| | | { |
| | | SystemSecondAuthentication(); |
| | | return; |
| | | Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray());
|
| | | } |
| | | |
| | | action = () => |
| | | var addLogicPage = new Shared.Phone.Device.Logic.SoneLogicList();
|
| | | UserView.HomePage.Instance.AddChidren(addLogicPage);
|
| | | UserView.HomePage.Instance.PageIndex += 1;
|
| | | addLogicPage.Show();
|
| | | addLogicPage.action += (w) =>
|
| | | { |
| | | string msg = Language.StringByID(R.MyInternationalizationString.SetDoorLockNomallyOpen).Replace("{0}", "\r\n"); |
| | | var confirm = Language.StringByID(R.MyInternationalizationString.Confrim); |
| | | var alert = new ShowDoorLockMsgControl(ShowDoorLockMsgControl.DoorLockMsgType.Confirm, msg, confirm); |
| | | alert.Show(); |
| | | |
| | | alert.ConfirmClickEvent += async () => |
| | | { |
| | | Application.RunOnMainThread(() => { CommonPage.Loading.Start(""); }); |
| | | var result = await doorLock.SetNormallyOpenModeFuncAsync(true); |
| | | if (result == null || result.defaultControlResponseData == null) |
| | | { |
| | | string msg0 = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime); |
| | | this.ShowTipMsg(msg0); |
| | | return; |
| | | } |
| | | if (result.defaultControlResponseData.status != 0) |
| | | { |
| | | string msg1 = Language.StringByID(R.MyInternationalizationString.OpenNormallyOpenModeFailed); |
| | | this.ShowTipMsg(msg1); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | //添加App开启常开模式的历史记录 |
| | | HdlDeviceDoorLockLogic.Current.AddDoorHistoryLog(this.doorLock, 9001, string.Empty); |
| | | |
| | | //每次重新设置常开,默认时间都是12小时 |
| | | DoorLockCommonInfo.NormallyOpenModeInvalidTime = 12; |
| | | DoorLockCommonInfo.NormallyOpenModeValue(doorLock, true); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | doorLock.IsDoorLockNormallyMode = w;
|
| | | ///留给徐梅用的
|
| | | UpdateNomallyOpenStatus(); |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | |
| | | //常开模式开启提示 |
| | | AlreadyOpenNormallyMode(); |
| | | } |
| | | }; |
| | | |
| | | }; |
| | | HdlCheckLogic.Current.CheckSecondarySecurity(action); |
| | | } |
| | | else |
| | | { |
| | | NomallyOpenModeInvalidDialog(); |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | public void NomallyOpenModeInvalidDialog(bool IsFromReport = false) |
| | | { |
| | | if (!canShowDialog) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (UserCenterResourse.UserInfo.AuthorityNo != 1) |
| | | { |
| | | this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.OnlyMasterOperate)); |
| | |
| | | string msg = Language.StringByID(R.MyInternationalizationString.NomallyModeIsCanceled).Replace("{0}", "\r\n"); |
| | | var confirm = Language.StringByID(R.MyInternationalizationString.SureCancel); |
| | | var alert = new ShowDoorLockMsgControl(ShowDoorLockMsgControl.DoorLockMsgType.NomallyOpenMode, msg, confirm); |
| | | if (HaveLogicNormallyOpenMode) |
| | | if (haveLogicNormallyOpenMode) |
| | | { |
| | | //有逻辑设置的弹窗 |
| | | alert = new ShowDoorLockMsgControl(ShowDoorLockMsgControl.DoorLockMsgType.CancelNomallyOpenModeWithLogic, msg, confirm); |
| | |
| | | UpdateNomallyOpenStatus(); |
| | | }); |
| | | //删除已经失效的“常开模式”的逻辑 |
| | | if (HaveLogicNormallyOpenMode) |
| | | if (haveLogicNormallyOpenMode) |
| | | { |
| | | var resTemp = await Shared.Phone.Device.Logic.SkipView.Exist(3); |
| | | //if (resTemp == 3) |
| | |
| | | //上报“常开模式”已被取消 |
| | | Application.RunOnMainThread(() => { CommonPage.Loading.Start(""); }); |
| | | //先删除已失效的“常开模式”的逻辑 |
| | | if (HaveLogicNormallyOpenMode) |
| | | if (haveLogicNormallyOpenMode) |
| | | { |
| | | var resTemp = await Shared.Phone.Device.Logic.SkipView.Exist(3); |
| | | //if (resTemp == 3) |
| | |
| | | }); |
| | | |
| | | //删除已经失效的“常开模式”的逻辑 |
| | | if (HaveLogicNormallyOpenMode) |
| | | if (haveLogicNormallyOpenMode) |
| | | { |
| | | var resTemp = await Shared.Phone.Device.Logic.SkipView.Exist(3); |
| | | //if (resTemp == 3) |
| | |
| | | UpdateNomallyOpenStatus(); |
| | | }); |
| | | //删除设置常开模式创建的逻辑 |
| | | if (HaveLogicNormallyOpenMode) |
| | | if (haveLogicNormallyOpenMode) |
| | | { |
| | | var resTemp = await Shared.Phone.Device.Logic.SkipView.Exist(3); |
| | | //因为目前机制问题,逻辑经常失败,所以不提示,后期机制要改,重新做一个这个界面 |
| | |
| | |
|
| | | //body占完整个屏幕,除了底部菜单
|
| | | bodyFrameLayout.Y = 0;
|
| | | bodyFrameLayout.Height = ControlCommonResourse.TopMenuFrameHeight + ControlCommonResourse.TopFrameHeight
|
| | | + ControlCommonResourse.BodyFrameHeight - ControlCommonResourse.BottomFrameHeight;
|
| | | bodyFrameLayout.Height = this.Height;
|
| | | bodyFrameLayout.BackgroundColor = UserCenterColor.Current.BlackBackGround;
|
| | |
|
| | | //初始化中部控件
|
old mode 100755
new mode 100644
| | |
| | | { |
| | | return Newtonsoft.Json.JsonConvert.DeserializeObject<FreshAir>(strDeviceByte); |
| | | } |
| | | else if (strDeviceType == ZigBee.Device.DeviceType.PMSensor.ToString()) |
| | | { |
| | | return Newtonsoft.Json.JsonConvert.DeserializeObject<PMSensor>(strDeviceByte); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | |
| | | //新风 |
| | | IconPath = "Device/FreshAirEpoint.png"; |
| | | } |
| | | else if (this.Type == DeviceType.FreshAir) |
| | | { |
| | | //PM2.5空气质量传感器 |
| | | IconPath = "Device/FreshAirEpoint.png"; |
| | | } |
| | | else if (this.Type == DeviceType.FreshAirHumiditySensor) |
| | | { |
| | | //湿度传感器 |
old mode 100755
new mode 100644
| | |
| | | /// <para>定义对象:TemperatureSensor</para>
|
| | | /// </summary> |
| | | TemperatureSensor = 770, |
| | | /// <summary>
|
| | | /// <para>PM2.5传感器</para>
|
| | | /// <para>设备ID为777</para>
|
| | | /// <para>定义对象:PMSensor</para>
|
| | | /// </summary> |
| | | PMSensor = 777, |
| | | }
|
| | |
|
| | | /// <summary>
|
old mode 100644
new mode 100755
old mode 100644
new mode 100755
New file |
| | |
| | | using System; |
| | | using ZigBee.Device; |
| | | |
| | | namespace ZigBee.Device |
| | | { |
| | | public class PMSensor : CommonDevice |
| | | { |
| | | /// <summary> |
| | | /// PM2.5传感器对象 |
| | | /// </summary> |
| | | public PMSensor() |
| | | { |
| | | this.Type = DeviceType.PMSensor; |
| | | } |
| | | } |
| | | } |
old mode 100644
new mode 100755
old mode 100644
new mode 100755
| | |
| | | /// </summary> |
| | | public const int GetPanelProximityFail = 233; |
| | | /// <summary> |
| | | /// 按住面板模式 |
| | | /// 按住面板模式按键5秒,绿色指示灯闪烁{0}进入配网状态;闪烁停止{0}指示灯变白色表示配网成功 |
| | | /// </summary> |
| | | public const int AddFreshAirPanelMsg = 235; |
| | | /// <summary> |
| | |
| | | /// PM2.5感器 -> 长按图示按键5秒以上,信号图标{0}快闪, 进入配网状态。信号图标常亮则配网成功 |
| | | /// </summary> |
| | | public const int AddSensorPMMsg = 313; |
| | | /// <summary> |
| | | /// 自动模式不支持操作 |
| | | /// </summary> |
| | | public const int AutoModeForbiddenOperate = 314; |
| | | |
| | | public readonly static int cancel = 5097; |
| | | public readonly static int confrim = 5098; |
| | |
| | | /// </summary>
|
| | | public const int uAddSensorTemperatureAndHumidityMsg = 21017;
|
| | | /// <summary>
|
| | | /// 方悦2按键轻触式面板 -> 按住面板左上角按键,所有按键指示灯{0}亮起,则配网成功
|
| | | /// 单开双控面板 -> 长按BUTTON1按键5秒,所有指示灯{0}变为绿色并闪烁,进入配网状态
|
| | | /// </summary>
|
| | | public const int uAddFangyueTwoButtonPanelMsg = 21018;
|
| | | /// <summary>
|
| | | /// 方悦4按键轻触式面板 -> 按住面板左上角按键,所有按键指示灯{0}亮起,则配网成功
|
| | | /// 双开四控面板 -> 长按BUTTON1按键5秒,所有指示灯{0}变为绿色并闪烁,进入配网状态
|
| | | /// </summary>
|
| | | public const int uAddFangyueFourButtonPanelMsg = 21019;
|
| | | /// <summary>
|
| | | /// 方悦8按键轻触式面板 -> 按住面板左上角按键,所有按键指示灯{0}亮起,则配网成功
|
| | | /// 四开八控面板-> 长按BUTTON1按键5秒,所有指示灯{0}变为绿色并闪烁,进入配网状态
|
| | | /// </summary>
|
| | | public const int uAddFangyueEightButtonPanelMsg = 21020;
|
| | | /// <summary>
|
| | |
| | | /// 镜像ID为1306的设备的默认名字:Zigbee吸顶燃气传感器 |
| | | /// </summary> |
| | | public const int uDeviceModelId1306 = 30039;
|
| | | /// <summary> |
| | | /// 镜像ID为1307的设备的默认名字:PM2.5空气质量传感器 |
| | | /// </summary> |
| | | public const int uDeviceModelId1307 = 30040;
|
| | |
|
| | | //★★★★下面这些是设备所属种类的翻译名字,从40000开始★★★★
|
| | | /// <summary>
|
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\PirSensor\PirSensorWorkModeMenuForm.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\AddUnLockMethod.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\AddUnLockMethodTip.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\DoorLockCommonInfo.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\DoorLockCommonLayout.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\DoorlockDialog.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\EntryStatusPage.cs" />
|
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\TimeSettignPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\UndistributeDoorlockUserPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\UnLockMethod.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\UserDoorLockPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\UserManagement.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Gateway\Add\AddGatewayHelpForm.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Gateway\Add\WirelessApDirection1Form.cs" />
|
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\IO\LocalFileUtils.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlSafeguardLogic.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlAlarmsLogic.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Panel\PanelFangyueFreshAirBackLightSettionForm.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\UserDoorLockPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\DoorLockCommonInfo.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\ShowDoorLockMsgControl.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\DoorLock.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\DeviceCard\DeviceFreshAirCardControl.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\SensorPMTwoPointFiveForm.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\PMSensor.cs" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <Folder Include="$(MSBuildThisFileDirectory)Phone\CommonForm\" />
|