HDL Home App 第二版本 旧平台金堂用 正在使用
陈嘉乐
2020-12-31 cb7fd6a89ad9fcd9cf575025ab43873f17bf17c8
ZigbeeApp/Shared/Phone/Device/Logic/Nightlight.cs
@@ -19,9 +19,6 @@
        public void Show(CommonDevice common, bool edit,string str_if,Dictionary<string, object> editdeviceActionInfo = null)
        {
            #region  布局界面
            actionsInfo = editdeviceActionInfo;
            this.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
            TopView view = new TopView();
            this.AddChidren(view.TopRowView());
@@ -90,7 +87,7 @@
            //保存点击事件
            saveView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
            {
                if (selectedDeviceStatus != "" && actionsInfo != null)
                if (TaskList.Count!=0)
                {
                    LogicIfon.AddDeviceActions(common, actionsInfo);
                }
@@ -98,7 +95,7 @@
                {
                    if (!edit)
                    {
                        var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
                        var alert = new UserCenter.ShowMsgControl(ShowMsgType.Normal,
                                    Language.StringByID(MyInternationalizationString.selectdevicestatuscondition),
                                   Language.StringByID(MyInternationalizationString.confrim));
                        alert.Show();
@@ -194,12 +191,9 @@
                actionsInfo.Add("DeviceAddr", common.DeviceAddr);
                actionsInfo.Add("Epoint", common.DeviceEpoint);
                actionsInfo.Add("Time", 0);
                actionsInfo.Add("TaskList", TaskList);
            }
            if (actionsInfo.ContainsKey("TaskList"))
            {
                actionsInfo.Remove("TaskList");
            }
            actionsInfo.Add("TaskList", TaskList);
        }
        public void CurrentDeviceView(string if_str, CommonDevice common, bool edit, Button button)
        {
@@ -221,13 +215,12 @@
            string status = "";
            Dictionary<string, string> dictionaryLight = new Dictionary<string, string>();
            dictionaryLight.Clear();
            switch (if_str)
            {
                case "夜灯开关":
                    {
                        Send.dictionary(dictionaryLight, "TaskType", "1");
                        Send.dictionary(dictionaryLight, "Data2", "0");
                        mFunView openView = new mFunView();
                        openView.frameLayout.Y = Application.GetRealHeight(140 + 20);
                        openView.titleBtn.TextID = MyInternationalizationString.open;
@@ -286,8 +279,6 @@
                    break;
                case "亮度":
                    {
                        Send.dictionary(dictionaryLight, "TaskType", "3");
                        Send.dictionary(dictionaryLight, "Data2", "0");
                        var horizontalSeekBarVol = new DiyImageSeekBar
                        {
                            Y = Application.GetRealHeight(140),//进度条父控件Y坐标
@@ -333,29 +324,27 @@
                    break;
                case "色温":
                    {
                        Send.dictionary(dictionaryLight, "TaskType", "8");
                        Send.dictionary(dictionaryLight, "Data2", "0");
                        Button seekIconBtn = new Button
                        {
                            Y = Application.GetRealHeight(140 + 160),
                            X = Application.GetRealWidth(78),
                            Height = Application.GetRealHeight(12),
                            Height = Application.GetRealWidth(12),
                            Width = Application.GetRealWidth(918 - 120),
                            UnSelectedImagePath = "ZigeeLogic/seek.png",
                            Gravity = Gravity.CenterHorizontal
                        };
                        completeView.Show(2).AddChidren(seekIconBtn);
                        var horizontalSeekBarVol = new UserCenter.SeekBarControl(918)
                        {
                            ProgressBarColor = 0x00000000,// ZigbeeColor.Current.LogicProgressColorSelected,//选中进度条颜色
                            SeekBarBackgroundColor = 0x00000000,
                            SeekBarViewHeight = Application.GetRealHeight(20),
                            SeekBarPadding = Application.GetRealWidth(60),
                            MinValue = 30,
                            MaxValue = 60,
                            ProgressChangeDelayTime = 0,
                        };
                        completeView.Show(2).AddChidren(seekIconBtn);
                        var horizontalSeekBarVol = new UserCenter.SeekBarControl(918)
                        {
                            ProgressBarColor = 0x00000000,// ZigbeeColor.Current.LogicProgressColorSelected,//选中进度条颜色
                            SeekBarBackgroundColor = 0x00000000,
                            SeekBarViewHeight = Application.GetRealHeight(20),
                            SeekBarPadding = Application.GetRealWidth(60),
                            MinValue = 30,
                            MaxValue = 60,
                            ProgressChangeDelayTime = 0,
                        };
                        completeView.Show(2).AddChidren(horizontalSeekBarVol);
                        horizontalSeekBarVol.Y = seekIconBtn.Y - (horizontalSeekBarVol.Height - seekIconBtn.Height) / 2;
                        horizontalSeekBarVol.ShowCustomTextView(Application.GetRealWidth(200), 12, ZigbeeColor.Current.LogicBtnCancelColor);
@@ -378,23 +367,20 @@
                                {
                                    var intvalue = int.Parse(value["Data1"]);
                                    var lightbrightnessvalue = 1000000 / (intvalue * 100);
                                    horizontalSeekBarVol.Progress = lightbrightnessvalue;
                                    horizontalSeekBarVol.Progress = lightbrightnessvalue;
                                    break;
                                }
                            }
                        }
                        var intValue = horizontalSeekBarVol.Progress;
                        if (intValue == 0) { intValue = 30; }
                        }
                        var intValue = horizontalSeekBarVol.Progress;
                        if (intValue == 0) { intValue = 30; }
                        horizontalSeekBarVol.SetCustomText(intValue * 100 + "K");
                    }
                    break;
                case "蜂鸣器":
                    {
                        Send.dictionary(dictionaryLight, "TaskType", "7");
                        Send.dictionary(dictionaryLight, "Data2", "0");
                        mFunView openView = new mFunView();
                        openView.frameLayout.Y = Application.GetRealHeight(140 + 20);
@@ -457,8 +443,10 @@
            }
            completeView.Btncomplete.MouseUpEventHandler += (sender, e) =>
            {
                if (selectedDeviceStatus != "")
                if (dictionaryLight.Count!=0)
                {
                    Send.dictionary(dictionaryLight, "TaskType", selectedDeviceStatus);
                    Send.dictionary(dictionaryLight, "Data2", "0");
                    flMain.RemoveFromParent();
                    DicValue(selectedDeviceStatus, dictionaryLight);
                    button.Text = status;
@@ -468,7 +456,7 @@
                {
                    if (!edit)
                    {
                        var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
                        var alert = new UserCenter.ShowMsgControl(ShowMsgType.Normal,
                                    Language.StringByID(MyInternationalizationString.selectdevicestatuscondition),
                                   Language.StringByID(MyInternationalizationString.confrim));
                        alert.Show();