test_flowpostprocessing.cpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  1. #include <unity.h>
  2. #include <ClassFlowPostProcessing.h>
  3. #include <ClassFlowCNNGeneral.h>
  4. #include <ClassFlowCNNGeneral.h>
  5. #include <ClassFlowMakeImage.h>
  6. void setUpClassFlowPostprocessing(void);
  7. string process_doFlow(std::vector<float> analog, std::vector<float> digits, t_CNNType digType = Digital100,
  8. bool checkConsistency=false, bool extendedResolution=false, int decimal_shift=0);
  9. ClassFlowCNNGeneral* _analog;
  10. ClassFlowCNNGeneral* _digit;
  11. std::vector<ClassFlow*> FlowControll;
  12. ClassFlowMakeImage* flowmakeimage;
  13. class UnderTestPost : public ClassFlowPostProcessing {
  14. public:
  15. UnderTestPost(std::vector<ClassFlow*>* lfc, ClassFlowCNNGeneral *_analog, ClassFlowCNNGeneral *_digit)
  16. : ClassFlowPostProcessing::ClassFlowPostProcessing(lfc, _analog, _digit) {}
  17. using ClassFlowPostProcessing::InitNUMBERS;
  18. };
  19. UnderTestPost* undertestPost;
  20. /**
  21. * @brief Testet die doFlow-Methode von ClassFlowPostprocessing
  22. * digits[] - enthält die liste der vom Model zurückgegebenen Ergebnisse (class100/cont) in der Reihenfolge von links nach rechts
  23. * analog[] - enthält die Liste der Zeiger vom Model, wie bei den digits
  24. * expected - enthält das erwartete Ergebnis, wobei der Dezimalpunkt genau zwischen digits und analog ist.
  25. *
  26. */
  27. void test_doFlow() {
  28. /*
  29. *
  30. * digit1 = 1.2
  31. * digit2 = 6.7
  32. * analog1 = 9.5
  33. * analog2 = 8.4
  34. *
  35. * Das Ergebnis sollte "16.984" sein. Bzw. 16.98 ohne Extended true
  36. */
  37. std::vector<float> digits = { 1.2, 6.7};
  38. std::vector<float> analogs = { 9.5, 8.4};
  39. const char* expected = "16.98";
  40. const char* expected_extended = "16.984";
  41. std::string result = process_doFlow(analogs, digits);
  42. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  43. /*
  44. * https://github.com/jomjol/AI-on-the-edge-device/issues/921
  45. *
  46. * Das Ergebnis sollte "376529.6" sein.
  47. */
  48. digits = { 3.0, 7.0, 6.0, 5.0, 2.5, 9.6};
  49. analogs = { 6.4};
  50. expected = "376529.6";
  51. result = process_doFlow(analogs, digits);
  52. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  53. /*
  54. * https://github.com/jomjol/AI-on-the-edge-device/issues/921
  55. *
  56. * Das Ergebnis sollte "167734.6" sein. Bzw. 16.98 ohne Extended true
  57. */
  58. digits = { 1.1, 6.0, 7.0, 7.0, 3.0, 4.6};
  59. analogs = { 6.2};
  60. expected = "167734.6";
  61. result = process_doFlow(analogs, digits);
  62. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  63. /*
  64. * https://github.com/jomjol/AI-on-the-edge-device/issues/919
  65. *
  66. * Das Ergebnis sollte "58.96889" sein. Bzw. 16.98 ohne Extended true
  67. */
  68. digits = { 5.0, 8.6};
  69. analogs = { 9.8, 6.7, 8.9, 8.6, 9.8};
  70. expected = "58.96889";
  71. result = process_doFlow(analogs, digits);
  72. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  73. /*
  74. * https://github.com/jomjol/AI-on-the-edge-device/issues/921
  75. *
  76. * Das Ergebnis sollte "376529.6" sein. Bzw. 16.98 ohne Extended true
  77. */
  78. digits = { 2.9, 7.0, 6.8, 9.9, 8.0, 3.9};
  79. analogs = { 9.7};
  80. expected = "377083.9";
  81. result = process_doFlow(analogs, digits);
  82. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  83. digits = { 1.1, 9.0, 4.0};
  84. analogs = { 6.1, 2.6, 6.25, 9.7};
  85. expected = "194.6259";
  86. result = process_doFlow(analogs, digits);
  87. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  88. digits = { 1.1, 9.0, 4.0};
  89. analogs = { 8.1, 2.6, 6.25, 9.7};
  90. expected = "193.8259";
  91. result = process_doFlow(analogs, digits);
  92. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  93. digits = { 1.1, 9.0, 4.0};
  94. analogs = { 9.1, 2.6, 6.25, 9.7};
  95. expected = "193.9259";
  96. result = process_doFlow(analogs, digits);
  97. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  98. // https://github.com/jomjol/AI-on-the-edge-device/discussions/950
  99. digits = { 1.0, 9.0, 9.0};
  100. analogs = { 7.1, 4.8, 8.3};
  101. expected = "199.748";
  102. result = process_doFlow(analogs, digits);
  103. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  104. // https://github.com/jomjol/AI-on-the-edge-device/issues/948
  105. digits = { 1.0, 9.0, 9.0};
  106. analogs = { 7.1, 4.8, 8.3};
  107. expected = "199.748";
  108. result = process_doFlow(analogs, digits);
  109. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  110. // https://github.com/jomjol/AI-on-the-edge-device/issues/942#issuecomment-1226966346
  111. digits = { 0.0, 2.9, 3.0, 2.9, 3.5, 9.5};
  112. analogs = { };
  113. expected = "33330";
  114. result = process_doFlow(analogs, digits);
  115. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  116. // https://github.com/jomjol/AI-on-the-edge-device/issues/942#issuecomment-1226966346
  117. digits = { 9.9, 2.8, 2.9, 2.9, 3.7, 9.7};
  118. analogs = { };
  119. expected = "33340";
  120. result = process_doFlow(analogs, digits);
  121. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  122. // https://github.com/jomjol/AI-on-the-edge-device/issues/942
  123. digits = { 0.0, 9.9, 6.8, 9.9, 3.7, 0.8, 6.9, 8.7};
  124. analogs = { };
  125. expected = "704179";
  126. result = process_doFlow(analogs, digits);
  127. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  128. // https://github.com/jomjol/AI-on-the-edge-device/issues/942#issuecomment-1228343319
  129. digits = { 9.9, 6.8, 1.1, 4.7, 2.7, 6.0, 9.0, 2.8}; // changed 3.7 --> 2.7 (see picture in issue)
  130. analogs = { };
  131. expected = "7153693";
  132. result = process_doFlow(analogs, digits);
  133. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  134. // Analoger Übergang Zähler Jomjolcom/jomjol/AI-on-the-edge-device/issues/942#issuecomment-1228343319
  135. digits = { 1.0, 9.0, 4.3}; // changed 3.7 --> 2.7 (see picture in issue)
  136. analogs = { 8.9, 0.7, 8.9, 9.4 };
  137. expected = "194.9089";
  138. result = process_doFlow(analogs, digits);
  139. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  140. // Fehler bei V11.2.0
  141. // https://github.com/jomjol/AI-on-the-edge-device/issues/921#issuecomment-1229552041
  142. digits = { 2.9, 7.0, 7.0, 9.1, 8.1, 8.5}; // 376.9884(1) als falsches Ergebnis
  143. analogs = { 4.1 };
  144. expected = "377988.4";
  145. result = process_doFlow(analogs, digits);
  146. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  147. // Fehler bei V11.2.0
  148. // https://github.com/jomjol/AI-on-the-edge-device/issues/921#issuecomment-1233149877
  149. digits = { 0.0, 0.0, 7.0, 8.9}; // 79.9999(6) als falsches Ergebnis
  150. analogs = { 0.1, 0.1, 0.1, 9.6};
  151. expected = "78.9999";
  152. result = process_doFlow(analogs, digits);
  153. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  154. // Fehler bei V11.2.0
  155. // https://github.com/jomjol/AI-on-the-edge-device/issues/921#issuecomment-1236119370
  156. digits = { 3.1, 9.1, 5.7}; // 9.1 führt zu falscher Erkennung eines unvollständigen Übergangs
  157. analogs = { 8.8, 6.1, 3.0, 2.0};
  158. expected = "395.8632";
  159. result = process_doFlow(analogs, digits);
  160. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  161. // Fehler bei V11.2.0
  162. // https://github.com/jomjol/AI-on-the-edge-device/discussions/950#discussion-4338615
  163. digits = { 1.0, 9.0, 9.0}; // Übergang wurde um 1 erhöht (200, statt 199)
  164. analogs = { 7.1, 4.8, 8.3};
  165. expected = "199.748";
  166. result = process_doFlow(analogs, digits, Digital);
  167. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  168. // Fehler bei Rolling (2002-09-09)
  169. // https://github.com/jomjol/AI-on-the-edge-device/issues/921#issuecomment-1242730397
  170. digits = { 3.0, 2.0, 2.0, 8.0, 9.0, 4.0, 1.7, 9.8}; // falscher Wert 32290.420
  171. analogs = { };
  172. expected = "32289.420";
  173. expected_extended= "32289.4198";
  174. // FALSCH! wegen ungenügender Präzision von NUMBERS->Value
  175. // expected_extended= "32289.4198";
  176. // extendResolution=false, checkConsistency=false
  177. result = process_doFlow(analogs, digits, Digital100, false, false, -3);
  178. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  179. // extendResolution=true
  180. result = process_doFlow(analogs, digits, Digital100, false, true, -3);
  181. TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
  182. // checkConsistency=true und extendResolution=true
  183. result = process_doFlow(analogs, digits, Digital100, false, true, -3);
  184. TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
  185. // Fehler Rolling (2022-09-10)
  186. // not documented as issue
  187. digits = { 0.0, 0.0, 7.9, 3.8}; // 84.99401 als falsches Ergebnis
  188. analogs = { 0.0, 9.4, 4.1, 0.1};
  189. expected = "83.9940";
  190. expected_extended= "83.99401";
  191. // checkConsistency=false
  192. result = process_doFlow(analogs, digits, Digital100, false);
  193. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  194. // checkConsistency=true
  195. result = process_doFlow(analogs, digits, Digital100, true);
  196. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  197. // extendResolution=true
  198. result = process_doFlow(analogs, digits, Digital100, false, true);
  199. TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
  200. // checkConsistency=true und extendResolution=true
  201. result = process_doFlow(analogs, digits, Digital100, false, true);
  202. TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
  203. // Fehler Rolling (2022-09-10)
  204. // https://github.com/jomjol/AI-on-the-edge-device/issues/994#issue-1368570945
  205. digits = { 0.0, 0.0, 1.0, 2.0, 2.8, 1.9, 2.8, 5.6}; // 123245.6 als falsches Ergebnis
  206. analogs = { };
  207. expected = "123236";
  208. expected_extended= "123235.6";
  209. // checkConsistency=true
  210. result = process_doFlow(analogs, digits, Digital100, false, false);
  211. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  212. // checkConsistency=true
  213. result = process_doFlow(analogs, digits, Digital100, true, false);
  214. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  215. // extendResolution=true
  216. result = process_doFlow(analogs, digits, Digital100, false, true);
  217. TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
  218. // Fehler bei V11.2.0
  219. // https://github.com/jomjol/AI-on-the-edge-device/discussions/950#discussioncomment-3661982
  220. digits = { 3.0, 2.0, 4.1, 9.0, 4.0, 6.3, 9.2}; // 3249.459 als falsches Ergebnis
  221. analogs = { };
  222. expected = "3249.469";
  223. expected_extended= "3249.4692";
  224. // checkConsistency=true
  225. result = process_doFlow(analogs, digits, Digital100, false, false, -3);
  226. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  227. // extendResolution=true
  228. result = process_doFlow(analogs, digits, Digital100, false, true, -3);
  229. TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
  230. // Fehler bei V11.2.0
  231. // https://github.com/jomjol/AI-on-the-edge-device/issues/1020#issue-1375648891
  232. digits = { 0.0, 2.0, 6.1, 9.2}; // 259.9227 als falsches Ergebnis
  233. analogs = { 9.0, 2.5, 2.9, 7.2};
  234. expected = "269.9227";
  235. expected_extended= "269.92272";
  236. // extendResolution=true
  237. result = process_doFlow(analogs, digits, Digital100, false, false);
  238. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  239. // checkConsistency=false und extendResolution=true
  240. result = process_doFlow(analogs, digits, Digital100, false, true);
  241. TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
  242. // Fehler bei V11.3.1
  243. // https://github.com/jomjol/AI-on-the-edge-device/issues/1028#issuecomment-1250239481
  244. digits = { 1.1, 6.0, 9.1, 3.0, 5.3, 9.4}; // 169.3493 als falsches Ergebnis
  245. analogs = { 3.5};
  246. expected = "169.3593";
  247. expected_extended= "169.35935";
  248. // extendResolution=false
  249. result = process_doFlow(analogs, digits, Digital100, false, false, -3);
  250. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  251. // checkConsistency=false und extendResolution=true
  252. result = process_doFlow(analogs, digits, Digital100, false, true, -3);
  253. TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
  254. // Fehler bei V12.0.1
  255. // Lokal
  256. digits = { 9.8, 9.8, 1.9, 0.9, 0.9, 9.9, 2.9, 4.8}; // 211.0355 als falsches Ergebnis
  257. analogs = { 5.5};
  258. expected = "211.0345";
  259. expected_extended= "211.03455";
  260. // extendResolution=false
  261. result = process_doFlow(analogs, digits, Digital100, false, false, -3);
  262. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  263. // checkConsistency=false und extendResolution=true
  264. result = process_doFlow(analogs, digits, Digital100, false, true, -3);
  265. TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
  266. // Fehler bei V12.0.1
  267. // https://github.com/jomjol/AI-on-the-edge-device/issues/1110#issuecomment-1277425333
  268. digits = { 2.2, 4.5, 5.9}; // 245.938 als falsches Ergebnis
  269. analogs = { 9.4, 3.8, 8.6};
  270. expected = "245.938";
  271. expected_extended= "245.9386";
  272. // extendResolution=false
  273. result = process_doFlow(analogs, digits, Digital100, false, false, 0);
  274. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  275. // checkConsistency=false und extendResolution=true
  276. result = process_doFlow(analogs, digits, Digital100, false, true, 0);
  277. TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
  278. // Fehler bei V12.0.1
  279. // https://github.com/jomjol/AI-on-the-edge-device/issues/1110#issuecomment-1277425333
  280. digits = { 2.2, 4.5, 5.9}; // 245.938 kein Fehler. Aber Grenzfall, deshalb mit als Test aufgenommen.
  281. analogs = { 9.4, 3.8, 8.6};
  282. expected = "245.938";
  283. expected_extended= "245.9386";
  284. // extendResolution=false
  285. result = process_doFlow(analogs, digits, Digital100, false, false, 0);
  286. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  287. // checkConsistency=false und extendResolution=true
  288. result = process_doFlow(analogs, digits, Digital100, false, true, 0);
  289. TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
  290. // Fehler bei V12.0.1
  291. // https://github.com/jomjol/AI-on-the-edge-device/issues/1110#issuecomment-1265523710
  292. digits = { 2.0, 4.0, 6.8}; // 246.2045 als falsches Ergebnis
  293. analogs = { 2.2, 0.1, 4.5};
  294. expected = "247.204";
  295. expected_extended= "247.2045";
  296. // extendResolution=false
  297. result = process_doFlow(analogs, digits, Digital100, false, false, 0);
  298. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  299. // checkConsistency=false und extendResolution=true
  300. result = process_doFlow(analogs, digits, Digital100, false, true, 0);
  301. TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
  302. // Fehler bei V12.0.1
  303. // https://github.com/jomjol/AI-on-the-edge-device/issues/1110#issue-1391153343
  304. digits = { 1.0, 4.0, 2.0}; // 142.9269 als falsches Ergebnis
  305. analogs = { 9.2, 2.5, 6.8, 9.0};
  306. expected = "141.9269";
  307. expected_extended= "141.92690";
  308. // extendResolution=false
  309. result = process_doFlow(analogs, digits, Digital100, false, false, 0);
  310. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  311. // checkConsistency=false und extendResolution=true
  312. result = process_doFlow(analogs, digits, Digital100, false, true, 0);
  313. TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
  314. // Fehler bei V12.0.1
  315. // https://github.com/jomjol/AI-on-the-edge-device/issues/1110#issuecomment-1262626388
  316. digits = { 1.2, 6.8, 0.0, 0.0, 5.0, 2.8}; //170.05387 als falsches Ergebnis
  317. analogs = { 8.7};
  318. expected = "170.0528";
  319. expected_extended= "170.05287";
  320. // extendResolution=false
  321. result = process_doFlow(analogs, digits, Digital100, false, false, -3);
  322. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  323. // checkConsistency=false und extendResolution=true
  324. result = process_doFlow(analogs, digits, Digital100, false, true, -3);
  325. TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
  326. // Fehler bei rolling post V12.0.1
  327. // lokal watermeter1
  328. digits = { 0.0, 0.0, 9.0, 1.0}; //91.88174 als falsches Ergebnis
  329. analogs = {9.0, 8.0, 1.8, 7.4};
  330. expected = "90.8817";
  331. expected_extended= "90.88174";
  332. // extendResolution=false
  333. result = process_doFlow(analogs, digits, Digital100, false, false, 0);
  334. TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
  335. // checkConsistency=false und extendResolution=true
  336. result = process_doFlow(analogs, digits, Digital100, false, true, 0);
  337. TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
  338. }
  339. void setUpClassFlowPostprocessing(t_CNNType digType, t_CNNType anaType)
  340. {
  341. // wird im doFlow verwendet
  342. flowmakeimage = new ClassFlowMakeImage(&FlowControll);
  343. FlowControll.push_back(flowmakeimage);
  344. // Die Modeltypen werden gesetzt, da keine Modelle verwendet werden.
  345. _analog = new ClassFlowCNNGeneral(nullptr, anaType);
  346. _digit = new ClassFlowCNNGeneral(nullptr, digType);
  347. undertestPost = new UnderTestPost(&FlowControll, _analog, _digit);
  348. }
  349. std::string process_doFlow(std::vector<float> analog, std::vector<float> digits, t_CNNType digType,
  350. bool checkConsistency, bool extendedResolution, int decimal_shift) {
  351. // setup the classundertest
  352. setUpClassFlowPostprocessing(digType, Analogue100);
  353. printf("SetupClassFlowPostprocessing completed.\n");
  354. // digits
  355. if (digits.size()>0) {
  356. general* gen_digit = _digit->GetGENERAL("default", true);
  357. gen_digit->ROI.clear();
  358. for (int i = 0; i<digits.size(); i++) {
  359. roi* digitROI = new roi();
  360. string name = "digit_" + std::to_string(i);
  361. digitROI->name = name;
  362. digitROI->result_klasse = (int) digits[i];
  363. digitROI->result_float = digits[i];
  364. gen_digit->ROI.push_back(digitROI);
  365. }
  366. }
  367. // analog
  368. if (analog.size()>0) {
  369. general* gen_analog = _analog->GetGENERAL("default", true);
  370. gen_analog->ROI.clear();
  371. for (int i = 0; i<analog.size(); i++) {
  372. roi* anaROI = new roi();
  373. string name = "ana_" + std::to_string(i);
  374. anaROI->name = name;
  375. anaROI->result_float = analog[i];
  376. gen_analog->ROI.push_back(anaROI);
  377. }
  378. }
  379. printf("Setting up of ROIs completed.\n");
  380. undertestPost->InitNUMBERS();
  381. if (checkConsistency) {
  382. printf("checkConsistency=true\n");
  383. std::vector<NumberPost*>* NUMBERS = undertestPost->GetNumbers();
  384. for (int _n = 0; _n < (*NUMBERS).size(); ++_n) {
  385. printf("Setting checkConsistency on number: %d\n", _n);
  386. (*NUMBERS)[_n]->checkDigitIncreaseConsistency = true;
  387. }
  388. }
  389. if (extendedResolution ) {
  390. std::vector<NumberPost*>* NUMBERS = undertestPost->GetNumbers();
  391. for (int _n = 0; _n < (*NUMBERS).size(); ++_n) {
  392. printf("Setting extendedResolution on number: %d\n", _n);
  393. (*NUMBERS)[_n]->isExtendedResolution = true;
  394. }
  395. }
  396. if (decimal_shift!=0) {
  397. std::vector<NumberPost*>* NUMBERS = undertestPost->GetNumbers();
  398. for (int _n = 0; _n < (*NUMBERS).size(); ++_n) {
  399. printf("Setting decimal shift on number: %d to %d\n", _n, decimal_shift);
  400. (*NUMBERS)[_n]->DecimalShift = decimal_shift;
  401. (*NUMBERS)[_n]->DecimalShiftInitial = decimal_shift;
  402. }
  403. }
  404. string time;
  405. // run test
  406. TEST_ASSERT_TRUE(undertestPost->doFlow(time));
  407. return undertestPost->getReadout(0);
  408. }