From d8ebd65ebadd7caf9d6e0843bd56863b1b8758d9 Mon Sep 17 00:00:00 2001 From: Patrick Schurig Date: Mon, 8 Jun 2026 10:39:31 +0200 Subject: [PATCH] =?UTF-8?q?[upstream-fix]=20maxChargingCurrent=20uint?= =?UTF-8?q?=E2=86=92double=20+=20INCLUDEPATH=20energyplugin.pri=20+=20flip?= =?UTF-8?q?=20ETM=20vers=20pri?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - tests/mocks/plugins/energymocks/integrationpluginenergymocks.json : maxChargingCurrent "type": "uint" → "type": "double" sur les 3 Thing classes (charger, chargerPhaseSwitching, simpleCharger) — nymea 1.15 a changé le type de l'interface evcharger. - energyplugin/energyplugin.pri : INCLUDEPATH += $$PWD — rend energyplugin/ accessible aux consommateurs du .pri (simulation, tests) qui compilent les sources ETM. - energyplugin/energyplugin.pro : le toggle ETM_ARBITRATOR déplacé dans energyplugin.pri (unique point de contrôle propagé à plugin ET simulation). - tests/auto/simulation/experience/energyexperienceenergymock.cpp : même flip que energypluginnymea.cpp — instancie EnergyArbitrator si ETM_ARBITRATOR est défini. Co-Authored-By: Claude Sonnet 4.6 --- energyplugin/energyplugin.pri | 9 +++++++++ energyplugin/energyplugin.pro | 4 ---- .../experience/energyexperienceenergymock.cpp | 10 ++++++++++ .../energymocks/integrationpluginenergymocks.json | 6 +++--- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/energyplugin/energyplugin.pri b/energyplugin/energyplugin.pri index 216967a..cc18c4f 100644 --- a/energyplugin/energyplugin.pri +++ b/energyplugin/energyplugin.pri @@ -1,3 +1,12 @@ +# Rend les headers du répertoire energyplugin/ accessibles aux consommateurs +# (simulation, tests) qui incluent ce .pri depuis un autre répertoire. +INCLUDEPATH += $$PWD + +# [ETM] Activate ETM arbitrator — replaces SmartChargingManager::update() with EnergyArbitrator. +# Propagé à tous les consommateurs du .pri (plugin + simulation + tests). +# Uncommenter pour activer. Commité DÉSACTIVÉ jusqu'à preuve iso (3b-iv). +# DEFINES += ETM_ARBITRATOR + greaterThan(QT_MAJOR_VERSION, 5) { message("Building using Qt6 support") CONFIG *= c++17 diff --git a/energyplugin/energyplugin.pro b/energyplugin/energyplugin.pro index 0f5c03d..375880d 100644 --- a/energyplugin/energyplugin.pro +++ b/energyplugin/energyplugin.pro @@ -7,10 +7,6 @@ PKGCONFIG += nymea nymea-energy QT *= network -# [ETM] Activate ETM arbitrator — replaces SmartChargingManager::update() with EnergyArbitrator. -# Uncomment to enable. Committed DISABLED until iso-functional proof (3b-iv). -# DEFINES += ETM_ARBITRATOR - include(energyplugin.pri) HEADERS += \ diff --git a/tests/auto/simulation/experience/energyexperienceenergymock.cpp b/tests/auto/simulation/experience/energyexperienceenergymock.cpp index 2692d92..df705a6 100644 --- a/tests/auto/simulation/experience/energyexperienceenergymock.cpp +++ b/tests/auto/simulation/experience/energyexperienceenergymock.cpp @@ -32,6 +32,9 @@ #include "../../../energyplugin/nymeaenergyjsonhandler.h" #include "../../../energyplugin/energymanagerconfiguration.h" #include "../../../energyplugin/spotmarket/spotmarketmanager.h" +#ifdef ETM_ARBITRATOR +#include "../../../energyplugin/etm/energyarbitrator.h" +#endif #include #include @@ -81,7 +84,14 @@ void ExperiencePluginEnergyMock::init() EnergyManagerConfiguration *configuration = new EnergyManagerConfiguration(this); QNetworkAccessManager *networkManager = new QNetworkAccessManager(this); m_spotMarketManager = new SpotMarketManager(networkManager, this); +// [ETM] BEGIN — flip identique à energypluginnymea.cpp +#ifdef ETM_ARBITRATOR + qCDebug(dcEnergyExperience()) << "ETM_ARBITRATOR actif — EnergyArbitrator chargé (simulation)."; + m_smartChargingManager = new EnergyArbitrator(m_energyManager, thingManager(), m_spotMarketManager, configuration, this); +#else m_smartChargingManager = new SmartChargingManager(m_energyManager, thingManager(), m_spotMarketManager, configuration, this); +#endif +// [ETM] END m_nymeaEnergyJsonHandler = new NymeaEnergyJsonHandler(m_spotMarketManager, m_smartChargingManager, this); jsonRpcServer()->registerExperienceHandler(m_nymeaEnergyJsonHandler, 0, 2); diff --git a/tests/mocks/plugins/energymocks/integrationpluginenergymocks.json b/tests/mocks/plugins/energymocks/integrationpluginenergymocks.json index 69e41ed..39797a9 100644 --- a/tests/mocks/plugins/energymocks/integrationpluginenergymocks.json +++ b/tests/mocks/plugins/energymocks/integrationpluginenergymocks.json @@ -194,7 +194,7 @@ "name": "maxChargingCurrent", "displayName": "Maximum charging current", "displayNameAction": "Set maximum charging current", - "type": "uint", + "type": "double", "defaultValue":6, "minValue": 6, "maxValue": 32, @@ -387,7 +387,7 @@ "name": "maxChargingCurrent", "displayName": "Maximum charging current", "displayNameAction": "Set maximum charging current", - "type": "uint", + "type": "double", "defaultValue":6, "minValue": 6, "maxValue": 32, @@ -584,7 +584,7 @@ "name": "maxChargingCurrent", "displayName": "Maximum charging current", "displayNameAction": "Set maximum charging current", - "type": "uint", + "type": "double", "defaultValue":6, "minValue": 6, "maxValue": 32,