| | |
| | | |
| | | |
| | | ///没有房间直接返回去; |
| | | if (Common.Room.Lists.Count == 0) |
| | | var listAllRoom = UserCenter.HdlRoomLogic.Current.GetAllListRooms(); |
| | | if (listAllRoom.Count == 0) |
| | | { |
| | | return; |
| | | } |
| | |
| | | dropdown.Visible = false; |
| | | if (Config.Instance.Home.FloorDics.Count == 0) |
| | | { |
| | | roomlists.AddRange(Common.Room.Lists); |
| | | roomlists.AddRange(listAllRoom); |
| | | } |
| | | else |
| | | { |
| | |
| | | roomTextButton.IsSelected = false; |
| | | roomTextButton = roomnameBtn; |
| | | roomnameBtn.IsSelected = true; |
| | | var list = new List<DeviceUI>(); |
| | | foreach (var device in room.DeviceUIList) |
| | | var list = new List<CommonDevice>(); |
| | | foreach (var deviceKeys in room.ListDevice) |
| | | { |
| | | if (device.CommonDevice == null) |
| | | var device = LocalDevice.Current.GetDevice(deviceKeys); |
| | | if (device == null) |
| | | { |
| | | continue; |
| | | } |
| | | if (!deviceTypeList.Contains(device.CommonDevice.Type)) |
| | | if (!deviceTypeList.Contains(device.Type)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | roomTextButton.IsSelected = false; |
| | | roomTextButton = roomnameBtn; |
| | | roomnameBtn.IsSelected = true; |
| | | var list = new List<DeviceUI>(); |
| | | foreach (var device in room.DeviceUIList) |
| | | var list = new List<CommonDevice>(); |
| | | foreach (var deviceKeys in room.ListDevice) |
| | | { |
| | | if (device.CommonDevice == null) |
| | | var device = LocalDevice.Current.GetDevice(deviceKeys); |
| | | if (device == null) |
| | | { |
| | | continue; |
| | | } |
| | | if (!deviceTypeList.Contains(device.CommonDevice.Type)) |
| | | if (!deviceTypeList.Contains(device.Type)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | /// <summary> |
| | | ///加载该区域所有设备的视图方法 |
| | | /// </summary> |
| | | void AllDeviceTypeView(List<DeviceUI> devicelist, HorizontalScrolViewLayout devicetypehorizontalScrol) |
| | | void AllDeviceTypeView(List<CommonDevice> devicelist, HorizontalScrolViewLayout devicetypehorizontalScrol) |
| | | { |
| | | |
| | | List<string> devicetypelist = new List<string>(); |
| | | devicetypelist.Clear(); |
| | | |
| | | #region ------排列设备类型------ |
| | | var lightjosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.DimmableLight || device.CommonDevice.Type == DeviceType.OnOffOutput); |
| | | var lightjosn = devicelist.Find((device) => device.Type == DeviceType.DimmableLight || device.Type == DeviceType.OnOffOutput); |
| | | if (lightjosn != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.Lights)); |
| | | } |
| | | var curtainjosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.WindowCoveringDevice); |
| | | var curtainjosn = devicelist.Find((device) => device.Type == DeviceType.WindowCoveringDevice); |
| | | if (curtainjosn != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.Curtains)); |
| | | } |
| | | var ac = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.Thermostat); |
| | | var ac = devicelist.Find((device) => device.Type == DeviceType.Thermostat); |
| | | if (ac != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.AC)); |
| | | } |
| | | var airSwitch = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.AirSwitch); |
| | | var airSwitch = devicelist.Find((device) => device.Type == DeviceType.AirSwitch); |
| | | if (airSwitch != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.Airswitch)); |
| | |
| | | /// 加载该类型设备视图方法 |
| | | /// </summary> |
| | | /// <param name="devicelist">设备列表</param> |
| | | void ActionDeviceView(List<DeviceType> deviceTypelist, List<DeviceUI> devicelist) |
| | | void ActionDeviceView(List<DeviceType> deviceTypelist, List<CommonDevice> devicelist) |
| | | { |
| | | middle.RemoveAll(); |
| | | foreach (var common in devicelist) |
| | | { |
| | | |
| | | if (deviceTypelist.Count != 0 && !deviceTypelist.Contains(common.CommonDevice.Type)) |
| | | if (deviceTypelist.Count != 0 && !deviceTypelist.Contains(common.Type)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | |
| | | var devicename = new Button |
| | | { |
| | | Text = common.CommonDevice.DeviceEpointName, |
| | | Text = common.DeviceEpointName, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | SelectedTextColor = ZigbeeColor.Current.LogicAddColor, |
| | | TextSize = 14, |
| | | }; |
| | | deviceRow.AddChidren(devicename); |
| | | switch (common.CommonDevice.Type) |
| | | switch (common.Type) |
| | | { |
| | | |
| | | case DeviceType.OnOffOutput: |
| | |
| | | |
| | | var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor }; |
| | | this.AddChidren(flMain); |
| | | CurrentDeviceStateView(flMain, common.CommonDevice, false); |
| | | CurrentDeviceStateView(flMain, common, false); |
| | | }; |
| | | deviceFramelayout.MouseUpEventHandler += devicclick; |
| | | bjFramelayout.MouseUpEventHandler += devicclick; |
| | |
| | | ThumbImagePath = "ZigeeLogic/progressbtn2.png",//进度条按钮图标 |
| | | ThumbImageHeight = Application.GetRealHeight(56),//进度条按钮图标的高度(默认正方形:宽和高一样) |
| | | ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor,//进度条原颜色 |
| | | ProgressTextSize = 13,//显示百分比字体大小 |
| | | ProgressTextSize = 12,//显示百分比字体大小 |
| | | SeekBarViewHeight = Application.GetRealHeight(10),//进度条的高度 |
| | | }; |
| | | openframelayout.AddChidren(horizontalSeekBarVol); |
| | |
| | | }; |
| | | openframelayout.AddChidren(horizontalSeekBarRow); |
| | | var horizontalSeekBarVol = new DiyImageSeekBar |
| | | {
|
| | | { |
| | | Y = openrowlayout.Bottom, |
| | | X = Application.GetRealWidth(80), |
| | | Width = Application.GetRealWidth(920), |
| | |
| | | ThumbImagePath = "ZigeeLogic/progressbtn2.png",//进度条按钮图标 |
| | | ThumbImageHeight = Application.GetRealHeight(56),//进度条按钮图标的高度(默认正方形:宽和高一样) |
| | | ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor,//进度条原颜色 |
| | | ProgressTextSize = 13,//显示百分比字体大小 |
| | | ProgressTextSize = 12,//显示百分比字体大小 |
| | | SeekBarViewHeight = Application.GetRealHeight(10),//进度条的高度 |
| | | }; |
| | | openframelayout.AddChidren(horizontalSeekBarVol); |
| | |
| | | Dictionary<string, string> temperaturedictionary = new Dictionary<string, string>(); |
| | | Dictionary<string, string> modedictionary = new Dictionary<string, string>(); |
| | | Dictionary<string, string> speeddictionary = new Dictionary<string, string>(); |
| | | |
| | | |
| | | dictionary(temperaturedictionary, "TaskType", "5"); |
| | | dictionary(modedictionary, "TaskType", "5"); |
| | | dictionary(modedictionary, "Data1", "3"); |
| | | dictionary(speeddictionary, "TaskType", "5"); |
| | | dictionary(speeddictionary, "Data1", "6"); |
| | | taskListInfo.Add(temperaturedictionary); |
| | | taskListInfo.Add(modedictionary); |
| | | taskListInfo.Add(speeddictionary); |
| | | #endregion |
| | | |
| | | #region 空调View |
| | |
| | | }; |
| | | devicefra.AddChidren(PickerViewfra); |
| | | |
| | | |
| | | //遮挡空调滑动view; |
| | | var pausePickerViewfra = new FrameLayout |
| | | { |
| | | Y = openframelayout.Bottom, |
| | | Height = Application.GetRealHeight(600), |
| | | BackgroundColor = 0x60ffffff, |
| | | }; |
| | | devicefra.AddChidren(pausePickerViewfra); |
| | | |
| | | |
| | | |
| | | var mUIPickerView = new UIPickerView |
| | | { |
| | |
| | | mList1.Add(i.ToString() + " " + "℃"); |
| | | } |
| | | mUIPickerView.setNPicker(mList1, mList2, mList3); |
| | | mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 0); |
| | | mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 1); |
| | | mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 2); |
| | | ///默认状态 |
| | | |
| | | |
| | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | //默认26,自动,中风 |
| | | int indextemperature = 10, indexmode = 2, indexspeed = 1; |
| | | mUIPickerView.OnSelectChangeEvent += (s1, s2, s3) => |
| | | { |
| | | indextemperature = s1; |
| | | indexmode = s2; |
| | | indexspeed = s3; |
| | | if (openBtnSelected.Visible) |
| | | { |
| | | SelectedDeviceStatusaction = "yes"; |
| | |
| | | }; |
| | | |
| | | #endregion |
| | | //默认26,自动,中风 |
| | | int indextemperature = 10, indexmode = 2, indexspeed = 1; |
| | | |
| | | if (edit && TaskList != null) |
| | | { |
| | | foreach (var value in TaskList) |
| | | { |
| | | if (TaskList.Count == 1) |
| | | { |
| | | mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 0); |
| | | mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 1); |
| | | mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 2); |
| | | //数组只有一个元素说明当前空调状态为关; |
| | | openBtnSelected.Visible = false; |
| | | closeBtnSelected.Visible = true; |
| | |
| | | } |
| | | else |
| | | { |
| | | mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 0); |
| | | mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 1); |
| | | mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 2); |
| | | openBtnSelected.Visible = true; |
| | | closeBtnSelected.Visible = false; |
| | | pausePickerViewfra.Height = Application.GetRealHeight(0); |
| | |
| | | ///确认事件 |
| | | EventHandler<MouseEventArgs> openclick = (sender, e) => |
| | | { |
| | | mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 0); |
| | | mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 1); |
| | | mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 2); |
| | | //清除之前数据; |
| | | taskListInfo.Clear(); |
| | | //加载新数据; |
| | |
| | | ///取消事件 |
| | | EventHandler<MouseEventArgs> closeclick = (sender, e) => |
| | | { |
| | | |
| | | mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 0); |
| | | mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 1); |
| | | mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 2); |
| | | //清除之前数据; |
| | | taskListInfo.Clear(); |
| | | dictionary(modedictionary, "TaskType", "5"); |
| | |
| | | { |
| | | if (!edit) |
| | | { |
| | | var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt), |
| | | Language.StringByID(MyInternationalizationString.selectdevicestatuscondition), |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal, |
| | | Language.StringByID(MyInternationalizationString.selectdevicestatuscondition), |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.Show(); |
| | | return; |
| | | } |