ccoleta.cpp
1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "ccoleta.h"
CColeta::CColeta(QObject *parent)
{
}
void CColeta::coletaHardware()
{
qDebug() << "coletaHardware() executado";
// oHardware.iniciaColeta();
}
void CColeta::coletaSoftware()
{
qDebug() << "coletaSoftware() executado";
oSoftware.iniciaColeta();
}
void CColeta::configuraColetas(){
QObject::connect(this, SIGNAL(beginHardware()), this, SLOT(coletaHardware()));
QObject::connect(this, SIGNAL(beginSoftware()), this, SLOT(coletaSoftware()));
}
CACIC_Computer CColeta::getOComputer() const
{
return oComputer;
}
cacic_software CColeta::getOSoftware() const
{
return oSoftware;
}
void CColeta::run()
{
QJsonObject coleta = oCacic.getJsonFromFile("configReq.json");
if( coleta.contains("hardware") )
emit beginHardware();
if ( coleta.contains("software") )
emit beginSoftware();
}
QJsonObject CColeta::toJsonObject()
{
QJsonObject coletaJson;
coletaJson["computer"] = oComputer.toJsonObject();
coletaJson["software"] = oSoftware.toJsonObject();
return coletaJson;
}