From ef3f8a51d69b581bfa06f82ee0851dafda4ffc3c Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期一, 13 六月 2022 11:23:33 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/wjc' into Dev-Branch
---
HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs | 12 +++-
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs | 14 +++-
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacControlPage.cs | 12 +++-
HDL_ON/UI/UI2/FuntionControlView/Music/A31PlayMusicPage.cs | 83 +++++++++++++--------------
4 files changed, 69 insertions(+), 52 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
index bdc7f95..6a45090 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
@@ -118,7 +118,15 @@
/// </summary>
private void InitFrameWhiteContent1()
{
+ //鑾峰彇娓╁害鍊�
temp = (int)Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", "."));
+ if (temp <= 0)
+ {
+ //榛樿鍊兼敼鎴�16,2022骞�06鏈�10鏃�10:03:19 鎴愮敨瑕佹眰鐨�
+ temp = 16;
+ device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString());
+ }
+
arcBar = new DiyArcSeekBar()
{
Gravity = Gravity.CenterHorizontal,
@@ -147,7 +155,7 @@
arcBar.IsOffline = device.GetAttrState(FunctionAttributeKey.OnOff) == "off";
arcBar.MinValue = device.GetAttribute(FunctionAttributeKey.SetTemp).min;
arcBar.MaxValue = device.GetAttribute(FunctionAttributeKey.SetTemp).max;
- arcBar.Progress = (int)Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", "."));
+ arcBar.Progress = temp;
btnTemp = new Button()
{
@@ -158,7 +166,7 @@
TextColor = CSS_Color.FirstLevelTitleColor,
TextSize = 50,
IsBold = true,
- Text = Convert.ToDouble( device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")).ToString(),
+ Text = Convert.ToDouble(temp).ToString(),
TextAlignment = TextAlignment.Center,
};
FrameWhiteCentet1.AddChidren(btnTemp);
@@ -1049,7 +1057,7 @@
btnSwing.UnSelectedImagePath = acFunction.GetSwingIconPath(device.GetAttrState(FunctionAttributeKey.Swing), false);
btnWindSpeed.UnSelectedImagePath = acFunction.GetFanIconPath(device.GetAttrState(FunctionAttributeKey.FanSpeed), false);
temp = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")));
-
+
arcBar.Progress = temp;
btnTemp.Text = temp.ToString() ;
diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacControlPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacControlPage.cs
index f4319c0..0aa3098 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacControlPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacControlPage.cs
@@ -126,6 +126,12 @@
temp = (int)Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", "."));
+ if (temp <= 0)
+ {
+ //榛樿鍊兼敼鎴�16,2022骞�06鏈�10鏃�10:03:19 鎴愮敨瑕佹眰鐨�
+ temp = 16;
+ device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString());
+ }
arcBar = new DiyArcSeekBar()
{
Gravity = Gravity.CenterHorizontal,
@@ -154,7 +160,7 @@
arcBar.IsOffline = device.GetAttrState(FunctionAttributeKey.OnOff) == "off";
arcBar.MinValue = device.GetAttribute(FunctionAttributeKey.SetTemp).min;
arcBar.MaxValue = device.GetAttribute(FunctionAttributeKey.SetTemp).max;
- arcBar.Progress = (int)Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", "."));
+ arcBar.Progress =temp;
btnTemp = new Button()
{
@@ -165,7 +171,7 @@
TextColor = CSS_Color.FirstLevelTitleColor,
TextSize = 50,
IsBold = true,
- Text = Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")).ToString(),
+ Text = Convert.ToDouble(temp).ToString(),
TextAlignment = TextAlignment.Center,
};
FrameWhiteCentet1.AddChidren(btnTemp);
@@ -603,7 +609,7 @@
+ Language.StringByID(StringId.Humidity) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState("room_humidity").Replace(", ", "."))) + "%";
btnMode.UnSelectedImagePath = acFunction.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode));
temp = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")));
-
+
arcBar.Progress = temp;
btnTemp.Text = temp.ToString();
diff --git a/HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs b/HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs
index cf582a2..a7e40b8 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs
@@ -141,7 +141,13 @@
//{
// controlView.AddChidren(btnCollection);
//}
-
+ //鑾峰彇娓╁害鍊�
+ var tempValue = (int)Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", "."));
+ if (tempValue<=0) {
+ //榛樿鍊兼敼鎴�16,2022骞�06鏈�10鏃�10:03:19 鎴愮敨瑕佹眰鐨�
+ tempValue = 16;
+ function.SetAttrState(FunctionAttributeKey.SetTemp, tempValue.ToString());
+ }
arcBar = new DiyArcSeekBar()
{
Gravity = Gravity.CenterHorizontal,
@@ -155,7 +161,7 @@
MaxValue = function.GetAttribute(FunctionAttributeKey.SetTemp).max,
//IsClickable = function.trait_on_off.curValue.ToString() == "on",
ArcColor = CSS_Color.BackgroundColor,
- Progress = (int)Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",",".")),
+ Progress = tempValue,
#if __IOS__
Y = Application.GetRealHeight(120 + 25),
Width = Application.GetRealWidth(260 - 40),
@@ -180,7 +186,7 @@
TextColor = CSS_Color.FirstLevelTitleColor,
TextSize = 50,
IsBold = true,
- Text = Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")).ToString(),
+ Text = Convert.ToDouble(tempValue).ToString(),
TextAlignment = TextAlignment.Center,
};
controlView.AddChidren(btnTemp);
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/A31PlayMusicPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/A31PlayMusicPage.cs
index 6bcea7c..71d6531 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Music/A31PlayMusicPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Music/A31PlayMusicPage.cs
@@ -39,8 +39,6 @@
/// </summary>
View.PlayView playView = new View.PlayView();
TopView topView;
-
-
public void Show()
{
@@ -96,15 +94,16 @@
string currModeKeyValue = A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.mode);
//鑾峰彇闊充箰鎾斁妯″紡鍒楄〃
var attributes = A31MusicModel.Current.functionMusic.GetAttribute(KeyProperty.mode);
- if (attributes==null) {
- attributes=new FunctionAttributes();
+ if (attributes == null)
+ {
+ attributes = new FunctionAttributes();
}
var attributesList = attributes.value;
//鎵惧埌褰撳墠鎾斁妯″紡绱㈠紩鍊�
int currModeIndexe = attributesList.IndexOf(currModeKeyValue);
//璁板綍閫変腑鐨勬挱鏀炬ā寮忕殑绱㈠紩鍊�
int count = 0;
- if (currModeIndexe >= attributesList.Count-1)
+ if (currModeIndexe >= attributesList.Count - 1)
{
//閲嶇疆绱㈠紩鍊�
count = 0;
@@ -119,7 +118,7 @@
{
//list_cycle鍒楄〃寰幆锛宻ingle_cycle鍗曟洸寰幆锛宺andom闅忔満鎾斁;
case ValueProperty.list_cycle:
- playView.playOrderBtn.UnSelectedImagePath = "MusicIcon/list.png";
+ playView.playOrderBtn.UnSelectedImagePath = "MusicIcon/list.png";
msg += Language.StringByID(StringId.listMode);
break;
case ValueProperty.single_cycle:
@@ -213,7 +212,7 @@
}
});
//缁撴潫鍒锋柊
-
+
};
///绉婚櫎鐣岄潰
EventHandler<MouseEventArgs> removeFromParentView = (sen, e1) =>
@@ -234,10 +233,10 @@
///闊抽噺鍥炬爣鐐瑰嚮浜嬩欢
playView.volIconBtn.MouseUpEventHandler += (sender, e) =>
{
-
+
};
///闊抽噺杩涘害鏉$偣鍑讳簨浠�
- int startVolume =0;//涔嬪墠鐨勯煶閲�
+ int startVolume = 0;//涔嬪墠鐨勯煶閲�
//int endVolume = 0;//鐜板湪鐨勯煶閲�
EventHandler<int> progressClick = (sender, e) =>
{
@@ -261,7 +260,7 @@
{
playView.prevBtn.IsSelected = true;
- A31MusicModel.Current.functionMusic.SetAttrState(KeyProperty.song_step,ValueProperty.down);
+ A31MusicModel.Current.functionMusic.SetAttrState(KeyProperty.song_step, ValueProperty.down);
Dictionary<string, string> dic = new Dictionary<string, string>();
dic.Add(KeyProperty.song_step, ValueProperty.up);
SendMethod.mMethod.SendControlCommand(A31MusicModel.Current.functionMusic, dic);
@@ -270,7 +269,7 @@
playView.prevBtn.MouseUpEventHandler += (sender, e) =>
{
playView.prevBtn.IsSelected = false;
- };
+ };
///鏆傚仠/鎾斁鐐瑰嚮浜嬩欢
playView.playBtn.MouseDownEventHandler += (sender, e) =>
{
@@ -279,7 +278,7 @@
{
playView.playBtn.IsSelected = false;
status = ValueProperty.off;
-
+
}
else
{
@@ -295,7 +294,7 @@
playView.nextBtn.MouseDownEventHandler += (sender, e) =>
{
playView.nextBtn.IsSelected = true;
- A31MusicModel.Current.functionMusic.SetAttrState(KeyProperty.song_step,ValueProperty.down);
+ A31MusicModel.Current.functionMusic.SetAttrState(KeyProperty.song_step, ValueProperty.down);
Dictionary<string, string> dic = new Dictionary<string, string>();
dic.Add(KeyProperty.song_step, ValueProperty.down);
SendMethod.mMethod.SendControlCommand(A31MusicModel.Current.functionMusic, dic);
@@ -406,13 +405,15 @@
//}
//鏄剧ず鎾斁鍣ㄥ尯鍩�
playView.regionBtn.Text = A31MusicModel.Current.functionMusic.GetRoomListName();
- //鏄剧ず鎾斁鍣ㄦ敹钘忕姸鎬佸浘鏍�
+ //鏄剧ず鎾斁鍣ㄦ敹钘忕姸鎬�
if (A31MusicModel.Current.functionMusic.collect)
{
+ //鏀惰棌
playView.collectIconBtn.IsSelected = true;
}
else
{
+ //涓嶆敹钘�
playView.collectIconBtn.IsSelected = false;
}
//if (A31MusicModel.Current.A31PlayStatus.IsMute)
@@ -432,9 +433,9 @@
// }
//}
//涓轰簡闃叉闊抽噺鏉¤烦鍔�,寤堕暱鏇存柊鏃堕棿(澶氬姞1s)
- if (2000 < (DateTime.Now - A31MusicModel.ProgressDateTime).TotalMilliseconds || A31MusicModel.ProgressDateTime==DateTime.MinValue)
+ if (2000 < (DateTime.Now - A31MusicModel.ProgressDateTime).TotalMilliseconds || A31MusicModel.ProgressDateTime == DateTime.MinValue)
{
- //闊抽噺杩涘害鏉�;
+ //鏄剧ず闊抽噺杩涘害鏉″��;
playView.volSeekBar.Progress = int.Parse(A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.volume));
//鏄剧ず褰撳墠闊抽噺鍊�;
playView.volValueBtn.Text = A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.volume) + "%";
@@ -448,17 +449,17 @@
if (A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.on_off) == ValueProperty.on)
{
//闊充箰鍦ㄦ挱鏀炬椂锛屽啀璁$畻鎾斁鏃堕棿(鐜板湪鏃堕棿=鍘熸潵鏃堕棿+1绉�)
- playSecond +=(int)(DateTime.Now - A31MusicModel.Current.LastDateTime).TotalSeconds;
+ playSecond += (int)(DateTime.Now - A31MusicModel.Current.LastDateTime).TotalSeconds;
playSecond += 1;//琛ㄧず鍔犱笂绛夊緟鐨勬椂闂�1s
///姝屾洸璁板綍鏆傛椂鏃堕棿鍐欏叆缂撳瓨锛�
A31MusicModel.Current.functionMusic.SetAttrState(KeyProperty.playing_time, playSecond);
}
- if (playSecond<=0)
+ if (playSecond <= 0)
{
///鎾斁鏃堕棿涓嶈兘灏忎簬0锛�
playSecond = 0;
}
- if (playSecond >=totalSecond)
+ if (playSecond >= totalSecond)
{
///鎾斁鏃堕棿涓嶈兘瓒呰繃鎬绘椂闂达紱
playSecond = totalSecond;
@@ -468,42 +469,38 @@
int playMusicSecond = playSecond % 60;
//杞寲鎾斁鏃堕棿鏃堕棿鏍煎紡
string playTime = (playMusicMinute.ToString().Length < 2 ? "0" + playMusicMinute.ToString() : playMusicMinute.ToString()) + ":" + (playMusicSecond.ToString().Length < 2 ? "0" + playMusicSecond.ToString() : playMusicSecond.ToString());
-
+ //鏄剧ず鎾斁鏃堕棿
+ playView.startTimeBtn.Text = playTime;
+ //鏄剧ず鎾斁鐘舵��
if (A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.on_off) == ValueProperty.on)
{
- //鏄剧ず鎾斁鐘舵�佸浘鏍�
+ //鎾斁
playView.playBtn.IsSelected = true;
- //鏄剧ず鎾斁鏃堕棿
- playView.startTimeBtn.Text = playTime;
- if (totalSecond == 0)
- {
- //鏄剧ず姝屾洸杩涘害鏉�
- playView.diyArcSeekBar.Progress = 0;
- }
- else
- {
- //鏄剧ず姝屾洸杩涘害鏉�
- playView.diyArcSeekBar.Progress = (int)(playSecond * 100.0 / totalSecond);//+1
- }
-
-
}
else
{
- //鏄剧ず鎾斁鐘舵�佸浘鏍�
+ //鏆傚仠
playView.playBtn.IsSelected = false;
- //鍋滄鎾斁
- playView.startTimeBtn.Text =playTime;
- //playView.startTimeBtn.Text ="00:00";
///璁板綍姝屾洸鏆傚仠鏃堕棿锛�<LastDateTime 璁$畻鎾斁鏃堕棿鏈夌敤鍒�>
A31MusicModel.Current.LastDateTime = DateTime.Now;
+ }
+ //鏄剧ず杩涘害鏉″��
+ if (totalSecond == 0)
+ {
+ //姝屾洸鎾斁杩涘害
+ playView.diyArcSeekBar.Progress = 0;
+ }
+ else
+ {
+ //姝屾洸鎾斁杩涘害
+ playView.diyArcSeekBar.Progress = (int)(playSecond * 100.0 / totalSecond);//+1
}
//鏄剧ず姝屾洸鍚嶇О
playView.songNameTextView.Text = A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.song_name) == null ? "Unkown" : A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.song_name);
//鏄剧ず姝屾墜鍚嶇О
playView.singerBtn.Text = A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.song_name) == null ? "Unkown" : A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.song_name);
//鏇存柊婧愮殑鐣岄潰
- // showSourcePage();
+ // showSourcePage();
}
catch (Exception e)
{
@@ -603,7 +600,9 @@
void PlayListView(FrameLayout frameLayout, VerticalRefreshLayout verticalScrolViewLayout)
{
verticalScrolViewLayout.RemoveAll();
+ //鑾峰彇鎾斁鍣ㄥ悕绉�
var listName = A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.playlist_name);
+ //鑾峰彇缂撳瓨姝屾洸鍒楄〃
var musicList = A31MusicModel.Current.GetSongList(listName);
if (musicList.Count == 0)
{
@@ -614,6 +613,7 @@
A31MusicModel.Current.palyLists.Clear();
if (A31MusicModel.Current.palyLists.Count == 0)
{
+ //鑾峰彇姝屾洸鍒楄〃
SendMethod.mMethod.GetPalyList(A31MusicModel.Current.functionMusic);
}
@@ -643,8 +643,5 @@
{
UpdateThread.updateCurrMusicThread(frameLayout, middViewLayout, A31MusicModel.Current);
}
-
-
-
}
}
--
Gitblit v1.8.0