LCOV - code coverage report
Current view: top level - singledishfiller/Filler - WeatherRecord.h (source / functions) Hit Total Coverage
Test: casacpp_coverage.info Lines: 0 28 0.0 %
Date: 2024-10-28 15:53:10 Functions: 0 3 0.0 %

          Line data    Source code
       1             : /*
       2             :  * WeatherRecord.h
       3             :  *
       4             :  *  Created on: Jan 27, 2016
       5             :  *      Author: nakazato
       6             :  */
       7             : 
       8             : #ifndef SINGLEDISH_FILLER_WeatherRECORD_H_
       9             : #define SINGLEDISH_FILLER_WeatherRECORD_H_
      10             : 
      11             : #include <casacore/casa/BasicSL/String.h>
      12             : #include <casacore/measures/Measures/MPosition.h>
      13             : #include <casacore/ms/MeasurementSets/MSWeather.h>
      14             : #include <casacore/ms/MeasurementSets/MSWeatherColumns.h>
      15             : 
      16             : namespace casa { //# NAMESPACE CASA - BEGIN
      17             : namespace sdfiller { //# NAMESPACE SDFILLER - BEGIN
      18             : 
      19             : struct WeatherRecord {
      20             :   typedef casacore::MSWeather AssociatingTable;
      21             :   typedef casacore::MSWeatherColumns AssociatingColumns;
      22             : 
      23             :   // mandatory
      24             :   casacore::Int antenna_id;
      25             :   casacore::Double time;
      26             :   casacore::Double interval;
      27             : 
      28             :   // optional
      29             :   casacore::Float temperature;
      30             :   casacore::Float pressure;
      31             :   casacore::Float rel_humidity;
      32             :   casacore::Float wind_speed;
      33             :   casacore::Float wind_direction;
      34             : 
      35             :   // method
      36           0 :   void clear() {
      37           0 :     antenna_id = -1;
      38           0 :     time = 0.0;
      39           0 :     interval = 0.0;
      40           0 :     temperature = -1.0;
      41           0 :     pressure = -1.0;
      42           0 :     rel_humidity = -1.0;
      43           0 :     wind_speed = -1.0;
      44           0 :     wind_direction = -1.0;
      45           0 :   }
      46             : 
      47             :   WeatherRecord &operator=(WeatherRecord const &other) {
      48             :     antenna_id = other.antenna_id;
      49             :     time = other.time;
      50             :     interval = other.interval;
      51             :     temperature = other.temperature;
      52             :     pressure = other.pressure;
      53             :     rel_humidity = other.rel_humidity;
      54             :     wind_speed = other.wind_speed;
      55             :     wind_direction = other.wind_direction;
      56             :     return *this;
      57             :   }
      58             : 
      59           0 :   bool operator==(WeatherRecord const &other) {
      60           0 :     return (antenna_id == other.antenna_id)
      61           0 :         && (temperature == other.temperature) && (pressure == other.pressure)
      62           0 :         && (rel_humidity == other.rel_humidity)
      63           0 :         && (wind_speed == other.wind_speed)
      64           0 :         && (wind_direction == other.wind_direction);
      65             :   }
      66             : 
      67             :   void add(AssociatingTable &table, AssociatingColumns &/*columns*/) {
      68             :     table.addRow(1, true);
      69             :   }
      70             : 
      71           0 :   casacore::Bool fill(casacore::uInt irow, AssociatingColumns &columns) {
      72           0 :     if (columns.nrow() <= irow) {
      73           0 :       return false;
      74             :     }
      75             : 
      76           0 :     columns.antennaId().put(irow, antenna_id);
      77           0 :     columns.time().put(irow, time);
      78           0 :     columns.interval().put(irow, interval);
      79           0 :     columns.temperature().put(irow, temperature);
      80           0 :     columns.pressure().put(irow, pressure);
      81           0 :     columns.relHumidity().put(irow, rel_humidity);
      82           0 :     columns.windSpeed().put(irow, wind_speed);
      83           0 :     columns.windDirection().put(irow, wind_direction);
      84             : 
      85           0 :     return true;
      86             :   }
      87             : };
      88             : 
      89             : } //# NAMESPACE SDFILLER - END
      90             : } //# NAMESPACE CASA - END
      91             : 
      92             : #endif /* SINGLEDISH_FILLER_WeatherRECORD_H_ */

Generated by: LCOV version 1.16