Compare commits

..

18 Commits

Author SHA1 Message Date
Uwe Jakobeit
e978fcacfa update to reduce repo files 2026-04-06 01:20:57 +02:00
Uwe Jakobeit
ac00c1ee63 cmopany name added 2026-04-06 01:18:47 +02:00
Uwe Jakobeit
152dd86b21 comment for resuming ST-Code review 2026-04-06 01:17:43 +02:00
Uwe Jakobeit
71563cba88 added some comments; minor (prelimnary) structural adaptions 2026-04-06 01:16:09 +02:00
Uwe Jakobeit
144f09ab07 variable name changed for compatibilty 2026-04-06 01:09:03 +02:00
Uwe Jakobeit
070de3d2d3 added some comments and formatting 2026-04-06 01:05:35 +02:00
Uwe Jakobeit
3ce5c867c5 data structs and interface 'inputs' supplied 2026-04-06 01:03:19 +02:00
Uwe Jakobeit
12b21daa2d model interface returns data 2026-04-06 01:01:38 +02:00
Uwe Jakobeit
f0107377db plant model supplied 2026-04-06 00:58:00 +02:00
Uwe Jakobeit
2c427b6a99 include path supplied 2026-04-06 00:53:27 +02:00
Uwe Jakobeit
c220df2df9 comment added 2026-04-06 00:50:27 +02:00
Uwe Jakobeit
50a0bc749e updated to reduce files to commit 2026-04-06 00:24:31 +02:00
Uwe Jakobeit
1f8fe3af50 KS ( plant) taken from earlier example for a complete environment; some formatting on curly brackets and indentations 2026-04-06 00:07:33 +02:00
Uwe Jakobeit
858aa47d00 static_cast supplied for definition 'MAX'; take-over ST-code comments for orientation 2026-04-05 15:17:27 +02:00
Uwe Jakobeit
9c4eb6ea1d Comments on magic numbers, some formatting; take-over comments from ST-Code for orientation 2026-04-04 23:26:45 +02:00
Uwe Jakobeit
628076ead6 Comments on magic numbers & cast restored 2026-04-04 22:32:01 +02:00
Uwe Jakobeit
fe49b993b4 Some reconstruction and formatting 2026-04-04 22:13:21 +02:00
Uwe Jakobeit
47196263f8 Mainly improved readability; formatting of if-else-blocks (curly brackets) indentation of logical context etc 2026-04-04 19:28:00 +02:00
26 changed files with 2662 additions and 2472 deletions

12
.gitignore vendored
View File

@@ -11,12 +11,24 @@ CMakeCache.*
app/.qtcreator/CMakeLists.txt.user
app/CMakeFiles/**
app/app_lib_autogen/*
app/app_autogen/*
app/app_lib_autogen/*
app/meta_types/**
app/libapp_lib.a
app/*.cmake
app/app
controller/CMakeFiles/*
controller/*.cmake
controller/ctrl_algo_autogen/*
controller/libctrl_algo.so
tests/CMakeFiles/*
tests/*.json
tests/*.cmake
tests/tests
*.*swp
.cmake/**

View File

@@ -19,6 +19,7 @@ qt_add_library(app_lib STATIC
datamodel.h datamodel.cpp
dataset.h dataset.cpp
util.h util.cpp
TestModel.cpp
text-templates.h

196
app/TestModel.cpp Executable file
View File

@@ -0,0 +1,196 @@
#include <vector>
#include <array>
#include <iostream>
#include <chrono>
#include <thread>
class HeatModel
{
public:
using State = std::array<double,3>;
HeatModel(State x0,int log_size=600)
{
T_hist_.reserve(log_size);
log_size_=log_size;
log_counter_= 0;
T_=x0;
};
void initialize(double T_start,double T_amb)
{
T_start_ = T_start;
T_amb_ = T_amb;
T_Air_ = T_amb;
}
// Log the Temperature. Return true if log is big enough, return false if log is already full
//you can use this as a timer (while (log(){}))
bool log()
{
if (log_counter_< log_size_-1)
{
T_hist_.push_back(T_Air_);
log_counter_++;
std::cout <<"T="<<T_Air_<<"\n";
return true;
}
else
{
T_hist_.push_back(T_Air_);
log_counter_++;
std::cout<<"Log exceeded Reservation Limit \n";
return false;
}
}
double get_Temp()
{
return T_Air_;
}
// You can call stepfunction with Bool Parameter(stepPWM) if you have PWM output, or with double parameter
// if you have normalized heating Power (0,1) (stepPower)
// Call this Function at least every 250ms (cycletime of Algortihm)
void stepPWM(double dt, bool u)
{
double u_double;
if (u)
{
u_double=1.0;
}
else
{
u_double=0.0;
}
u_double = u_double *1000.0;
const State k1 = Func(T_, u_double);
const State k2 = Func(addScaled(T_, k1, 0.5 * dt), u_double);
const State k3 = Func(addScaled(T_, k2, 0.5 * dt), u_double);
const State k4 = Func(addScaled(T_, k3, dt), u_double);
for (int i = 0; i < 3; ++i)
{
T_[i] += (dt / 6.0) * (k1[i] + 2.0 * k2[i] + 2.0 * k3[i] + k4[i]);
}
T_Air_=T_[0];
}
void stepPower(double dt, double u)
{
u = u *1000.0;
const State k1 = Func(T_, u);
const State k2 = Func(addScaled(T_, k1, 0.5 * dt), u);
const State k3 = Func(addScaled(T_, k2, 0.5 * dt), u);
const State k4 = Func(addScaled(T_, k3, dt), u);
for (int i = 0; i < 3; ++i)
{
T_[i] += (dt / 6.0) * (k1[i] + 2.0 * k2[i] + 2.0 * k3[i] + k4[i]);
}
T_Air_=T_[0];
}
private:
double T_start_;
int log_size_;
double T_Air_;
double T_amb_;
int log_counter_;
std::vector<int> T_hist_;
State T_;
/*
LTI System Matrices for FP56
A =
x1 x2 x3
x1 -0.007659 0.003217 0.004442
x2 0.08422 -0.08422 0
x3 0.005135 0 -0.005856
B =
u1
x1 0
x2 0.008313
x3 0
C =
x1 x2 x3
y1 1 0 0
D =
u1
y1 0 */
const std::array<std::array<double, 3>, 3> A_{{
{ -0.007659, 0.003217, 0.00442 },
{ 0.08422, -0.08422, 0.0 },
{ 0.005135, 0.0, -0.005856 }
}};
const std::vector<double> B_{0.0,0.008313, 0.00};
const std::vector<double> C_{1.0, 0.0, 0.0};
static State addScaled(const State& x, const State& dx, double scale)
{
State out{};
for (int i = 0; i < 3; ++i)
{
out[i] = x[i] + scale * dx[i];
}
return out;
}
State Func(const State& x,double u)const
{
State dx=matVec(A_,x);
for (int i=0;i<3;i++)
{
dx[i]+=B_[i]*u;
}
return dx;
}
static State matVec(const std::array<std::array<double, 3>, 3>& M, const State& x)
{
State y{};
for (int i= 0; i < 3; ++i)
{
double sum = 0.0;
for (int j = 0; j < 3; ++j)
{
sum += M[i][j] * x[j];
}
y[i] = sum;
}
return y;
}
};
#define SINGLE_APP 1
#if SINGLE_APP
int main(){
HeatModel::State x0={22.0,22.0,22.0};
int STEP_TIME=50; // dt in milliseconds
// Heatmodel(state starting_Values, size_of_log)
HeatModel TestModel(x0,5);
std::vector<double> temp;
temp.reserve(6000);
bool running = true;
int counter=0;
while (running){
TestModel.stepPower(STEP_TIME/1000.0,1.0);
temp.push_back(TestModel.get_Temp());
counter++;
//logg every Minute --> simulate for 5 minutes
if (counter >=10){
running=TestModel.log();
counter = 0;
}
std::this_thread::sleep_for(std::chrono::milliseconds(STEP_TIME));
}
}
#endif

BIN
app/app

Binary file not shown.

View File

@@ -1,5 +0,0 @@
app_autogen/timestamp: \
/home/k4/tmp/bbr-algo/BinderBeispielRegler/app/CMakeLists.txt \
/home/k4/tmp/bbr-algo/BinderBeispielRegler/app/main.cpp \
/usr/local/share/cmake-4.3/Modules/GNUInstallDirs.cmake \
/usr/local/bin/cmake

View File

@@ -1,473 +0,0 @@
#define __DBL_MIN_EXP__ (-1021)
#define __LDBL_MANT_DIG__ 64
#define __cpp_nontype_template_parameter_auto 201606L
#define __UINT_LEAST16_MAX__ 0xffff
#define __FLT16_HAS_QUIET_NAN__ 1
#define __ATOMIC_ACQUIRE 2
#define __FLT128_MAX_10_EXP__ 4932
#define __FLT_MIN__ 1.17549435082228750796873653722224568e-38F
#define __GCC_IEC_559_COMPLEX 2
#define __cpp_aggregate_nsdmi 201304L
#define __UINT_LEAST8_TYPE__ unsigned char
#define __SIZEOF_FLOAT80__ 16
#define __BFLT16_DENORM_MIN__ 9.18354961579912115600575419704879436e-41BF16
#define __INTMAX_C(c) c ## L
#define __CHAR_BIT__ 8
#define __UINT8_MAX__ 0xff
#define __SCHAR_WIDTH__ 8
#define __WINT_MAX__ 0xffffffffU
#define __FLT32_MIN_EXP__ (-125)
#define __cpp_static_assert 201411L
#define __BFLT16_MIN_10_EXP__ (-37)
#define __cpp_inheriting_constructors 201511L
#define __ORDER_LITTLE_ENDIAN__ 1234
#define __WCHAR_MAX__ 0x7fffffff
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
#define __GCC_ATOMIC_CHAR_LOCK_FREE 2
#define __GCC_IEC_559 2
#define __FLT32X_DECIMAL_DIG__ 17
#define __FLT_EVAL_METHOD__ 0
#define __cpp_binary_literals 201304L
#define __FLT64_DECIMAL_DIG__ 17
#define __cpp_noexcept_function_type 201510L
#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2
#define __cpp_variadic_templates 200704L
#define __UINT_FAST64_MAX__ 0xffffffffffffffffUL
#define __SIG_ATOMIC_TYPE__ int
#define __DBL_MIN_10_EXP__ (-307)
#define __FINITE_MATH_ONLY__ 0
#define __cpp_variable_templates 201304L
#define __FLT32X_MAX_EXP__ 1024
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
#define __FLT32_HAS_DENORM__ 1
#define __UINT_FAST8_MAX__ 0xff
#define __cpp_rvalue_reference 200610L
#define __cpp_nested_namespace_definitions 201411L
#define __DEC64_MAX_EXP__ 385
#define __INT8_C(c) c
#define __LDBL_HAS_INFINITY__ 1
#define __INT_LEAST8_WIDTH__ 8
#define __cpp_variadic_using 201611L
#define __UINT_LEAST64_MAX__ 0xffffffffffffffffUL
#define __INT_LEAST8_MAX__ 0x7f
#define __cpp_attributes 200809L
#define __cpp_capture_star_this 201603L
#define __SHRT_MAX__ 0x7fff
#define __LDBL_MAX__ 1.18973149535723176502126385303097021e+4932L
#define __FLT64X_MAX_10_EXP__ 4932
#define __cpp_if_constexpr 201606L
#define __BFLT16_MAX_10_EXP__ 38
#define __BFLT16_MAX_EXP__ 128
#define __LDBL_IS_IEC_60559__ 1
#define __FLT64X_HAS_QUIET_NAN__ 1
#define __UINT_LEAST8_MAX__ 0xff
#define __GCC_ATOMIC_BOOL_LOCK_FREE 2
#define __FLT128_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966F128
#define __UINTMAX_TYPE__ long unsigned int
#define __cpp_nsdmi 200809L
#define __BFLT16_DECIMAL_DIG__ 4
#define __linux 1
#define __DEC32_EPSILON__ 1E-6DF
#define __FLT_EVAL_METHOD_TS_18661_3__ 0
#define __UINT32_MAX__ 0xffffffffU
#define __GXX_EXPERIMENTAL_CXX0X__ 1
#define __DBL_DENORM_MIN__ double(4.94065645841246544176568792868221372e-324L)
#define __FLT128_MIN_EXP__ (-16381)
#define __DEC64X_MAX_EXP__ 6145
#define __WINT_MIN__ 0U
#define __FLT128_MIN_10_EXP__ (-4931)
#define __FLT32X_IS_IEC_60559__ 1
#define __INT_LEAST16_WIDTH__ 16
#define __SCHAR_MAX__ 0x7f
#define __FLT128_MANT_DIG__ 113
#define __WCHAR_MIN__ (-__WCHAR_MAX__ - 1)
#define __INT64_C(c) c ## L
#define __GCC_ATOMIC_POINTER_LOCK_FREE 2
#define __ATOMIC_SEQ_CST 5
#define __unix 1
#define __INT_LEAST64_MAX__ 0x7fffffffffffffffL
#define __FLT32X_MANT_DIG__ 53
#define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2
#define __cpp_aligned_new 201606L
#define __FLT32_MAX_10_EXP__ 38
#define __FLT64X_EPSILON__ 1.08420217248550443400745280086994171e-19F64x
#define __STDC_HOSTED__ 1
#define __DEC64_MIN_EXP__ (-382)
#define __cpp_decltype_auto 201304L
#define __DBL_DIG__ 15
#define __STDC_EMBED_EMPTY__ 2
#define __FLT_EPSILON__ 1.19209289550781250000000000000000000e-7F
#define __GXX_WEAK__ 1
#define __SHRT_WIDTH__ 16
#define __FLT32_IS_IEC_60559__ 1
#define __LDBL_MIN__ 3.36210314311209350626267781732175260e-4932L
#define __DBL_IS_IEC_60559__ 1
#define __DEC32_MAX__ 9.999999E96DF
#define __cpp_threadsafe_static_init 200806L
#define __cpp_enumerator_attributes 201411L
#define __FLT64X_DENORM_MIN__ 3.64519953188247460252840593361941982e-4951F64x
#define __FLT32X_HAS_INFINITY__ 1
#define __unix__ 1
#define __INT_WIDTH__ 32
#define __STDC_IEC_559__ 1
#define __STDC_ISO_10646__ 201706L
#define __DECIMAL_DIG__ 21
#define __STDC_IEC_559_COMPLEX__ 1
#define __FLT64_EPSILON__ 2.22044604925031308084726333618164062e-16F64
#define __gnu_linux__ 1
#define __INT16_MAX__ 0x7fff
#define __FLT64_MIN_EXP__ (-1021)
#define __DEC64X_EPSILON__ 1E-33D64x
#define __FLT64X_MIN_10_EXP__ (-4931)
#define __LDBL_HAS_QUIET_NAN__ 1
#define __FLT16_MIN_EXP__ (-13)
#define __FLT64_MANT_DIG__ 53
#define __FLT64X_MANT_DIG__ 64
#define __BFLT16_DIG__ 2
#define __GNUC__ 15
#define __GXX_RTTI 1
#define __MMX__ 1
#define __FLT_HAS_DENORM__ 1
#define __SIZEOF_LONG_DOUBLE__ 16
#define __BIGGEST_ALIGNMENT__ 16
#define __STDC_UTF_16__ 1
#define __FLT64_MAX_10_EXP__ 308
#define __BFLT16_IS_IEC_60559__ 0
#define __FLT16_MAX_10_EXP__ 4
#define __cpp_delegating_constructors 200604L
#define __DBL_MAX__ double(1.79769313486231570814527423731704357e+308L)
#define __cpp_raw_strings 200710L
#define __INT_FAST32_MAX__ 0x7fffffffffffffffL
#define __DBL_HAS_INFINITY__ 1
#define __INT64_MAX__ 0x7fffffffffffffffL
#define __SIZEOF_FLOAT__ 4
#define __HAVE_SPECULATION_SAFE_VALUE 1
#define __cpp_fold_expressions 201603L
#define __DEC32_MIN_EXP__ (-94)
#define __INTPTR_WIDTH__ 64
#define __UINT_LEAST32_MAX__ 0xffffffffU
#define __FLT32X_HAS_DENORM__ 1
#define __INT_FAST16_TYPE__ long int
#define __MMX_WITH_SSE__ 1
#define __LDBL_HAS_DENORM__ 1
#define __SEG_GS 1
#define __BFLT16_EPSILON__ 7.81250000000000000000000000000000000e-3BF16
#define __cplusplus 201703L
#define __cpp_ref_qualifiers 200710L
#define __DEC32_MIN__ 1E-95DF
#define __DEPRECATED 1
#define __cpp_rvalue_references 200610L
#define __DBL_MAX_EXP__ 1024
#define __WCHAR_WIDTH__ 32
#define __FLT32_MAX__ 3.40282346638528859811704183484516925e+38F32
#define __DEC128_EPSILON__ 1E-33DL
#define __FLT16_DECIMAL_DIG__ 5
#define __SSE2_MATH__ 1
#define __ATOMIC_HLE_RELEASE 131072
#define __PTRDIFF_MAX__ 0x7fffffffffffffffL
#define __amd64 1
#define __DEC64X_MAX__ 9.999999999999999999999999999999999E6144D64x
#define __ATOMIC_HLE_ACQUIRE 65536
#define __GNUG__ 15
#define __LONG_LONG_MAX__ 0x7fffffffffffffffLL
#define __SIZEOF_SIZE_T__ 8
#define __BFLT16_HAS_INFINITY__ 1
#define __FLT64X_MIN_EXP__ (-16381)
#define __SIZEOF_WINT_T__ 4
#define __FLT32X_DIG__ 15
#define __LONG_LONG_WIDTH__ 64
#define __cpp_initializer_lists 200806L
#define __FLT32_MAX_EXP__ 128
#define ABI_ID "ELF"
#define __cpp_hex_float 201603L
#define __GXX_ABI_VERSION 1020
#define __FLT_MIN_EXP__ (-125)
#define __GCC_HAVE_DWARF2_CFI_ASM 1
#define __x86_64 1
#define __cpp_lambdas 200907L
#define __INT_FAST64_TYPE__ long int
#define __BFLT16_MAX__ 3.38953138925153547590470800371487867e+38BF16
#define __FLT64_DENORM_MIN__ 4.94065645841246544176568792868221372e-324F64
#define __cpp_template_auto 201606L
#define __FLT16_DENORM_MIN__ 5.96046447753906250000000000000000000e-8F16
#define __FLT128_EPSILON__ 1.92592994438723585305597794258492732e-34F128
#define __FLT64X_NORM_MAX__ 1.18973149535723176502126385303097021e+4932F64x
#define __SIZEOF_POINTER__ 8
#define __SIZE_TYPE__ long unsigned int
#define __LP64__ 1
#define __DBL_HAS_QUIET_NAN__ 1
#define __FLT32X_EPSILON__ 2.22044604925031308084726333618164062e-16F32x
#define __LDBL_MAX_EXP__ 16384
#define __DECIMAL_BID_FORMAT__ 1
#define __FLT64_MIN_10_EXP__ (-307)
#define __FLT16_MIN_10_EXP__ (-4)
#define __FLT64X_DECIMAL_DIG__ 21
#define __DEC128_MIN__ 1E-6143DL
#define __REGISTER_PREFIX__
#define __UINT16_MAX__ 0xffff
#define __FLT128_HAS_INFINITY__ 1
#define __FLT32_MIN__ 1.17549435082228750796873653722224568e-38F32
#define __UINT8_TYPE__ unsigned char
#define __FLT_DIG__ 6
#define __NO_INLINE__ 1
#define __DEC_EVAL_METHOD__ 2
#define __FLT_MANT_DIG__ 24
#define __LDBL_DECIMAL_DIG__ 21
#define __VERSION__ "15.1.0"
#define __UINT64_C(c) c ## UL
#define __cpp_unicode_characters 201411L
#define __DEC64X_MIN__ 1E-6143D64x
#define _STDC_PREDEF_H 1
#define __INT_LEAST32_MAX__ 0x7fffffff
#define __GCC_ATOMIC_INT_LOCK_FREE 2
#define __FLT128_MAX_EXP__ 16384
#define __FLT32_MANT_DIG__ 24
#define __cpp_decltype 200707L
#define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__
#define SIZEOF_DPTR (sizeof(void*))
#define __FLT32X_MIN_EXP__ (-1021)
#define __STDC_IEC_60559_COMPLEX__ 201404L
#define __cpp_aggregate_bases 201603L
#define __BFLT16_MIN__ 1.17549435082228750796873653722224568e-38BF16
#define __FLT128_HAS_DENORM__ 1
#define __FLT32_DECIMAL_DIG__ 9
#define __FLT128_DIG__ 33
#define __INT32_C(c) c
#define __DEC64_EPSILON__ 1E-15DD
#define __ORDER_PDP_ENDIAN__ 3412
#define __DEC128_MIN_EXP__ (-6142)
#define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL
#define __INT_FAST32_TYPE__ long int
#define __UINT_LEAST16_TYPE__ short unsigned int
#define __DEC64X_MANT_DIG__ 34
#define __DEC128_MAX_EXP__ 6145
#define unix 1
#define __DBL_HAS_DENORM__ 1
#define __cpp_rtti 199711L
#define __UINT64_MAX__ 0xffffffffffffffffUL
#define __FLT_IS_IEC_60559__ 1
#define __GNUC_WIDE_EXECUTION_CHARSET_NAME "UTF-32LE"
#define __FLT64X_DIG__ 18
#define __INT8_TYPE__ signed char
#define __cpp_digit_separators 201309L
#define __ELF__ 1
#define __GCC_ASM_FLAG_OUTPUTS__ 1
#define __UINT32_TYPE__ unsigned int
#define __BFLT16_HAS_QUIET_NAN__ 1
#define __FLT_RADIX__ 2
#define __INT_LEAST16_TYPE__ short int
#define __LDBL_EPSILON__ 1.08420217248550443400745280086994171e-19L
#define __UINTMAX_C(c) c ## UL
#define __FLT16_DIG__ 3
#define __k8 1
#define __FLT32X_MIN__ 2.22507385850720138309023271733240406e-308F32x
#define __SIG_ATOMIC_MAX__ 0x7fffffff
#define __cpp_constexpr 201603L
#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2
#define __USER_LABEL_PREFIX__
#define __STDC_IEC_60559_BFP__ 201404L
#define __SIZEOF_PTRDIFF_T__ 8
#define __FLT64X_HAS_INFINITY__ 1
#define __SIZEOF_LONG__ 8
#define __LDBL_DIG__ 18
#define __FLT64_IS_IEC_60559__ 1
#define __x86_64__ 1
#define __FLT16_IS_IEC_60559__ 1
#define __FLT16_MAX_EXP__ 16
#define __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF
#define __STDC_EMBED_FOUND__ 1
#define __INT_FAST16_MAX__ 0x7fffffffffffffffL
#define __GCC_CONSTRUCTIVE_SIZE 64
#define __FLT64_DIG__ 15
#define __UINT_FAST32_MAX__ 0xffffffffffffffffUL
#define __UINT_LEAST64_TYPE__ long unsigned int
#define __FLT16_EPSILON__ 9.76562500000000000000000000000000000e-4F16
#define __FLT_HAS_QUIET_NAN__ 1
#define __FLT_MAX_10_EXP__ 38
#define __FLT64X_HAS_DENORM__ 1
#define __DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL
#define __FLT_HAS_INFINITY__ 1
#define __GNUC_EXECUTION_CHARSET_NAME "UTF-8"
#define __cpp_unicode_literals 200710L
#define __UINT_FAST16_TYPE__ long unsigned int
#define __DEC64_MAX__ 9.999999999999999E384DD
#define __STDC_EMBED_NOT_FOUND__ 0
#define __INT_FAST32_WIDTH__ 64
#define __CHAR16_TYPE__ short unsigned int
#define __PRAGMA_REDEFINE_EXTNAME 1
#define __DEC64X_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143D64x
#define __SIZE_WIDTH__ 64
#define __SEG_FS 1
#define __INT_LEAST16_MAX__ 0x7fff
#define __FLT16_NORM_MAX__ 6.55040000000000000000000000000000000e+4F16
#define __DEC64_MANT_DIG__ 16
#define __FLT32_DENORM_MIN__ 1.40129846432481707092372958328991613e-45F32
#define __SIG_ATOMIC_WIDTH__ 32
#define __INT_LEAST64_TYPE__ long int
#define __INT16_TYPE__ short int
#define __INT_LEAST8_TYPE__ signed char
#define __FLT16_MAX__ 6.55040000000000000000000000000000000e+4F16
#define __FLT128_MIN__ 3.36210314311209350626267781732175260e-4932F128
#define __cpp_structured_bindings 201606L
#define __SIZEOF_INT__ 4
#define __DEC32_MAX_EXP__ 97
#define __INT_FAST8_MAX__ 0x7f
#define __FLT128_MAX__ 1.18973149535723176508575932662800702e+4932F128
#define __INTPTR_MAX__ 0x7fffffffffffffffL
#define __cpp_sized_deallocation 201309L
#define QT_QML_DEBUG 1
#define __cpp_guaranteed_copy_elision 201606L
#define linux 1
#define __FLT64_HAS_QUIET_NAN__ 1
#define __FLT32_MIN_10_EXP__ (-37)
#define __EXCEPTIONS 1
#define __UINT16_C(c) c
#define __PTRDIFF_WIDTH__ 64
#define __cpp_range_based_for 201603L
#define __INT_FAST16_WIDTH__ 64
#define __FLT64_HAS_INFINITY__ 1
#define __FLT64X_MAX__ 1.18973149535723176502126385303097021e+4932F64x
#define __FLT16_HAS_INFINITY__ 1
#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 16
#define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1)
#define __code_model_small__ 1
#define __GCC_ATOMIC_LONG_LOCK_FREE 2
#define __cpp_nontype_template_args 201411L
#define __DEC32_MANT_DIG__ 7
#define __k8__ 1
#define __INTPTR_TYPE__ long int
#define __UINT16_TYPE__ short unsigned int
#define __WCHAR_TYPE__ int
#define __UINTPTR_MAX__ 0xffffffffffffffffUL
#define __INT_FAST64_WIDTH__ 64
#define __INT_FAST64_MAX__ 0x7fffffffffffffffL
#define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1
#define __FLT_NORM_MAX__ 3.40282346638528859811704183484516925e+38F
#define __FLT32_HAS_INFINITY__ 1
#define __FLT64X_MAX_EXP__ 16384
#define __UINT_FAST64_TYPE__ long unsigned int
#define __cpp_inline_variables 201606L
#define __BFLT16_MIN_EXP__ (-125)
#define __INT_MAX__ 0x7fffffff
#define __linux__ 1
#define __INT64_TYPE__ long int
#define __FLT_MAX_EXP__ 128
#define __ORDER_BIG_ENDIAN__ 4321
#define __DBL_MANT_DIG__ 53
#define QT_CORE_LIB 1
#define __SIZEOF_FLOAT128__ 16
#define __BFLT16_MANT_DIG__ 8
#define __DEC64_MIN__ 1E-383DD
#define __WINT_TYPE__ unsigned int
#define __UINT_LEAST32_TYPE__ unsigned int
#define __SIZEOF_SHORT__ 2
#define __FLT32_NORM_MAX__ 3.40282346638528859811704183484516925e+38F32
#define __SSE__ 1
#define __LDBL_MIN_EXP__ (-16381)
#define __FLT64_MAX__ 1.79769313486231570814527423731704357e+308F64
#define __DEC64X_MIN_EXP__ (-6142)
#define __amd64__ 1
#define __WINT_WIDTH__ 32
#define __INT_LEAST64_WIDTH__ 64
#define __FLT32X_MAX_10_EXP__ 308
#define __cpp_namespace_attributes 201411L
#define __SIZEOF_INT128__ 16
#define __FLT16_MIN__ 6.10351562500000000000000000000000000e-5F16
#define __FLT64X_IS_IEC_60559__ 1
#define __GXX_CONSTEXPR_ASM__ 1
#define __LDBL_MAX_10_EXP__ 4932
#define __ATOMIC_RELAXED 0
#define __DBL_EPSILON__ double(2.22044604925031308084726333618164062e-16L)
#define __INT_LEAST32_TYPE__ int
#define _LP64 1
#define __UINT8_C(c) c
#define __FLT64_MAX_EXP__ 1024
#define __cpp_return_type_deduction 201304L
#define __SIZEOF_WCHAR_T__ 4
#define __GNUC_PATCHLEVEL__ 0
#define __FLT128_NORM_MAX__ 1.18973149535723176508575932662800702e+4932F128
#define __FLT64_NORM_MAX__ 1.79769313486231570814527423731704357e+308F64
#define __FLT128_HAS_QUIET_NAN__ 1
#define __INTMAX_MAX__ 0x7fffffffffffffffL
#define __INT_FAST8_TYPE__ signed char
#define __FLT64X_MIN__ 3.36210314311209350626267781732175260e-4932F64x
#define __STDCPP_THREADS__ 1
#define __BFLT16_HAS_DENORM__ 1
#define __GNUC_STDC_INLINE__ 1
#define __FLT64_HAS_DENORM__ 1
#define __FLT32_EPSILON__ 1.19209289550781250000000000000000000e-7F32
#define __FLT16_HAS_DENORM__ 1
#define __DBL_DECIMAL_DIG__ 17
#define __STDC_UTF_32__ 1
#define __INT_FAST8_WIDTH__ 8
#define __FXSR__ 1
#define __FLT32X_MAX__ 1.79769313486231570814527423731704357e+308F32x
#define __DBL_NORM_MAX__ double(1.79769313486231570814527423731704357e+308L)
#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
#define __GCC_DESTRUCTIVE_SIZE 64
#define __INTMAX_WIDTH__ 64
#define __cpp_runtime_arrays 198712L
#define __FLT32_DIG__ 6
#define __UINT64_TYPE__ long unsigned int
#define __UINT32_C(c) c ## U
#define ARCHITECTURE_ID "x86_64"
#define __cpp_alias_templates 200704L
#define __FLT_DENORM_MIN__ 1.40129846432481707092372958328991613e-45F
#define __FLT128_IS_IEC_60559__ 1
#define __INT8_MAX__ 0x7f
#define __LONG_WIDTH__ 64
#define __DBL_MIN__ double(2.22507385850720138309023271733240406e-308L)
#define __INT32_MAX__ 0x7fffffff
#define __UINT_FAST32_TYPE__ long unsigned int
#define __FLT16_MANT_DIG__ 11
#define __FLT32X_NORM_MAX__ 1.79769313486231570814527423731704357e+308F32x
#define __CHAR32_TYPE__ unsigned int
#define __FLT_MAX__ 3.40282346638528859811704183484516925e+38F
#define __SSE2__ 1
#define __cpp_deduction_guides 201703L
#define __BFLT16_NORM_MAX__ 3.38953138925153547590470800371487867e+38BF16
#define __INT32_TYPE__ int
#define __SIZEOF_DOUBLE__ 8
#define __cpp_exceptions 199711L
#define __FLT_MIN_10_EXP__ (-37)
#define __FLT64_MIN__ 2.22507385850720138309023271733240406e-308F64
#define __INT_LEAST32_WIDTH__ 32
#define __INTMAX_TYPE__ long int
#define __GLIBCXX_BITSIZE_INT_N_0 128
#define __FLT32X_HAS_QUIET_NAN__ 1
#define __ATOMIC_CONSUME 1
#define __GNUC_MINOR__ 1
#define __GLIBCXX_TYPE_INT_N_0 __int128
#define __UINTMAX_MAX__ 0xffffffffffffffffUL
#define __FLT32X_DENORM_MIN__ 4.94065645841246544176568792868221372e-324F32x
#define __cpp_template_template_args 201611L
#define __DBL_MAX_10_EXP__ 308
#define __LDBL_DENORM_MIN__ 3.64519953188247460252840593361941982e-4951L
#define __INT16_C(c) c
#define __STDC__ 1
#define __PTRDIFF_TYPE__ long int
#define __LONG_MAX__ 0x7fffffffffffffffL
#define __FLT32X_MIN_10_EXP__ (-307)
#define __UINTPTR_TYPE__ long unsigned int
#define __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD
#define __DEC128_MANT_DIG__ 34
#define __LDBL_MIN_10_EXP__ (-4931)
#define __cpp_generic_lambdas 201304L
#define __SSE_MATH__ 1
#define __SIZEOF_LONG_LONG__ 8
#define __cpp_user_defined_literals 200809L
#define __FLT128_DECIMAL_DIG__ 36
#define __GCC_ATOMIC_LLONG_LOCK_FREE 2
#define __FLT32_HAS_QUIET_NAN__ 1
#define __FLT_DECIMAL_DIG__ 9
#define __UINT_FAST16_MAX__ 0xffffffffffffffffUL
#define __LDBL_NORM_MAX__ 1.18973149535723176502126385303097021e+4932L
#define __GCC_ATOMIC_SHORT_LOCK_FREE 2
#define __SIZE_MAX__ 0xffffffffffffffffUL
#define __UINT_FAST8_TYPE__ unsigned char
#define _GNU_SOURCE 1
#define __cpp_init_captures 201304L
#define __ATOMIC_ACQ_REL 4
#define __ATOMIC_RELEASE 3

View File

@@ -1,3 +0,0 @@
// This file is autogenerated. Changes will be overwritten.
// No files found that require moc or the moc files are included
enum some_compilers { need_more_than_nothing };

View File

@@ -29,8 +29,9 @@ DataModel::DataModel()
Kennfeld_Ueberhitzung = Kennfeld_Ueberhitzung_Default;
}
// provide current process data ( relevant sensor data for the control algorithm )
void* DataModel::CurrentData(void)
// provide current process data ( relevant process data for the control algorithm )
QList<Input_t>* DataModel::getInputs()
{
return nullptr;
return &in;
}

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
};

Binary file not shown.

View File

@@ -4,6 +4,9 @@
#include <fcntl.h>
#include <unistd.h>
#include "datamodel.h"
#include "Controller.h"
// evaluate keyboard hits
// return 0 - no keyboard hit detected
@@ -31,7 +34,6 @@ int kbhit() {
}
return 0;
}
#include "Controller.h"
// entry point for controller app
@@ -41,15 +43,21 @@ int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
DataModel model; // create data model instance
Controller bbr; // create controller instance
bbr.initialize(&model);
// loop endlessly until keybord hit
qDebug() << "Press any key to stop ...";
while(!kbhit())
{
qDebug() << "Perform bbr setp";
qDebug() << "Perform 'temperature is rising'";
bbr.step();
usleep(200000); // 200ms delay
model.getInputs()->data()->analog.Istwert_Temperatur += 0.1;
}
return 0;

View File

@@ -1,2 +0,0 @@
[
]

View File

@@ -1,2 +0,0 @@
[
]

View File

@@ -6,7 +6,7 @@ Description: This is a C++ source file containing implementation code for a prog
Rev: 0.1
Created: [Date]
Author: [Your Name]
Copyright: [Your Organization or Name] [Year(s)]
Copyright: Binder GmbH TUT 2026
Purpose: [Briefly describe the file's functionality, e.g., "Implements a class for managing user data."]
Notes: [Any relevant details, such as dependencies, usage examples, or known issues.]
*/

View File

@@ -25,34 +25,53 @@ namespace UTILITY_FUNCTIONS {
// if so - x will be returned
// if not - lo will be returned if x is smaller than lo
// - hi will be returned if x is greater than hi
inline double limit(double x, double lo, double hi) {
inline double limit(double x, double lo, double hi)
{
return (x < lo) ? lo : (x > hi) ? hi : x;
}
inline double max3(double a, double b, double c) {
// determine the maximum of the 3 parameters
inline double max3(double a, double b, double c)
{
return std::max(a, std::max(b, c));
}
inline double min3(double a, double b, double c) {
// determine the minimum of the 3 parameters
inline double min3(double a, double b, double c)
{
return std::min(a, std::min(b, c));
}
inline bool is_valid(double x) { return std::isfinite(x); }
inline bool is_valid(double x)
{
return std::isfinite(x);
}
// ST: REAL_TO_INT(x) i.d.R. trunc Richtung 0. Bei Siemens oft ROUND? Du nutzt
// häufig +0.5.
inline int real_to_int(double x) { return static_cast<int>(x); }
inline int real_to_int(double x)
{
return static_cast<int>(x);
}
// Platzhalter für GET_VALUE_* (kommt vermutlich aus Parameter-/Recipe-System)
inline std::int32_t GET_VALUE_DINT(int /*a*/, int /*b*/, int /*c*/, int /*d*/) {
inline int32_t GET_VALUE_DINT(int /*a*/, int /*b*/, int /*c*/, int /*d*/)
{
// TODO: an dein Parameter-System anbinden
return 0;
}
inline double GET_VALUE_REAL(int /*a*/, int /*b*/, int /*c*/, int /*d*/) {
inline double GET_VALUE_REAL(int /*a*/, int /*b*/, int /*c*/, int /*d*/)
{
// TODO: an dein Parameter-System anbinden
return 0.0;
}
// UJ: not yet needed, maybe future use - leave it for now
class Util{
public:

View File

@@ -14,6 +14,8 @@ target_include_directories(ctrl_algo PUBLIC
$<INSTALL_INTERFACE:include>
)
target_include_directories(ctrl_algo PRIVATE ${Qt6Core_INCLUDE_DIRS})
# Link an executable to the library
# add_executable(app src/main.cpp)
# target_link_libraries(app PRIVATE math_utils)

View File

@@ -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"
#ifdef BUILD_TARGET_SOM
#include "application/AppLogic.hpp"
#include "application/Environment.hpp"
@@ -16,7 +30,8 @@ bool Controller::initialize(const char *configFilePath, appengine::IAppLogic *ap
auto deviceState = appLogic->deviceState();
MV_ Magnet Variable
SV_ State Variable
// Beispiel:
SV_Temperatur_Variable_ = deviceState.getVariableByKey("Temperatur_Innenraum");
@@ -136,11 +151,13 @@ bool Controller::initialize(const char *configFilePath, appengine::IAppLogic *ap
return true;
}
#endif
void Controller::step() {
void Controller::stepSOM(void)
{
#ifdef BUILD_TARGET_SOM
ClimateAlgorithm::Inputs in{};
in.Istwert_Temperatur = FILTERED_TEMP.step(SV_Temperatur_Variable_->toType<double>());
@@ -210,6 +227,29 @@ void Controller::step() {
#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() {
#ifdef BUILD_TARGET_SOM
subscriptions_.clear();
@@ -222,3 +262,39 @@ ControllerBase *create() {
return new Controller;
}
#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;
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -1,73 +0,0 @@
{
"tests": 11,
"name": "AllTests",
"testsuites": [
{
"name": "PT1FilterTest",
"tests": 3,
"testsuite": [
{
"name": "InitialOutputIsZero",
"file": "\/home\/k4\/tmp\/bbr-algo\/BinderBeispielRegler\/tests\/filter-test.cpp",
"line": 6
},
{
"name": "StepResponse",
"file": "\/home\/k4\/tmp\/bbr-algo\/BinderBeispielRegler\/tests\/filter-test.cpp",
"line": 11
},
{
"name": "FilterFactorEffect",
"file": "\/home\/k4\/tmp\/bbr-algo\/BinderBeispielRegler\/tests\/filter-test.cpp",
"line": 20
}
]
},
{
"name": "UtilityTest_max3",
"tests": 8,
"testsuite": [
{
"name": "param_3_is_max",
"file": "\/home\/k4\/tmp\/bbr-algo\/BinderBeispielRegler\/tests\/util-test.cpp",
"line": 25
},
{
"name": "param_2_is_max",
"file": "\/home\/k4\/tmp\/bbr-algo\/BinderBeispielRegler\/tests\/util-test.cpp",
"line": 31
},
{
"name": "param_1_is_max",
"file": "\/home\/k4\/tmp\/bbr-algo\/BinderBeispielRegler\/tests\/util-test.cpp",
"line": 37
},
{
"name": "all_params_equal",
"file": "\/home\/k4\/tmp\/bbr-algo\/BinderBeispielRegler\/tests\/util-test.cpp",
"line": 43
},
{
"name": "all_params_zero",
"file": "\/home\/k4\/tmp\/bbr-algo\/BinderBeispielRegler\/tests\/util-test.cpp",
"line": 49
},
{
"name": "2_params_negative_one_is_zero",
"file": "\/home\/k4\/tmp\/bbr-algo\/BinderBeispielRegler\/tests\/util-test.cpp",
"line": 55
},
{
"name": "all_params_negative_one_is_max",
"file": "\/home\/k4\/tmp\/bbr-algo\/BinderBeispielRegler\/tests\/util-test.cpp",
"line": 61
},
{
"name": "all_params_type_double",
"file": "\/home\/k4\/tmp\/bbr-algo\/BinderBeispielRegler\/tests\/util-test.cpp",
"line": 67
}
]
}
]
}

Binary file not shown.

View File

@@ -1,89 +0,0 @@
add_test([=[PT1FilterTest.InitialOutputIsZero]=] /home/k4/tmp/bbr-algo/BinderBeispielRegler/tests/tests [==[--gtest_filter=PT1FilterTest.InitialOutputIsZero]==] --gtest_also_run_disabled_tests)
set_tests_properties([=[PT1FilterTest.InitialOutputIsZero]=]
PROPERTIES
DEF_SOURCE_LINE [==[/home/k4/tmp/bbr-algo/BinderBeispielRegler/tests/filter-test.cpp:6]==]
WORKING_DIRECTORY [==[/home/k4/tmp/bbr-algo/BinderBeispielRegler/tests]==]
SKIP_REGULAR_EXPRESSION [==[\[ SKIPPED \]]==]
)
add_test([=[PT1FilterTest.StepResponse]=] /home/k4/tmp/bbr-algo/BinderBeispielRegler/tests/tests [==[--gtest_filter=PT1FilterTest.StepResponse]==] --gtest_also_run_disabled_tests)
set_tests_properties([=[PT1FilterTest.StepResponse]=]
PROPERTIES
DEF_SOURCE_LINE [==[/home/k4/tmp/bbr-algo/BinderBeispielRegler/tests/filter-test.cpp:11]==]
WORKING_DIRECTORY [==[/home/k4/tmp/bbr-algo/BinderBeispielRegler/tests]==]
SKIP_REGULAR_EXPRESSION [==[\[ SKIPPED \]]==]
)
add_test([=[PT1FilterTest.FilterFactorEffect]=] /home/k4/tmp/bbr-algo/BinderBeispielRegler/tests/tests [==[--gtest_filter=PT1FilterTest.FilterFactorEffect]==] --gtest_also_run_disabled_tests)
set_tests_properties([=[PT1FilterTest.FilterFactorEffect]=]
PROPERTIES
DEF_SOURCE_LINE [==[/home/k4/tmp/bbr-algo/BinderBeispielRegler/tests/filter-test.cpp:20]==]
WORKING_DIRECTORY [==[/home/k4/tmp/bbr-algo/BinderBeispielRegler/tests]==]
SKIP_REGULAR_EXPRESSION [==[\[ SKIPPED \]]==]
)
add_test([=[UtilityTest_max3.param_3_is_max]=] /home/k4/tmp/bbr-algo/BinderBeispielRegler/tests/tests [==[--gtest_filter=UtilityTest_max3.param_3_is_max]==] --gtest_also_run_disabled_tests)
set_tests_properties([=[UtilityTest_max3.param_3_is_max]=]
PROPERTIES
DEF_SOURCE_LINE [==[/home/k4/tmp/bbr-algo/BinderBeispielRegler/tests/util-test.cpp:25]==]
WORKING_DIRECTORY [==[/home/k4/tmp/bbr-algo/BinderBeispielRegler/tests]==]
SKIP_REGULAR_EXPRESSION [==[\[ SKIPPED \]]==]
)
add_test([=[UtilityTest_max3.param_2_is_max]=] /home/k4/tmp/bbr-algo/BinderBeispielRegler/tests/tests [==[--gtest_filter=UtilityTest_max3.param_2_is_max]==] --gtest_also_run_disabled_tests)
set_tests_properties([=[UtilityTest_max3.param_2_is_max]=]
PROPERTIES
DEF_SOURCE_LINE [==[/home/k4/tmp/bbr-algo/BinderBeispielRegler/tests/util-test.cpp:31]==]
WORKING_DIRECTORY [==[/home/k4/tmp/bbr-algo/BinderBeispielRegler/tests]==]
SKIP_REGULAR_EXPRESSION [==[\[ SKIPPED \]]==]
)
add_test([=[UtilityTest_max3.param_1_is_max]=] /home/k4/tmp/bbr-algo/BinderBeispielRegler/tests/tests [==[--gtest_filter=UtilityTest_max3.param_1_is_max]==] --gtest_also_run_disabled_tests)
set_tests_properties([=[UtilityTest_max3.param_1_is_max]=]
PROPERTIES
DEF_SOURCE_LINE [==[/home/k4/tmp/bbr-algo/BinderBeispielRegler/tests/util-test.cpp:37]==]
WORKING_DIRECTORY [==[/home/k4/tmp/bbr-algo/BinderBeispielRegler/tests]==]
SKIP_REGULAR_EXPRESSION [==[\[ SKIPPED \]]==]
)
add_test([=[UtilityTest_max3.all_params_equal]=] /home/k4/tmp/bbr-algo/BinderBeispielRegler/tests/tests [==[--gtest_filter=UtilityTest_max3.all_params_equal]==] --gtest_also_run_disabled_tests)
set_tests_properties([=[UtilityTest_max3.all_params_equal]=]
PROPERTIES
DEF_SOURCE_LINE [==[/home/k4/tmp/bbr-algo/BinderBeispielRegler/tests/util-test.cpp:43]==]
WORKING_DIRECTORY [==[/home/k4/tmp/bbr-algo/BinderBeispielRegler/tests]==]
SKIP_REGULAR_EXPRESSION [==[\[ SKIPPED \]]==]
)
add_test([=[UtilityTest_max3.all_params_zero]=] /home/k4/tmp/bbr-algo/BinderBeispielRegler/tests/tests [==[--gtest_filter=UtilityTest_max3.all_params_zero]==] --gtest_also_run_disabled_tests)
set_tests_properties([=[UtilityTest_max3.all_params_zero]=]
PROPERTIES
DEF_SOURCE_LINE [==[/home/k4/tmp/bbr-algo/BinderBeispielRegler/tests/util-test.cpp:49]==]
WORKING_DIRECTORY [==[/home/k4/tmp/bbr-algo/BinderBeispielRegler/tests]==]
SKIP_REGULAR_EXPRESSION [==[\[ SKIPPED \]]==]
)
add_test([=[UtilityTest_max3.2_params_negative_one_is_zero]=] /home/k4/tmp/bbr-algo/BinderBeispielRegler/tests/tests [==[--gtest_filter=UtilityTest_max3.2_params_negative_one_is_zero]==] --gtest_also_run_disabled_tests)
set_tests_properties([=[UtilityTest_max3.2_params_negative_one_is_zero]=]
PROPERTIES
DEF_SOURCE_LINE [==[/home/k4/tmp/bbr-algo/BinderBeispielRegler/tests/util-test.cpp:55]==]
WORKING_DIRECTORY [==[/home/k4/tmp/bbr-algo/BinderBeispielRegler/tests]==]
SKIP_REGULAR_EXPRESSION [==[\[ SKIPPED \]]==]
)
add_test([=[UtilityTest_max3.all_params_negative_one_is_max]=] /home/k4/tmp/bbr-algo/BinderBeispielRegler/tests/tests [==[--gtest_filter=UtilityTest_max3.all_params_negative_one_is_max]==] --gtest_also_run_disabled_tests)
set_tests_properties([=[UtilityTest_max3.all_params_negative_one_is_max]=]
PROPERTIES
DEF_SOURCE_LINE [==[/home/k4/tmp/bbr-algo/BinderBeispielRegler/tests/util-test.cpp:61]==]
WORKING_DIRECTORY [==[/home/k4/tmp/bbr-algo/BinderBeispielRegler/tests]==]
SKIP_REGULAR_EXPRESSION [==[\[ SKIPPED \]]==]
)
add_test([=[UtilityTest_max3.all_params_type_double]=] /home/k4/tmp/bbr-algo/BinderBeispielRegler/tests/tests [==[--gtest_filter=UtilityTest_max3.all_params_type_double]==] --gtest_also_run_disabled_tests)
set_tests_properties([=[UtilityTest_max3.all_params_type_double]=]
PROPERTIES
DEF_SOURCE_LINE [==[/home/k4/tmp/bbr-algo/BinderBeispielRegler/tests/util-test.cpp:67]==]
WORKING_DIRECTORY [==[/home/k4/tmp/bbr-algo/BinderBeispielRegler/tests]==]
SKIP_REGULAR_EXPRESSION [==[\[ SKIPPED \]]==]
)
set( tests_TESTS PT1FilterTest.InitialOutputIsZero PT1FilterTest.StepResponse PT1FilterTest.FilterFactorEffect UtilityTest_max3.param_3_is_max UtilityTest_max3.param_2_is_max UtilityTest_max3.param_1_is_max UtilityTest_max3.all_params_equal UtilityTest_max3.all_params_zero UtilityTest_max3.2_params_negative_one_is_zero UtilityTest_max3.all_params_negative_one_is_max UtilityTest_max3.all_params_type_double)

View File

@@ -17,14 +17,15 @@ Notes: [Any relevant details, such as dependencies, usage examples, or kno
#include "util.h"
using namespace UTILITY_FUNCTIONS;
using namespace std;
//----------- Test of utility function 'max3' ---------
// Magic numbers for simplicity ( exceptionally allowed here )
// test if param 3 is max value
TEST(UtilityTest_max3, param_3_is_max) {
double max = max3(1.0f, 2.0f, 3.0f);
EXPECT_DOUBLE_EQ(max, 3.0f);
double ma = max3(1.0f, 2.0f, 3.0f);
EXPECT_DOUBLE_EQ(ma, 3.0f);
}
// test if param 2 is max value