debug prevision
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 9.0.1, 2025-10-05T19:33:41. -->
|
||||
<!-- Written by QtCreator 9.0.1, 2025-10-05T23:00:49. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
@@ -90,7 +90,7 @@
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 6.4.1 (qt6)</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Qt 6.4.1 (qt6)</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{17b0ba8e-e6fe-4c71-98eb-9b4d3bcc4307}</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||
@@ -209,7 +209,7 @@
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseTerminal">false</value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default">/home/daniel/develop/pws2mqtt-qt/build/Release</value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default">/home/daniel/develop/pws2mqtt-qt/build/debug</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
||||
</valuemap>
|
||||
|
35
pws2mqtt.cpp
35
pws2mqtt.cpp
@@ -245,6 +245,7 @@ void Pws2mqtt::parseData(QList<std::pair<QString, QString>> queryList)
|
||||
QString msg = "";
|
||||
static QDateTime timeWind = QDateTime::currentDateTime().addSecs(-600);
|
||||
quint8 windPriority = 1;
|
||||
static QString msgNotif;
|
||||
|
||||
debug (DEBUGMACRO, name + " : " + QByteArray::number(propertyValue), DEBUG);
|
||||
propertyValue = round(mphTokmh(value.toFloat()));
|
||||
@@ -269,8 +270,7 @@ void Pws2mqtt::parseData(QList<std::pair<QString, QString>> queryList)
|
||||
propertyList["rafales"] = msg;
|
||||
msg.prepend("Rafales - ");
|
||||
}
|
||||
QString msgNotif = formatNotifString (msg, propertyName[name].second , QByteArray::number(propertyValue));
|
||||
notif += msgNotif;
|
||||
msgNotif = formatNotifString (msg, propertyName[name].second , QByteArray::number(propertyValue));
|
||||
setPriority(priority, windPriority);
|
||||
|
||||
propertyList["winddir"] = winddir;
|
||||
@@ -286,6 +286,8 @@ void Pws2mqtt::parseData(QList<std::pair<QString, QString>> queryList)
|
||||
|
||||
debug (DEBUGMACRO, "Notif = *" + notif + "*", DEBUG);
|
||||
}
|
||||
notif += msgNotif;
|
||||
|
||||
/*}else if (name == "windgustmph")
|
||||
{
|
||||
propertyValue = round(mphTokmh(pair.second.toFloat()));
|
||||
@@ -314,9 +316,10 @@ void Pws2mqtt::parseData(QList<std::pair<QString, QString>> queryList)
|
||||
if (compare (propertyList[name].toFloat(), propertyValue, ecart))
|
||||
{
|
||||
//notif += formatNotifString (propertyName[name].first, propertyName[name].second , value);
|
||||
QString pluviosite = getPluviosite(propertyValue);
|
||||
priority = setPriority (priority, 4);
|
||||
//debug (DEBUGMACRO, "Notif = #" + notif + "#", DEBUG);
|
||||
propertyList[name] = propertyValue;
|
||||
propertyList[name] = pluviosite + " : " + QString::number(round(propertyValue*100)/100);
|
||||
changed = true;
|
||||
}
|
||||
}else if (name == "baromin")
|
||||
@@ -345,7 +348,7 @@ void Pws2mqtt::parseData(QList<std::pair<QString, QString>> queryList)
|
||||
prevision = newPrevision;
|
||||
propertyList["prevision"] = prevision;
|
||||
//debug (DEBUGMACRO, "Notif = #" + notif + "#", DEBUG);
|
||||
changed = true;
|
||||
//changed = true;
|
||||
}
|
||||
}
|
||||
notif += prevision + " \n";
|
||||
@@ -430,6 +433,26 @@ void Pws2mqtt::parseData(QList<std::pair<QString, QString>> queryList)
|
||||
debug(DEBUGMACRO, "parseData: Returning", DEBUG);
|
||||
}
|
||||
|
||||
QString getPluviosite(double value)
|
||||
{
|
||||
if (value < 1)
|
||||
{
|
||||
return "Pluie fine, bruine";
|
||||
}else if (value < 5)
|
||||
{
|
||||
return "Pluie Modérée";
|
||||
}else if (value < 15)
|
||||
{
|
||||
return "Pluie forte";
|
||||
}else if (value > 30)
|
||||
{
|
||||
return "Évènement extrème";
|
||||
}else if (value > 15)
|
||||
{
|
||||
return "Forte pluie";
|
||||
}
|
||||
}
|
||||
|
||||
QString previsionMeteo(double currentPressure, double variation3h, quint8 &priority)
|
||||
{
|
||||
QString variation = "";
|
||||
@@ -509,6 +532,10 @@ QString pressureVariation(double currentPressure, quint8 &priority)
|
||||
|
||||
debug(DEBUGMACRO, "ending pressureVariation with result", DEBUG);
|
||||
return prevision;
|
||||
}else
|
||||
{
|
||||
static QTime time = QTime::currentTime();
|
||||
return "Première prévision à " + time.addSecs((NB_MESURES_3H - historiquePressions.size()) * 30).toString();
|
||||
}
|
||||
debug(DEBUGMACRO, "ending pressureVariation no result", DEBUG);
|
||||
return "";
|
||||
|
@@ -60,6 +60,7 @@ void notify (QString notif, QString priority = "low", QString inputPath = "");
|
||||
quint8 setPriority (quint8 currentPriority, quint8 newPriority);
|
||||
QString previsionMeteo(double currentPressure, double variation3h, quint8 &priority);
|
||||
QString pressureVariation(double currentPressure, quint8 &priority);
|
||||
QString getPluviosite(double value);
|
||||
void rotateAndSaveImage(const QString &inputPath, const QString &outputPath, qreal angle=0);
|
||||
|
||||
#endif // PWS2MQTT_H
|
||||
|
Reference in New Issue
Block a user