libdballe  9.14
common.h
1 #ifndef DBALLE_MSG_WREXPORTER_BASE_H
2 #define DBALLE_MSG_WREXPORTER_BASE_H
3 
4 #include <dballe/msg/msg.h>
5 
6 namespace wreport {
7 struct Subset;
8 struct Bulletin;
9 struct Var;
10 } // namespace wreport
11 
12 namespace dballe {
13 namespace impl {
14 namespace msg {
15 namespace wr {
16 
18 {
19 protected:
20  // Subset being written
21  wreport::Subset* subset;
22  const Message* msg = 0;
23  const msg::Context* c_ana = 0;
24  const msg::Context* c_surface_instant = 0;
25 
26  void add(wreport::Varcode code, const msg::Context* ctx,
27  const Shortcut& shortcut) const;
28  void add(wreport::Varcode code, const msg::Context* ctx,
29  wreport::Varcode srccode) const;
30  void add(wreport::Varcode code, const msg::Context* ctx) const;
31  void add(wreport::Varcode code, const wreport::Var* var) const;
32 
33 public:
34  void init(const Message& msg, wreport::Subset& subset);
35  void scan_context(const msg::Context& c);
36 
37  void add_ecmwf_synop_head();
38 };
39 
41 {
42 protected:
43  const msg::Context* c_geopotential;
44  const msg::Context* c_thermo;
45  const msg::Context* c_tmax;
46  const msg::Context* c_tmin;
47  const msg::Context* c_prec1;
48  const msg::Context* c_prec2;
49  const msg::Context* c_prec24;
50  const msg::Context* c_cloud_cover;
51  const msg::Context* c_cloud_data[4];
52  const msg::Context* c_cloud_group[4];
53  const msg::Context* c_wind;
54  const msg::Context* c_gust1;
55  const msg::Context* c_gust2;
56  const msg::Context* c_visib;
57  const msg::Context* c_past_wtr;
58  const msg::Context* c_depth;
59  const msg::Context* c_swell_waves[2];
60 
61 public:
62  const wreport::Var* v_press;
63  const wreport::Var* v_pressmsl;
64  const wreport::Var* v_pchange3;
65  const wreport::Var* v_pchange24;
66  const wreport::Var* v_ptend;
67  const wreport::Var* v_geopotential;
68 
69  void init(const Message& msg, wreport::Subset& subset);
70  void scan_context(const msg::Context& c);
71 
72  // Pressure data
73  void add_D02001();
74  // synop: pressure data
75  void add_D02031();
76  // synop: temperature and humidity
77  void add_D02032();
78  // ship: temperature and humidity
79  void add_D02052();
80  // synop: extreme temperature data
81  void add_D02041();
82  // ship: extreme temperature data
83  void add_D02058();
84  void add_pressure();
85  void add_geopotential(wreport::Varcode code);
86  // Precipitation past 24 hours
87  void add_D02034();
88  // Precipitation measurement
89  void add_D02040();
90  // synop: wind data
91  void add_D02042();
92  // ship: wind data
93  void add_D02059();
94  // Present and past weather
95  void add_D02038();
96  void add_ecmwf_synop_weather();
97  // Basic synoptic "instantaneous" data
98  void add_D02035();
99  // Icing and ice
100  void add_D02055();
101  void add_ecmwf_ice();
102  // ship: visibility data
103  void add_D02053();
104  // Ship marine data
105  void add_D02056();
106  // Sea waves
107  void add_plain_waves();
108  // Ship waves (wind and swell)
109  void add_D02024();
110 
115  void add_sensor_height(const msg::Context& c,
116  const wreport::Var* sample_var = NULL);
117 
123  const wreport::Var* sample_var = NULL);
124 
129  void add_xtemp_group(wreport::Varcode code, const msg::Context* c);
130 
134  void add_prec_group(const msg::Context* c);
135 
139  void add_cloud_data();
140 
142  void add_wind_gust(const msg::Context* c);
143 
148  void add_time_period(wreport::Varcode code, const msg::Context& c,
149  const wreport::Var* sample_var, const Trange& tr_std);
150 };
151 
152 } // namespace wr
153 } // namespace msg
154 } // namespace impl
155 } // namespace dballe
156 
157 #endif
void add_marine_sensor_height(const msg::Context &c, const wreport::Var *sample_var=NULL)
Add B07032 and B07033 sensor heights, taking the value from the var attributes or the context...
Information on how a value has been sampled or computed with regards to time.
Definition: types.h:688
Definition: cmdline.h:18
void add_xtemp_group(wreport::Varcode code, const msg::Context *c)
Add an extreme temperature group, with the measured value added with the given code, from temperature data found on the given context.
Store an array of physical data all on the same level.
Definition: context.h:23
void add_time_period(wreport::Varcode code, const msg::Context &c, const wreport::Var *sample_var, const Trange &tr_std)
Add a B04025 or B04025 time period variable, with data taken from its parameters as needed...
void add_prec_group(const msg::Context *c)
Add time period and total precipitation from the given context.
void add_wind_gust(const msg::Context *c)
Add a wind gust block with info from the given context.
Definition: shortcuts.h:11
void add_cloud_data()
Add cloud data, as D02004 and a delayed replication of D02005.
void add_sensor_height(const msg::Context &c, const wreport::Var *sample_var=NULL)
Add B07032 sensor height, taking the value from the var attributes or the context, as appropriate.
Storage for related physical data.
Definition: msg.h:133