using BPA.Message;
using BPA.Message.Enum;
using BPASmartClient.Device;
using BPASmartClient.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BPASmartClient.Business
{
///
/// 主题定义
///
public class TopicDefine : Singleton
{
///
/// 获取订阅主题
///
public List SubscribTopics { get; private set; }
///
/// 获取心跳上报主题
///
public Dictionary PushHeartbeatTopics { get; set; }
public void Initialize(List devices)
{
SubscribTopics = new List();
PushHeartbeatTopics = new Dictionary();
foreach (var device in devices)
{
//SubscribTopics.Add(TOPIC.GetInstance.GetOrderPushTopic(device.DeviceType, Plugin.GetInstance().GetPlugin().ClientId));
//SubscribTopics.Add(TOPIC.GetInstance.GetBusinessTopic(device.DeviceType, Plugin.GetInstance().GetPlugin().ClientId));
SubscribTopics.Add(TOPIC.GetInstance.GetOrderPushTopic(device.DeviceType, device.DeviceId));
SubscribTopics.Add(TOPIC.GetInstance.GetBusinessTopic(device.DeviceType, device.DeviceId));
PushHeartbeatTopics.Add(device.DeviceType, TOPIC.GetInstance.GetHeatbeatTopic(device.DeviceType));
}
}
}
}