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

          Line data    Source code
       1             : /*
       2             :  * ObservationRecord.h
       3             :  *
       4             :  *  Created on: Jan 27, 2016
       5             :  *      Author: nakazato
       6             :  */
       7             : 
       8             : #ifndef SINGLEDISH_FILLER_OBSERVATIONRECORD_H_
       9             : #define SINGLEDISH_FILLER_OBSERVATIONRECORD_H_
      10             : 
      11             : #include <casacore/casa/BasicSL/String.h>
      12             : #include <casacore/ms/MeasurementSets/MSObservation.h>
      13             : #include <casacore/ms/MeasurementSets/MSObsColumns.h>
      14             : 
      15             : namespace casa { //# NAMESPACE CASA - BEGIN
      16             : namespace sdfiller { //# NAMESPACE SDFILLER - BEGIN
      17             : 
      18             : struct ObservationRecord {
      19             :   typedef casacore::MSObservation AssociatingTable;
      20             :   typedef casacore::MSObservationColumns AssociatingColumns;
      21             : 
      22             :   // mandatory
      23             :   casacore::String telescope_name;
      24             :   casacore::Vector<casacore::Double> time_range;
      25             :   casacore::String observer;
      26             :   casacore::String project;
      27             : 
      28             :   // optional
      29             :   casacore::String schedule_type;
      30             :   casacore::Double release_date;
      31             :   casacore::Vector<casacore::String> schedule;
      32             :   casacore::Vector<casacore::String> log;
      33             : 
      34             :   // method
      35           0 :   void clear() {
      36           0 :     telescope_name = "";
      37           0 :     time_range.resize();
      38           0 :     observer = "";
      39           0 :     project = "";
      40           0 :     schedule_type = "";
      41           0 :     release_date = -1.0;
      42           0 :     schedule = "";
      43           0 :     log.resize();
      44           0 :   }
      45             : 
      46             :   ObservationRecord &operator=(ObservationRecord const &other) {
      47             :     telescope_name = other.telescope_name;
      48             :     time_range = other.time_range;
      49             :     observer = other.observer;
      50             :     project = other.project;
      51             :     schedule_type = other.schedule_type;
      52             :     release_date = other.release_date;
      53             :     schedule = other.schedule;
      54             :     log = other.log;
      55             :     return *this;
      56             :   }
      57             : 
      58           0 :   void add(AssociatingTable &table, AssociatingColumns &/*columns*/) {
      59           0 :     table.addRow(1, true);
      60           0 :   }
      61             : 
      62           0 :   casacore::Bool fill(casacore::uInt irow, AssociatingColumns &columns) {
      63           0 :     if (columns.nrow() <= irow) {
      64           0 :       return false;
      65             :     }
      66             : 
      67           0 :     columns.telescopeName().put(irow, telescope_name);
      68           0 :     columns.timeRange().put(irow, time_range);
      69           0 :     columns.observer().put(irow, observer);
      70           0 :     columns.project().put(irow, project);
      71           0 :     if (schedule_type.size() > 0) {
      72           0 :       columns.scheduleType().put(irow, schedule_type);
      73             :     }
      74           0 :     if (0.0 <= release_date) {
      75           0 :       columns.releaseDate().put(irow, release_date);
      76             :     }
      77           0 :     if (schedule.size() > 0) {
      78           0 :       columns.schedule().put(irow, schedule);
      79             :     }
      80           0 :     if (log.size() > 0) {
      81           0 :       columns.log().put(irow, log);
      82             :     }
      83           0 :     return true;
      84             :   }
      85             : };
      86             : 
      87             : } //# NAMESPACE SDFILLER - END
      88             : } //# NAMESPACE CASA - END
      89             : 
      90             : #endif /* SINGLEDISH_FILLER_OBSERVATIONRECORD_H_ */

Generated by: LCOV version 1.16