From f3c52a6658ed781fd1cb581a49bfcab107250679 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 19 十月 2022 13:11:48 +0800
Subject: [PATCH] 增加保加利亚语
---
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs | 205 ++++++++++++++++++++++++++------------------------
1 files changed, 106 insertions(+), 99 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
index ca02d57..be06592 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
@@ -90,27 +90,28 @@
this.InitFrameWhiteContent1();
//鍒锋柊褰撳墠璁惧鐨勭姸鎬佺紦瀛�
- this.RefreshNowDeviceStatuMemory(this.device);
+ //this.RefreshNowDeviceStatuMemory(this.device);
//鍒锋柊鐣岄潰鐘舵��
this.RefreshFormStatu();
//璇诲彇鐘舵��
- new System.Threading.Thread(() =>
- {
- while (true)
- {
- if(controlTime == DateTime.MinValue)
- {
+ Control.Ins.SendReadCommand(device);
+ //new System.Threading.Thread(() =>
+ //{
+ // while (true)
+ // {
+ // if(controlTime == DateTime.MinValue)
+ // {
- }
- else if (controlTime.AddSeconds(2)<DateTime.Now)
- {
- Control.Ins.SendReadCommand(device);
- controlTime = DateTime.MinValue;
- }
- System.Threading.Thread.Sleep(1000);
- }
- })
- { IsBackground = true }.Start();
+ // }
+ // else if (controlTime.AddSeconds(2)<DateTime.Now)
+ // {
+ // Control.Ins.SendReadCommand(device);
+ // controlTime = DateTime.MinValue;
+ // }
+ // System.Threading.Thread.Sleep(1000);
+ // }
+ //})
+ //{ IsBackground = true }.Start();
}
/// <summary>
@@ -119,14 +120,17 @@
private void InitFrameWhiteContent1()
{
//鑾峰彇娓╁害鍊�
- temp = (int)Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", "."));
+ string setTempTemp = device.GetAttrState(FunctionAttributeKey.SetTemp);
+ temp = (int) Convert.ToDouble(setTempTemp);
if (temp <= 0)
{
//榛樿鍊兼敼鎴�16,2022骞�06鏈�10鏃�10:03:19 鎴愮敨瑕佹眰鐨�
temp = 16;
device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString());
}
-
+
+
+
arcBar = new DiyArcSeekBar()
{
Gravity = Gravity.CenterHorizontal,
@@ -166,10 +170,13 @@
TextColor = CSS_Color.FirstLevelTitleColor,
TextSize = 50,
IsBold = true,
- Text = Convert.ToDouble(temp).ToString(),
+ Text = "111",
TextAlignment = TextAlignment.Center,
};
+ btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5);
+ btnTemp.Text = Convert.ToDouble(temp).ToString();
FrameWhiteCentet1.AddChidren(btnTemp);
+
btnTempUint = new Button()
{
@@ -191,7 +198,7 @@
Y = btnTemp.Bottom,
Width = Application.GetRealWidth(120),
Height = Application.GetRealHeight(20),
- Text = Language.StringByID(StringId.IndoorTemp) + "20掳C",
+ Text = Language.StringByID(StringId.Indoor) + " 20掳C",
TextColor = CSS_Color.PromptingColor1,
TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
};
@@ -366,15 +373,15 @@
};
EventHandler<MouseEventArgs> eventHandler1 = (sender, e) =>
{
- if (!device.online)
- {
- new Tip()
- {
- CloseTime = 1,
- Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
- Direction = AMPopTipDirection.None,
- }.Show(MainPage.BaseView);
- }
+ //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.Mode, m);
btnMode.UnSelectedImagePath = acFunction.GetModeIconPath(m);
@@ -502,15 +509,15 @@
};
EventHandler<MouseEventArgs> eventHandler1 = (sender, e) =>
{
- if (!device.online)
- {
- new Tip()
- {
- CloseTime = 1,
- Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
- Direction = AMPopTipDirection.None,
- }.Show(MainPage.BaseView);
- }
+ //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.Swing, m);
btnSwing.UnSelectedImagePath = acFunction.GetSwingIconPath(m);
@@ -626,15 +633,15 @@
};
EventHandler<MouseEventArgs> eventHandler1 = (sender, e) =>
{
- if (!device.online)
- {
- new Tip()
- {
- CloseTime = 1,
- Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
- Direction = AMPopTipDirection.None,
- }.Show(MainPage.BaseView);
- }
+ //if (!device.online)
+ //{
+ // new Tip()
+ // {
+ // CloseTime = 1,
+ // Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+ // Direction = AMPopTipDirection.None,
+ // }.Show(MainPage.BaseView);
+ //}
btnFanIcon.IsSelected = btnFanText.IsSelected = true;
device.SetAttrState(FunctionAttributeKey.FanSpeed, m);
btnWindSpeed.UnSelectedImagePath = acFunction.GetFanIconPath(m);
@@ -822,15 +829,15 @@
btn.MouseUpEventHandler = (sender, e) =>
{
- if (!device.online)
- {
- new Tip()
- {
- CloseTime = 1,
- Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
- Direction = AMPopTipDirection.None,
- }.Show(MainPage.BaseView);
- }
+ //if (!device.online)
+ //{
+ // new Tip()
+ // {
+ // CloseTime = 1,
+ // Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+ // Direction = AMPopTipDirection.None,
+ // }.Show(MainPage.BaseView);
+ //}
Dictionary<string, string> d = new Dictionary<string, string>();
d.Add(attr.key, "");
Control.Ins.SendWriteCommand(device, d);
@@ -869,7 +876,7 @@
if (this.device.sid != i_LocalDevice.sid) { return; }
//鍒锋柊褰撳墠璁惧鐨勭姸鎬佺紦瀛�
- this.RefreshNowDeviceStatuMemory(i_LocalDevice);
+ //this.RefreshNowDeviceStatuMemory(i_LocalDevice);
//鍒锋柊鐣岄潰鐘舵��
this.RefreshFormStatu();
}
@@ -885,15 +892,15 @@
{
btnMinus.MouseUpEventHandler = (sender, e) =>
{
- if (!device.online)
- {
- new Tip()
- {
- CloseTime = 1,
- Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
- Direction = AMPopTipDirection.None,
- }.Show(MainPage.BaseView);
- }
+ //if (!device.online)
+ //{
+ // new Tip()
+ // {
+ // CloseTime = 1,
+ // Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+ // Direction = AMPopTipDirection.None,
+ // }.Show(MainPage.BaseView);
+ //}
if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan")
{
return;
@@ -908,6 +915,8 @@
controlTime = DateTime.Now;
arcBar.Progress = temp;
btnTemp.Text = temp.ToString();
+ //btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5);
+ //btnTempUint.X = btnTemp.Right;
device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString());
System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
d.Add(FunctionAttributeKey.SetTemp, temp.ToString());
@@ -915,15 +924,15 @@
};
btnPlus.MouseUpEventHandler = (sender, e) =>
{
- if (!device.online)
- {
- new Tip()
- {
- CloseTime = 1,
- Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
- Direction = AMPopTipDirection.None,
- }.Show(MainPage.BaseView);
- }
+ //if (!device.online)
+ //{
+ // new Tip()
+ // {
+ // CloseTime = 1,
+ // Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+ // Direction = AMPopTipDirection.None,
+ // }.Show(MainPage.BaseView);
+ //}
if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan")
{
return;
@@ -936,12 +945,14 @@
controlTime = DateTime.Now;
arcBar.Progress = temp;
btnTemp.Text = temp.ToString();
+ //btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5);
+ //btnTempUint.X = btnTemp.Right;
device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString());
System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
d.Add(FunctionAttributeKey.SetTemp, temp.ToString());
Control.Ins.SendWriteCommand(device, d);
};
- if (!device.online)
+ //if (device.online)
{
arcBar.OnStopTrackingTouchEvent = (sender, e) =>
{
@@ -949,7 +960,7 @@
device.SetAttrState(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString());
btnTemp.Text = arcBar.Progress.ToString();
controlTime = DateTime.Now;
- System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
+ Dictionary<string, string> d = new Dictionary<string, string>();
d.Add(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString());
Control.Ins.SendWriteCommand(device, d);
};
@@ -957,6 +968,8 @@
{
device.SetAttrState(FunctionAttributeKey.SetTemp, e.ToString());
btnTemp.Text = e.ToString();
+ //btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5);
+ //btnTempUint.X = btnTemp.Right;
};
//arcBar.MouseDownEventHandler = (sender, e) => {
// Console.WriteLine("ddd");
@@ -1002,15 +1015,15 @@
btnSwitch.MouseUpEventHandler = (sender, e) =>
{
- if (!device.online)
- {
- new Tip()
- {
- CloseTime = 1,
- Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
- Direction = AMPopTipDirection.None,
- }.Show(MainPage.BaseView);
- }
+ //if (!device.online)
+ //{
+ // new Tip()
+ // {
+ // CloseTime = 1,
+ // Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+ // Direction = AMPopTipDirection.None,
+ // }.Show(MainPage.BaseView);
+ //}
btnSwitch.IsSelected = !btnSwitch.IsSelected;
device.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
if (device.trait_on_off.curValue.ToString() == "on")
@@ -1049,7 +1062,9 @@
}
else
{
- btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp).Replace(",", "."))) + "掳C";
+ //device = FunctionList.List.Functions.Find((obj) => obj.sid == device.sid);
+
+ btnIndoorTemp.Text = Language.StringByID(StringId.Indoor) + " " + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp).Replace(",", "."))) + "掳C";
btnMode.SelectedImagePath = acFunction.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode));
btnSwing.SelectedImagePath = acFunction.GetSwingIconPath(device.GetAttrState(FunctionAttributeKey.Swing));
btnWindSpeed.SelectedImagePath = acFunction.GetFanIconPath(device.GetAttrState(FunctionAttributeKey.FanSpeed));
@@ -1060,7 +1075,9 @@
arcBar.Progress = temp;
- btnTemp.Text = temp.ToString() ;
+ btnTemp.Text = temp.ToString();
+ //btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5);
+ //btnTempUint.X = btnTemp.Right;
if (device.trait_on_off.curValue.ToString() == "on")
{
@@ -1099,15 +1116,5 @@
#endregion
- #region 鈻� 涓�鑸柟娉昣__________________________
-
- /// <summary>
- /// 鍒锋柊褰撳墠璁惧鐨勭姸鎬佺紦瀛�
- /// </summary>
- private void RefreshNowDeviceStatuMemory(Function i_LocalDevice)
- {
- }
-
- #endregion
}
}
\ No newline at end of file
--
Gitblit v1.8.0