diff options
Diffstat (limited to 'source/use_case/ad')
-rw-r--r-- | source/use_case/ad/src/MainLoop.cc | 1 | ||||
-rw-r--r-- | source/use_case/ad/src/UseCaseHandler.cc | 16 |
2 files changed, 10 insertions, 7 deletions
diff --git a/source/use_case/ad/src/MainLoop.cc b/source/use_case/ad/src/MainLoop.cc index 6431509..3c2f9cc 100644 --- a/source/use_case/ad/src/MainLoop.cc +++ b/source/use_case/ad/src/MainLoop.cc @@ -40,6 +40,7 @@ static void DisplayMenu() printf(" %u. Show NN model info\n", MENU_OPT_SHOW_MODEL_INFO); printf(" %u. List audio signals\n\n", MENU_OPT_LIST_AUDIO_CLIPS); printf(" Choice: "); + fflush(stdout); } diff --git a/source/use_case/ad/src/UseCaseHandler.cc b/source/use_case/ad/src/UseCaseHandler.cc index ec35156..0c78179 100644 --- a/source/use_case/ad/src/UseCaseHandler.cc +++ b/source/use_case/ad/src/UseCaseHandler.cc @@ -266,21 +266,23 @@ namespace app { /* Display each result */ uint32_t rowIdx1 = dataPsnTxtStartY1 + 2 * dataPsnTxtYIncr; - std::string resultStr = std::string{"Average anomaly score is: "} + std::to_string(result) + - std::string("\n") + std::string("Anomaly threshold is: ") + std::to_string(threshold) + - std::string("\n"); + std::string anomalyScore = std::string{"Average anomaly score is: "} + std::to_string(result); + std::string anomalyThreshold = std::string("Anomaly threshold is: ") + std::to_string(threshold); + std::string anomalyResult; if (result > threshold) { - resultStr += std::string("Anomaly detected!"); + anomalyResult += std::string("Anomaly detected!"); } else { - resultStr += std::string("Everything fine, no anomaly detected!"); + anomalyResult += std::string("Everything fine, no anomaly detected!"); } platform.data_psn->present_data_text( - resultStr.c_str(), resultStr.size(), + anomalyScore.c_str(), anomalyScore.size(), dataPsnTxtStartX1, rowIdx1, false); - info("%s\n", resultStr.c_str()); + info("%s\n", anomalyScore.c_str()); + info("%s\n", anomalyThreshold.c_str()); + info("%s\n", anomalyResult.c_str()); return true; } |