Add Kostal vendor and fix block override of protected method
parent
0abc756a3d
commit
2d732359f6
|
|
@ -55,7 +55,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecFlowBatteryModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecFlowBatteryModuleModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecFlowBatteryStackModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecFlowBatteryStringModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecFreqWattModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecHfrtcModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecHfrtModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecHfrtxModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecHvrtcModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecHvrtModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecHvrtxModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecIrradianceModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecLfrtcModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecLfrtModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecLfrtxModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecLithiumIonBankModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecLithiumIonModuleModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecLithiumIonStringModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecLvrtcModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecLvrtModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecLvrtxModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecMpptModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecScheduleModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecSecureAcMeterSelectedReadingsModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecStringCombinerAdvancedModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecStringCombinerCurrentModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecTrackerControllerModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecVoltVarModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecVoltWattModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ public:
|
|||
void processBlockData(const QVector<quint16> blockData) override;
|
||||
|
||||
protected:
|
||||
void initDataPoints();
|
||||
void initDataPoints() override;
|
||||
|
||||
private:
|
||||
SunSpecWattPfModel *m_parentModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -417,6 +417,7 @@ void SunSpecConnection::scanModelsOnBaseRegister(quint16 offset)
|
|||
scanModelsOnBaseRegister(offset + 2 + modelLength);
|
||||
} else {
|
||||
qCWarning(dcSunSpec()) << "Error occured while reading model header from" << this << "using offset" << offset << m_modbusTcpClient->errorString();
|
||||
// FIXME: check if models have already been found, finish with success in that case so we show at least the models found so far...
|
||||
setDiscoveryRunning(false);
|
||||
emit discoveryFinished(false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -867,7 +867,7 @@ def writeRepeatingBlockClassDefinition(fileDescriptor, className, modelId):
|
|||
# Protected members
|
||||
writeLine(fileDescriptor)
|
||||
writeLine(fileDescriptor, 'protected:')
|
||||
writeLine(fileDescriptor, ' void initDataPoints();')
|
||||
writeLine(fileDescriptor, ' void initDataPoints() override;')
|
||||
|
||||
# Private members
|
||||
writeLine(fileDescriptor)
|
||||
|
|
|
|||
|
|
@ -66,20 +66,25 @@ void IntegrationPluginSunSpec::init()
|
|||
// SunSpec connection params
|
||||
m_connectionIpParamTypeIds.insert(sunspecConnectionThingClassId, sunspecConnectionThingIpAddressParamTypeId);
|
||||
m_connectionIpParamTypeIds.insert(solarEdgeConnectionThingClassId, solarEdgeConnectionThingIpAddressParamTypeId);
|
||||
m_connectionIpParamTypeIds.insert(kostalConnectionThingClassId, kostalConnectionThingIpAddressParamTypeId);
|
||||
|
||||
m_connectionPortParamTypeIds.insert(sunspecConnectionThingClassId, sunspecConnectionThingPortParamTypeId);
|
||||
m_connectionPortParamTypeIds.insert(solarEdgeConnectionThingClassId, solarEdgeConnectionThingPortParamTypeId);
|
||||
m_connectionPortParamTypeIds.insert(kostalConnectionThingClassId, kostalConnectionThingPortParamTypeId);
|
||||
|
||||
m_connectionMacAddressParamTypeIds.insert(sunspecConnectionThingClassId, sunspecConnectionThingMacAddressParamTypeId);
|
||||
m_connectionMacAddressParamTypeIds.insert(solarEdgeConnectionThingClassId, solarEdgeConnectionThingMacAddressParamTypeId);
|
||||
m_connectionMacAddressParamTypeIds.insert(kostalConnectionThingClassId, kostalConnectionThingMacAddressParamTypeId);
|
||||
|
||||
m_connectionSlaveIdParamTypeIds.insert(sunspecConnectionThingClassId, sunspecConnectionThingSlaveIdParamTypeId);
|
||||
m_connectionSlaveIdParamTypeIds.insert(solarEdgeConnectionThingClassId, solarEdgeConnectionThingSlaveIdParamTypeId);
|
||||
m_connectionSlaveIdParamTypeIds.insert(kostalConnectionThingClassId, kostalConnectionThingSlaveIdParamTypeId);
|
||||
|
||||
// Connected state for all things
|
||||
m_connectedStateTypeIds.insert(sunspecConnectionThingClassId, sunspecConnectionConnectedStateTypeId);
|
||||
m_connectedStateTypeIds.insert(solarEdgeConnectionThingClassId, solarEdgeConnectionConnectedStateTypeId);
|
||||
m_connectedStateTypeIds.insert(solarEdgeBatteryThingClassId, solarEdgeBatteryConnectedStateTypeId);
|
||||
m_connectedStateTypeIds.insert(kostalConnectionThingClassId, kostalConnectionConnectedStateTypeId);
|
||||
|
||||
m_connectedStateTypeIds.insert(sunspecStorageThingClassId, sunspecStorageConnectedStateTypeId);
|
||||
m_connectedStateTypeIds.insert(sunspecSinglePhaseInverterThingClassId, sunspecSinglePhaseInverterConnectedStateTypeId);
|
||||
|
|
@ -162,6 +167,8 @@ void IntegrationPluginSunSpec::discoverThings(ThingDiscoveryInfo *info)
|
|||
title += networkDeviceInfo.address().toString() + " (" + networkDeviceInfo.hostName() + ")";
|
||||
}
|
||||
} else {
|
||||
// Kostal does not provide usefull information for filterin in the discovery
|
||||
|
||||
// Generic or not discoverable sunspec connection, show all network results
|
||||
if (networkDeviceInfo.hostName().isEmpty()) {
|
||||
title += networkDeviceInfo.address().toString();
|
||||
|
|
@ -205,7 +212,7 @@ void IntegrationPluginSunSpec::setupThing(ThingSetupInfo *info)
|
|||
Thing *thing = info->thing();
|
||||
qCDebug(dcSunSpec()) << "Setup thing" << thing->name();
|
||||
|
||||
if (thing->thingClassId() == sunspecConnectionThingClassId || thing->thingClassId() == solarEdgeConnectionThingClassId) {
|
||||
if (thing->thingClassId() == sunspecConnectionThingClassId || thing->thingClassId() == solarEdgeConnectionThingClassId || thing->thingClassId() == kostalConnectionThingClassId) {
|
||||
setupConnection(info);
|
||||
} else if (thing->thingClassId() == sunspecThreePhaseInverterThingClassId || thing->thingClassId() == sunspecSplitPhaseInverterThingClassId || thing->thingClassId() == sunspecSinglePhaseInverterThingClassId ) {
|
||||
Thing *parentThing = myThings().findById(thing->parentId());
|
||||
|
|
@ -287,7 +294,7 @@ void IntegrationPluginSunSpec::thingRemoved(Thing *thing)
|
|||
{
|
||||
qCDebug(dcSunSpec()) << "Thing removed" << thing->name();
|
||||
|
||||
if (thing->thingClassId() == sunspecConnectionThingClassId) {
|
||||
if (m_sunSpecConnections.contains(thing->id())) {
|
||||
SunSpecConnection *connection = m_sunSpecConnections.take(thing->id());
|
||||
if (connection)
|
||||
connection->deleteLater();
|
||||
|
|
@ -360,6 +367,8 @@ void IntegrationPluginSunSpec::processDiscoveryResult(Thing *thing, SunSpecConne
|
|||
continue;
|
||||
}
|
||||
|
||||
// TODO: Make sure to not add duplicated models like inverter + inverter float..
|
||||
|
||||
switch (model->modelId()) {
|
||||
case SunSpecModelFactory::ModelIdCommon:
|
||||
// Skip the common model, we already handled this one for each thing model
|
||||
|
|
|
|||
|
|
@ -1463,6 +1463,61 @@
|
|||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "kostal",
|
||||
"displayName": "KOSTAL Solar Electric",
|
||||
"id": "862d1ebf-cb78-4c55-89b2-819fddfd9acd",
|
||||
"thingClasses": [
|
||||
{
|
||||
"name": "kostalConnection",
|
||||
"displayName": "Kostal SunSpec connection",
|
||||
"id": "0cad2dca-66ac-489c-8443-074e32aa27a0",
|
||||
"createMethods": [ "User", "Discovery" ],
|
||||
"interfaces": ["gateway"],
|
||||
"paramTypes": [
|
||||
{
|
||||
"id": "9fe10047-b2fd-460b-88ad-7f00977efc57",
|
||||
"name":"ipAddress",
|
||||
"displayName": "IP address",
|
||||
"type": "QString",
|
||||
"defaultValue": "127.0.0.1"
|
||||
},
|
||||
{
|
||||
"id": "047b048d-2e93-4129-80df-231688436da4",
|
||||
"name":"macAddress",
|
||||
"displayName": "MAC address",
|
||||
"type": "QString",
|
||||
"defaultValue": "00:00:00:00:00:00"
|
||||
},
|
||||
{
|
||||
"id": "bf87f540-ce2e-4c35-af62-942da7be2f80",
|
||||
"name":"port",
|
||||
"displayName": "Port",
|
||||
"type": "int",
|
||||
"defaultValue": 502
|
||||
},
|
||||
{
|
||||
"id": "48b133da-cce3-47f3-9c7c-470026af7829",
|
||||
"name":"slaveId",
|
||||
"displayName": "Slave ID",
|
||||
"type": "int",
|
||||
"defaultValue": 1
|
||||
}
|
||||
],
|
||||
"stateTypes":[
|
||||
{
|
||||
"id": "b9c52ae8-cb9b-4742-8e9a-450dce3a009f",
|
||||
"name": "connected",
|
||||
"displayName": "Connected",
|
||||
"displayNameEvent": "Connected changed",
|
||||
"type": "bool",
|
||||
"defaultValue": false,
|
||||
"cached": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue