added some comments; minor (prelimnary) structural adaptions
This commit is contained in:
@@ -1,6 +1,20 @@
|
|||||||
|
/*
|
||||||
|
File: Controller.cpp
|
||||||
|
Description: This is a C++ source file containing implementation code for a program or library component.
|
||||||
|
Rev: 0.1
|
||||||
|
Created: 06.04.26
|
||||||
|
Author: Uwe Jakobeit
|
||||||
|
Copyright: Binder GmbH TUT 2026
|
||||||
|
Purpose: Prelimnary version of control algorithm
|
||||||
|
Notes: [Any relevant details, such as dependencies, usage examples, or known issues.]
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "Controller.h"
|
#include "Controller.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef BUILD_TARGET_SOM
|
#ifdef BUILD_TARGET_SOM
|
||||||
#include "application/AppLogic.hpp"
|
#include "application/AppLogic.hpp"
|
||||||
#include "application/Environment.hpp"
|
#include "application/Environment.hpp"
|
||||||
@@ -16,7 +30,8 @@ bool Controller::initialize(const char *configFilePath, appengine::IAppLogic *ap
|
|||||||
auto deviceState = appLogic->deviceState();
|
auto deviceState = appLogic->deviceState();
|
||||||
|
|
||||||
|
|
||||||
|
MV_ Magnet Variable
|
||||||
|
SV_ State Variable
|
||||||
|
|
||||||
// Beispiel:
|
// Beispiel:
|
||||||
SV_Temperatur_Variable_ = deviceState.getVariableByKey("Temperatur_Innenraum");
|
SV_Temperatur_Variable_ = deviceState.getVariableByKey("Temperatur_Innenraum");
|
||||||
@@ -136,11 +151,13 @@ bool Controller::initialize(const char *configFilePath, appengine::IAppLogic *ap
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
void Controller::stepSOM(void)
|
||||||
void Controller::step() {
|
{
|
||||||
#ifdef BUILD_TARGET_SOM
|
#ifdef BUILD_TARGET_SOM
|
||||||
ClimateAlgorithm::Inputs in{};
|
ClimateAlgorithm::Inputs in{};
|
||||||
in.Istwert_Temperatur = FILTERED_TEMP.step(SV_Temperatur_Variable_->toType<double>());
|
in.Istwert_Temperatur = FILTERED_TEMP.step(SV_Temperatur_Variable_->toType<double>());
|
||||||
@@ -210,6 +227,29 @@ void Controller::step() {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Controller::step(void)
|
||||||
|
{
|
||||||
|
#ifdef BUILD_TARGET_SOM
|
||||||
|
|
||||||
|
stepSOM();
|
||||||
|
|
||||||
|
#else
|
||||||
|
stepDesk();
|
||||||
|
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Controller::stepDesk(void)
|
||||||
|
{
|
||||||
|
inputs = model->getInputs();
|
||||||
|
qDebug() << "Tist.: " << inputs->data()->analog.Istwert_Temperatur;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Controller::terminate() {
|
void Controller::terminate() {
|
||||||
#ifdef BUILD_TARGET_SOM
|
#ifdef BUILD_TARGET_SOM
|
||||||
subscriptions_.clear();
|
subscriptions_.clear();
|
||||||
@@ -222,3 +262,39 @@ ControllerBase *create() {
|
|||||||
return new Controller;
|
return new Controller;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// initialize algorithm according to configuration ( not yet available 02.04.26 )
|
||||||
|
// return plainly true (until otherwise)
|
||||||
|
bool Controller::initialize(const char *configFilePath)
|
||||||
|
{
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
// uncomment when available
|
||||||
|
// result = (configFilePath != (const char *) nullptr);
|
||||||
|
|
||||||
|
// DataModel* model = new DataModel;
|
||||||
|
// QList<Input_t>* inputs;
|
||||||
|
// model->getInputs();
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Controller::initialize( QList<Input_t>* inputs)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Controller::initialize( DataModel* instance)
|
||||||
|
{
|
||||||
|
model = instance;
|
||||||
|
|
||||||
|
inputs = model->getInputs();
|
||||||
|
|
||||||
|
return inputs != nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user