test_flow_postrocess_helper.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #pragma once
  2. #ifndef TEST_FLOW_H
  3. #define TEST_FLOW_H
  4. #include <unity.h>
  5. #include <ClassFlowPostProcessing.h>
  6. #include <ClassFlowCNNGeneral.h>
  7. #include <ClassFlowTakeImage.h>
  8. #include <Helper.h>
  9. class UnderTestPost : public ClassFlowPostProcessing {
  10. public:
  11. UnderTestPost(std::vector<ClassFlow*>* lfc, ClassFlowCNNGeneral *_analog, ClassFlowCNNGeneral *_digit)
  12. : ClassFlowPostProcessing::ClassFlowPostProcessing(lfc, _analog, _digit) {}
  13. using ClassFlowPostProcessing::InitNUMBERS;
  14. using ClassFlowPostProcessing::flowAnalog;
  15. using ClassFlowPostProcessing::flowDigit;
  16. };
  17. /**
  18. * @brief Set the Up Class Flow Postprocessing object
  19. *
  20. * @param digType the model type of digits
  21. * @param anaType the model type of analog
  22. * @return UnderTestPost* a created, but not setted up testobject
  23. */
  24. UnderTestPost* setUpClassFlowPostprocessing(t_CNNType digType, t_CNNType anaType);
  25. /**
  26. * @brief creates a testobject (including setup). AnalogType is Class100, because all analog types do the same.
  27. *
  28. * @param analog the analog recognitions
  29. * @param digits the digit recognitions
  30. * @param digType the digit model type (default Digit100)
  31. * @param checkConsistency sets property checkConsistency (default = false)
  32. * @param extendedResolution sets property extendedResolution (default = false)
  33. * @param decimal_shift set property decimal_shift (Nachkommastellen, default = 0)
  34. * @return UnderTestPost* the created testobject
  35. */
  36. UnderTestPost* init_do_flow(std::vector<float> analog, std::vector<float> digits, t_CNNType digType = Digit100,
  37. bool checkConsistency=false, bool extendedResolution=false, int decimal_shift=0);
  38. /**
  39. * @brief creates a testobject an run do flow (including setup). AnalogType is Class100, because all analog types do the same.
  40. *
  41. * @param analog the analog recognitions
  42. * @param digits the digit recognitions
  43. * @param digType the digit model type (default Digit100)
  44. * @param checkConsistency sets property checkConsistency (default = false)
  45. * @param extendedResolution sets property extendedResolution (default = false)
  46. * @param decimal_shift set property decimal_shift (Nachkommastellen, default = 0)
  47. * @return std::string the return value of do_Flow is the Value as string
  48. */
  49. std::string process_doFlow(std::vector<float> analog, std::vector<float> digits, t_CNNType digType = Digit100,
  50. bool checkConsistency=false, bool extendedResolution=false, int decimal_shift=0);
  51. /**
  52. * @brief run do_Flow on the testobject
  53. *
  54. * @param _underTestPost the testobject
  55. * @return std::string the return value of do_Flow is the Value as string
  56. */
  57. std::string process_doFlow(UnderTestPost* _underTestPost);
  58. /**
  59. * @brief Set the Consitency Check on testobject
  60. *
  61. * @param _UnderTestPost the testobject
  62. * @param _checkConsistency true/false if checkConsistency
  63. */
  64. void setConsitencyCheck(UnderTestPost* _UnderTestPost, bool _checkConsistency);
  65. /**
  66. * @brief Set the Pre Value on testobject
  67. *
  68. * @param _UnderTestPost the testobject
  69. * @param _preValue the previous value
  70. */
  71. void setPreValue(UnderTestPost* _UnderTestPost, double _preValue);
  72. /**
  73. * @brief Set the Extended Resolution on undertest
  74. *
  75. * @param _UnderTestPost the testobject
  76. * @param _extendedResolution true/false
  77. */
  78. void setExtendedResolution(UnderTestPost* _UnderTestPost, bool _extendedResolution);
  79. /**
  80. * @brief Set the Decimal Shift (Nachkomma)
  81. *
  82. * @param _UnderTestPost the testobject
  83. * @param decimal_shift count of nachkomma
  84. */
  85. void setDecimalShift(UnderTestPost* _UnderTestPost, int decimal_shift);
  86. /**
  87. * @brief Set the Analogdigit Transistion Start
  88. *
  89. * @param _underTestPost the testobject
  90. * @param _analogdigitTransistionStart the analog to digit transition start
  91. */
  92. void setAnalogdigitTransistionStart(UnderTestPost* _underTestPost, float _analogdigitTransistionStart);
  93. /**
  94. * @brief Set the allowNegatives in testobject
  95. *
  96. * @param _underTestPost the testobject
  97. * @param _allowNegatives if should be set true or false
  98. */
  99. void setAllowNegatives(UnderTestPost* _underTestPost, bool _allowNegatives);
  100. #endif // TEST_FLOW_H