From 18d933b835110e8aa42efa0d4456f61efeb27e5b Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期四, 30 七月 2020 12:00:40 +0800
Subject: [PATCH] 2020-07-30-2

---
 HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicModel.cs |   78 ++++++++++++++++++++++----------------
 .vs/HDL_APP_Project/xs/sqlite3/storage.ide              |    0 
 .vs/HDL_APP_Project/xs/UserPrefs.xml                    |   15 +++----
 HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs     |    6 +++
 .vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal          |    0 
 5 files changed, 58 insertions(+), 41 deletions(-)

diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml
index ec75660..b5cb440 100644
--- a/.vs/HDL_APP_Project/xs/UserPrefs.xml
+++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,11 +1,6 @@
 锘�<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default">
   <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.D4411691-F5B8-40F4-97C1-964F33115DBC" />
-  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/FuntionControlView/Music/A31PlayMusicPage.cs">
-    <Files>
-      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicModel.cs" Line="69" Column="14" />
-      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs" Line="152" Column="30" />
-      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Music/A31PlayMusicPage.cs" Line="47" Column="22" />
-    </Files>
+  <MonoDevelop.Ide.Workbench>
     <Pads>
       <Pad Id="ProjectPad">
         <State name="__root__">
@@ -15,8 +10,7 @@
                 <Node name="UI2" expanded="True">
                   <Node name="FuntionControlView" expanded="True">
                     <Node name="Music" expanded="True">
-                      <Node name="View" expanded="True" />
-                      <Node name="A31PlayMusicPage.cs" selected="True" />
+                      <Node name="A31MusicSourcePage.cs" selected="True" />
                     </Node>
                   </Node>
                 </Node>
@@ -25,6 +19,11 @@
           </Node>
         </State>
       </Pad>
+      <Pad Id="MonoDevelop.Debugger.WatchPad">
+        <State>
+          <Value>DB_ResidenceData.residenceData.functionList.functions[18].functionCategory</Value>
+        </State>
+      </Pad>
     </Pads>
   </MonoDevelop.Ide.Workbench>
   <MonoDevelop.Ide.DebuggingService.PinnedWatches />
diff --git a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide
index 6f22094..0e8a33a 100644
--- a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide
+++ b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide
Binary files differ
diff --git a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal
index 582e364..07f996b 100644
--- a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal
+++ b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal
Binary files differ
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicModel.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicModel.cs
index 1a23d20..d2b6715 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicModel.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicModel.cs
@@ -17,18 +17,45 @@
         }
 
         static List<System.Threading.Thread> updataMusicStatesListThread = new List<System.Threading.Thread>();
-
         /// <summary>
         /// 璇诲彇闊充箰鐘舵��
         /// </summary>
         public static void ReadMusicStates()
         {
-
+            RemoveListThread();
+            if (GetCollection)
+            {
+                for (int i = 0; i < A31MusicModelList.Count; i++)
+                {
+                    var a31player = A31MusicModelList[i];
+                    var musicThread = new System.Threading.Thread(() =>
+                    {
+                        while (true)
+                        {
+                            System.Threading.Thread.Sleep(1000);
+                            if (!a31player.IsOnLine)
+                            {
+                                continue;
+                            }
+                            SendMethod.ReadStatus(a31player);
+                        }
+                    })
+                    { IsBackground = true, Name = "A31" };
+                    musicThread.Start();
+                    updataMusicStatesListThread.Add(musicThread);
+                }
+            }
+        }
+        
+        /// <summary>
+        /// 绉婚櫎涔嬪墠鐨勭嚎绋�
+        /// </summary>
+        public static void RemoveListThread() {
             var threads = updataMusicStatesListThread.FindAll((obj) => { return obj.Name == "A31"; });
-            for (int i =0;i< updataMusicStatesListThread.Count;)
+            for (int i = 0; i < updataMusicStatesListThread.Count;)
             {
                 try
-                {
+                {                    
                     var thread = updataMusicStatesListThread[i];
                     if (thread.IsAlive)
                     {
@@ -45,34 +72,11 @@
                     MainPage.Log("clearA31Threads over");
                 }
             }
-            if (GetCollection) {
-                for (int i = 0; i < A31MusicModelList.Count; i++)
-                {
-                    var a31player = A31MusicModelList[i];
-                    var musicThread = new System.Threading.Thread(() =>
-                    {
-                        while (true)
-                        {
-                            System.Threading.Thread.Sleep(1000);
-                            if (!a31player.IsOnLine)
-                            {
-                                continue;
-                            }
-                            //A31MusicModel.ReadMusicStates();
-                            SendMethod.ReadStatus(a31player);
-                        }
-                    })
-                    { IsBackground = true, Name = "A31" };
-                    musicThread.Start();
-                    updataMusicStatesListThread.Add(musicThread);
-                }
-            }
-            
         }
         /// <summary>
         /// 闊充箰鍒楄〃閲屾槸鍚︽湁闊充箰琚敹钘忚繃
         /// </summary>
-         static bool GetCollection
+        static bool GetCollection
         {
             get
             {
@@ -259,16 +263,15 @@
             }
         }
         /// <summary>
-        /// 璁板綍涓绘挱鏀惧櫒鏄惁琚敹钘�
+        /// 璁板綍涓绘挱鏀惧櫒鏄惁琚敹钘�(绉�妗″畾涔夌殑)
         /// </summary>
         public bool MainPlayCollection = false;
 
         public Slaves Slave = new Slaves();
-
+        /// <summary>
+        /// 璁板綍鏃堕棿
+        /// </summary>
         public static DateTime ProgressDateTime = DateTime.Now;
-        //static System.Threading.Tasks.Task task;
-        //闊抽噺鍒楄〃
-        //static List<int> volumeCommandList = new List<int> ();
 
         public static bool IsJson(string json)
         {
@@ -284,6 +287,14 @@
             {
                 return false;
             }
+        }
+        /// <summary>
+        /// 鑷畾涔夋棩蹇楄緭鍑�
+        /// </summary>
+        public static void LogMusic(string str)
+        {
+            var time = DateTime.Now;
+            Console.WriteLine(time + str);
         }
 
     }
@@ -329,4 +340,5 @@
         public string version = string.Empty;
         public string uuid = string.Empty;
     }
+
 }
\ No newline at end of file
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs
index 22f34f4..3b748fe 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs
@@ -12,6 +12,8 @@
         public MusicMain()
         {
             Tag = "MusicMain";
+            //杩涙潵闊充箰鍒楄〃鐣岄潰鍏堢Щ闄や箣鍓嶇嚎绋�;
+            A31MusicModel.RemoveListThread();
         }
         public override void RemoveFromParent()
         {
@@ -20,6 +22,9 @@
             A31MusicModel.ReadMusicStates();//杩涙潵娌℃湁闊充箰琚敹钘忚繃锛岄��鍑烘湁闊充箰琚敹钘忚繃
         }
         static List<System.Threading.Thread> threadLists = new List<System.Threading.Thread>();
+        /// <summary>
+        /// 绉婚櫎绾跨▼
+        /// </summary>
         static void clearA31Threads()
         {
             var threads = threadLists.FindAll((obj) => { return obj.Name == "A31"; });
@@ -49,6 +54,7 @@
 
         public void Show()
         {
+
             #region 鐣岄潰甯冨眬
             this.BackgroundColor = Color.ViewColor;
             var topView = new TopView();

--
Gitblit v1.8.0