| | |
| | | Button clickbutton = new Button(); |
| | | Button clicktextcolcrbutton = new Button(); |
| | | |
| | | public void Show() |
| | | public void Show() |
| | | { |
| | | |
| | | |
| | | UserView.HomePage.Instance.ScrollEnabled = false; |
| | | this.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor; |
| | | #region 最上面的布局代码 |
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.devicestate, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | | |
| | |
| | | |
| | | }; |
| | | this.AddChidren(devicetypehorizontalScrol); |
| | | devicetypehorizontalScrol.SetCornerWithSameRadius(20,HDLUtils.RectCornerBottomLeft); |
| | | devicetypehorizontalScrol.SetCornerWithSameRadius(Application.GetRealHeight(50), HDLUtils.RectCornerBottomLeft); |
| | | |
| | | middle = new VerticalScrolViewLayout(); |
| | | middle.Y = devicetypehorizontalScrol.Bottom + Application.GetRealHeight(40); |
| | |
| | | middle.X = Application.GetRealWidth(58); |
| | | //middle.Radius = (uint)Application.GetRealHeight(50); |
| | | this.AddChidren(middle); |
| | | middle.SetCornerWithSameRadius(20, HDLUtils.RectCornerTopLeft); |
| | | middle.SetCornerWithSameRadius(Application.GetRealHeight(50), HDLUtils.RectCornerTopLeft); |
| | | ///目前支持的设备 |
| | | var deviceTypeList = new List<DeviceType> { |
| | | DeviceType.IASZone, |
| | |
| | | foolrname.Text = btnfoolrname.Text; |
| | | flMain.RemoveFromParent(); |
| | | var list = Send.GetRoomList(btnfoolrname.Tag.ToString()); |
| | | |
| | | AllRoomView(list, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol); |
| | | }; |
| | | foolrRowLayout.MouseUpEventHandler += foolrnameclick; |
| | |
| | | /// </summary> |
| | | void AllRoomView(List<Common.Room> roomlist, List<DeviceType> deviceTypeList, HorizontalScrolViewLayout roomhorizontalScrol, HorizontalScrolViewLayout devicetypehorizontalScrol) |
| | | { |
| | | |
| | | for (int i = 0; i < roomlist.Count; i++) |
| | | { |
| | | var room = roomlist[i]; |
| | |
| | | // Radius = (uint)Application.GetRealHeight(60), |
| | | }; |
| | | flMain.AddChidren(devicefra); |
| | | devicefra.SetCornerWithSameRadius(20, HDLUtils.RectCornerTopLeft|HDLUtils.RectCornerTopRight); |
| | | devicefra.SetCornerWithSameRadius(Application.GetRealHeight(50), HDLUtils.RectCornerTopLeft|HDLUtils.RectCornerTopRight); |
| | | |
| | | #region -------取消 完成 |
| | | var timetype = new RowLayout |
| | |
| | | Width = Application.GetRealWidth(600), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor, |
| | | TextSize = 14, |
| | | }; |
| | | timeoutrowlayout.AddChidren(btntimeout); |
| | | |
| | |
| | | case DeviceType.TemperatureSensor: |
| | | { |
| | | string current = Language.StringByID(MyInternationalizationString.current); |
| | | devicefra.Y = Application.GetRealHeight(1920 - 140 - 160 * 2 - 20 - 50); |
| | | devicefra.Height = Application.GetRealHeight(140 + 160 * 2 + 20 + 50); |
| | | devicefra.Y = Application.GetRealHeight(1920 - 140 - 600); |
| | | devicefra.Height = Application.GetRealHeight(140 + 600); |
| | | var temperatureSensor = common as TemperatureSensor; |
| | | var Btntemperaturevalue = new Button |
| | | SelectedDeviceStatuscondition = "TemperatureSensor"; |
| | | #region 布局View |
| | | var PickerViewfra = new FrameLayout |
| | | { |
| | | TextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | | Height = Application.GetRealHeight(60), |
| | | Width = Application.GetRealWidth(400), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | X = Application.GetRealWidth(80), |
| | | Y = timetype.Bottom + Application.GetRealHeight(70), |
| | | TextSize = 14, |
| | | Y = Application.GetRealHeight(140), |
| | | Height = Application.GetRealHeight(600), |
| | | }; |
| | | devicefra.AddChidren(Btntemperaturevalue); |
| | | devicefra.AddChidren(PickerViewfra); |
| | | |
| | | var horizontalSeekBarVol = new HorizontalSeekBar |
| | | |
| | | var mUIPickerView = new UIPickerView |
| | | { |
| | | Width = Application.GetRealWidth(920), |
| | | Height = Application.GetRealHeight(80), |
| | | Radius = (uint)Application.GetRealHeight(25), |
| | | Y = timetype.Bottom + Application.GetRealHeight(70 + 60 + 70), |
| | | X = Application.GetRealWidth(80), |
| | | ProgressColor = ZigbeeColor.Current.LogicProgressColorSelected, |
| | | Max = 100, |
| | | SleepTime = 1000, |
| | | ThumbRadius = 9, |
| | | Height = Application.GetRealHeight(600 - 5), |
| | | }; |
| | | devicefra.AddChidren(horizontalSeekBarVol); |
| | | horizontalSeekBarVol.MouseUpEventHandler += (sender, e) => |
| | | PickerViewfra.AddChidren(mUIPickerView); |
| | | |
| | | var mList1 = new List<string> { ">", "<", "=", "≥", "≤" }; |
| | | var mList2 = new List<string>(); |
| | | var mList3 = new List<string>(); |
| | | for (int i = 1; i <=100; i++) |
| | | { |
| | | SelectedDeviceStatuscondition = "TemperatureSensor"; |
| | | if (temperatureSensor.SensorDiv == 1) |
| | | { |
| | | dictionary(deviceConditionsInfo, "AttriButeData1", horizontalSeekBarVol.Progress.ToString()); |
| | | |
| | | Btntemperaturevalue.Text = current + ">" + horizontalSeekBarVol.Progress.ToString() + "℃"; |
| | | |
| | | } |
| | | else |
| | | { |
| | | Btntemperaturevalue.Text = current + "<" + horizontalSeekBarVol.Progress.ToString() + "%"; |
| | | dictionary(deviceConditionsInfo, "AttriButeData1", horizontalSeekBarVol.Progress.ToString());//温度值 |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | if (temperatureSensor.SensorDiv == 1) |
| | | { |
| | | mList2.Add(i.ToString()); |
| | | } |
| | | if (temperatureSensor.SensorDiv == 1) { |
| | | mList3.Add("℃"); |
| | | dictionary(deviceConditionsInfo, "Cluster_ID", "1026"); |
| | | dictionary(deviceConditionsInfo, "AttriButeId", "0"); |
| | | dictionary(deviceConditionsInfo, "Range", "0");//0大于AttriButeData1时触发动作 |
| | | dictionary(deviceConditionsInfo, "AttriButeData1", "0"); |
| | | dictionary(deviceConditionsInfo, "Range", "1");//1:等于AttriButeData1时触发动作 |
| | | dictionary(deviceConditionsInfo, "AttriButeData1", "50");//默认温度值50℃ |
| | | dictionary(deviceConditionsInfo, "AttriButeData2", "0"); |
| | | Btntemperaturevalue.Text = current + ">0℃"; |
| | | |
| | | } |
| | | else |
| | | { |
| | | Btntemperaturevalue.Text = current + "<0%"; |
| | | } else { |
| | | mList3.Add("%"); |
| | | dictionary(deviceConditionsInfo, "Cluster_ID", "1029"); |
| | | dictionary(deviceConditionsInfo, "AttriButeId", "0"); |
| | | dictionary(deviceConditionsInfo, "Range", "2");//2小于AttriButeData1时触发动作 |
| | | dictionary(deviceConditionsInfo, "AttriButeData1", "0");//温度值 |
| | | dictionary(deviceConditionsInfo, "Range", "1");//1:等于AttriButeData1时触发动作 |
| | | dictionary(deviceConditionsInfo, "AttriButeData1", "50");//默认湿度值50% |
| | | dictionary(deviceConditionsInfo, "AttriButeData2", "0"); |
| | | } |
| | | mUIPickerView.setNPicker(mList1, mList2, mList3); |
| | | |
| | | #endregion |
| | | |
| | | mUIPickerView.OnSelectChangeEvent += (s1, s2, s3) => |
| | | { |
| | | SelectedDeviceStatuscondition = "TemperatureSensor"; |
| | | dictionary(deviceConditionsInfo, "AttriButeData1", mList2[s2]); |
| | | switch (mList1[s1]) |
| | | { |
| | | case ">": { |
| | | dictionary(deviceConditionsInfo, "Range", "0"); |
| | | } break; |
| | | case "<": { |
| | | dictionary(deviceConditionsInfo, "Range", "2"); |
| | | } break; |
| | | case "=": { |
| | | dictionary(deviceConditionsInfo, "Range", "1"); |
| | | } break; |
| | | case "≥": { |
| | | dictionary(deviceConditionsInfo, "Range", "6"); |
| | | } break; |
| | | case "≤": { |
| | | dictionary(deviceConditionsInfo, "Range", "7"); |
| | | } break; |
| | | } |
| | | }; |
| | | |
| | | //默认=,50 |
| | | int index1 = 2, index2 = 49; |
| | | if (edit && devices != null) |
| | | { |
| | | horizontalSeekBarVol.Progress = int.Parse(devices["AttriButeData1"]); |
| | | if (temperatureSensor.SensorDiv == 1) |
| | | SelectedDeviceStatuscondition = ""; |
| | | string s = ""; |
| | | switch (devices["Range"]) |
| | | { |
| | | |
| | | Btntemperaturevalue.Text = current + ">" + devices["AttriButeData1"] + "℃"; |
| | | |
| | | case "0": |
| | | { |
| | | s = ">"; |
| | | } |
| | | break; |
| | | case "1": |
| | | { |
| | | s = "="; |
| | | } |
| | | break; |
| | | case "2": |
| | | { |
| | | s = "<"; |
| | | } |
| | | break; |
| | | case "6": |
| | | { |
| | | s = "≥"; |
| | | } |
| | | break; |
| | | case "7": |
| | | { |
| | | s = "≤"; |
| | | } |
| | | break; |
| | | } |
| | | else |
| | | { |
| | | Btntemperaturevalue.Text = current + "<" + devices["AttriButeData1"] + "%"; |
| | | } |
| | | //查找索引 |
| | | index1 = mList1.IndexOf(s); |
| | | index2 = mList2.IndexOf(devices["AttriButeData1"]); |
| | | |
| | | } |
| | | ///更新最新状态; |
| | | mUIPickerView.setCurrentItems(index1, index2, 0); |
| | | |
| | | } |
| | | break; |
| | |
| | | { |
| | | if (!edit) |
| | | { |
| | | var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt), |
| | | Language.StringByID(MyInternationalizationString.selectdevicestatuscondition), |
| | | Language.StringByID(MyInternationalizationString.complete)); |
| | | var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal, |
| | | Language.StringByID(MyInternationalizationString.selectdevicestatuscondition), |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.Show(); |
| | | return; |
| | | } |