@@ -12,12 +12,32 @@ using namespace std;
1212#define __PARAMS_INPUT_MNEMOS__
1313
1414#include " parameters.hxx"
15- #include " params_codes.hxx"
1615
1716
18- class mnemos_bytes_stream : public mnemo_event {
17+ // Keep left and right in order to allow comma or point as a decimal separator
18+ // and even a mix inside the same file
19+ // The restriction is 3 digits blocs are not allowed e.g. 123,456.5
20+ /* * \brief Internal data specific to the mnemo events
21+ */
22+ struct mnemo_event {
23+ string TS_left;
24+ string TS_right;
25+ string TS_unit;
26+ string channel;
27+ string mnemo;
28+ string value_left;
29+ string value_right;
30+ string value_unit;
31+ mnemo_event ();
32+ mnemo_event ( const string&, const string&, const string&,
33+ const string&channel,
34+ const string&mnemo,
35+ const string&, const string&, const string& );
36+ };
37+
38+ class mnemos_bytes_stream : public mnemo_event , public input_event {
1939 // just copied and pasted, have to be enriched by the line parsing
20- enum state_t { state_ts, state_code, state_key, state_val, state_string, state_end } state;
40+ enum state_t { state_ts, state_code, state_end } state;
2141 enum { ls_start=0 , ls_wait_eol_comment=1 ,
2242 ls_in_ts_left=2 , ls_in_ts_right=3 , ls_in_ts_unit=4 , ls_spctab_ts=5 ,
2343 ls_in_channel=6 , ls_spctab_channel=7 ,
@@ -44,7 +64,7 @@ public:
4464 // For debug purposes, sends the content of a mnemo message
4565 friend ostream&operator <<( ostream&, const mnemos_bytes_stream& );
4666};
47- class mnemos_bytes_datagram_test : public mnemo_event {
67+ class mnemos_bytes_datagram_test : public mnemo_event , public input_event {
4868 ostream&info_out_str;
4969 input_params_base::clearing_t &mbs_clearing;
5070public:
@@ -122,7 +142,7 @@ private:
122142 unsigned long get_value ( const unsigned char &exponent_size, const unsigned char &exponent_const )const ;
123143 const mnemo_event&the_event;
124144 input_params_base::clearing_t &ipm2a_clearing;
125- mnemo_event ::status_t &ipm2a_status;
145+ input_event ::status_t &ipm2a_status;
126146 const multimap< short , string >mnemos_list;
127147 // Not that readable, but it avoid excessive indentation in the constructor
128148 const map< string, function< string(unsigned long &,signals_param_action::action_list&)> >mrf;
@@ -138,7 +158,7 @@ public:
138158 input_params_mnemos_2_action (ostream&info_out_str,
139159 const mnemo_event&,
140160 input_params_base::clearing_t &clearing,
141- mnemo_event ::status_t &status);
161+ input_event ::status_t &status);
142162 void mnemos_2_action_run (vector<signals_param_action>&actions_list);
143163};
144164
0 commit comments