Line |
Branch |
Decision |
Exec |
Source |
1 |
|
|
|
// |
2 |
|
|
|
// Created by kifir on 8/20/24. |
3 |
|
|
|
// |
4 |
|
|
|
|
5 |
|
|
|
#pragma once |
6 |
|
|
|
|
7 |
|
|
|
#include "hysteresis.h" |
8 |
|
|
|
|
9 |
|
|
|
template <typename RisingChecker = StrictChecker, typename FallingChecker = StrictChecker> |
10 |
|
|
|
class MaxLimitWithHysteresis { |
11 |
|
|
|
public: |
12 |
|
|
|
bool checkIfLimitIsExceeded(const float value, const float maxLimit, const float hysteresis); |
13 |
|
|
|
private: |
14 |
|
|
|
Hysteresis m_hysteresis; |
15 |
|
|
|
}; |
16 |
|
|
|
|
17 |
|
|
|
template <typename RisingChecker, typename FallingChecker> |
18 |
|
|
1447 |
bool MaxLimitWithHysteresis<RisingChecker, FallingChecker>::checkIfLimitIsExceeded( |
19 |
|
|
|
const float value, |
20 |
|
|
|
const float maxLimit, |
21 |
|
|
|
const float hysteresis |
22 |
|
|
|
) { |
23 |
|
|
1447 |
return m_hysteresis.test<RisingChecker, FallingChecker>(value, maxLimit, maxLimit - hysteresis); |
24 |
|
|
|
} |
25 |
|
|
|
|