| | |
| | | using System.Collections.Generic;
|
| | | using System.Text;
|
| | | using System.Threading.Tasks;
|
| | | using ZigBee.Device; |
| | | namespace Shared.Phone.UserCenter.DevicePanel |
| | | { |
| | | public class PanelBackLighWithSensorForm : EditorCommonForm |
| | | { |
| | | #region ■ 变量声明___________________________ |
| | | using ZigBee.Device;
|
| | | namespace Shared.Phone.UserCenter.DevicePanel
|
| | | {
|
| | | public class PanelBackLighWithSensorForm : EditorCommonForm
|
| | | {
|
| | | #region ■ 变量声明___________________________ |
| | | /// <summary>
|
| | | /// 列表控件
|
| | | /// </summary>
|
| | | private VerticalScrolViewLayout listview = null; |
| | | |
| | | private VerticalScrolViewLayout listview = null;
|
| | | /// <summary>
|
| | | /// 面板的回路
|
| | | /// </summary>
|
| | |
| | | /// 按键的颜色数据
|
| | | /// </summary>
|
| | | private Panel.KeyColorData keyColorData = null;
|
| | | /// <summary>
|
| | | /// 选择睡眠时间的事件 value:索引(从0开始) 文本信息请用Text获取
|
| | | /// </summary>
|
| | | public Action<int> timeAction = null;
|
| | | /// <summary>
|
| | | /// 当前选择的功能类型索引
|
| | | /// </summary>
|
| | | private int nowSelectNo = 0;
|
| | | /// <summary>
|
| | | /// /// <summary>
|
| | | /// 睡眠时间的值
|
| | | /// </summary>
|
| | | /// </summary>
|
| | | public string sleepTimeText
|
| | | {
|
| | | get { return btnSleepTime.Text; }
|
| | | set { btnSleepTime.Text = value; }
|
| | | }
|
| | | /// <summary>
|
| | | ///睡眠时间 |
| | | /// </summary>
|
| | | public NormalViewControl btnSleepTime = null;
|
| | |
|
| | | #endregion
|
| | |
|
| | |
| | | if (result == false)
|
| | | {
|
| | | return;
|
| | | } |
| | | |
| | | //清空bodyFrame |
| | | this.ClearBodyFrame(); |
| | | |
| | | listview = new VerticalScrolViewLayout(); |
| | | listview.Height = Application.GetRealHeight(1981 - 184); |
| | | bodyFrameLayout.AddChidren(listview); |
| | | }
|
| | |
|
| | | //清空bodyFrame
|
| | | this.ClearBodyFrame();
|
| | |
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | { |
| | | //添加节能模式 |
| | | this.AddEnergyConservationRow(); |
| | | //添加点击前,亮度进度条 |
| | | {
|
| | | listview = new VerticalScrolViewLayout();
|
| | | listview.Height = Application.GetRealHeight(1981 - 184);
|
| | | bodyFrameLayout.AddChidren(listview);
|
| | |
|
| | | //添加节能模式
|
| | | this.AddEnergyConservationRow();
|
| | | //添加点击前,亮度进度条
|
| | | this.AddBeforeClickProgress();
|
| | | //添加点击后,亮度进度条
|
| | | this.AddAfterClickProgress(); |
| | | }); |
| | | //容器补充 |
| | | FinishInitControl(listview); |
| | | //保存 |
| | | var btnSave = new BottomClickButton(); |
| | | btnSave.TextID = R.MyInternationalizationString.uSave; |
| | | bodyFrameLayout.AddChidren(btnSave); |
| | | btnSave.ButtonClickEvent += (sender, e) => |
| | | { |
| | | //保存面板数据 |
| | | this.SavePanelData(); |
| | | }; |
| | | this.AddAfterClickProgress();
|
| | |
|
| | | this.FinishInitControl(listview, energyModeInfo.enable);
|
| | |
|
| | | //保存
|
| | | var btnSave = new BottomClickButton();
|
| | | btnSave.TextID = R.MyInternationalizationString.uSave;
|
| | | bodyFrameLayout.AddChidren(btnSave);
|
| | | btnSave.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //保存面板数据
|
| | | this.SavePanelData();
|
| | | };
|
| | | });
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | /// <param name="frameLinght">各种背光灯的容器(控件伸缩使用)</param>
|
| | | private void AddEnergyConservationRow()
|
| | | {
|
| | | //缩小:170 扩大:429
|
| | | //缩小:170 扩大:614
|
| | | var frameBack = new FrameRowControl();
|
| | | frameBack.BackgroundColor = UserCenterColor.Current.White;
|
| | | frameBack.UseClickStatu = false;
|
| | |
| | | btnSwitch.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | btnSwitch.IsSelected = !btnSwitch.IsSelected;
|
| | | energyModeInfo.enable = btnSwitch.IsSelected; |
| | | //展开或者缩小的高度 |
| | | var value = Application.GetRealHeight(443);
|
| | | energyModeInfo.enable = btnSwitch.IsSelected;
|
| | | //展开或者缩小的高度
|
| | | var value = Application.GetRealHeight(614);
|
| | | if (btnSwitch.IsSelected == true)
|
| | | {
|
| | | frameBack.Height += value; |
| | | frameBack.Height += value;
|
| | | }
|
| | | else
|
| | | {
|
| | | frameBack.Height -= value; |
| | | } |
| | | //容器补充 |
| | | frameBack.Height -= value;
|
| | | }
|
| | | //容器补充
|
| | | this.FinishInitControl(listview, energyModeInfo.enable);
|
| | | };
|
| | | if (energyModeInfo.enable == true)
|
| | |
| | | if (energyModeInfo.enable == true)
|
| | | {
|
| | | //展开或者缩小的高度
|
| | | var value = Application.GetRealHeight(443);
|
| | | var value = Application.GetRealHeight(614);
|
| | | frameBack.Height += value;
|
| | | //添加接近感应 |
| | | this.AddProximitySensorsRow(frameBack); |
| | | }
|
| | | } |
| | | |
| | |
|
| | | //添加接近感应
|
| | | this.AddProximitySensorsRow(frameBack);
|
| | |
|
| | | //底线 |
| | | var btnLine = new NormalViewControl(965, 5, true);
|
| | | btnLine.Height = 1;
|
| | | btnLine.X = Application.GetRealWidth(52);
|
| | | btnLine.Y = Application.GetRealHeight(484 + 127);
|
| | | btnLine.BackgroundColor = UserCenterColor.Current.ButtomLine;
|
| | | frameBack.AddChidren(btnLine);
|
| | |
|
| | | //添加睡眠时间
|
| | | this.AddSleepTimeRow(frameBack);
|
| | | }
|
| | |
|
| | | #endregion
|
| | | |
| | |
|
| | | #region ■ 接近感应___________________________
|
| | | |
| | |
|
| | | /// <summary>
|
| | | /// 接近感应行
|
| | | /// </summary>
|
| | | private void AddProximitySensorsRow(FrameRowControl frameRowControl)
|
| | | { |
| | | //接近感应行 |
| | | {
|
| | | //接近感应行
|
| | | var frameBack = new FrameRowControl();
|
| | | frameBack.BackgroundColor = UserCenterColor.Current.White;
|
| | | frameBack.UseClickStatu = false;
|
| | |
| | | //接近感应
|
| | | frameBack.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.ProximitySensors), 400);
|
| | | //开关控件
|
| | | var btnSwitch = frameBack.AddMostRightSwitchIcon(); |
| | | |
| | | btnSwitch.ButtonClickEvent += (sender, e) => |
| | | { |
| | | btnSwitch.IsSelected = !btnSwitch.IsSelected; |
| | | proximitySensorsInfo.enable = btnSwitch.IsSelected; |
| | | }; |
| | | var btnSwitch = frameBack.AddMostRightSwitchIcon();
|
| | |
|
| | | btnSwitch.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | btnSwitch.IsSelected = !btnSwitch.IsSelected;
|
| | | proximitySensorsInfo.enable = btnSwitch.IsSelected;
|
| | | };
|
| | | if (proximitySensorsInfo.enable == true)
|
| | | {
|
| | | btnSwitch.IsSelected = true;
|
| | | } |
| | | } |
| | | }
|
| | | }
|
| | | #endregion
|
| | | |
| | |
|
| | | #region ■ 睡眠时间___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 睡眠时间行
|
| | | /// </summary>
|
| | | private void AddSleepTimeRow(FrameRowControl frameRowControl)
|
| | | {
|
| | | //睡眠时间行
|
| | | var frameBack = new FrameRowControl();
|
| | | frameBack.BackgroundColor = UserCenterColor.Current.White;
|
| | | frameBack.UseClickStatu = false;
|
| | | frameBack.Y = Application.GetRealHeight(784 - 170);
|
| | | frameBack.Height = Application.GetRealHeight(170);
|
| | | frameRowControl.AddChidren(frameBack);
|
| | |
|
| | | //睡眠时间
|
| | | frameBack.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.SleepTime), 400);
|
| | | //右箭头
|
| | | frameBack.AddRightArrow();
|
| | | btnSleepTime = new NormalViewControl(700, true);
|
| | | switch (energyModeInfo.time)
|
| | | {
|
| | | case 15:
|
| | | btnSleepTime.Text = "15s";
|
| | | nowSelectNo = 0;
|
| | | break;
|
| | | case 60:
|
| | | btnSleepTime.Text = "1min";
|
| | | nowSelectNo = 1;
|
| | | break;
|
| | | case 300:
|
| | | btnSleepTime.Text = "5min";
|
| | | nowSelectNo = 2;
|
| | | break;
|
| | | }
|
| | | frameBack.AddMostRightView(this.sleepTimeText, 700);
|
| | |
|
| | | timeAction = null;
|
| | | timeAction += (nowSelectNo) =>
|
| | | {
|
| | | switch (nowSelectNo)
|
| | | {
|
| | | case 0:
|
| | | energyModeInfo.time = 15;
|
| | | break;
|
| | | case 1:
|
| | | energyModeInfo.time = 60;
|
| | | break;
|
| | | case 2:
|
| | | energyModeInfo.time = 300;
|
| | | break;
|
| | | }
|
| | | AddSleepTimeRow(frameRowControl);
|
| | | };
|
| | | frameBack.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | this.ShowSelectDeviceSleepTimeListForm();
|
| | | };
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region ■ 显示选择设备睡眠时间_______________ |
| | | /// <summary>
|
| | | /// 显示选择设备睡眠时间的界面
|
| | | /// </summary>
|
| | | public void ShowSelectDeviceSleepTimeListForm()
|
| | | {
|
| | | //显示列表
|
| | | var listText = new List<string>();
|
| | | listText.Add("15s");
|
| | | listText.Add("1min");
|
| | | listText.Add("5min");
|
| | | //标题:选择功能类型
|
| | | var title = Language.StringByID(R.MyInternationalizationString.SleepTime);
|
| | |
|
| | | var form = new BottomItemSelectForm();
|
| | | form.CancelCallEvent = false;//允许取消
|
| | | form.AddForm(title, listText, null, nowSelectNo);
|
| | | form.FinishSelectEvent += (selectNo) =>
|
| | | {
|
| | | if (selectNo == nowSelectNo)
|
| | | {
|
| | | //选择的是相同的
|
| | | return;
|
| | | }
|
| | | //-1:选择取消
|
| | | this.sleepTimeText = selectNo == -1 ? string.Empty : listText[selectNo];
|
| | | nowSelectNo = selectNo;
|
| | | //调用回调函数
|
| | | this.timeAction?.Invoke(nowSelectNo);
|
| | | };
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region ■ 点击前_____________________________
|
| | | |
| | |
|
| | | /// <summary>
|
| | | /// 添加点击前的背光灯进度条
|
| | | /// </summary>
|
| | |
| | | {
|
| | | //点击前
|
| | | var btnClick = new NormalViewControl(600, 107, true);
|
| | | btnClick.X = ControlCommonResourse.XXLeft; |
| | | btnClick.X = ControlCommonResourse.XXLeft;
|
| | | btnClick.TextSize = 12;
|
| | | btnClick.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | btnClick.TextID = R.MyInternationalizationString.uBeforeClick;
|
| | |
| | | btnTemp2.Text = "100%";
|
| | | frameBack.AddChidren(btnTemp2);
|
| | |
|
| | | var frameColor = new FrameLayoutControl();
|
| | | var frameColor = new FrameLayoutStatuControl();
|
| | | frameColor.UseClickStatu = false;
|
| | | frameColor.Width = Application.GetRealHeight(262);
|
| | | frameColor.Height = Application.GetMinRealAverage(79);
|
| | | frameColor.Height = this.GetPictrueRealSize(79);
|
| | | frameColor.Y = Application.GetRealHeight(26);
|
| | | frameColor.X = listview.Width - ControlCommonResourse.XXLeft - Application.GetRealHeight(262);
|
| | | frameBack.AddChidren(frameColor);
|
| | |
|
| | | //颜色
|
| | | var btnColorView = new NormalViewControl(Application.GetRealHeight(110), Application.GetMinRealAverage(49), false);
|
| | | var btnColorView = new NormalViewControl(Application.GetRealHeight(110), this.GetPictrueRealSize(49), false);
|
| | | btnColorView.Gravity = Gravity.CenterVertical;
|
| | | btnColorView.TextAlignment = TextAlignment.CenterRight;
|
| | | btnColorView.TextSize = 12;
|
| | | btnColorView.Y = Application.GetRealHeight(5);
|
| | | btnColorView.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | | btnColorView.TextID = R.MyInternationalizationString.uColor;
|
| | | frameColor.AddChidren(btnColorView, ChidrenBindMode.BindEventOnly);
|
| | | frameColor.AddChidren(btnColorView, ChidrenBindMode.BindEvent);
|
| | |
|
| | | int R1 = Convert.ToInt32(this.keyColorData.CloseColorR, 16);
|
| | | int G1 = Convert.ToInt32(this.keyColorData.CloseColorG, 16);
|
| | | int B1 = Convert.ToInt32(this.keyColorData.CloseColorB, 16);
|
| | | uint backColor = this.GetColorByRGB((byte)R1, (byte)G1, (byte)B1); |
| | | |
| | | //颜色外框 |
| | | var btnColorLine = new FrameLayoutControl(); |
| | | btnColorLine.Width = Application.GetRealHeight(79);
|
| | | btnColorLine.Height = Application.GetMinRealAverage(79); |
| | | btnColorLine.X = btnColorView.Right + Application.GetRealHeight(18);
|
| | | btnColorLine.Radius = (uint)Application.GetMinRealAverage(79) / 2;
|
| | | btnColorLine.BorderWidth = 1;
|
| | | btnColorLine.BorderColor = 0xffcccccc; |
| | | frameColor.AddChidren(btnColorLine, ChidrenBindMode.BindEventOnly);
|
| | | uint backColor = this.GetColorByRGB((byte)R1, (byte)G1, (byte)B1);
|
| | |
|
| | | var btnColor = new NormalViewControl(Application.GetMinRealAverage(69), Application.GetMinRealAverage(69), false);
|
| | | //颜色外框
|
| | | var frameColorLine = new FrameLayoutStatuControl();
|
| | | frameColorLine.UseClickStatu = false;
|
| | | frameColorLine.Height = this.GetPictrueRealSize(79);
|
| | | frameColorLine.Width = this.GetPictrueRealSize(79);
|
| | | frameColorLine.X = btnColorView.Right + Application.GetRealHeight(18);
|
| | | frameColorLine.Radius = (uint)this.GetPictrueRealSize(79) / 2;
|
| | | frameColorLine.BorderWidth = 1;
|
| | | frameColorLine.BorderColor = 0xffcccccc;
|
| | | frameColor.AddChidren(frameColorLine, ChidrenBindMode.NotBind);
|
| | |
|
| | | //分两步计算,不然有可能它得出的结果有误差导致不居中
|
| | | int btnColorWidth = frameColorLine.Height - this.GetPictrueRealSize(7) - this.GetPictrueRealSize(7);
|
| | | var btnColor = new NormalViewControl(btnColorWidth, btnColorWidth, false);
|
| | | btnColor.Gravity = Gravity.Center;
|
| | | btnColor.Radius = (uint)Application.GetMinRealAverage(69) / 2;
|
| | | btnColor.Radius = (uint)btnColorWidth / 2;
|
| | | btnColor.BackgroundColor = backColor;
|
| | | btnColorLine.AddChidren(btnColor, ChidrenBindMode.BindEventOnly);
|
| | | frameColorLine.AddChidren(btnColor, ChidrenBindMode.NotBind);
|
| | | frameColor.ChangedChidrenBindMode(frameColorLine, ChidrenBindMode.BindEvent);
|
| | |
|
| | | //变更滑动条的颜色
|
| | | seekBar1.ProgressBarColor = backColor;
|
| | |
|
| | | var btnRight = new NormalViewControl(Application.GetMinRealAverage(58), Application.GetMinRealAverage(58), false);
|
| | | var btnRight = new NormalViewControl(this.GetPictrueRealSize(58), this.GetPictrueRealSize(58), false);
|
| | | btnRight.UnSelectedImagePath = "Item/RightNext.png";
|
| | | btnRight.Y = Application.GetRealHeight(5);
|
| | | btnRight.X = frameColor.Width - Application.GetMinRealAverage(58);
|
| | | frameColor.AddChidren(btnRight, ChidrenBindMode.BindEventOnly);
|
| | | btnRight.Y += Application.GetMinRealAverage(8);
|
| | | btnRight.X = frameColor.Width - this.GetPictrueRealSize(58);
|
| | | frameColor.AddChidren(btnRight, ChidrenBindMode.BindEvent);
|
| | | btnRight.Y += this.GetPictrueRealSize(8);
|
| | |
|
| | | frameColor.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | |
| | | btnClick.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | btnClick.TextID = R.MyInternationalizationString.uAfterClick;
|
| | | listview.AddChidren(btnClick);
|
| | |
|
| | | //背景
|
| | | var frameBack = new FrameLayout();
|
| | | frameBack.Y = Application.GetRealHeight(608);
|
| | |
| | | btnTemp2.Text = "100%";
|
| | | frameBack.AddChidren(btnTemp2);
|
| | |
|
| | | var frameColor = new FrameLayoutControl();
|
| | | var frameColor = new FrameLayoutStatuControl();
|
| | | frameColor.UseClickStatu = false;
|
| | | frameColor.Width = Application.GetRealHeight(262);
|
| | | frameColor.Height = Application.GetMinRealAverage(79);
|
| | | frameColor.Height = this.GetPictrueRealSize(79);
|
| | | frameColor.Y = Application.GetRealHeight(26);
|
| | | frameColor.X = listview.Width - ControlCommonResourse.XXLeft - Application.GetRealHeight(262);
|
| | | frameBack.AddChidren(frameColor); |
| | | |
| | | //颜色 |
| | | var btnColorView = new NormalViewControl(Application.GetRealHeight(110), Application.GetMinRealAverage(49), false);
|
| | | frameBack.AddChidren(frameColor);
|
| | |
|
| | | //颜色
|
| | | var btnColorView = new NormalViewControl(Application.GetRealHeight(110), this.GetPictrueRealSize(49), false);
|
| | | btnColorView.Gravity = Gravity.CenterVertical;
|
| | | btnColorView.TextAlignment = TextAlignment.CenterRight;
|
| | | btnColorView.TextSize = 12;
|
| | | btnColorView.Y = Application.GetRealHeight(5);
|
| | | btnColorView.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | | btnColorView.TextID = R.MyInternationalizationString.uColor;
|
| | | frameColor.AddChidren(btnColorView, ChidrenBindMode.BindEventOnly);
|
| | | frameColor.AddChidren(btnColorView, ChidrenBindMode.BindEvent);
|
| | |
|
| | | int R1 = Convert.ToInt32(this.keyColorData.OpenColorR, 16);
|
| | | int G1 = Convert.ToInt32(this.keyColorData.OpenColorG, 16);
|
| | | int B1 = Convert.ToInt32(this.keyColorData.OpenColorB, 16);
|
| | | uint backColor = this.GetColorByRGB((byte)R1, (byte)G1, (byte)B1); |
| | | |
| | | //颜色外框 |
| | | var btnColorLine = new FrameLayoutControl(); |
| | | btnColorLine.Width = Application.GetRealHeight(79);
|
| | | btnColorLine.Height = Application.GetMinRealAverage(79); |
| | | btnColorLine.X = btnColorView.Right + Application.GetRealHeight(18);
|
| | | btnColorLine.Radius = (uint)Application.GetMinRealAverage(79) / 2;
|
| | | btnColorLine.BorderWidth = 1;
|
| | | btnColorLine.BorderColor = 0xffcccccc; |
| | | frameColor.AddChidren(btnColorLine, ChidrenBindMode.BindEventOnly); |
| | | |
| | | var btnColor = new NormalViewControl(Application.GetMinRealAverage(69), Application.GetMinRealAverage(69), false); |
| | | uint backColor = this.GetColorByRGB((byte)R1, (byte)G1, (byte)B1);
|
| | |
|
| | | //颜色外框
|
| | | var frameColorLine = new FrameLayoutStatuControl();
|
| | | frameColorLine.UseClickStatu = false;
|
| | | frameColorLine.Height = this.GetPictrueRealSize(79);
|
| | | frameColorLine.Width = this.GetPictrueRealSize(79);
|
| | | frameColorLine.X = btnColorView.Right + Application.GetRealHeight(18);
|
| | | frameColorLine.Radius = (uint)this.GetPictrueRealSize(79) / 2;
|
| | | frameColorLine.BorderWidth = 1;
|
| | | frameColorLine.BorderColor = 0xffcccccc;
|
| | | frameColor.AddChidren(frameColorLine, ChidrenBindMode.NotBind);
|
| | |
|
| | | //分两步计算,不然有可能它得出的结果有误差导致不居中
|
| | | int btnColorWidth = frameColorLine.Height - this.GetPictrueRealSize(7) - this.GetPictrueRealSize(7);
|
| | | var btnColor = new NormalViewControl(btnColorWidth, btnColorWidth, false);
|
| | | btnColor.Gravity = Gravity.Center;
|
| | | btnColor.Radius = (uint)Application.GetMinRealAverage(69) / 2;
|
| | | btnColor.Radius = (uint)btnColorWidth / 2;
|
| | | btnColor.BackgroundColor = backColor;
|
| | | btnColorLine.AddChidren(btnColor, ChidrenBindMode.BindEventOnly);
|
| | | frameColorLine.AddChidren(btnColor, ChidrenBindMode.NotBind);
|
| | | frameColor.ChangedChidrenBindMode(frameColorLine, ChidrenBindMode.BindEvent);
|
| | |
|
| | | //变更滑动条的颜色
|
| | | seekBar1.ProgressBarColor = backColor;
|
| | |
|
| | | var btnRight = new NormalViewControl(Application.GetMinRealAverage(58), Application.GetMinRealAverage(58), false);
|
| | | var btnRight = new NormalViewControl(this.GetPictrueRealSize(58), this.GetPictrueRealSize(58), false);
|
| | | btnRight.UnSelectedImagePath = "Item/RightNext.png";
|
| | | btnRight.Y = Application.GetRealHeight(5);
|
| | | btnRight.X = frameColor.Width - Application.GetMinRealAverage(58);
|
| | | frameColor.AddChidren(btnRight, ChidrenBindMode.BindEventOnly);
|
| | | btnRight.Y += Application.GetMinRealAverage(8);
|
| | | btnRight.X = frameColor.Width - this.GetPictrueRealSize(58);
|
| | | frameColor.AddChidren(btnRight, ChidrenBindMode.BindEvent);
|
| | | btnRight.Y += this.GetPictrueRealSize(8);
|
| | |
|
| | | frameColor.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | |
| | | };
|
| | | };
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 获取初始数据_______________________
|
| | |
| | | //开启进度条
|
| | | this.ShowProgressBar();
|
| | | //亮度调节(他们说随便拿一路回路就行了)
|
| | | linghtLevelInfo = await HdlDevicePanelLogic.Current.GetDeviceLightSettion(panelDevice);
|
| | | linghtLevelInfo = HdlDevicePanelLogic.Current.GetDeviceLightSettion(panelDevice);
|
| | | if (linghtLevelInfo == null)
|
| | | {
|
| | | //关闭进度条
|
| | |
| | | return false;
|
| | | }
|
| | | //节能模式(他们说随便拿一路回路就行了)
|
| | | energyModeInfo = await HdlDevicePanelLogic.Current.GetDeviceEnergyConservationMode(panelDevice);
|
| | | energyModeInfo = HdlDevicePanelLogic.Current.GetDeviceEnergyConservationMode(panelDevice);
|
| | | if (energyModeInfo == null)
|
| | | {
|
| | | //关闭进度条
|
| | | this.CloseProgressBar(ShowReLoadMode.YES);
|
| | | return false;
|
| | | }
|
| | | keyColorData = await HdlDevicePanelLogic.Current.GetPanelEpointColorInfo(panelDevice);
|
| | | keyColorData = HdlDevicePanelLogic.Current.GetPanelEpointColorInfo(panelDevice);
|
| | | if (this.keyColorData == null)
|
| | | {
|
| | | //关闭进度条
|
| | |
| | | {
|
| | | this.ShowProgressBar();
|
| | | //亮度调节更改(他们说随便一个回路就行)
|
| | | var result = await HdlDevicePanelLogic.Current.SetDeviceLightSettion(panelDevice, linghtLevelInfo.panelDirectionsLevel, linghtLevelInfo.panelBacklightLevel);
|
| | | var result = HdlDevicePanelLogic.Current.SetDeviceLightSettion(panelDevice, linghtLevelInfo.panelDirectionsLevel, linghtLevelInfo.panelBacklightLevel);
|
| | | if (result == false)
|
| | | {
|
| | | this.CloseProgressBar();
|
| | |
| | | }
|
| | |
|
| | | //节能模式修改(他们说随便一个回路就行)
|
| | | //设备同事说默认去秒时间,这样接近感应功能才合理
|
| | | energyModeInfo.time = 1;
|
| | | result = await HdlDevicePanelLogic.Current.SetDeviceEnergyConservationMode(panelDevice, energyModeInfo.enable, energyModeInfo.time, energyModeInfo.level);
|
| | | //肖志豪给按键控制面板(四开八控)设备,说默认15秒时间,这样接近感应功能才合理
|
| | | result = HdlDevicePanelLogic.Current.SetDeviceEnergyConservationMode(panelDevice, energyModeInfo.enable, energyModeInfo.time, energyModeInfo.level);
|
| | | if (result == false)
|
| | | {
|
| | | this.CloseProgressBar();
|
| | | return;
|
| | | }
|
| | | //接近修改(他们说随便一个回路就行)
|
| | | //接近传感设置 (肖志豪给按键控制面板(四开八控)设备,传感距离和触发延迟时间默认用最大值)
|
| | | result = await HdlDevicePanelLogic.Current.SetProximitySensorStatus(panelDevice, proximitySensorsInfo.enable);
|
| | | if (result == false)
|
| | | {
|
| | |
| | | return;
|
| | | }
|
| | | //设置按键面板指定端点的【指示灯开关颜色】的信息
|
| | | result = await HdlDevicePanelLogic.Current.SetPanelEpointColorInfo(panelDevice, this.keyColorData);
|
| | | result = HdlDevicePanelLogic.Current.SetPanelEpointColorInfo(panelDevice, this.keyColorData);
|
| | | this.CloseProgressBar();
|
| | | if (result == false)
|
| | | {
|
| | |
| | | private uint GetColorByRGB(byte R, byte G, byte B)
|
| | | {
|
| | | return (uint)(0xFF000000 + R * 256 * 256 + G * 256 + B);
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | #endregion
|
| | | }
|
| | | } |
| | | }
|