data structs and interface 'inputs' supplied

This commit is contained in:
Uwe Jakobeit
2026-04-06 01:03:19 +02:00
parent 12b21daa2d
commit 3ce5c867c5

View File

@@ -18,12 +18,127 @@ Notes: [Any relevant details, such as dependencies, usage examples, or kno
#define HeadlineOverheat Kennfeld_Ueberhitzung
#define HeadlineOverheatDefault Kennfeld_Ueberhitzung_Default
// Inputs for the component 'control-algorithm', not (only) to be seen als physical inputs e.g. from a sensor
typedef struct Inputs
{
struct BinInputs {
// Eingangswerte aus bool_inXX / real_inXX / reset_flag
bool reset_flag{};
bool Sammelalarm_quittiert{};
bool Tuer_offen{};
bool Sollwert_Feuchte_aktiv{};
bool Steuerkontakt_Standby{};
bool Steuerkontakt_Befeuchtung_aus{};
bool Steuerkontakt_Entfeuchtung_aus{};
bool Entleerbehaelter_Oben{};
bool Wasserkanister_leer{};
bool Entleerbehaelter_Unten{};
bool Sammelalarm{};
} bin;
class DataModel{
struct AnalogInputs {
double Istwert_Temperatur{};
double Sollwert_Temperatur{};
double Temperaturband{};
double Istwert_Ueberwachungsregler{};
double Klasse_Ueberwachungsregler{};
double Grenzwert_Untertemperatur{};
double Istwert_Feuchte{};
double Sollwert_Feuchte{};
double Feuchteband{};
double Sollwert_Luefter{};
double Istwert_Temperatur_Tuer{};
double Istwert_Temperatur_Verdampferausgang{};
double Temperatur_Feuchtemodul{};
double Bandalarm_nach{};
double Betauungsschutz{};
double real_in11{}; // du nutzt real_in11 später direkt in alarm_15 ?? uj - todo : Kann das weg?
} analog;
}Input_t;
typedef struct Outputs
{
struct AnalogOutputs {
// real_outXX (nur die, die du im ST setzt)
double real_out01{};
double real_out02{};
double real_out04{};
double real_out05{};
double real_out06{};
double real_out07{};
double real_out08{};
double real_out09{};
double real_out10{};
double real_out11{};
double real_out12{};
double real_out13{};
double real_out14{};
double real_out16{};
double Stellgrad_Feuchtemodul{}; // ...out17
double real_out18{};
double real_out19{};
double real_out20{};
double real_out21{};
double real_out25{};
double real_out26{};
double Stellgrad_Heizung{};
double Stellgrad_Kuehlung{};
double Stellgrad_Befeuchtung{};
double Stellgrad_Entfeuchtung{};
double Counter_Tuer{};
} analog;
struct BinOutputs {
// bool_outXX
bool bool_out01{};
bool bool_out02{};
bool bool_out03{};
bool bool_out07{};
bool bool_out09{};
bool bool_out11{};
bool bool_out12{};
bool bool_out13{};
bool bool_out14{};
bool bool_out16{};
bool bool_out17{};
bool bool_out18{};
bool bool_out19{};
bool bool_out20{};
bool bool_out21{};
bool bool_out23{};
} bin;
}Output_t;
static constexpr double sampling_time = 0.25;
typedef struct Counter
{
}Counter_t;
class IInputs {
public:
virtual ~IInputs() = default;
// Pure virtual function returning a pointer to a vector
virtual QList<Input_t>* getInputs() = 0;
};
class DataModel: public IInputs
{
public:
DataModel();
QList<Input_t>* getInputs() override;
private:
Input_t input;
QList<Input_t> in{ input };
#ifndef BUILD_TARGET_SOM
QList<QList<double>> Kennfeld_Ueberhitzung;
QList<QList<double>> Kennfeld_Entfeuchtung;
QList<QList<double>> Kennfeld_Regler_Heizung_Xp;
@@ -70,7 +185,14 @@ private:
{1.00, 0.80, 0.60, 0.50, 0.40, 0.35, 0.30, 0.25, 0.20},
{1.00, 0.80, 0.60, 0.50, 0.40, 0.35, 0.30, 0.25, 0.20}};
void* CurrentData(void);
QList<QList<double>> Kennfeld_Sollwert_Feuchte_Limit_List{
{0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100},
{80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
#endif
};