bufr2synop 0.24.0
Functions
bufr2tac_print.c File Reference

file with the code to print the results More...

#include "bufr2tac.h"
Include dependency graph for bufr2tac_print.c:

Go to the source code of this file.

Functions

int print_plain (FILE *f, struct metreport *m)
 Print in a file the report decoded to Traditional Alphanumeric Code in plain text format. A line per report. More...
 
int print_html (FILE *f, struct metreport *m)
 Print in a file the report decoded to Traditional Alphanumeric Code in plain html format. A line per report. More...
 
size_t print_geo (char **geo, size_t lmax, struct metreport *m)
 
size_t print_wigos_id (char **wid, size_t lmax, struct metreport *m)
 

Detailed Description

file with the code to print the results

Definition in file bufr2tac_print.c.

Function Documentation

◆ print_geo()

size_t print_geo ( char **  geo,
size_t  lmax,
struct metreport m 
)

Definition at line 71 of file bufr2tac_print.c.

72{
73 size_t used;
74 char sep = '|';
75
76 used = snprintf(*geo, lmax, "%8.4lf %9.4lf %6.1lf%c", m->g.lat, m->g.lon, m->g.alt, sep);
77 *geo += used;
78 return used;
79}
double lat
Definition: bufr2tac.h:299
double lon
Definition: bufr2tac.h:300
double alt
Definition: bufr2tac.h:301
struct met_geo g
Definition: bufr2tac.h:315

References met_geo::alt, metreport::g, met_geo::lat, and met_geo::lon.

Referenced by print_buoy_report(), print_climat_report(), print_synop_report(), print_temp_a(), print_temp_b(), print_temp_c(), and print_temp_d().

Here is the caller graph for this function:

◆ print_html()

int print_html ( FILE *  f,
struct metreport m 
)

Print in a file the report decoded to Traditional Alphanumeric Code in plain html format. A line per report.

Parameters
fpointer to file where to write to
mpointer to struct metreport where the decoded report is stored

Definition at line 51 of file bufr2tac_print.c.

52{
53 fprintf(f, "<pre>");
54 if ( m->alphanum[0] )
55 fprintf ( f, "%s\n", m->alphanum );
56 if ( m->alphanum2[0] )
57 fprintf ( f, "%s\n", m->alphanum2 );
58 if ( m->alphanum3[0] )
59 fprintf ( f, "%s\n", m->alphanum3 );
60 if ( m->alphanum4[0] )
61 fprintf ( f, "%s\n", m->alphanum4 );
62 fprintf(f, "</pre>");
63 return 0;
64}
char alphanum[REPORT_LENGTH]
Definition: bufr2tac.h:321
char alphanum3[REPORT_LENGTH]
Definition: bufr2tac.h:325
char alphanum2[REPORT_LENGTH]
Definition: bufr2tac.h:323
char alphanum4[REPORT_LENGTH]
Definition: bufr2tac.h:327

References metreport::alphanum, metreport::alphanum2, metreport::alphanum3, and metreport::alphanum4.

Referenced by main().

Here is the caller graph for this function:

◆ print_plain()

int print_plain ( FILE *  f,
struct metreport m 
)

Print in a file the report decoded to Traditional Alphanumeric Code in plain text format. A line per report.

Parameters
fpointer to file where to write to
mpointer to struct metreport where the decoded report is stored

Definition at line 32 of file bufr2tac_print.c.

33{
34 if ( m->alphanum[0] )
35 fprintf ( f, "%s\n", m->alphanum );
36 if ( m->alphanum2[0] )
37 fprintf ( f, "%s\n", m->alphanum2 );
38 if ( m->alphanum3[0] )
39 fprintf ( f, "%s\n", m->alphanum3 );
40 if ( m->alphanum4[0] )
41 fprintf ( f, "%s\n", m->alphanum4 );
42 return 0;
43}

References metreport::alphanum, metreport::alphanum2, metreport::alphanum3, and metreport::alphanum4.

Referenced by main().

Here is the caller graph for this function:

◆ print_wigos_id()

size_t print_wigos_id ( char **  wid,
size_t  lmax,
struct metreport m 
)

Definition at line 86 of file bufr2tac_print.c.

87{
88 char aux[40];
89 size_t used;
90 char sep = '|';
91
92 if (m->g.wid.series == 0 && m->g.wid.issuer == 0 && m->g.wid.issue == 0 && m->g.wid.local_id[0] == '\0')
93 sprintf (aux,"0-0-0-MISSING");
94 else
95 sprintf (aux,"%d-%d-%d-%s", m->g.wid.series, m->g.wid.issuer, m->g.wid.issue, m->g.wid.local_id );
96
97 used = snprintf (*wid, lmax, "%-32s%c", aux, sep);
98 *wid += used;
99 return used;
100}
struct wigos_id wid
Definition: bufr2tac.h:295
uint16_t issue
Definition: metcommon.h:49
uint16_t issuer
Definition: metcommon.h:48
uint8_t series
Definition: metcommon.h:47
char local_id[24]
Definition: metcommon.h:50

References metreport::g, wigos_id::issue, wigos_id::issuer, wigos_id::local_id, wigos_id::series, and met_geo::wid.

Referenced by print_buoy_report(), print_climat_report(), print_synop_report(), print_temp_a(), print_temp_b(), print_temp_c(), and print_temp_d().

Here is the caller graph for this function: