CARMA C++
SDPFiller.h
Go to the documentation of this file.
1 
11 #ifndef CARMA_SDP_SDPFILLER_H
12 #define CARMA_SDP_SDPFILLER_H
13 
14 // Carma includes
15 #include <carma/util/Time.h>
16 #include "carma/monitor/DataflowSubsystem.h"
17 
18 // Carma tools includes
19 
20 // C++ standard library includes
21 #include <string>
22 #include <vector>
23 #include <map>
24 
25 // Namespace using directives
26 
27 // Class definitions
28 namespace carma {
29  namespace sdp {
38  class SDPFiller
39  {
40  public:
45  SDPFiller(const std::string& astroHeaderDir,
46  const std::string& visBrickDir,
47  const std::string& scienceDataFormatDir,
48  const std::string& recycleDir,
49  const int& sleep,
50  const std::string& stopFile,
51  const bool writeFloats = false,
52  const bool getScript = true,
53  const bool force = false);
54 
57  ~SDPFiller();
58 
64  void reset();
65 
68  void processFiles(const std::vector<std::string>& inputAstroHdrFiles,
69  const carma::util::frameType& startFrame,
70  const carma::util::frameType& endFrame,
71  const std::string& corrType,
72  const std::string& outputSDPFile,
73  const bool& append, const bool& pdb);
74 
75  void processFiles(const std::vector<std::string>& inputAstroHdrFiles,
76  const carma::util::frameType& startFrame,
77  const carma::util::frameType& endFrame,
78  const std::string& corrType,
79  const bool& append, const bool& pdb);
80 
83  void processFrameCountRange(const carma::util::frameType& startFrame,
84  const carma::util::frameType& endFrame,
85  const std::string& corrType,
86  const std::string& outputSDPFile,
87  const bool& append, const bool& rt,
88  const bool& pdb);
89 
92  void processAll(const carma::util::frameType& startFrame,
93  const carma::util::frameType& endFrame,
94  const std::string& corrType, const bool& rt,
95  const bool& pdb);
96 
97  private:
98 
99  carma::monitor::DataflowSubsystem dataflow_;
102  std::string astroHeaderDir_p;
103 
106  std::string visBrickDir_p;
107 
110  std::string scienceDataFormatDir_p;
111 
114  std::string recycleDir_p;
115 
118  int sleep_p;
119 
122  static std::vector<std::string> badFiles;
123 
126  std::string stopFile_p;
127 
130  std::map<std::string, carma::util::frameType> lastFrameWritten_p;
131 
136  bool writeFloats_;
137  bool getScript_;
138  bool force_;
139 
140 
143  std::vector<std::string> dirlist(const std::string& dir);
144 
145 
146  bool in(std::string & file);
147 
150  carma::util::frameType extractFirstFrameCount(const std::string&
151  fileName);
152 
155  std::vector<std::string>
156  refreshInputFileList(const carma::util::frameType& startFrame,
157  const carma::util::frameType& endFrame,
158  bool ignoreDone=true, bool ignoreWrite=true);
159 
162  std::string sdpFileName(const std::string& astroHdrFile);
163 
166  std::string extractObsBlockId(const std::string& astroHdrFile);
167 
170  void updateReadState(const std::string& state,
171  std::string& astroHdrFile);
172 
175  void deleteSDPFile(const std::string& outputSDPFile);
176 
179  int moveCorruptedFile(const std::string& corruptedFile);
180 
181  };
182  }; // namespace sdp
183 }; // namespace carma
184 
185 
186 #endif //CARMA_SDP_SDPFILLER_H
~SDPFiller()
Desctructor.
Common time functions.
unsigned int frameType
Half second frames since Jan 1, 2000.
Definition: types.h:29
SDPFiller(const std::string &astroHeaderDir, const std::string &visBrickDir, const std::string &scienceDataFormatDir, const std::string &recycleDir, const int &sleep, const std::string &stopFile, const bool writeFloats=false, const bool getScript=true, const bool force=false)
Constructor.
void processFrameCountRange(const carma::util::frameType &startFrame, const carma::util::frameType &endFrame, const std::string &corrType, const std::string &outputSDPFile, const bool &append, const bool &rt, const bool &pdb)
Process input astro header files within a frame count range.
void processFiles(const std::vector< std::string > &inputAstroHdrFiles, const carma::util::frameType &startFrame, const carma::util::frameType &endFrame, const std::string &corrType, const std::string &outputSDPFile, const bool &append, const bool &pdb)
Process a list of astronomical header files.
void processAll(const carma::util::frameType &startFrame, const carma::util::frameType &endFrame, const std::string &corrType, const bool &rt, const bool &pdb)
Process all available input astronomical header files.
void reset()
Reset the science data products filler.
A class to create output files in the science data product format.
Definition: SDPFiller.h:38