You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.7 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. #pragma once
  2. #include <fstream>
  3. #include <functional>
  4. #include <iostream>
  5. #include <list>
  6. #include <map>
  7. #include <memory>
  8. #include <set>
  9. #include <sstream>
  10. #include <string>
  11. #include <vector>
  12. namespace a8k_opt_algo {
  13. using namespace std;
  14. /***********************************************************************************************************************
  15. * *
  16. ***********************************************************************************************************************/
  17. typedef enum {
  18. kOptErr_suc,
  19. kOptErr_pointNumError,
  20. } ecode_t;
  21. class OptAlgoPreProcessResult {
  22. public:
  23. bool scanAgain;
  24. int32_t suggestScanGain;
  25. };
  26. ecode_t T_A8kOptAlgoPreProcess(vector<float> ogigin_val, //
  27. int32_t now_scan_gain, //
  28. int32_t expectResultRangeStart, //
  29. int32_t expectResultRangeEnd, //
  30. OptAlgoPreProcessResult& result);
  31. ecode_t F_A8kOptAlgoPreProcess(vector<float> ogigin_val, //
  32. int32_t now_scan_gain, //
  33. int32_t expectResultRangeStart, //
  34. int32_t expectResultRangeEnd, //
  35. OptAlgoPreProcessResult& result);
  36. /***********************************************************************************************************************
  37. * *
  38. ***********************************************************************************************************************/
  39. class PeakInfo {
  40. public:
  41. bool find_peak; //
  42. float area; //
  43. int peak_pos; //
  44. int peak_start_pos; //
  45. int peak_end_pos; //
  46. };
  47. class OptAlgoResult {
  48. public:
  49. /**
  50. * @brief
  51. */
  52. vector<float> input; //
  53. vector<float> displayData; //
  54. /**
  55. * @brief
  56. */
  57. PeakInfo pin040; //
  58. PeakInfo pin080; //
  59. PeakInfo pin120; //
  60. PeakInfo pin160; //
  61. PeakInfo pin200; //
  62. };
  63. ecode_t A8kOptAlgoProcess(vector<float> ogigin_val, OptAlgoResult& result);
  64. /**
  65. * @brief Debug
  66. */
  67. class PorcessContext {
  68. public:
  69. vector<float> raw; //
  70. vector<float> avg; //
  71. vector<float> diff; //
  72. vector<float> diffX2; //
  73. float agvline; //
  74. };
  75. void A8kOptAlgoGetProcessContext(PorcessContext& context);
  76. } // namespace a8k_opt_algo