| | |
| | | |
| | | SecurityAlarm alarm; |
| | | |
| | | public AddOutputPage(SecurityAlarm inOutput ,Action<SecurityAlarm> action) |
| | | public AddOutputPage(SecurityAlarm inOutput, Action<SecurityAlarm> action) |
| | | { |
| | | bodyView = this; |
| | | refreshAction = action; |
| | |
| | | functionListView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = showdFunctionTypeRow.Bottom, |
| | | Height = Application.GetRealHeight(530 -100), |
| | | Height = Application.GetRealHeight(530 - 100), |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(functionListView); |
| | |
| | | /// <summary> |
| | | /// 配置数据 |
| | | /// </summary> |
| | | void SetData(string roomId="") |
| | | void SetData(string roomId = "") |
| | | { |
| | | allocatedList.Clear(); |
| | | foreach (var function in FunctionList.List.GetLightList()) |
| | |
| | | var output = alarm.output.Find((obj) => obj.sid == function.sid); |
| | | if (output == null) |
| | | { |
| | | output = new SecurityOutput() { status = new List<SecurityOutputStatus> { new SecurityOutputStatus { |
| | | output = new SecurityOutput() |
| | | { |
| | | status = new List<SecurityOutputStatus> { new SecurityOutputStatus { |
| | | key = FunctionAttributeKey.OnOff, |
| | | value = "on" |
| | | } } }; |
| | | |
| | | } } |
| | | }; |
| | | |
| | | output.sid = function.sid; |
| | | } |
| | | //else |
| | |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | }; |
| | | functionRow.AddChidren(btnState); |
| | | |
| | | |
| | | |
| | | Button btnChooseIcon = new Button() |
| | | { |
| | |
| | | |
| | | var localOutput = alarm.output.Find((obj) => obj.sid == output.sid); |
| | | |
| | | if (localOutput!=null) |
| | | if (localOutput != null) |
| | | { |
| | | btnChooseIcon.IsSelected = true; |
| | | btnState.Text = output.StateText(); |
| | |
| | | optinView.AddChidren(btnClose); |
| | | if (output.status.Count > 0) |
| | | { |
| | | btnOpen.IsSelected = output.status[0].value.ToLower() == "on"; |
| | | btnOpen.IsSelected = output.status[0].value.ToLower() == "on"; |
| | | btnClose.IsSelected = !btnOpen.IsSelected; |
| | | } |
| | | |