陈嘉乐
2020-05-18 5da99fed2eb0d08b6338064da5f998891252c7b8
ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs
@@ -19,10 +19,13 @@
            UserView.HomePage.Instance.ScrollEnabled = false;
            CompleteView completeView = new CompleteView();
            flMain.AddChidren(completeView.Show(1));
            completeView.Btntitle.Text = common.DeviceEpointName;
            completeView.Btntitle.Text = LocalDevice.Current.GetDeviceEpointName(common);
            EventHandler<MouseEventArgs> clickcancel = (sender, e) =>
            {
                UserView.HomePage.Instance.ScrollEnabled = true;
                if (!edit)
                {
                    UserView.HomePage.Instance.ScrollEnabled = true;
                }
                flMain.RemoveFromParent();
            };
            flMain.MouseUpEventHandler += clickcancel;
@@ -34,29 +37,31 @@
            openView.titleBtn.TextID = MyInternationalizationString.open;
            mFunView closeView = new mFunView();
            closeView.frameLayout.Y = openView.frameLayout.Bottom;
            closeView.frameLayout.Y = Application.GetRealHeight(140 + 20+160);
            // closeView.frameLayout.Y = openView.frameLayout.Bottom;
            //completeView.Show(l).AddChidren(closeView.Show());
            closeView.titleBtn.TextID = MyInternationalizationString.close;
            mFunView takebackView = new mFunView();
            takebackView.frameLayout.Y = closeView.frameLayout.Bottom;
             takebackView.frameLayout.Y = Application.GetRealHeight(140+20+160+160);
            // takebackView.frameLayout.Y = closeView.frameLayout.Bottom;
            //completeView.Show(l).AddChidren(takebackView.Show());
            takebackView.titleBtn.TextID = MyInternationalizationString.onoff;
            takebackView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
            #region  -------进度条控件
            var horizontalSeekBarRowLien = new RowLayout
            {
                Y = openView.frameLayout.Bottom,
                Width = Application.GetRealWidth(920),
                //Y = openView.frameLayout.Bottom,
                Width = Application.GetRealWidth(915),
                Height = Application.GetRealHeight(160),
                X = Application.GetRealWidth(80),
                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
            };
            var horizontalSeekBarVol = new DiyImageSeekBar
            {
                Y = openView.frameLayout.Bottom,
                //Y = openView.frameLayout.Bottom,
                X = Application.GetRealWidth(80),
                Width = Application.GetRealWidth(920),
                Width = Application.GetRealWidth(915),
                Height = Application.GetRealHeight(160),
                IsProgressTextShow = true,//显示百分比
                IsClickable = false,//进度条是否滑动
@@ -64,9 +69,10 @@
                ThumbImagePath = "ZigeeLogic/progressbtn2.png",//进度条按钮图标
                ThumbImageHeight = Application.GetRealHeight(56),//进度条按钮图标的高度(默认正方形:宽和高一样)
                ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor,
                ProgressTextSize = 12,//显示百分比字体大小
                SeekBarViewHeight = Application.GetRealHeight(10),//进度条的高度
                ProgressTextSize = 9,//显示百分比字体大小12
                SeekBarViewHeight = Application.GetRealHeight(5),//进度条的高度10
            };
            #endregion
            #endregion
            #region  -------数据处理部分
@@ -207,7 +213,9 @@
                            completeView.Show(l).AddChidren(openView.Show());
                            completeView.Show(l).AddChidren(closeView.Show());
                            //closeView.frameLayout.Y = openView.frameLayout.Bottom;
                            completeView.Show(l).AddChidren(takebackView.Show());
                            //takebackView.frameLayout.Y = closeView.frameLayout.Bottom;
                            takebackView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
                            #endregion
@@ -379,6 +387,7 @@
                                break;
                            case 40:
                                {
                                    openView.titleBtn.TextID = MyInternationalizationString.smokescreen;
                                    openView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
                                    completeView.Show(1).AddChidren(openView.Show());
@@ -395,7 +404,7 @@
                                }
                                break;
                            case 43:
                                {
                                {//召元说的
                                    openView.titleBtn.TextID = MyInternationalizationString.gas;
                                    openView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
                                    completeView.Show(1).AddChidren(openView.Show());
@@ -484,7 +493,7 @@
                    }
                    break;
                case DeviceType.DoorLock:
                    {
                    {
                        flMain.RemoveFromParent();
                        var memberList = new MemberList();
@@ -527,7 +536,7 @@
                            Send.dictionary(deviceConditionsInfo, "Cluster_ID", "1026");
                            Send.dictionary(deviceConditionsInfo, "AttriButeId", "0");
                            Send.dictionary(deviceConditionsInfo, "Range", "1");//1:等于AttriButeData1时触发动作
                            Send.dictionary(deviceConditionsInfo, "AttriButeData1", "50");//默认温度值50℃
                            Send.dictionary(deviceConditionsInfo, "AttriButeData1", "5000");//默认温度值50℃
                            Send.dictionary(deviceConditionsInfo, "AttriButeData2", "0");
                        }
                        else
@@ -536,7 +545,7 @@
                            Send.dictionary(deviceConditionsInfo, "Cluster_ID", "1029");
                            Send.dictionary(deviceConditionsInfo, "AttriButeId", "0");
                            Send.dictionary(deviceConditionsInfo, "Range", "1");//1:等于AttriButeData1时触发动作
                            Send.dictionary(deviceConditionsInfo, "AttriButeData1", "50");//默认湿度值50%
                            Send.dictionary(deviceConditionsInfo, "AttriButeData1", "5000");//默认湿度值50%
                            Send.dictionary(deviceConditionsInfo, "AttriButeData2", "0");
                        }
                        mUIPickerView.setNPicker(mList1, mList2, mList3);
@@ -545,8 +554,10 @@
                        mUIPickerView.OnSelectChangeEvent += (s1, s2, s3) =>
                        {
                            ///温度进率转换*100
                            var strValue = (int.Parse(mList2[s2]) * 100).ToString();
                            SelectedDeviceStatus = "TemperatureSensor";
                            Send.dictionary(deviceConditionsInfo, "AttriButeData1", mList2[s2]);
                            Send.dictionary(deviceConditionsInfo, "AttriButeData1", strValue);
                            switch (mList1[s1])
                            {
                                case ">":
@@ -612,8 +623,10 @@
                                    break;
                            }
                            //查找索引
                            index1 = mList1.IndexOf(s);
                            index2 = mList2.IndexOf(devices["AttriButeData1"]);
                            index1 = mList1.IndexOf(s);
                            //转换温度值/100
                            var dd = (int.Parse(devices["AttriButeData1"])/100).ToString();
                            index2 = mList2.IndexOf(dd);
                        }
                        ///更新最新状态;
@@ -631,8 +644,12 @@
                        taskListInfo.Add(switchdictionary);
                        completeView.Show(l).AddChidren(openView.Show());
                        openView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
                        horizontalSeekBarRowLien.Y = openView.frameLayout.Bottom;
                        horizontalSeekBarVol.Y = openView.frameLayout.Bottom;
                        completeView.Show(l).AddChidren(horizontalSeekBarRowLien);
                        completeView.Show(l).AddChidren(horizontalSeekBarVol);
                        closeView.frameLayout.Y = horizontalSeekBarRowLien.Bottom;
                        completeView.Show(l).AddChidren(closeView.Show());
@@ -748,6 +765,9 @@
                        openView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
                        horizontalSeekBarRowLien.Y = openView.frameLayout.Bottom;
                        horizontalSeekBarVol.Y = openView.frameLayout.Bottom;
                        completeView.Show(l).AddChidren(horizontalSeekBarRowLien);
                        completeView.Show(l).AddChidren(horizontalSeekBarVol);
@@ -1194,7 +1214,14 @@
                    }
                    else
                    {   //添加目标
                        LogicIfon.AddDeviceactions(common, actionsInfo);
                        if (SelectedDeviceStatus == "DoorLock")
                        {//门锁数据特殊,进行特殊处理;
                            LogicIfon.AddDoorLockActions(common, actionsInfo);
                        }
                        else
                        {
                            LogicIfon.AddDeviceActions(common, actionsInfo);
                        }
                    }
                }
                else