LCOV - code coverage report
Current view: top level - include - us_processor.hpp (source / functions) Coverage Total Hit
Test: Ultrasonic Sensor Unified Coverage Lines: 100.0 % 2 2
Test Date: 2026-04-24 03:29:20 Functions: 50.0 % 2 1
Branches: - 0 0

             Branch data     Line data    Source code
       1                 :             : #pragma once
       2                 :             : 
       3                 :             : #include "i_us_processor.hpp"
       4                 :             : #include "us_types.hpp"
       5                 :             : #include <cstddef>
       6                 :             : 
       7                 :             : namespace ultrasonic {
       8                 :             : 
       9                 :             : /**
      10                 :             :  * @brief Concrete implementation of IUsProcessor for statistical filtering of ultrasonic samples.
      11                 :             :  * @internal
      12                 :             :  */
      13                 :             : class UsProcessor : public IUsProcessor
      14                 :             : {
      15                 :             : public:
      16                 :             :     /** @internal */
      17                 :           3 :     UsProcessor() = default;
      18                 :          17 :     ~UsProcessor() override = default;
      19                 :             : 
      20                 :             :     /** @copydoc IUsProcessor::process() */
      21                 :             :     Reading process(const Reading *pings, uint8_t total_pings, const UsConfig &cfg) override;
      22                 :             : 
      23                 :             : private:
      24                 :             :     /** @internal */
      25                 :             :     float reduce_median(float *v, std::size_t n);
      26                 :             : 
      27                 :             :     /** @internal */
      28                 :             :     float reduce_dominant_cluster(float *v, std::size_t n);
      29                 :             : 
      30                 :             :     /** @internal */
      31                 :             :     float get_std_dev(const float *samples, uint8_t count);
      32                 :             : };
      33                 :             : 
      34                 :             : } // namespace ultrasonic
        

Generated by: LCOV version 2.0-1