Эх сурвалжийг харах

init the analogDigitalTransitionStart with 9.2 if nothing set in config

Frank Haverland 3 жил өмнө
parent
commit
bc46149573

+ 1 - 1
code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.h

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

+ 1 - 0
code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp

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

+ 9 - 1
code/test/components/jomjol-flowcontroll/test_ZeigerEvalAnalogToDigitNeu.cpp

@@ -53,7 +53,7 @@ void test_analogToDigit_Standard() {
     // Standard: dig=6.8, ana=1.0 => erg=7
     // Transition = 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));
 
 
+    // 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));
+
 }