| | |
| | | { |
| | | //添加节能模式控件 |
| | | this.AddEnergyConservationRow(); |
| | | |
| | | //添加屏幕亮度级别控件 |
| | | this.AddScreenBrightnesLevelControl(); |
| | | //添加背光灯亮度控件 |
| | | this.AddBackLightControl(); |
| | | }); |
| | | |
| | | //容器补充 |
| | | FinishInitControl(listview);
|
| | | //添加背光灯亮度控件【暂时不需要,可能后期新风面板的这个颜色要补回来】 |
| | | //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();
|
| | | };
|
| | | //保存 |
| | | var btnSave = new BottomClickButton();
|
| | | btnSave.TextID = R.MyInternationalizationString.uSave;
|
| | | bodyFrameLayout.AddChidren(btnSave);
|
| | | btnSave.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //保存面板数据 |
| | | this.SavePanelData();
|
| | | };
|
| | | }); |
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 屏幕亮度级别_______________________
|
| | |
|
| | | #region ■ 屏幕亮度级别_______________________ |
| | | /// <summary>
|
| | | /// 添加屏幕亮度级别控件
|
| | | /// </summary>
|
| | | private void AddScreenBrightnesLevelControl()
|
| | | {
|
| | | 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.BackgroundColor = UserCenterColor.Current.White;
|
| | | listview.AddChidren(frameBack);
|
| | |
|
| | |
| | | btnLevel.Y = Application.GetRealHeight(54);
|
| | | btnLevel.TextAlignment = TextAlignment.CenterRight;
|
| | | btnLevel.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | | btnLevel.Text = "3" + strRank;
|
| | | frameBack.AddChidren(btnLevel);
|
| | |
|
| | | //当前亮度
|
| | |
| | | btnProgress1.Y = Application.GetRealHeight(157);
|
| | | btnProgress1.TextSize = 12;
|
| | | btnProgress1.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | | btnProgress1.Text = "4";
|
| | | frameBack.AddChidren(btnProgress1);
|
| | |
|
| | | //进度条
|
| | |
| | | frameBack.AddChidren(seekBar1);
|
| | | seekBar1.ProgressChangedEvent += (div, value) =>
|
| | | {
|
| | | btnProgress1.Text = value.ToString();
|
| | | //数据变更
|
| | | 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; |
| | | } |
| | | };
|
| | | //seekBar1.Progress = linghtLevelInfo.panelBacklightLevel;
|
| | |
|
| | | 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;
|
| | | btnTemp1.Y = Application.GetRealHeight(322);
|
| | | btnTemp1.TextSize = 12;
|
| | | btnTemp1.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | btnTemp1.Text = "0";
|
| | | btnTemp1.Text = "1";
|
| | | frameBack.AddChidren(btnTemp1);
|
| | |
|
| | | var btnTemp2 = new NormalViewControl(100, 50, true);
|
| | |
| | | btnTemp2.Text = "5";
|
| | | frameBack.AddChidren(btnTemp2);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 背光灯亮度_________________________
|
| | |
| | | /// </summary>
|
| | | private void AddBackLightControl()
|
| | | {
|
| | | var btnEspace = new NormalViewControl(600, 58, true); |
| | | btnEspace.X = ControlCommonResourse.XXLeft; |
| | | listview.AddChidren(btnEspace); |
| | | |
| | | //背景
|
| | | var frameBack = new FrameLayout();
|
| | | frameBack.Y = Application.GetRealHeight(490);
|
| | |
| | | seekBar1.ProgressChangedEvent += (div, value) =>
|
| | | {
|
| | | btnProgress1.Text = value + "%";
|
| | | //数据变更
|
| | | };
|
| | | //seekBar1.Progress = linghtLevelInfo.panelBacklightLevel;
|
| | |
|
| | |
| | | |
| | | #endregion
|
| | | |
| | | #region ■ 节能模式行_________________________
|
| | | |
| | | #region ■ 节能模式行_________________________ |
| | | /// <summary>
|
| | | /// 添加节能模式行
|
| | | /// </summary>
|
| | |
| | | //展开或者缩小的高度
|
| | | var value = Application.GetRealHeight(443);
|
| | | frameBack.Height += value;
|
| | | //添加接近感应 |
| | | this.AddProximitySensorsRow(frameBack); |
| | | }
|
| | | } |
| | | //添加接近感应 |
| | | this.AddProximitySensorsRow(frameBack); |
| | | } |
| | | |
| | | #endregion
|
| | |
| | | private async void SavePanelData()
|
| | | {
|
| | | this.ShowProgressBar();
|
| | | //亮度调节更改(他们说随便一个回路就行)
|
| | | var result = await HdlDevicePanelLogic.Current.SetDeviceLightSettion(panelDevice, linghtLevelInfo.panelDirectionsLevel, linghtLevelInfo.panelBacklightLevel);
|
| | | if (result == false)
|
| | | {
|
| | | this.CloseProgressBar();
|
| | | return;
|
| | | }
|
| | |
|
| | | //节能模式修改(他们说随便一个回路就行)
|
| | | //设备同事说默认去秒时间,这样接近感应功能才合理
|
| | | energyModeInfo.time = 1;
|
| | | result = await HdlDevicePanelLogic.Current.SetDeviceEnergyConservationMode(panelDevice, energyModeInfo.enable, energyModeInfo.time, energyModeInfo.level);
|
| | | //设备同事说新风面板默认60秒时间,这样接近感应功能才合理
|
| | | energyModeInfo.time = 60;
|
| | | var result = await 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)
|
| | | {
|
| | | 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();
|
| | | if (result == false)
|
| | | {
|
| | | return;
|
| | | }
|
| | | //result = await HdlDevicePanelLogic.Current.SetPanelEpointColorInfo(panelDevice, this.keyColorData);
|
| | | //this.CloseProgressBar();
|
| | | //if (result == false)
|
| | | //{
|
| | | // return;
|
| | | //}
|
| | | //关闭自身
|
| | | this.CloseForm();
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 保存配置___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 保存配置
|
| | | /// </summary>
|
| | | private void SaveSettionData()
|
| | | {
|
| | | this.CloseForm();
|
| | | }
|
| | |
|