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,