#include "core.h"
#include <QFile>
#include <QDir>


class PcbCamCorePrivate
{
    Q_DECLARE_PUBLIC(PcbCamCore)
public:
    explicit PcbCamCorePrivate(PcbCamCore *qptr):q_ptr(qptr){}
    ~PcbCamCorePrivate(){}

    PcbCamConfig config;
    PcbCamAbstractDataIo *dataIo {nullptr};

protected:
    PcbCamCore * const q_ptr;
};


PcbCamCore *PcbCamCore::instance()
{
    static PcbCamCore gInstance;
    return &gInstance;
}

void PcbCamCore::setConfig(const PcbCamConfig &iConf)
{
    Q_D(PcbCamCore);
    d->config = iConf;
}

PcbCamConfig &PcbCamCore::config()
{
    Q_D(PcbCamCore);
    return d->config;
}

void PcbCamCore::setDataIo(PcbCamAbstractDataIo *iDataIo)
{
    Q_D(PcbCamCore);
    d->dataIo = iDataIo;
}

PcbCamAbstractDataIo *PcbCamCore::dataIo()
{
    Q_D(PcbCamCore);
    return d->dataIo;
}

void PcbCamCore::notifyMessage(const QString &iMessage, const QString &iType, const QString &iCategory, const QVariant &iUserData)
{
    emit messageNotified(iMessage, iType, iCategory, iUserData);
}

PcbCamCore::PcbCamCore() : QObject(nullptr),
    d_ptr(new PcbCamCorePrivate(this))
{

}

PcbCamCore::~PcbCamCore()
{

}

