From 46a177eb1acf7ce91af7fe9ff57af87228de938d Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 17 十月 2023 10:03:24 +0800
Subject: [PATCH] IOS库更新
---
HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage_V2.cs | 174 ++++++++++++++++++++++++++++++++-------------------------
1 files changed, 98 insertions(+), 76 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage_V2.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage_V2.cs
index b05731e..c48a8d5 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage_V2.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage_V2.cs
@@ -1,7 +1,5 @@
锘縰sing System;
using System.Collections.Generic;
-using HDL_ON.Common;
-using HDL_ON.DriverLayer;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
using Shared;
@@ -209,31 +207,39 @@
attrView.AddChidren(new Button() { Height = Application.GetRealHeight(18) });
- btnSwitch = new Button()
+ var btnOn = new Button()
{
- Gravity = Gravity.CenterHorizontal,
+ X = Application.GetRealWidth(100),
+ Y = Application.GetRealHeight(466),
+ Width = Application.GetMinRealAverage(32),
+ Height = Application.GetMinRealAverage(32),
+ //UnSelectedImagePath = "Public/PowerClose.png",
+ UnSelectedImagePath = "Public/PowerOpen.png",
+ };
+ controlView.AddChidren(btnOn);
+
+ var btnOff = new Button()
+ {
+ X = Application.GetRealWidth(180),
Y = Application.GetRealHeight(466),
Width = Application.GetMinRealAverage(32),
Height = Application.GetMinRealAverage(32),
UnSelectedImagePath = "Public/PowerClose.png",
- SelectedImagePath = "Public/PowerOpen.png",
+ //UnSelectedImagePath = "Public/PowerOpen.png",
};
- controlView.AddChidren(btnSwitch);
- btnSwitch.MouseUpEventHandler = (sender, e) => {
- if (btnSwitch.IsSelected)
- {
- btnSwitch.IsSelected = false;
- var d = new Dictionary<string, string>();
- d.Add(FunctionAttributeKey.OnOff, "off");
- function.Control(d);
- }
- else
- {
- btnSwitch.IsSelected = true;
- var d = new Dictionary<string, string>();
- d.Add(FunctionAttributeKey.OnOff, "on");
- function.Control(d);
- }
+ controlView.AddChidren(btnOff);
+ btnOn.MouseUpEventHandler = (sender, e) =>
+ {
+ var d = new Dictionary<string, string>();
+ d.Add(FunctionAttributeKey.OnOff, "on");
+ function.Control(d);
+ };
+
+ btnOff.MouseUpEventHandler = (sender, e) =>
+ {
+ var d = new Dictionary<string, string>();
+ d.Add(FunctionAttributeKey.OnOff, "off");
+ function.Control(d);
};
@@ -267,21 +273,16 @@
btnSwitchIcon.MouseUpEventHandler = (sender, e) => {
if (btnSwitchIcon.IsSelected)
{
- btnSwitchIcon.IsSelected = btnSwitch.IsSelected = false;
var d = new Dictionary<string, string>();
d.Add(FunctionAttributeKey.OnOff, "off");
function.Control(d);
}
else
{
- btnSwitchIcon.IsSelected = btnSwitch.IsSelected = true;
var d = new Dictionary<string, string>();
d.Add(FunctionAttributeKey.OnOff, "on");
function.Control(d);
}
- };
- btnSwitch.MouseUpEventHandler += (sender, e) => {
- btnSwitchIcon.IsSelected = btnSwitch.IsSelected;
};
}
@@ -289,7 +290,6 @@
}
- Button btnSwitch;
/// <summary>
/// 鍔犺浇璋冨厜灞炴�ц缃帶浠�
@@ -337,23 +337,33 @@
};
dimmerView.AddChidren(btnBrightnessText);
+ dimmerBar.OnStopTrackingTouchEvent = (sender, e) => {
+ new System.Threading.Thread(() =>
+ {
+ var d = new Dictionary<string, string>();
+ d.Add(FunctionAttributeKey.Brightness, e.ToString());
+ function.Control(d);
+ })
+ { IsBackground = true }.Start();
+ };
+
dimmerBar.OnProgressChangedEvent = (sender, e) =>
{
+ return;
if (e == 0 && lastBrightness != 0)
{
- btnSwitch.IsSelected = false;
lastBrightness = 0;
}
else
{
if (lastBrightness == 0)
lastBrightness = e;
- btnSwitch.IsSelected = true;
}
if (e == 0 || e == 100)
{
var d = new Dictionary<string, string>();
d.Add(FunctionAttributeKey.Brightness, e.ToString());
+ d.Add(FunctionAttributeKey.OnOff, e == 0 ? "off" : "on");
function.Control(d);
}
else
@@ -372,19 +382,6 @@
}
- btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100);
- btnBrightnessText.Text = dimmerBar.Progress + "%";
- };
-
- btnSwitch.MouseUpEventHandler += (sender, e) => {
- if (btnSwitch.IsSelected)
- {
- dimmerBar.Progress = 100;
- }
- else
- {
- dimmerBar.Progress = 0;
- }
btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100);
btnBrightnessText.Text = dimmerBar.Progress + "%";
};
@@ -435,24 +432,34 @@
};
dimmerView.AddChidren(btnBrightnessText);
+ dimmerBar.OnStopTrackingTouchEvent = (sender, e) => {
+ new System.Threading.Thread(() =>
+ {
+ var d = new Dictionary<string, string>();
+ d.Add(FunctionAttributeKey.Brightness, e.ToString());
+ function.Control(d);
+ })
+ { IsBackground = true }.Start();
+ };
+
dimmerBar.OnProgressChangedEvent = (sender, e) =>
{
+ return;
if (e == 0 && lastBrightness != 0)
{
- btnSwitch.IsSelected = false;
lastBrightness = 0;
}
else
{
if (lastBrightness == 0)
lastBrightness = e;
- btnSwitch.IsSelected = true;
}
if (e == 0 || e == 100)
{
var d = new Dictionary<string, string>();
d.Add(FunctionAttributeKey.Brightness, e.ToString());
+ d.Add(FunctionAttributeKey.OnOff, e == 0 ? "off" : "on");
function.Control(d);
}
else
@@ -475,19 +482,7 @@
btnBrightnessText.Text = dimmerBar.Progress + "%";
};
- btnSwitch.MouseUpEventHandler += (sender, e) => {
- if (btnSwitch.IsSelected)
- {
- dimmerBar.Progress = 100;
- }
- else
- {
- dimmerBar.Progress = 0;
- }
- btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100);
- btnBrightnessText.Text = dimmerBar.Progress + "%";
- };
-
+
//attrView.AddChidren(new Button() { Height = Application.GetRealHeight(10) });
#region 鑹叉俯
@@ -666,7 +661,22 @@
};
colorPicker.ColorChaged += (sender2, e2) =>
{
+ if ( pointIsRight == false)
+ {
+ return;
+ }
+ //if (colorPicker.ColorImagePath == "FunctionIcon/Light/ColorWheelGray.png")
+ //{
+ // return;
+ //}
+ if (function.refreshTime.AddMilliseconds(350) > DateTime.Now)
+ {
+ MainPage.Log("棰戠箒鎺у埗锛岄��鍑�");
+ return;
+ }
+ function.refreshTime = DateTime.Now;
rgbString = (e2[0] + "," + e2[1] + "," + e2[2]).ToString();
+
btnCurColor.BackgroundColor = (uint)(0xFF000000 + rgbTemp.GetRGBcolor(rgbString));
var d = new Dictionary<string, string>();
d.Add(FunctionAttributeKey.RGB, rgbString);
@@ -677,9 +687,13 @@
pointIsRight = this.CheckPoint(circleR, colorPicker.Width / 2, colorPicker.Height / 2, (int)e.X, (int)e.Y);
if (pointIsRight == false)
{
- //鐐圭殑鍖哄煙涓嶆槸鍦嗙洏鍐�
+ //pointIsRight:鐐圭殑鍖哄煙涓嶆槸鍦嗙洏鍐�
return;
}
+ //if (colorPicker.ColorImagePath == "FunctionIcon/Light/ColorWheelGray.png")
+ //{
+ // return;
+ //}
//鏄剧ず鐧界偣
btnWhiteRound.X = (int)e.X - btnWhiteRound.Width / 2;
btnWhiteRound.Y = (int)e.Y - btnWhiteRound.Height / 2;
@@ -694,8 +708,6 @@
//褰撻紶鏍囩偣涓嬩簨浠跺鐞�
colorPicker.MouseDownEventHandler(sender, e);
};
-
-
#region 浜害璋冭妭
var btnBrightnessText = new Button()
@@ -742,24 +754,33 @@
};
controlView.AddChidren(dimmerBar);
+ dimmerBar.OnStopTrackingTouchEvent = (sender, e) => {
+ new System.Threading.Thread(() =>
+ {
+ var d = new Dictionary<string, string>();
+ d.Add(FunctionAttributeKey.Brightness, e.ToString());
+ function.Control(d);
+ })
+ { IsBackground = true }.Start();
+ };
dimmerBar.OnProgressChangedEvent = (sender, e) =>
{
+ return;
if (e == 0 && lastBrightness != 0)
{
- btnSwitch.IsSelected = false;
lastBrightness = 0;
}
else
{
if (lastBrightness == 0)
lastBrightness = e;
- btnSwitch.IsSelected = true;
}
if (e == 0 || e == 100)
{
var d = new Dictionary<string, string>();
d.Add(FunctionAttributeKey.Brightness, e.ToString());
+ d.Add(FunctionAttributeKey.OnOff, e == 0 ? "off" : "on");
function.Control(d);
}
else
@@ -776,7 +797,22 @@
{ IsBackground = true }.Start();
}
}
+ //if (e == 0)
+ //{
+ // if (colorPicker.ColorImagePath != "FunctionIcon/Light/ColorWheelGray.png")
+ // {
+ // colorPicker.ColorImagePath = "FunctionIcon/Light/ColorWheelGray.png";
+ // }
+ //}
+ //else
+ //{
+ // if (colorPicker.ColorImagePath != "FunctionIcon/Light/ColorWheel.png")
+ // {
+ // colorPicker.ColorImagePath = "FunctionIcon/Light/ColorWheel.png";
+ // }
+ //}
};
+
var btnMaxValuesText = new Button()
@@ -792,16 +828,6 @@
};
controlView.AddChidren(btnMaxValuesText);
- btnSwitch.MouseUpEventHandler += (sender, e) => {
- if (btnSwitch.IsSelected)
- {
- dimmerBar.Progress = 100;
- }
- else
- {
- dimmerBar.Progress = 0;
- }
- };
#endregion
int heightMore = 375 - magriHeight-20;
@@ -902,9 +928,7 @@
#endregion
-
heightMore = 70;
-
}
if (hadColorful)
@@ -986,8 +1010,6 @@
};
#endregion
-
-
}
--
Gitblit v1.8.0