|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- using BPA.Helper;
- using BPA.Message;
- using BPA.Message.Enum;
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Linq;
- using System.Text;
- using System.Threading;
- using System.Threading.Tasks;
-
- namespace BPASmartClient.ScreenLib
- {
- public class ScreenSplitMealsControl1ViewModel : NotifyBase
- {
- #region 变量
- /// <summary>
- /// 广告地址
- /// </summary>
- public Uri GgAdder { get { return _GgAdder; } set { _GgAdder = value; OnPropertyChanged(); } }
- private Uri _GgAdder = new Uri(System.Configuration.ConfigurationManager.AppSettings["GgAdder"].ToString());
- /// <summary>
- /// 界面数据绑定
- /// </summary>
- public ScreenModelSplitMeals ViewData
- {
- get { return _ViewData; }
- set
- {
- _ViewData = value;
- OnPropertyChanged();
- }
- }
- private ScreenModelSplitMeals _ViewData = new ScreenModelSplitMeals();
-
- /// <summary>
- /// 当前刷新数据类型
- /// </summary>
- public ScreenDeviceType type = ScreenDeviceType.分餐机;
- #endregion
-
- public ScreenSplitMealsControl1ViewModel()
- {
- ThreadManage.GetInstance().StartLong(new Action(() =>
- {
- System.Windows.Application.Current?.Dispatcher.Invoke((Action)(() =>
- {
- if (Main.GetInstance.mqttDatasDic.ContainsKey(type))
- {
- ScreenModelSplitMeals modelMaxWok = Main.GetInstance.mqttDatasDic[type] as ScreenModelSplitMeals;
- if (modelMaxWok != null && modelMaxWok.Alarm != null)
- modelMaxWok.Alarm = modelMaxWok.Alarm?.OrderByDescending(k => DateTime.Parse(k.AlarmTime)).ToList();
- ViewData = modelMaxWok;
- }
- }));
- Thread.Sleep(1000);
- }), $"{DateTime.Now}_1,线程服务");
- }
- }
- }
|