| | |
| | | using System; |
| | | using System.Threading.Tasks; |
| | | using ZigBee.Device; |
| | | namespace Shared.Phone.UserCenter.DevicePanel |
| | | { |
| | | public class PanelFangyueFreshAirBackLightSettionForm : EditorCommonForm |
| | | { |
| | | using System;
|
| | | using System.Threading.Tasks;
|
| | | using ZigBee.Device;
|
| | | namespace Shared.Phone.UserCenter.DevicePanel
|
| | | {
|
| | | public class PanelFangyueFreshAirBackLightSettionForm : EditorCommonForm
|
| | | {
|
| | | #region ■ 变量声明___________________________
|
| | | /// <summary>
|
| | | /// 列表控件
|
| | | /// </summary>
|
| | | private VerticalScrolViewLayout listview = null; |
| | | private VerticalScrolViewLayout listview = null;
|
| | | /// <summary>
|
| | | /// 面板的回路
|
| | | /// </summary>
|
| | |
| | | public void ShowForm(Panel i_panel)
|
| | | {
|
| | | //左滑使能不可
|
| | | this.ScrollEnabled = false; |
| | | this.ScrollEnabled = false;
|
| | | this.panelDevice = i_panel;
|
| | |
|
| | | //设置头部信息
|
| | |
| | | /// 初始化中部信息
|
| | | /// </summary>
|
| | | private async void InitMiddleFrame()
|
| | | { |
| | | //获取设备初始数据 |
| | | {
|
| | | //获取设备初始数据
|
| | | var result = await this.GetDeviceDefultData();
|
| | | if (result == false)
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | //清空bodyFrame
|
| | | this.ClearBodyFrame(); |
| | | |
| | | listview = new VerticalScrolViewLayout(); |
| | | listview.Height = Application.GetRealHeight(1981 - 184); |
| | | bodyFrameLayout.AddChidren(listview); |
| | | |
| | | this.ClearBodyFrame();
|
| | |
|
| | | listview = new VerticalScrolViewLayout();
|
| | | listview.Height = Application.GetRealHeight(1981 - 184);
|
| | | bodyFrameLayout.AddChidren(listview);
|
| | |
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | { |
| | | //添加节能模式控件 |
| | | this.AddEnergyConservationRow(); |
| | | |
| | | //添加屏幕亮度级别控件 |
| | | this.AddScreenBrightnesLevelControl(); |
| | | //添加背光灯亮度控件【暂时不需要,可能后期新风面板的这个颜色要补回来】 |
| | | //this.AddBackLightControl(); |
| | | //【暂时不需要,可能后期新风面板的这个颜色要补回来】 |
| | | {
|
| | | //添加节能模式控件
|
| | | this.AddEnergyConservationRow();
|
| | |
|
| | | //添加屏幕亮度级别控件
|
| | | this.AddScreenBrightnesLevelControl();
|
| | | //添加背光灯亮度控件【暂时不需要,可能后期新风面板的这个颜色要补回来】
|
| | | //this.AddBackLightControl();
|
| | | //【暂时不需要,可能后期新风面板的这个颜色要补回来】
|
| | | //this.FinishInitControl(listview, energyModeInfo.enable);
|
| | |
|
| | | //保存 |
| | | //保存
|
| | | var btnSave = new BottomClickButton();
|
| | | btnSave.TextID = R.MyInternationalizationString.uSave;
|
| | | bodyFrameLayout.AddChidren(btnSave);
|
| | | btnSave.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //保存面板数据 |
| | | //保存面板数据
|
| | | this.SavePanelData();
|
| | | };
|
| | | }); |
| | | });
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | /// </summary>
|
| | | private void AddScreenBrightnesLevelControl()
|
| | | {
|
| | | var btnEspace = new NormalViewControl(600, 58, true); |
| | | btnEspace.X = ControlCommonResourse.XXLeft; |
| | | listview.AddChidren(btnEspace); |
| | | |
| | | var btnEspace = new NormalViewControl(600, 58, true);
|
| | | btnEspace.X = ControlCommonResourse.XXLeft;
|
| | | listview.AddChidren(btnEspace);
|
| | |
|
| | | var frameBack = new FrameLayout();
|
| | | frameBack.Height = Application.GetRealHeight(429);
|
| | | frameBack.Y = Application.GetRealHeight(58); |
| | | frameBack.Y = Application.GetRealHeight(58);
|
| | | frameBack.BackgroundColor = UserCenterColor.Current.White;
|
| | | listview.AddChidren(frameBack);
|
| | |
|
| | |
| | | frameBack.AddChidren(seekBar1);
|
| | | seekBar1.ProgressChangedEvent += (div, value) =>
|
| | | {
|
| | | if (value == 0) |
| | | { |
| | | btnProgress1.Text = (value + 1).ToString(); |
| | | } |
| | | else |
| | | { |
| | | if (value == 0)
|
| | | {
|
| | | btnProgress1.Text = (value + 1).ToString();
|
| | | }
|
| | | else
|
| | | {
|
| | | btnProgress1.Text = value.ToString();
|
| | | } |
| | | |
| | | switch (value) |
| | | { |
| | | case 0: |
| | | case 1: |
| | | linghtLevelInfo.panelDirectionsLevel = 20; |
| | | btnLevel.Text = "1" + strRank; |
| | | |
| | | break; |
| | | case 2: |
| | | linghtLevelInfo.panelDirectionsLevel = 40; |
| | | btnLevel.Text = "2" + strRank; |
| | | break; |
| | | case 3: |
| | | linghtLevelInfo.panelDirectionsLevel = 60; |
| | | btnLevel.Text = "3" + strRank; |
| | | break; |
| | | case 4: |
| | | linghtLevelInfo.panelDirectionsLevel = 80; |
| | | btnLevel.Text = "4" + strRank; |
| | | break; |
| | | case 5: |
| | | linghtLevelInfo.panelDirectionsLevel = 100; |
| | | btnLevel.Text = "5" + strRank; |
| | | break; |
| | | } |
| | | }; |
| | | |
| | | seekBar1.OnStopTrackingTouchEvent += (div, value) => |
| | | { |
| | | if (value == 0) |
| | | { |
| | | seekBar1.Progress = 1; |
| | | } |
| | | else |
| | | { |
| | | seekBar1.Progress = value; |
| | | } |
| | | }
|
| | |
|
| | | switch (value)
|
| | | {
|
| | | case 0:
|
| | | case 1:
|
| | | linghtLevelInfo.panelDirectionsLevel = 20;
|
| | | btnLevel.Text = "1" + strRank;
|
| | |
|
| | | break;
|
| | | case 2:
|
| | | linghtLevelInfo.panelDirectionsLevel = 40;
|
| | | btnLevel.Text = "2" + strRank;
|
| | | break;
|
| | | case 3:
|
| | | linghtLevelInfo.panelDirectionsLevel = 60;
|
| | | btnLevel.Text = "3" + strRank;
|
| | | break;
|
| | | case 4:
|
| | | linghtLevelInfo.panelDirectionsLevel = 80;
|
| | | btnLevel.Text = "4" + strRank;
|
| | | break;
|
| | | case 5:
|
| | | linghtLevelInfo.panelDirectionsLevel = 100;
|
| | | btnLevel.Text = "5" + strRank;
|
| | | break;
|
| | | }
|
| | | };
|
| | |
|
| | | if (linghtLevelInfo.panelDirectionsLevel <= 20 && linghtLevelInfo.panelDirectionsLevel >= 0) |
| | | { |
| | | btnLevel.Text = "1" + strRank; |
| | | btnProgress1.Text = "1"; |
| | | seekBar1.Progress = 1; |
| | | } |
| | | else if (linghtLevelInfo.panelDirectionsLevel <= 40 && linghtLevelInfo.panelDirectionsLevel > 20) |
| | | { |
| | | btnLevel.Text = "2" + strRank; |
| | | btnProgress1.Text = "2"; |
| | | seekBar1.Progress = 2; |
| | | } |
| | | else if (linghtLevelInfo.panelDirectionsLevel <= 60 && linghtLevelInfo.panelDirectionsLevel > 40) |
| | | { |
| | | btnLevel.Text = "3" + strRank; |
| | | btnProgress1.Text = "3"; |
| | | seekBar1.Progress = 3; |
| | | } |
| | | else if (linghtLevelInfo.panelDirectionsLevel <= 80 && linghtLevelInfo.panelDirectionsLevel > 60) |
| | | { |
| | | btnLevel.Text = "4" + strRank; |
| | | btnProgress1.Text = "4"; |
| | | seekBar1.Progress = 4; |
| | | } |
| | | else if (linghtLevelInfo.panelDirectionsLevel <= 100 && linghtLevelInfo.panelDirectionsLevel > 80) |
| | | { |
| | | btnLevel.Text = "5" + strRank; |
| | | btnProgress1.Text = "5"; |
| | | seekBar1.Progress = 5; |
| | | } |
| | | else |
| | | { |
| | | btnLevel.Text = "1" + strRank; |
| | | btnProgress1.Text = "1"; |
| | | seekBar1.Progress = 1; |
| | | } |
| | | seekBar1.OnStopTrackingTouchEvent += (div, value) =>
|
| | | {
|
| | | if (value == 0)
|
| | | {
|
| | | seekBar1.Progress = 1;
|
| | | }
|
| | | else
|
| | | {
|
| | | seekBar1.Progress = value;
|
| | | }
|
| | | };
|
| | |
|
| | | if (linghtLevelInfo.panelDirectionsLevel <= 20 && linghtLevelInfo.panelDirectionsLevel >= 0)
|
| | | {
|
| | | btnLevel.Text = "1" + strRank;
|
| | | btnProgress1.Text = "1";
|
| | | seekBar1.Progress = 1;
|
| | | }
|
| | | else if (linghtLevelInfo.panelDirectionsLevel <= 40 && linghtLevelInfo.panelDirectionsLevel > 20)
|
| | | {
|
| | | btnLevel.Text = "2" + strRank;
|
| | | btnProgress1.Text = "2";
|
| | | seekBar1.Progress = 2;
|
| | | }
|
| | | else if (linghtLevelInfo.panelDirectionsLevel <= 60 && linghtLevelInfo.panelDirectionsLevel > 40)
|
| | | {
|
| | | btnLevel.Text = "3" + strRank;
|
| | | btnProgress1.Text = "3";
|
| | | seekBar1.Progress = 3;
|
| | | }
|
| | | else if (linghtLevelInfo.panelDirectionsLevel <= 80 && linghtLevelInfo.panelDirectionsLevel > 60)
|
| | | {
|
| | | btnLevel.Text = "4" + strRank;
|
| | | btnProgress1.Text = "4";
|
| | | seekBar1.Progress = 4;
|
| | | }
|
| | | else if (linghtLevelInfo.panelDirectionsLevel <= 100 && linghtLevelInfo.panelDirectionsLevel > 80)
|
| | | {
|
| | | btnLevel.Text = "5" + strRank;
|
| | | btnProgress1.Text = "5";
|
| | | seekBar1.Progress = 5;
|
| | | }
|
| | | else
|
| | | {
|
| | | btnLevel.Text = "1" + strRank;
|
| | | btnProgress1.Text = "1";
|
| | | seekBar1.Progress = 1;
|
| | | }
|
| | |
|
| | | var btnTemp1 = new NormalViewControl(200, 50, true);
|
| | | btnTemp1.X = ControlCommonResourse.XXLeft;
|
| | |
| | | /// </summary>
|
| | | private void AddBackLightControl()
|
| | | {
|
| | | var btnEspace = new NormalViewControl(600, 58, true); |
| | | btnEspace.X = ControlCommonResourse.XXLeft; |
| | | listview.AddChidren(btnEspace); |
| | | |
| | | var btnEspace = new NormalViewControl(600, 58, true);
|
| | | btnEspace.X = ControlCommonResourse.XXLeft;
|
| | | listview.AddChidren(btnEspace);
|
| | |
|
| | | //背景
|
| | | var frameBack = new FrameLayout();
|
| | | frameBack.Y = Application.GetRealHeight(490);
|
| | |
| | | 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 = frameBack.Width - ControlCommonResourse.XXLeft - Application.GetRealHeight(262);
|
| | | frameBack.AddChidren(frameColor);
|
| | | //颜色
|
| | | var btnColorView = new NormalViewControl(Application.GetRealHeight(110), Application.GetMinRealAverage(50), false);
|
| | | var btnColorView = new NormalViewControl(Application.GetRealHeight(110), this.GetPictrueRealSize(50), false);
|
| | | btnColorView.Gravity = Gravity.CenterVertical;
|
| | | btnColorView.TextAlignment = TextAlignment.CenterRight;
|
| | | btnColorView.TextSize = 12;
|
| | |
| | | uint backColor = this.GetColorByRGB((byte)R1, (byte)G1, (byte)B1);
|
| | |
|
| | | //颜色外框
|
| | | var btnColorLine = new NormalViewControl(Application.GetMinRealAverage(79), Application.GetMinRealAverage(79), false);
|
| | | var btnColorLine = new NormalViewControl(this.GetPictrueRealSize(79), this.GetPictrueRealSize(79), false);
|
| | | btnColorLine.X = btnColorView.Right + Application.GetRealHeight(18);
|
| | | btnColorLine.Radius = (uint)Application.GetMinRealAverage(79) / 2;
|
| | | btnColorLine.Radius = (uint)this.GetPictrueRealSize(79) / 2;
|
| | | btnColorLine.BorderWidth = 1;
|
| | | btnColorLine.BorderColor = 0xff666666;
|
| | | frameColor.AddChidren(btnColorLine, ChidrenBindMode.BindEventOnly);
|
| | |
|
| | | var btnColor = new NormalViewControl(Application.GetMinRealAverage(69), Application.GetMinRealAverage(69), false);
|
| | | var btnColor = new NormalViewControl(this.GetPictrueRealSize(69), this.GetPictrueRealSize(69), false);
|
| | | btnColor.Y = Application.GetRealHeight(5);
|
| | | btnColor.X = btnColorView.Right + Application.GetRealHeight(23);
|
| | | btnColor.Radius = (uint)Application.GetMinRealAverage(69) / 2;
|
| | | btnColor.Radius = (uint)this.GetPictrueRealSize(69) / 2;
|
| | | btnColor.BackgroundColor = UserCenterColor.Current.ErrorColor;
|
| | | frameColor.AddChidren(btnColor, ChidrenBindMode.BindEventOnly);
|
| | |
|
| | | //变更滑动条的颜色
|
| | | 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);
|
| | | btnRight.X = frameColor.Width - this.GetPictrueRealSize(58);
|
| | | frameColor.AddChidren(btnRight, ChidrenBindMode.BindEventOnly);
|
| | | btnRight.Y += Application.GetMinRealAverage(8);
|
| | | btnRight.Y += this.GetPictrueRealSize(8);
|
| | |
|
| | | frameColor.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | |
| | | seekBar1.ProgressBarColor = btnColor.BackgroundColor;
|
| | | };
|
| | | };
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | #endregion
|
| | | |
| | |
|
| | | #region ■ 节能模式行_________________________
|
| | | /// <summary>
|
| | | /// 添加节能模式行
|
| | |
| | | btnSwitch.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | btnSwitch.IsSelected = !btnSwitch.IsSelected;
|
| | | energyModeInfo.enable = btnSwitch.IsSelected; |
| | | //展开或者缩小的高度 |
| | | energyModeInfo.enable = btnSwitch.IsSelected;
|
| | | //展开或者缩小的高度
|
| | | var value = Application.GetRealHeight(443);
|
| | | 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)
|
| | |
| | | //展开或者缩小的高度
|
| | | var value = Application.GetRealHeight(443);
|
| | | frameBack.Height += value;
|
| | | } |
| | | //添加接近感应 |
| | | this.AddProximitySensorsRow(frameBack); |
| | | } |
| | | |
| | | }
|
| | | //添加接近感应
|
| | | this.AddProximitySensorsRow(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 ■ 获取初始数据_______________________
|
| | |
| | | this.CloseProgressBar();
|
| | | return;
|
| | | }
|
| | | |
| | | //亮度调节更改(他们说随便一个回路就行) |
| | | result = await HdlDevicePanelLogic.Current.SetDeviceLightSettion(panelDevice, linghtLevelInfo.panelDirectionsLevel, linghtLevelInfo.panelBacklightLevel); |
| | | if (result == false) |
| | | { |
| | | this.CloseProgressBar(); |
| | | return; |
| | | } |
| | | |
| | |
|
| | | //亮度调节更改(他们说随便一个回路就行)
|
| | | result = await HdlDevicePanelLogic.Current.SetDeviceLightSettion(panelDevice, linghtLevelInfo.panelDirectionsLevel, linghtLevelInfo.panelBacklightLevel);
|
| | | if (result == false)
|
| | | {
|
| | | this.CloseProgressBar();
|
| | | return;
|
| | | }
|
| | |
|
| | | //设置按键面板指定端点的【指示灯开关颜色】的信息
|
| | | //result = await HdlDevicePanelLogic.Current.SetPanelEpointColorInfo(panelDevice, this.keyColorData);
|
| | | //this.CloseProgressBar();
|
| | |
| | |
|
| | | #endregion
|
| | | }
|
| | | } |
| | | }
|