| | |
| | | { |
| | | continue; |
| | | } |
| | | if (!string.IsNullOrEmpty(roomId) && roomId == "ALLSELECT") |
| | | if (!string.IsNullOrEmpty(roomId) && roomId != "ALLSELECT") |
| | | { |
| | | if (!function.roomIds.Contains(roomId)) |
| | | { |
| | |
| | | { |
| | | continue; |
| | | } |
| | | if (!string.IsNullOrEmpty(roomId)) |
| | | if (!string.IsNullOrEmpty(roomId) && roomId != "ALLSELECT") |
| | | { |
| | | if (!scene.roomIds.Contains(roomId)) |
| | | { |
| | |
| | | void LoadFunctionListRow() |
| | | { |
| | | functionListView.RemoveAll(); |
| | | foreach (var function in allocatedList) |
| | | new System.Threading.Thread(() => |
| | | { |
| | | //var output = alarm.output.Find((obj) => obj.sid == function.sid); |
| | | //if (output == null) |
| | | //{ |
| | | // output = new SecurityOutput(); |
| | | // output.sid = function.sid; |
| | | //} |
| | | |
| | | FrameLayout functionRow = new FrameLayout() |
| | | System.Threading.Thread.Sleep(50); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | Height = Application.GetRealHeight(65), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | functionListView.AddChidren(functionRow); |
| | | |
| | | var btnFunctionName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealHeight(44), |
| | | Text = function.name, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | functionRow.AddChidren(btnFunctionName); |
| | | |
| | | var btnFunctionFloorName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(24), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealHeight(41), |
| | | Text = function.RoomName, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, |
| | | }; |
| | | functionRow.AddChidren(btnFunctionFloorName); |
| | | |
| | | Button btnState = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(317), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | Text = function.StateText() |
| | | }; |
| | | functionRow.AddChidren(btnState); |
| | | |
| | | Button btnChooseIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(333), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(32), |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "Public/ChooseIcon.png", |
| | | SelectedImagePath = "Public/ChooseOnIcon.png", |
| | | }; |
| | | functionRow.AddChidren(btnChooseIcon); |
| | | |
| | | btnChooseIcon.MouseUpEventHandler = (sender, e) => { |
| | | btnChooseIcon.IsSelected = !btnChooseIcon.IsSelected; |
| | | var tempLocal = alarm.output.Find((obj) => |
| | | obj.sid == function.sid |
| | | ); |
| | | //if (tempLocal == null && !string.IsNullOrEmpty(output.spk)) |
| | | //{ |
| | | // ShowStateDialog(output, btnState, btnChooseIcon); |
| | | //} |
| | | if (btnChooseIcon.IsSelected) |
| | | foreach (var function in allocatedList) |
| | | { |
| | | if (tempLocal == null) |
| | | alarm.output.Add(function); |
| | | ShowStateDialog(function, btnState, btnChooseIcon); |
| | | } |
| | | else |
| | | { |
| | | if (tempLocal != null) |
| | | //var output = alarm.output.Find((obj) => obj.sid == function.sid); |
| | | //if (output == null) |
| | | //{ |
| | | // output = new SecurityOutput(); |
| | | // output.sid = function.sid; |
| | | //} |
| | | |
| | | FrameLayout functionRow = new FrameLayout() |
| | | { |
| | | alarm.output.Remove(function); |
| | | Height = Application.GetRealHeight(65), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | functionListView.AddChidren(functionRow); |
| | | |
| | | var btnFunctionName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealHeight(44), |
| | | Text = function.name, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | functionRow.AddChidren(btnFunctionName); |
| | | |
| | | var btnFunctionFloorName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(24), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealHeight(41), |
| | | Text = function.RoomName, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, |
| | | }; |
| | | functionRow.AddChidren(btnFunctionFloorName); |
| | | |
| | | Button btnState = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(317), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | Text = function.StateText() |
| | | }; |
| | | functionRow.AddChidren(btnState); |
| | | |
| | | Button btnChooseIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(333), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(32), |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "Public/ChooseIcon.png", |
| | | SelectedImagePath = "Public/ChooseOnIcon.png", |
| | | }; |
| | | functionRow.AddChidren(btnChooseIcon); |
| | | |
| | | btnChooseIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnChooseIcon.IsSelected = !btnChooseIcon.IsSelected; |
| | | var tempLocal = alarm.output.Find((obj) => |
| | | obj.sid == function.sid |
| | | ); |
| | | //if (tempLocal == null && !string.IsNullOrEmpty(output.spk)) |
| | | //{ |
| | | // ShowStateDialog(output, btnState, btnChooseIcon); |
| | | //} |
| | | if (btnChooseIcon.IsSelected) |
| | | { |
| | | if (tempLocal == null) |
| | | alarm.output.Add(function); |
| | | ShowStateDialog(function, btnState, btnChooseIcon); |
| | | } |
| | | else |
| | | { |
| | | if (tempLocal != null) |
| | | { |
| | | alarm.output.Remove(function); |
| | | } |
| | | } |
| | | }; |
| | | btnState.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnChooseIcon.IsSelected = true; |
| | | var tempLocal = alarm.output.Find((obj) => |
| | | obj.sid == function.sid |
| | | ); |
| | | if (tempLocal == null) |
| | | alarm.output.Add(function); |
| | | ShowStateDialog(function, btnState, btnChooseIcon); |
| | | }; |
| | | |
| | | var localOutput = alarm.output.Find((obj) => obj.sid == function.sid); |
| | | |
| | | if (localOutput != null) |
| | | { |
| | | btnChooseIcon.IsSelected = true; |
| | | btnState.Text = function.StateText(); |
| | | } |
| | | |
| | | |
| | | functionListView.AddChidren(new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealWidth(1), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | }); |
| | | |
| | | |
| | | } |
| | | }; |
| | | btnState.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnChooseIcon.IsSelected = true; |
| | | var tempLocal = alarm.output.Find((obj) => |
| | | obj.sid == function.sid |
| | | ); |
| | | if (tempLocal == null) |
| | | alarm.output.Add(function); |
| | | ShowStateDialog(function, btnState, btnChooseIcon); |
| | | }; |
| | | |
| | | var localOutput = alarm.output.Find((obj) => obj.sid == function.sid); |
| | | |
| | | if (localOutput != null) |
| | | { |
| | | btnChooseIcon.IsSelected = true; |
| | | btnState.Text = function.StateText(); |
| | | } |
| | | |
| | | |
| | | functionListView.AddChidren(new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealWidth(1), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | }); |
| | | |
| | | |
| | | } |
| | | }).Start(); |
| | | } |
| | | |
| | | |
| | |
| | | var form = new FloorRoomSelectPopupView(); |
| | | form.ShowDeviceFunctionView(btnFloor, listAllFun, (selectId, listFun) => |
| | | { |
| | | SetData(selectId); |
| | | var selecteRoom = SpatialInfo.CurrentSpatial.RoomList.Find((obj) => obj.uid == selectId); |
| | | SetData(selecteRoom.roomId); |
| | | //重新刷新设备列表 |
| | | this.LoadFunctionListRow(); |
| | | }, nowSelectId); |