init the analogDigitalTransitionStart with 9.2 if nothing set in config

This commit is contained in:
Frank Haverland
2022-10-17 22:22:47 +02:00
parent be8598bcaa
commit bc46149573
3 changed files with 11 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ class ClassFlowCNNGeneral :
public ClassFlowImage public ClassFlowImage
{ {
protected: protected:
bool debugdetailgeneral = false; bool debugdetailgeneral = true;
t_CNNType CNNType; t_CNNType CNNType;
std::vector<general*> GENERAL; std::vector<general*> GENERAL;
float CNNGoodThreshold; float CNNGoodThreshold;

View File

@@ -584,6 +584,7 @@ void ClassFlowPostProcessing::InitNUMBERS()
_number->DecimalShift = 0; _number->DecimalShift = 0;
_number->DecimalShiftInitial = 0; _number->DecimalShiftInitial = 0;
_number->isExtendedResolution = false; _number->isExtendedResolution = false;
_number->AnalogDigitalTransitionStart=9.2;
_number->FlowRateAct = 0; // m3 / min _number->FlowRateAct = 0; // m3 / min

View File

@@ -53,7 +53,7 @@ void test_analogToDigit_Standard() {
// Standard: dig=6.8, ana=1.0 => erg=7 // Standard: dig=6.8, ana=1.0 => erg=7
// Transition = nein // Transition = nein
// Versatz = nein // Versatz = nein
TEST_ASSERT_EQUAL_INT(7, undertest->ZeigerEvalAnalogToDigitNeu( 6.8, 8.6, 6, 9.2)); TEST_ASSERT_EQUAL_INT(7, undertest->ZeigerEvalAnalogToDigitNeu( 6.8, 1.0, 1, 9.2));
} }
@@ -85,4 +85,12 @@ void test_analogToDigit_Transition() {
TEST_ASSERT_EQUAL_INT(9, undertest->ZeigerEvalAnalogToDigitNeu( 9.8, 0.1, 9, 9.2)); TEST_ASSERT_EQUAL_INT(9, undertest->ZeigerEvalAnalogToDigitNeu( 9.8, 0.1, 9, 9.2));
// https://github.com/jomjol/AI-on-the-edge-device/issues/1110#issuecomment-1277425333
// Standard: dig=5.9, ana=9.4 => erg=9
// Transition = ja
// Nulldurchgang = nein
// Versatz = nein
// Besonderheit:
TEST_ASSERT_EQUAL_INT(5, undertest->ZeigerEvalAnalogToDigitNeu( 5.9, 9.4, 9, 9.2));
} }