debug
This commit is contained in:
1 parent
2f7f72d9b4
commit
6cdae78c2a
2 files changed
+11
-2
No files matched your search
+10
-1
@@ -454,6 +454,7 @@ void Pws2mqtt::parseData(QList<std::pair<QString, QString>> queryList)
|
|||||||
debug (DEBUGMACRO, "solarradiations : " + QByteArray::number(propertyValue), DEBUG);
|
debug (DEBUGMACRO, "solarradiations : " + QByteArray::number(propertyValue), DEBUG);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
debug(DEBUGMACRO, "propertyList[name] = " + propertyList[name]);
|
||||||
}
|
}
|
||||||
propertiesValue["windchill"] = calc.computeUTCI(propertiesValue["tempf"], propertiesValue["vent"], propertiesValue["solarradiation"], propertiesValue["humidity"]);
|
propertiesValue["windchill"] = calc.computeUTCI(propertiesValue["tempf"], propertiesValue["vent"], propertiesValue["solarradiation"], propertiesValue["humidity"]);
|
||||||
propertyList["windchill"] = formatNotifString(propertyName["windchill"], QByteArray::number(propertiesValue["windchill"]));
|
propertyList["windchill"] = formatNotifString(propertyName["windchill"], QByteArray::number(propertiesValue["windchill"]));
|
||||||
@@ -478,6 +479,11 @@ void Pws2mqtt::parseData(QList<std::pair<QString, QString>> queryList)
|
|||||||
//bool changed = false;
|
//bool changed = false;
|
||||||
quint8 aPriority= 0;
|
quint8 aPriority= 0;
|
||||||
|
|
||||||
|
debug(DEBUGMACRO, "looping for propertyList", DEBUG);
|
||||||
|
for (auto [name,value]: propertyList.asKeyValueRange())
|
||||||
|
{
|
||||||
|
debug(DEBUGMACRO, "name = " + name + " => value = " + value);
|
||||||
|
}
|
||||||
debug(DEBUGMACRO, "looping to fill notif", DEBUG);
|
debug(DEBUGMACRO, "looping to fill notif", DEBUG);
|
||||||
|
|
||||||
QTime currentTime = QTime::currentTime();
|
QTime currentTime = QTime::currentTime();
|
||||||
@@ -503,12 +509,13 @@ void Pws2mqtt::parseData(QList<std::pair<QString, QString>> queryList)
|
|||||||
debug(DEBUGMACRO, "parseData: Returning", DEBUG);
|
debug(DEBUGMACRO, "parseData: Returning", DEBUG);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString listProperties2notify (QMap <QByteArray, QString> propertyList, QHash <QByteArray, quint8> priority, quint8 minAlert)
|
QString listProperties2notify (const QMap <QByteArray, QString> &propertyList, QHash <QByteArray, quint8> priority, quint8 minAlert)
|
||||||
{
|
{
|
||||||
static QHash <QByteArray, quint8> announced = {};
|
static QHash <QByteArray, quint8> announced = {};
|
||||||
QString notif = "";
|
QString notif = "";
|
||||||
for (auto [name, value]: propertyList.asKeyValueRange())
|
for (auto [name, value]: propertyList.asKeyValueRange())
|
||||||
{
|
{
|
||||||
|
debug(DEBUGMACRO, "property : " + name + " value : " + value, DEBUG);
|
||||||
if (name != "prevision")
|
if (name != "prevision")
|
||||||
{
|
{
|
||||||
//if (precPropertyList.contains(name))
|
//if (precPropertyList.contains(name))
|
||||||
@@ -518,6 +525,7 @@ QString listProperties2notify (QMap <QByteArray, QString> propertyList, QHash <
|
|||||||
if (minAlert == 0)
|
if (minAlert == 0)
|
||||||
{
|
{
|
||||||
notif += propertyList[name];
|
notif += propertyList[name];
|
||||||
|
debug(DEBUGMACRO, "notif : " + notif, DEBUG);
|
||||||
}else if (priority[name] >= minAlert)
|
}else if (priority[name] >= minAlert)
|
||||||
{
|
{
|
||||||
if (announced.contains(name) and priority.contains(name))
|
if (announced.contains(name) and priority.contains(name))
|
||||||
@@ -526,6 +534,7 @@ QString listProperties2notify (QMap <QByteArray, QString> propertyList, QHash <
|
|||||||
{
|
{
|
||||||
notif += propertyList[name];
|
notif += propertyList[name];
|
||||||
announced[name] = priority[name];
|
announced[name] = priority[name];
|
||||||
|
debug(DEBUGMACRO, "notif : " + notif, DEBUG);
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
debug (DEBUGMACRO, name + " : déjà annoncé = " + announced[name] + " nouvelle valeur = " + priority[name], INFO);
|
debug (DEBUGMACRO, name + " : déjà annoncé = " + announced[name] + " nouvelle valeur = " + priority[name], INFO);
|
||||||
|
|||||||
+1
-1
@@ -68,5 +68,5 @@ void rotateAndSaveImage(const QString &inputPath, const QString &outputPath, qre
|
|||||||
double windChill(double airT, double vent);
|
double windChill(double airT, double vent);
|
||||||
double calculerHumidex(double temperature, double humiditeRelative);
|
double calculerHumidex(double temperature, double humiditeRelative);
|
||||||
void notify (QString notif, QString priority = "low", QString inputPath = "", QString tag = "");
|
void notify (QString notif, QString priority = "low", QString inputPath = "", QString tag = "");
|
||||||
QString listProperties2notify (QMap <QByteArray, QString> propertyList, QHash <QByteArray, quint8> priority, quint8 minAlert = 0);
|
QString listProperties2notify (const QMap<QByteArray, QString> &propertyList, QHash <QByteArray, quint8> priority, quint8 minAlert = 0);
|
||||||
|
|
||||||
Reference in new issue
Block a user