From e7c4740cb2e4dec599a99c8823af5839acef084c Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期二, 18 一月 2022 17:44:05 +0800
Subject: [PATCH] 2021-1-18-01
---
HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SingleLogicView.cs | 14 ++++
HDL_ON/UI/UI2/FuntionControlView/Music/View/MyListView.cs | 6 +-
HDL_ON/UI/UI2/3-Intelligence/Automation/Set.cs | 7 ++
HDL_ON/UI/UI2/FuntionControlView/Music/A31PlayMusicPage.cs | 81 ++++++++++++++++-----------
HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs | 4 +
HDL_ON/UI/UI2/FuntionControlView/Music/View/PlayView.cs | 2
HDL_ON/Common/ApiUtlis.cs | 10 +-
HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs | 2
HDL_ON/DAL/DriverLayer/Control.cs | 2
HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs | 3
HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs | 2
HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs | 12 ++++
12 files changed, 98 insertions(+), 47 deletions(-)
diff --git a/HDL_ON/Common/ApiUtlis.cs b/HDL_ON/Common/ApiUtlis.cs
index 1421a8c..e16185b 100644
--- a/HDL_ON/Common/ApiUtlis.cs
+++ b/HDL_ON/Common/ApiUtlis.cs
@@ -171,11 +171,11 @@
for (int i = 0; i < FunctionList.List.GetDeviceFunctionList().Count;)
{
var localFunction = FunctionList.List.GetDeviceFunctionList()[i];
- if (SPK.MusicSpkList().Contains(localFunction.spk))
- {
- i++;
- continue;
- }
+ //if (SPK.MusicSpkList().Contains(localFunction.spk))
+ //{
+ // i++;
+ // continue;
+ //}
var newFunction = deviceList.list.Find((obj) => obj.deviceId == localFunction.deviceId);
if (delFile == localFunction.savePath)
diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs
index cc8237a..24300c5 100644
--- a/HDL_ON/DAL/DriverLayer/Control.cs
+++ b/HDL_ON/DAL/DriverLayer/Control.cs
@@ -972,7 +972,6 @@
var localFunction = allLocalFuntion.Find((obj) => obj.sid == updateTemp.sid);
if (localFunction == null)
{
- Console.WriteLine("鎵句笉鍒伴煶涔愭挱鏀惧櫒娣�=======" + revString);
continue;
}
if (Ins.GatewayOnline_Local && isCloudData)//鏈湴閾炬帴锛岄櫎浜嗘秱楦﹁澶囨暟鎹箣澶栫殑浜戠鏁版嵁涓嶅鐞�
@@ -999,7 +998,6 @@
{
localFunction.time_stamp = temp.time_stamp;
localFunction.SetAttrState(attr.key, attr.value);
- Console.WriteLine("闊充箰鎾斁鍣ㄦ坊鍔犵紦瀛樻暟鎹�=======" + revString);
}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs
index bbbea86..1466958 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs
@@ -26,6 +26,10 @@
/// </summary>
public string sid = "";
/// <summary>
+ /// 鏄惁鍏佽鍒犻櫎(false=鍙互鍒犻櫎)
+ /// </summary>
+ public bool tag = false;
+ /// <summary>
/// 閫昏緫鍚嶇О
/// </summary>
public string name = "鑷姩鍖�";
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SingleLogicView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SingleLogicView.cs
index 2a67225..3ee8fd6 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SingleLogicView.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SingleLogicView.cs
@@ -81,6 +81,19 @@
};
/// <summary>
+ /// 鏄剧ず鏄惁鍒犻櫎鏍囧織
+ /// </summary>
+ public Button btnIsDelTag = new Button
+ {
+ Width = Application.GetRealWidth(10),
+ Height = Application.GetRealWidth(10),
+ Y = Application.GetRealHeight(12),
+ X = Application.GetRealWidth(295 + 36 - 10),
+ Radius = (uint)Application.GetRealHeight(5),
+ BackgroundColor = 0xFFFF0000,
+ Visible = false,
+ };
+ /// <summary>
/// 鐐瑰嚮浜嬩欢
/// </summary>
public Button btnclick= new Button
@@ -101,6 +114,7 @@
frameLayout.AddChidren(btnLienIcon);
frameLayout.AddChidren(btnclick);
frameLayout.AddChidren(btnSwitchIcon);
+ frameLayout.AddChidren(btnIsDelTag);
return frameLayout;
}
}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs
index f38003b..66fe538 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs
@@ -81,6 +81,8 @@
})
{ IsBackground = true }.Start();
};
+
+
GetSelectIcon(logicView.frameLayout, currLogic);
if (i == 0)//闄嶅簭鎺掑垪
//if (Logic.LogicList.Count - 1 == i)
@@ -95,6 +97,15 @@
else
{
logicView.btnSwitchIcon.IsSelected = false;
+ }
+ ///鏄剧ず鐗规畩鑷姩鍖栨爣蹇�
+ if (currLogic.tag == true)
+ {
+ logicView.btnIsDelTag.Visible = true;
+ }
+ else
+ {
+ logicView.btnIsDelTag.Visible = false;
}
}
@@ -288,6 +299,7 @@
{
Logic newlogic = new Logic();
+ newlogic.tag = logic.tag;
newlogic.name = logic.name;
newlogic.userLogicId = logic.userLogicId;
newlogic.sid = logic.sid;
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs
index e52e8e3..8cae2d3 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs
@@ -163,6 +163,7 @@
var logicIfon = new JObject { };
logicIfon.Add("sid", logic.sid);
logicIfon.Add("gatewayId", LogicMethod.CurrLogicMethod.GatewayId);
+ logicIfon.Add("tag", logic.tag);
logicIfon.Add("name", logic.name);
logicIfon.Add("relation", logic.relation);
logicIfon.Add("enable", logic.enable);
@@ -287,6 +288,7 @@
logicIfon.Add("userLogicId", logic.userLogicId);
logicIfon.Add("sid", logic.sid);
logicIfon.Add("gatewayId", LogicMethod.CurrLogicMethod.GatewayId);
+ logicIfon.Add("tag", logic.tag);
logicIfon.Add("name", logic.name);
logicIfon.Add("relation", logic.relation);
logicIfon.Add("enable", logic.enable);
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/Set.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/Set.cs
index 7113132..06795e1 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/Set.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/Set.cs
@@ -81,7 +81,11 @@
BackgroundColor = CSS.CSS_Color.view,
Gravity = Gravity.BottomCenter,//缃簳鐨勫睘鎬�
};
- this.AddChidren(frameLayout);
+ ///鍙互鏄剧ず鍒犻櫎鎺т欢
+ if (Logic.currlogic.tag == false)
+ {
+ this.AddChidren(frameLayout);
+ }
Button btnDel = new Button
{
TextSize = LogicView.TextSize.text16,
@@ -94,6 +98,7 @@
frameLayout.AddChidren(btnDel);
+
EventHandler<MouseEventArgs> delClick = (sender, e) =>
{
Loading loading = new Loading();
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/A31PlayMusicPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/A31PlayMusicPage.cs
index 90a7991..39f941d 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Music/A31PlayMusicPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Music/A31PlayMusicPage.cs
@@ -70,7 +70,8 @@
///鍔犺浇鎾斁闊充箰鐣岄潰鐨勬帶浠舵柟娉�
playView.viewFrameLayout(middLayout);
#endregion
- #region ---鎺т欢鐨勭偣鍑讳簨浠�---
+
+ #region ---鐣岄潰鐐瑰嚮浜嬩欢---
//鏀惰棌鍥炬爣浜嬩欢
playView.collectIconBtn.MouseUpEventHandler += (sender, e) =>
{
@@ -98,7 +99,6 @@
playView.playOrderBtn.UnSelectedImagePath = "MusicIcon/single.png";
msg += Language.StringByID(StringId.singleMode);
break;
-
case ValueProperty.single_cycle:
modeValueString =ValueProperty.random;
playView.playOrderBtn.UnSelectedImagePath = "MusicIcon/random.png";
@@ -154,8 +154,34 @@
///涓嬫媺鍒锋柊
myListView.verticalScrolViewLayout.BeginHeaderRefreshingAction += () =>
{
+ System.Threading.Tasks.Task.Run(() =>
+ {
+ try
+ {
+ A31MusicModel.Current.palyLists.Clear();
+ if (A31MusicModel.Current.palyLists.Count == 0)
+ {
+ SendMethod.mMethod.GetPalyList(A31MusicModel.Current.functionMusic);
+
+ }
+ }
+ catch
+ {
+ }
+ finally
+ {
+ Application.RunOnMainThread(() =>
+ {
+ myListView.verticalScrolViewLayout.EndHeaderRefreshing();
+ myListView.verticalScrolViewLayout.RemoveAll();
+ var listName = A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.playlist_name);
+ var musicList = A31MusicModel.Current.GetSongList(listName);
+ A31SongPlay.SongListView(myListView.verticalScrolViewLayout, musicList, listName, myListView.popFra);
+ });
+ }
+ });
//缁撴潫鍒锋柊
- myListView.verticalScrolViewLayout.EndHeaderRefreshing();
+
};
///绉婚櫎鐣岄潰
EventHandler<MouseEventArgs> removeFromParentView = (sen, e1) =>
@@ -243,25 +269,23 @@
{
playView.nextBtn.IsSelected = false;
};
- ///鐗╃悊鎸夐敭鐨勭偣鍑讳簨浠�
- Volume.VolumeChange = (volume) =>
- {
- if (Application.DeviceType == Device.Ios && A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.source) == "bluetooth")
- {
- return;
- }
- playView.volSeekBar.Progress = volume;
-
- if (startVolume != volume)
- {
- startVolume = volume;
- A31MusicModel.Current.functionMusic.SetAttrState(KeyProperty.volume, startVolume);
- Dictionary<string, string> dic = new Dictionary<string, string>();
- dic.Add(KeyProperty.volume, startVolume.ToString());
- SendMethod.mMethod.SendControlCommand(A31MusicModel.Current.functionMusic, dic);
- }
-
- };
+ /////鐗╃悊鎸夐敭鐨勭偣鍑讳簨浠�
+ //Volume.VolumeChange = (volume) =>
+ //{
+ // if (Application.DeviceType == Device.Ios && A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.source) == "bluetooth")
+ // {
+ // return;
+ // }
+ // playView.volSeekBar.Progress = volume;
+ // if (startVolume != volume)
+ // {
+ // startVolume = volume;
+ // A31MusicModel.Current.functionMusic.SetAttrState(KeyProperty.volume, startVolume);
+ // Dictionary<string, string> dic = new Dictionary<string, string>();
+ // dic.Add(KeyProperty.volume, startVolume.ToString());
+ // SendMethod.mMethod.SendControlCommand(A31MusicModel.Current.functionMusic, dic);
+ // }
+ //};
#endregion
}
/// <summary>
@@ -283,7 +307,7 @@
{
//鏇存柊鎬绘椂闂�
//鎬诲叡鏈夊灏戠
- int totalSecond = int.Parse(A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.song_time))/1000;
+ int totalSecond = int.Parse(A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.song_time));
//鍒嗛挓
int totalMusicMinute = totalSecond / 60;
//绉掗挓
@@ -448,16 +472,7 @@
switch (A31MusicModel.Current.functionMusic.GetAttrState("source"))
{
-
- case "QPLAY"://QQ闊充箰
- playView.loveBtn.Alpha = 0.5f;
- playView.loveBtn.Enable = false;
- break;
- case "AIRPLAY"://閰风嫍闊充箰
- playView.loveBtn.Alpha = 0.5f;
- playView.loveBtn.Enable = false;
- playView.diyArcSeekBar.IsClickable = false;
- break;
+ //sdcard/audio_in/ftp/radio/bluetooth
case "SONGLIST-NETWORK"://鏈湴闊充箰
break;
case "SONGLIST-LOCAL"://USB
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs
index 2d2a565..07c2fdc 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs
@@ -102,9 +102,10 @@
verticalRefresh.BeginHeaderRefreshingAction += () =>
{
- verticalRefresh.EndHeaderRefreshing();
+
////鍙戦�佽鍙栭煶涔愭挱鏀惧櫒鐘舵�佺嚎绋�
SeachMusic();
+ verticalRefresh.EndHeaderRefreshing();
};
this.AddChidren(loading);
SeachMusic();
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs
index 70026c6..fda2963 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs
@@ -57,7 +57,7 @@
{
try
{
- // RefreshDeviceStatus(functionIds);
+ //RefreshDeviceStatus(functionIds);
a31Music.LastDateTime = DateTime.Now;
///浠庣紦瀛橀噷闈㈡煡鎵鹃煶涔愭挱鏀惧櫒瀵硅薄<缂撳瓨鏁版嵁鏀跺埌鎺ㄩ�佽繃鏉ョ殑鐘舵�佷細鏇存柊缂撳瓨鏁版嵁>
var allLocalFuntion = FunctionList.List.GetDeviceFunctionList();
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/View/MyListView.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/View/MyListView.cs
index 86bf14f..f6ec20b 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Music/View/MyListView.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Music/View/MyListView.cs
@@ -95,17 +95,17 @@
switch (mode)
{
//0鍒楄〃寰幆锛�1鍗曟洸寰幆锛�2闅忔満鎾斁;
- case "list_cycle":
+ case ValueProperty.list_cycle:
orderIconBtn.UnSelectedImagePath = "MusicIcon/list.png";
orderTxetBtn.Text = Language.StringByID(StringId.listMode);
break;
- case "single_cycle/order":
+ case ValueProperty.single_cycle:
orderIconBtn.UnSelectedImagePath = "MusicIcon/single.png";
orderTxetBtn.Text = Language.StringByID(StringId.singleMode);
break;
- case "random":
+ case ValueProperty.random:
orderIconBtn.UnSelectedImagePath = "MusicIcon/random.png";
orderTxetBtn.Text = Language.StringByID(StringId.randomMode);
break;
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/View/PlayView.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/View/PlayView.cs
index 9c9b11a..5335d37 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Music/View/PlayView.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Music/View/PlayView.cs
@@ -285,7 +285,7 @@
musicBjFl.AddChidren(songNameTextView);
musicBjFl.AddChidren(singerBtn);
musicBjFl.AddChidren(playOrderBtn);
- musicBjFl.AddChidren(loveBtn);
+ //musicBjFl.AddChidren(loveBtn);
musicBjFl.AddChidren(playlistBtn);
musicBjFl.AddChidren(volIconBtn);
musicBjFl.AddChidren(volSeekBar);
--
Gitblit v1.8.0