| | |
| | | else if (automationBtn.IsSelected) |
| | | { |
| | | ShowAutotion(); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | |
|
| | | functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
|
| | |
|
| | | var bjFrameLayout = new FrameLayout |
| | | { |
| | | Width = Application.GetRealWidth(1080 - 58), |
| | |
| | | Yheight = 0; |
| | | } |
| | | logicScrolView.Y = scenehorizontalScrol.Bottom + Yheight; |
| | | logicScrolView.Height = functionSceneBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30) - Yheight; |
| | | logicScrolView.Height = functionSceneAutoBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30) - Yheight; |
| | | Automationview(logicScrolView); |
| | | }; |
| | | |
| | |
| | | //自动化 |
| | | Automationview(logicScrolView); |
| | | CommonPage.Loading.Hide(); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | refresview.RemoveAll(); |
| | | foreach (var logic in Common.Logic.LogicList) |
| | | { |
| | | var bjRow = new RowLayout |
| | | { |
| | | Width = Application.GetRealWidth(1080 - 58), |
| | | Height = Application.GetRealHeight(220), |
| | | LineColor = ZigbeeColor.Current.LogicBackgroundColor, |
| | | BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor, |
| | | |
| | | }; |
| | | refresview.AddChidren(bjRow); |
| | | |
| | | var logicRowlayout = new RowLayout |
| | | { |
| | | Y = Application.GetRealHeight(220 - 190), |
| | | Height = Application.GetRealHeight(190), |
| | | Width = Application.GetRealWidth(1080 - 58 - 46), |
| | | LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor, |
| | | X = Application.GetRealWidth(46), |
| | | Height = Application.GetRealHeight(190 + 30), |
| | | Width = Application.GetRealWidth(1080), |
| | | LineColor = ZigbeeColor.Current.LogicBackgroundColor, |
| | | BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor, |
| | | }; |
| | | bjRow.AddChidren(logicRowlayout); |
| | | refresview.AddChidren(logicRowlayout); |
| | | |
| | | |
| | | |
| | | var logicnameBtn = new Button |
| | | { |
| | | Height = Application.GetRealHeight(58), |
| | | Width = Application.GetRealWidth(350), |
| | | Text = logic.LogicName, |
| | | X = Application.GetRealWidth(12), |
| | | X = Application.GetRealWidth(12 + 46), |
| | | Y = Application.GetRealHeight(30), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | }; |
| | |
| | | Height = Application.GetMinRealAverage(63), |
| | | UnSelectedImagePath = "ZigeeLogic/logicclose.png", |
| | | SelectedImagePath = "ZigeeLogic/logicopen.png", |
| | | X = logicRowlayout.Width - Application.GetRealWidth(104 + 58), |
| | | Y = Application.GetRealHeight(58 + 30 + 9), |
| | | X = logicRowlayout.Width - Application.GetRealWidth(104 + 58 + 58), |
| | | Y = Application.GetRealHeight(58 + 30 + 9 + 30), |
| | | }; |
| | | logicRowlayout.AddChidren(logicswitchBtn); |
| | | |
| | |
| | | alert.Show(); |
| | | |
| | | }; |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | #region ◆ 控制状态_________________________ |
| | | |
| | | /// <summary> |
| | | /// 显示设备控制状态 |
| | | /// </summary> |
| | | /// <param name="command">Command.</param> |
| | | /// <param name="objValue">Object value.</param> |
| | | private void UpdateDeviceControllStatu(string command, object objValue) |
| | | { |
| | | if (command != "DeviceDefaultAck" || objValue == null) |
| | | { |
| | | return; |
| | | } |
| | | var tempDevice = (CommonDevice)objValue; |
| | | if (null == commonDeviceList.Find((obj) => obj.DeviceEpoint == tempDevice.DeviceEpoint && obj.DeviceAddr == tempDevice.DeviceAddr)) |
| | | { |
| | | return; |
| | | } |
| | | //标记已经发送控制命令到网关 |
| | | sendedControlCommand = true; |
| | | //DeviceUI.ShowStatuTip(R.MyInternationalizationString.Success); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 移除全部更新控制设备的action |
| | | /// </summary> |
| | | private void RemoveAllUpdateControlDeviceStatuAction() |
| | | { |
| | | foreach (var gateway in zbGatewayList) |
| | | { |
| | | //移除action |
| | | if (gateway != null) |
| | | var line = new Button |
| | | { |
| | | gateway.ReportAction -= UpdateDeviceControllStatu; |
| | | } |
| | | Y = Application.GetRealHeight(215), |
| | | Height = Application.GetRealHeight(5), |
| | | Width = Application.GetRealWidth(1080 - 58), |
| | | BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor, |
| | | X = Application.GetRealWidth(58), |
| | | }; |
| | | logicRowlayout.AddChidren(line); |
| | | } |
| | | } |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 移除单个控制设备的更新状态action |
| | | /// 显示图标的颜色 |
| | | /// </summary> |
| | | /// <param name="gateway">Gateway.</param> |
| | | private void RemoveUpdateControlDeviceStatuAction(ZbGateway gateway) |
| | | { |
| | | //移除action |
| | | if (gateway != null) |
| | | { |
| | | gateway.ReportAction -= UpdateDeviceControllStatu; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 添加需要监控回调状态的网关和设备 |
| | | /// </summary> |
| | | /// <param name="gatewayList">Gateway list.</param> |
| | | /// <param name="gateway">Gateway.</param> |
| | | /// <param name="deviceList">Device list.</param> |
| | | /// <param name="common">Common.</param> |
| | | private void AddZbGateway(List<ZbGateway> gatewayList, ZbGateway gateway, List<CommonDevice> deviceList, CommonDevice common) |
| | | { |
| | | if (null == gatewayList.Find((obj) => obj.getGatewayBaseInfo.gwID == gateway.getGatewayBaseInfo.gwID)) |
| | | { |
| | | gatewayList.Add(gateway); |
| | | } |
| | | if (null == commonDeviceList.Find((obj) => obj.DeviceEpoint == common.DeviceEpoint && obj.DeviceAddr == common.DeviceAddr)) |
| | | { |
| | | commonDeviceList.Add(common); |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | /// <param name="logic"></param> |
| | | /// <param name="logicRowlayout"></param> |
| | | /// <param name="intvalue"></param> |
| | | private void StatusColor(Common.Logic logic, RowLayout logicRowlayout, int intvalue) |
| | | { |
| | | |
| | | var logictimeBtn = new Button |
| | | { |
| | | Height = Application.GetRealHeight(58), |
| | | Width = logicRowlayout.Width - Application.GetRealWidth(58 + 12 + 350), |
| | | Width = logicRowlayout.Width - Application.GetRealWidth(58 + 12 + 350 + 58), |
| | | Y = Application.GetRealHeight(30), |
| | | X = Application.GetRealWidth(365), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = ZigbeeColor.Current.LogicListWeekTextColor, |
| | |
| | | { |
| | | Width = Application.GetRealWidth(82), |
| | | Height = Application.GetRealHeight(82), |
| | | X = Application.GetRealWidth(12 + (12 + 82 + 45 + 12) * i), |
| | | Y = Application.GetRealHeight(58 + 30), |
| | | X = Application.GetRealWidth(58) + Application.GetRealWidth(12 + (12 + 82 + 45 + 12) * i), |
| | | Y = Application.GetRealHeight(58 + 30 + 30), |
| | | Radius = (uint)Application.GetRealHeight(41), |
| | | BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, |
| | | }; |
| | |
| | | var connectIconBtn = new Button |
| | | { |
| | | Y = typebjBtn.Y + Application.GetRealHeight(35), |
| | | X = Application.GetRealWidth((12 + 82 + 12) + (12 + 45 + 82 + 12) * i), |
| | | X = Application.GetRealWidth(58) + Application.GetRealWidth((12 + 82 + 12) + (12 + 45 + 82 + 12) * i), |
| | | Width = Application.GetRealWidth(48), |
| | | Height = Application.GetRealHeight(15), |
| | | UnSelectedImagePath = "ZigeeLogic/connect.png", |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region ◆ 控制状态_________________________ |
| | | |
| | | /// <summary> |
| | | /// 显示设备控制状态 |
| | | /// </summary> |
| | | /// <param name="command">Command.</param> |
| | | /// <param name="objValue">Object value.</param> |
| | | private void UpdateDeviceControllStatu(string command, object objValue) |
| | | { |
| | | if (command != "DeviceDefaultAck" || objValue == null) |
| | | { |
| | | return; |
| | | } |
| | | var tempDevice = (CommonDevice)objValue; |
| | | if (null == commonDeviceList.Find((obj) => obj.DeviceEpoint == tempDevice.DeviceEpoint && obj.DeviceAddr == tempDevice.DeviceAddr)) |
| | | { |
| | | return; |
| | | } |
| | | //标记已经发送控制命令到网关 |
| | | sendedControlCommand = true; |
| | | //DeviceUI.ShowStatuTip(R.MyInternationalizationString.Success); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 移除全部更新控制设备的action |
| | | /// </summary> |
| | | private void RemoveAllUpdateControlDeviceStatuAction() |
| | | { |
| | | foreach (var gateway in zbGatewayList) |
| | | { |
| | | //移除action |
| | | if (gateway != null) |
| | | { |
| | | gateway.ReportAction -= UpdateDeviceControllStatu; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 移除单个控制设备的更新状态action |
| | | /// </summary> |
| | | /// <param name="gateway">Gateway.</param> |
| | | private void RemoveUpdateControlDeviceStatuAction(ZbGateway gateway) |
| | | { |
| | | //移除action |
| | | if (gateway != null) |
| | | { |
| | | gateway.ReportAction -= UpdateDeviceControllStatu; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 添加需要监控回调状态的网关和设备 |
| | | /// </summary> |
| | | /// <param name="gatewayList">Gateway list.</param> |
| | | /// <param name="gateway">Gateway.</param> |
| | | /// <param name="deviceList">Device list.</param> |
| | | /// <param name="common">Common.</param> |
| | | private void AddZbGateway(List<ZbGateway> gatewayList, ZbGateway gateway, List<CommonDevice> deviceList, CommonDevice common) |
| | | { |
| | | if (null == gatewayList.Find((obj) => obj.getGatewayBaseInfo.gwID == gateway.getGatewayBaseInfo.gwID)) |
| | | { |
| | | gatewayList.Add(gateway); |
| | | } |
| | | if (null == commonDeviceList.Find((obj) => obj.DeviceEpoint == common.DeviceEpoint && obj.DeviceAddr == common.DeviceAddr)) |
| | | { |
| | | commonDeviceList.Add(common); |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | } |