WJC
2019-12-30 f1c3921b08bb22ac6f5db22d620e01d7e8e5c49f
ZigbeeApp/Shared/Phone/Device/Logic/LogicDevicePage.cs
@@ -1054,6 +1054,8 @@
                        openframelayout.AddChidren(horizontalSeekBarRow);
                        var horizontalSeekBarVol = new DiyImageSeekBar
                        {
                            Y = openrowlayout.Bottom,
                            X = Application.GetRealWidth(80),
                            Width = Application.GetRealWidth(920),
                            Height = Application.GetRealHeight(160),
                            IsProgressTextShow = true,//显示百分比
@@ -1061,12 +1063,12 @@
                            ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected,//选中进度条颜色
                            ThumbImagePath = "ZigeeLogic/progressbtn2.png",//进度条按钮图标
                            ThumbImageHeight = Application.GetRealHeight(56),//进度条按钮图标的高度(默认正方形:宽和高一样)
                            ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor,//进度条原颜色
                            ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor,
                            ProgressTextSize = 13,//显示百分比字体大小 
                            SeekBarViewHeight = Application.GetRealHeight(10),//进度条的高度
                        };
                        horizontalSeekBarRow.AddChidren(horizontalSeekBarVol);
                        openframelayout.AddChidren(horizontalSeekBarVol);
                         #endregion
                        #region  关
@@ -1138,24 +1140,26 @@
                        #endregion
                        int Progressvalue = 100;
                        horizontalSeekBarVol.OnProgressChangedEvent += (sender, e) =>
                        {
                            SelectedDeviceStatusaction = "yes";
                            Progressvalue = horizontalSeekBarVol.Progress;
                            if (switchdictionary.ContainsKey("TaskType"))
                            {
                                switchdictionary.Remove("TaskType");
                            }
                            if (switchdictionary.ContainsKey("Data1"))
                            {
                                switchdictionary.Remove("Data1");
                            }
                            switchdictionary.Add("TaskType", "3");
                        EventHandler<int> progressclick = (sender, e) =>
                         {
                             SelectedDeviceStatusaction = "yes";
                             Progressvalue = horizontalSeekBarVol.Progress;
                             if (switchdictionary.ContainsKey("TaskType"))
                             {
                                 switchdictionary.Remove("TaskType");
                             }
                             if (switchdictionary.ContainsKey("Data1"))
                             {
                                 switchdictionary.Remove("Data1");
                             }
                             switchdictionary.Add("TaskType", "3");
                            //最大亮度值是254需要转换;
                            var lightbrightnessvalue = (254 * horizontalSeekBarVol.Progress) / 100;
                            switchdictionary.Add("Data1", lightbrightnessvalue.ToString());
                             switchdictionary.Add("Data1", lightbrightnessvalue.ToString());
                        };
                         };
                        horizontalSeekBarVol.OnProgressChangedEvent += progressclick;
                        horizontalSeekBarVol.OnStopTrackingTouchEvent += progressclick;
                        ///确认事件
                        EventHandler<MouseEventArgs> openclick = (sender, e) =>
                        {
@@ -1352,6 +1356,8 @@
                        openframelayout.AddChidren(horizontalSeekBarRow);
                        var horizontalSeekBarVol = new DiyImageSeekBar
                        {
                            Y = openrowlayout.Bottom,
                            X = Application.GetRealWidth(80),
                            Width = Application.GetRealWidth(920),
                            Height = Application.GetRealHeight(160),
                            IsProgressTextShow = true,//显示百分比
@@ -1361,9 +1367,9 @@
                            ThumbImageHeight = Application.GetRealHeight(56),//进度条按钮图标的高度(默认正方形:宽和高一样)
                            ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor,//进度条原颜色
                            ProgressTextSize = 14,//显示百分比字体大小 
                            SeekBarViewHeight = Application.GetRealHeight(10),//进度条的高度
                            SeekBarViewHeight = Application.GetRealHeight(10),
                        };
                        horizontalSeekBarRow.AddChidren(horizontalSeekBarVol);
                        openframelayout.AddChidren(horizontalSeekBarVol);
                        #endregion
@@ -1403,7 +1409,8 @@
                        #endregion
                        int Progressvalue = 100;
                        horizontalSeekBarVol.OnProgressChangedEvent += (sender, e) =>
                        EventHandler<int> progressclick = (sender, e) =>
                        {
                            SelectedDeviceStatusaction = "yes";
                            Progressvalue = horizontalSeekBarVol.Progress;
@@ -1419,8 +1426,10 @@
                            switchdictionary.Add("Data2", horizontalSeekBarVol.Progress.ToString());
                        };
                        horizontalSeekBarVol.OnProgressChangedEvent += progressclick;
                        horizontalSeekBarVol.OnStopTrackingTouchEvent += progressclick;
                        ///确认事件
                        EventHandler<MouseEventArgs> openclick = (sender, e) =>
                        EventHandler <MouseEventArgs> openclick = (sender, e) =>
                        {
                            SelectedDeviceStatusaction = "yes";
                            horizontalSeekBarVol.IsClickable = true;
@@ -1737,7 +1746,7 @@
                        }
                    }
                    break;
                ///空调
                case DeviceType.Thermostat:
                    {
@@ -1745,8 +1754,15 @@
                       var temperaturedictionary = new Dictionary<string, string>();
                       var modedictionary = new Dictionary<string, string>();
                        var 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.Y = Application.GetRealHeight(1920 - 600 - 210 - 160*2);
@@ -1793,11 +1809,12 @@
                        };
                        devicefra.AddChidren(PickerViewfra);
                        //遮挡空调滑动view;
                        var pausePickerViewfra= new FrameLayout
                        {
                            Y = openframelayout.Bottom,
                            Height = Application.GetRealHeight(600),
                            BackgroundColor=0x60ffffff,
                        };
                        devicefra.AddChidren(pausePickerViewfra);
@@ -1872,11 +1889,14 @@
                        var closeBtnSelected = new SelectedButton();
                        closerowlayout.AddChidren(closeBtnSelected);
                        #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";
@@ -1888,20 +1908,23 @@
                                dictionary(temperaturedictionary, "Data2", a.ToString());
                                SpeedState(speedstring, speeddictionary);
                            }
                        };
                        #endregion
                        //默认26,自动,中风
                        int indextemperature = 10, indexmode = 2, indexspeed = 1;
                       mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 0);
                        mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 1);
                        mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 2);
                        #endregion
                        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;
@@ -1915,6 +1938,9 @@
                                    openBtnSelected.Visible = true;
                                    closeBtnSelected.Visible = false;
                                    pausePickerViewfra.Height = Application.GetRealHeight(0);
                                    mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 0);
                                    mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 1);
                                    mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 2);
                                }
@@ -1988,7 +2014,7 @@
                                        }
                                        indexspeed = mList3.IndexOf(speedtext);
                                    }
                                    //4---设置加热度数;5---设置制冷、除湿度数;7---设置自动度数
                                    //4-设置加热度数;5-设置制冷、除湿度数;7-设置自动度数
                                    else if (value["Data1"] == "4" || value["Data1"] == "5" || value["Data1"] == "7")
                                    {
                                        var s = int.Parse(value["Data2"]) / 100;
@@ -2002,10 +2028,18 @@
                        }
                        ///更新最新空调状态;
                        mUIPickerView.setCurrentItems(indextemperature, indexmode, indexspeed);
                        ///确认事件
                        EventHandler<MouseEventArgs> openclick = (sender, e) =>
                        {
                            mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 0);
                            mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 1);
                            mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 2);
                            mUIPickerView.setCurrentItems(indextemperature, indexmode, indexspeed);
                            pausePickerViewfra.Height = Application.GetRealHeight(0);
                            SelectedDeviceStatusaction = "yes";
                            openBtnSelected.Visible = true;
                            closeBtnSelected.Visible = false;
                            //清除之前数据;
                            taskListInfo.Clear();
                            //加载新数据;
@@ -2017,10 +2051,7 @@
                            taskListInfo.Add(temperaturedictionary);
                            taskListInfo.Add(modedictionary);
                            taskListInfo.Add(speeddictionary);
                            pausePickerViewfra.Height = Application.GetRealHeight(0);
                            SelectedDeviceStatusaction = "yes";
                            openBtnSelected.Visible = true;
                            closeBtnSelected.Visible = false;
                            var temperature = mList1[indextemperature].Split(' ')[0];
                            var modestring = mList2[indexmode].Split(' ')[0];
                            var speedstring = mList3[indexspeed].Split(' ')[0];
@@ -2039,6 +2070,10 @@
                        ///取消事件
                        EventHandler<MouseEventArgs> closeclick = (sender, e) =>
                        {
                            mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 0);
                            mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 1);
                            mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 2);
                            mUIPickerView.setCurrentItems(indextemperature, indexmode, indexspeed);
                            //清除之前数据;
                            taskListInfo.Clear();
                            dictionary(modedictionary, "TaskType", "5");