From 452e8cef1c740d18ee398be6971d9952e41dbd4a Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 12 四月 2023 16:11:50 +0800
Subject: [PATCH] 1
---
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs | 170 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 166 insertions(+), 4 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs
index 085c95f..ec6fda3 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs
@@ -36,6 +36,11 @@
/// </summary>
Button btnMode;
/// <summary>
+ /// 宸ヤ綔妯″紡鎸夐挳
+ /// </summary>
+ Button btnWrokMode;
+
+ /// <summary>
/// 寮�鍏虫寜閽�
/// </summary>
Button btnSwitch;
@@ -172,6 +177,25 @@
};
FrameWhiteCentet1.AddChidren(btnPlus);
+ if (device.GetAttribute("mode_work") != null)
+ {
+ btnWrokMode = new Button()
+ {
+ X = Application.GetRealWidth(60),
+ Y = Application.GetRealHeight(334),
+ Width = Application.GetRealWidth(30),
+ Height = Application.GetRealWidth(30),
+ UnSelectedImagePath = fhTemp.GetWrokModeIconPath(device.GetAttrState("mode_work")),
+ };
+ FrameWhiteCentet1.AddChidren(btnWrokMode);
+ if (device.GetAttribute("mode_work").value.Count > 1)
+ {
+ btnMode.MouseUpEventHandler = (sender, e) =>
+ {
+ LoadDiv_ChangeModeView();
+ };
+ }
+ }
if (device.GetAttribute(FunctionAttributeKey.Mode) != null)
{
btnMode = new Button()
@@ -208,6 +232,135 @@
LoadEvent_AcStatesChange();
}
+
+
+ /// <summary>
+ /// 鍔犺浇淇敼妯″紡鍖哄煙
+ /// </summary>
+ void LoadDiv_ChangeWorkModeView()
+ {
+ Dialog dialog = new Dialog();
+
+ FrameLayout dialogView = new FrameLayout()
+ {
+ BackgroundColor = CSS_Color.DialogTransparentColor1,
+ };
+ dialog.AddChidren(dialogView);
+
+ FrameLayout modeChangeView;
+ modeChangeView = new FrameLayout()
+ {
+ X = Application.GetRealWidth(30),
+ Y = Application.GetRealHeight(128),
+ Width = Application.GetRealWidth(160),
+ Height = Application.GetRealHeight(287),
+ BackgroundImagePath = "FunctionIcon/AC/DivBg1.png",
+ };
+ dialogView.AddChidren(modeChangeView);
+
+ Button btnTitle;
+ btnTitle = new Button()
+ {
+ X = Application.GetRealWidth(8 + 16),
+ Y = Application.GetRealHeight(8),
+ Width = Application.GetRealWidth(112),
+ Height = Application.GetRealHeight(44),
+ TextID = StringId.ChooseMode,
+ TextAlignment = TextAlignment.CenterLeft,
+ TextColor = CSS_Color.FirstLevelTitleColor,
+ TextSize = CSS_FontSize.EmphasisFontSize_Secondary,
+ };
+ modeChangeView.AddChidren(btnTitle);
+
+ Button btnLine = new Button()
+ {
+ X = btnTitle.X,
+ Y = btnTitle.Bottom,
+ Width = Application.GetRealWidth(112),
+ Height = Application.GetRealHeight(1),
+ BackgroundColor = CSS_Color.BackgroundColor,
+ };
+ modeChangeView.AddChidren(btnLine);
+
+ var modeList = device.GetAttribute(FunctionAttributeKey.WorkMode).value;
+ foreach (var m in modeList)
+ {
+ Button btnModeIcon = new Button()
+ {
+ X = btnTitle.X,
+ Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 10 + 8),
+ Width = Application.GetRealWidth(24),
+ Height = Application.GetRealWidth(24),
+ IsSelected = device.GetAttrState(FunctionAttributeKey.WorkMode) == m,
+ };
+ modeChangeView.AddChidren(btnModeIcon);
+
+ Button btnModeText = new Button()
+ {
+ X = Application.GetRealWidth(12) + btnModeIcon.Right,
+ Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 8),
+ Height = Application.GetRealHeight(44),
+ Width = Application.GetRealWidth(90),
+ TextAlignment = TextAlignment.CenterLeft,
+ TextColor = CSS_Color.FirstLevelTitleColor,
+ SelectedTextColor = CSS_Color.MainColor,
+ IsSelected = device.GetAttrState(FunctionAttributeKey.Mode) == m,
+ TextSize = CSS_FontSize.TextFontSize,
+ };
+ modeChangeView.AddChidren(btnModeText);
+
+ btnModeIcon.UnSelectedImagePath = fhTemp.GetModeIconPath(m, false);
+ btnModeIcon.SelectedImagePath = fhTemp.GetModeIconPath(m);
+ btnModeText.Text = fhTemp.GetModeAttrText(m);
+
+ if (modeList.IndexOf(m) < modeList.Count - 1)
+ {
+ modeChangeView.AddChidren(new Button()
+ {
+ X = btnTitle.X,
+ Y = btnModeText.Bottom,
+ Width = Application.GetRealWidth(112),
+ Height = Application.GetRealHeight(1),
+ BackgroundColor = CSS_Color.BackgroundColor,
+ });
+ }
+ EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
+ {
+ dialog.Close();
+ };
+ EventHandler<MouseEventArgs> eventHandler1 = (sender, e) =>
+ {
+ //if (!device.online)
+ //{
+ // new Tip()
+ // {
+ // CloseTime = 1,
+ // Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+ // Direction = AMPopTipDirection.None,
+ // }.Show(MainPage.BaseView);
+ //}
+ btnModeIcon.IsSelected = btnModeText.IsSelected = true;
+ device.SetAttrState(FunctionAttributeKey.WorkMode, m);
+ btnMode.UnSelectedImagePath = fhTemp.GetWrokModeIconPath(m);
+ System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
+ btnMode.UnSelectedImagePath = btnModeIcon.UnSelectedImagePath;
+ d.Add(FunctionAttributeKey.WorkMode, m);
+ Control.Ins.SendWriteCommand(device, d);
+ dialog.Close();
+
+ };
+ btnModeIcon.MouseUpEventHandler = eventHandler1;
+ btnModeText.MouseUpEventHandler = eventHandler1;
+ dialogView.MouseUpEventHandler = eventHandler;
+
+ }
+
+ dialogView.MouseUpEventHandler = (sender, e) => {
+ dialog.Close();
+ };
+ dialog.Show();
+ }
+
/// <summary>
/// 鍔犺浇淇敼妯″紡鍖哄煙
@@ -305,7 +458,7 @@
};
EventHandler<MouseEventArgs> eventHandler1 = (sender, e) =>
{
- if (!device.online2d)
+ if (!device.online)
{
new Tip()
{
@@ -371,7 +524,7 @@
{
btnMinus.MouseUpEventHandler = (sender, e) =>
{
- if (!device.online2d)
+ if (!device.online)
{
new Tip()
{
@@ -399,7 +552,7 @@
};
btnPlus.MouseUpEventHandler = (sender, e) =>
{
- if (!device.online2d)
+ if (!device.online)
{
new Tip()
{
@@ -426,7 +579,7 @@
Control.Ins.SendWriteCommand(device, d);
};
- if (!device.online2d)
+ if (!device.online)
{
arcBar.OnStopTrackingTouchEvent = (sender, e) =>
{
@@ -523,6 +676,15 @@
arcBar.IsClickable = false;
arcBar.IsOffline = true;
}
+
+ if(btnWrokMode!=null){
+ var dd = device.GetAttrState("mode_work");
+ if (dd != "0")
+ {
+ btnWrokMode.UnSelectedImagePath = fhTemp.GetWrokModeIconPath(dd);
+ }
+ }
+
});
}
--
Gitblit v1.8.0