libdballe 9.13
common.h
1#ifndef DBALLE_MSG_WREXPORTER_BASE_H
2#define DBALLE_MSG_WREXPORTER_BASE_H
3
4#include <dballe/msg/msg.h>
5
6namespace wreport {
7struct Subset;
8struct Bulletin;
9struct Var;
10} // namespace wreport
11
12namespace dballe {
13namespace impl {
14namespace msg {
15namespace wr {
16
18{
19protected:
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
33public:
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{
42protected:
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
61public:
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
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
135
140
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
Storage for related physical data.
Definition msg.h:134
Store an array of physical data all on the same level.
Definition context.h:24
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,...
void add_prec_group(const msg::Context *c)
Add time period and total precipitation from the given context.
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_wind_gust(const msg::Context *c)
Add a wind gust block with info from the given context.
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,...
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,...
Information on how a value has been sampled or computed with regards to time.
Definition types.h:689
Definition shortcuts.h:12