#pragma once
#include "../RedisAgent/RedisAgent.h"
#include "../TDAgent/TDAgent.h"
#include "BaseModule.h"
#include "oneitem.h"
#include <QtCore/QObject>
#include <list>

// 模块加载
class maincontrol : public QObject,public DataConsumer
{
    Q_OBJECT
public:
    maincontrol();

private:
    RedisAgent*               m_pRedis;          // 读取配置
    TDAgent*                  m_pTDengine;       // 订阅发布

    std::multimap<std::string,oneitem*>  m_mpItems;
    void loadConfig(std::string szFile,std::map<QString,QString>& mps);

public slots:
    void sltSubData(const std::string, const std::string);

public:
    virtual void OnData(std::string name,QVariant val);
    void Startup();
};
