lss
2022-06-27 ea285ffe71284f5499e870f89c65b710d2d6a79c
HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs
@@ -12,7 +12,7 @@
{
    public class SendMethod
    {
        private static SendMethod sMethod = null;
        private static SendMethod sMethod=null;
        public static SendMethod mMethod
        {
            get
@@ -44,12 +44,11 @@
        {
            new System.Threading.Thread(() =>
            {
                DriverLayer.Control.Ins.SendWriteCommand(function, dic);
                DriverLayer.Control.Ins.SendWriteCommand(function, dic,false,0);
            })
            { IsBackground = true }.Start();
        }
        //记录歌曲播放时间
        private int songPlayTime = -1;
        /// <summary>
        /// 获取设备最新的状态
        /// </summary>
@@ -59,7 +58,7 @@
            try
            {
                //RefreshDeviceStatus(functionIds);
                //a31Music.LastDateTime = DateTime.Now;
                a31Music.LastDateTime = DateTime.Now;
                ///从缓存里面查找音乐播放器对象<缓存数据收到推送过来的状态会更新缓存数据>
                var allLocalFuntion = FunctionList.List.GetDeviceFunctionList();
                var localFunction = allLocalFuntion.Find((obj) => obj.sid == sid);
@@ -69,13 +68,6 @@
                }
                ///更新的数据
                a31Music.functionMusic = localFunction;
                if (int.Parse(A31MusicModel.Current.functionMusic.GetAttrState(UI2.FuntionControlView.Music.KeyProperty.playing_time)) != songPlayTime)
                {
                    ///歌曲记录时间和当前时间不一样,立即更新数据反馈时间
                    a31Music.LastDateTime = DateTime.Now;
                    ///歌曲记录时间和当前时间不一样,立即更新歌曲播放时间
                    songPlayTime = int.Parse(A31MusicModel.Current.functionMusic.GetAttrState(UI2.FuntionControlView.Music.KeyProperty.playing_time));
                }
            }
            catch { }
@@ -97,7 +89,6 @@
                {
                    return;
                }
            }
            catch { }
        }
@@ -130,7 +121,7 @@
                d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
                d.Add("deviceIds", new List<string> { music.deviceId });
                var responsePackNew = RequestServerhomeId(d, NewAPI.Api_Post_PlayerList);
                if (responsePackNew.Code != "0" || responsePackNew.Data == null || responsePackNew.Data.ToString() == "")
                if (responsePackNew.Code != "0"||responsePackNew.Data == null ||responsePackNew.Data.ToString() == "")
                {
                    return;
                }
@@ -139,7 +130,7 @@
                var palyLists = Newtonsoft.Json.JsonConvert.DeserializeObject<List<PalyListInfo>>(str);
                if (palyLists == null)
                {
                    palyLists = new List<PalyListInfo>();
                    palyLists =new List<PalyListInfo>();
                }
                if (palyLists.Count > 0)
                {
@@ -152,12 +143,12 @@
            }
        }
        /// <summary>
        ///请求服务器(与住宅有关:例如;homeId) 
        /// </summary>
        /// <returns></returns>
        public ResponsePackNew RequestServerhomeId(object o, string api_Url, int mTimeout = 5)
        public  ResponsePackNew RequestServerhomeId(object o, string api_Url, int mTimeout = 5)
        {
            var requestJson = HttpUtil.GetSignRequestJson(o);
            return HttpUtil.RequestHttpsPostFroHome(api_Url, requestJson, mTimeout);