
#include "signals.h"

//GlobalUserSignal
GlobalUserSignal* GlobalUserSignal::instance = new GlobalUserSignal;

GlobalUserSignal *GlobalUserSignal::getInstance()
{
    return instance;

}

GlobalUserSignal::GlobalUserSignal(QObject *parent) : QObject(parent)
{
    mMap.clear();
}

bool GlobalUserSignal::getDeviceBusyStatus(QString dev)
{
    if (mMap.contains(dev))
        return mMap.value(dev);
    else {
        return false;
    }
}

void GlobalUserSignal::setDeviceBusyStatus(QString dev,bool result)
{
        mMap.insert(dev,result);
}

void GlobalUserSignal::removeDevice(QString dev,bool result)
{
    if (mMap.contains(dev)) { //判断设备是否在mMap中
        mMap.remove(dev);
    }
}

GlobalUserSignal::~GlobalUserSignal()
{

}

//GlobalCoreSignal
GlobalCoreSignal* GlobalCoreSignal::instance = new GlobalCoreSignal;

GlobalCoreSignal *GlobalCoreSignal::getInstance()
{
    return instance;
}


GlobalCoreSignal::GlobalCoreSignal(QObject *parent) : QObject(parent)
{

}

GlobalCoreSignal::~GlobalCoreSignal()
{

}

//GlobalConfigSignal
GlobalConfigSignal* GlobalConfigSignal::instance = new GlobalConfigSignal;
GlobalConfigSignal *GlobalConfigSignal::getInstance()
{
    return instance;
}

GlobalConfigSignal::GlobalConfigSignal(QObject *parent)
{

}

GlobalConfigSignal::~GlobalConfigSignal()
{

}
