• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

icsm-au / DynAdjust / 13494567994

24 Feb 2025 09:15AM UTC coverage: 81.168% (+2.0%) from 79.161%
13494567994

push

github

web-flow
Merge pull request #234 from icsm-au/1.2.8

Version 1.2.8 (fixes, ehnacements, improved datum management)

6131 of 8137 new or added lines in 90 files covered. (75.35%)

162 existing lines in 33 files now uncovered.

32214 of 39688 relevant lines covered (81.17%)

11775.25 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

89.27
/dynadjust/dynadjust/dnaplotwrapper/dnaplotwrapper.cpp
1
//============================================================================
2
// Name         : dnaplotwrapper.cpp
3
// Author       : Roger Fraser
4
// Contributors :
5
// Version      : 1.00
6
// Copyright    : Copyright 2017 Geoscience Australia
7
//
8
//                Licensed under the Apache License, Version 2.0 (the "License");
9
//                you may not use this file except in compliance with the License.
10
//                You may obtain a copy of the License at
11
//               
12
//                http ://www.apache.org/licenses/LICENSE-2.0
13
//               
14
//                Unless required by applicable law or agreed to in writing, software
15
//                distributed under the License is distributed on an "AS IS" BASIS,
16
//                WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
//                See the License for the specific language governing permissions and
18
//                limitations under the License.
19
//
20
// Description  : DynAdjust Plot Executable
21
//============================================================================
22

23
#include <dynadjust/dnaplotwrapper/dnaplotwrapper.hpp>
24

25
void ProcessGnuPlot(dna_plot* plotDynaML, project_settings& p, plotGraphMode mode)
4✔
26
{
27
        std::string str_mode;
4✔
28
        switch (mode)
4✔
29
        {
30
        case StationsMode:
2✔
31
                str_mode = "stations";
2✔
32
                break;
33
        case MeasurementsMode:
2✔
34
                str_mode = "measurements";
2✔
35
                break;
36
        }
37
        
38
        if (p.g.verbose > 0 || p.g.quiet != 1)
4✔
39
        {
40
                std::cout << "+ Preparing the " << str_mode << " histogram via gnuplot... ";
4✔
41
                std::cout.flush();
4✔
42
        }
43
        
44
        plotDynaML->CreategnuplotGraphEnvironment(&p, mode);
4✔
45

46
        if (p.g.verbose > 0 || p.g.quiet != 1)
4✔
47
        {
48
                std::cout << "done." << std::endl << std::endl;
4✔
49

50
                std::cout << std::setw(PRINT_VAR_PAD) << "+ Plot details:" << std::endl;
4✔
51
                std::cout << std::setw(PRINT_VAR_PAD) << "  PDF file name:" << p.p._pdf_file_name << std::endl;
4✔
52
                if (p.p._supress_pdf_creation || p.p._keep_gen_files)
4✔
53
                {
54
#if defined(_WIN32) || defined(__WIN32__)
55
                        std::cout << std::setw(PRINT_VAR_PAD) << "  Batch file:" << p.p._gnuplot_cmd_file << std::endl;
56
#elif defined(__linux) || defined(sun) || defined(__unix__) || defined(__APPLE__)
57
                        std::cout << std::setw(PRINT_VAR_PAD) << "  Shell script:" << p.p._gnuplot_cmd_file << std::endl;
4✔
58
#endif        
59
                }
60
                std::cout << std::setw(PRINT_VAR_PAD) << "  Block threshold:" << plotDynaML->blockThreshold() << std::endl;
4✔
61
                std::cout << std::setw(PRINT_VAR_PAD) << "  Min inner stns:" << plotDynaML->minInnerStns() << std::endl;
4✔
62
                std::cout << std::setw(PRINT_VAR_PAD) << "  Block count:" << plotDynaML->blockCount() << std::endl;
4✔
63
                std::cout << std::setw(PRINT_VAR_PAD) << "  Station count:" << plotDynaML->stationCount() << std::endl;
4✔
64
                std::cout << std::setw(PRINT_VAR_PAD) << "  Measurement count:" << plotDynaML->measurementCount() << std::endl;
4✔
65
                std::cout << std::setw(PRINT_VAR_PAD) << "  Measurement categories:" << plotDynaML->measurementCategories() << std::endl;
4✔
66
                
67
                std::cout << std::endl;
4✔
68

69
        }
70

71
        // if option --supress-pdf-creation is provided to dnaplotwrapper, then don't
72
        // execute the bat/shell scripts to call GMT or gnuplot.
73
        if (p.p._supress_pdf_creation)
4✔
74
        {
75
                if (p.g.verbose > 0 || p.g.quiet != 1)
4✔
76
                {
77
                        std::cout << "+ The input data files and " <<
4✔
78
#if defined(_WIN32) || defined(__WIN32__)
79
                        "batch file";
80
#elif defined(__linux) || defined(sun) || defined(__unix__) || defined(__APPLE__)
81
                        "shell script";
4✔
82
#endif
83
                        std::cout << " to create the final PDF histogram" << std::endl << 
4✔
84
                                "  via gnuplot have been generated." << std::endl;
4✔
85
                        std::cout << "+ To configure the histogram's font sizes, colours, scale, annotations, etc.," << std::endl <<
4✔
86
                                "  edit the " <<
87
#if defined(_WIN32) || defined(__WIN32__)
88
                        "batch file";
89
#elif defined(__linux) || defined(sun) || defined(__unix__) || defined(__APPLE__)
90
                        "shell script";
4✔
91
#endif
92
                        std::cout << " directly and execute as normal." << std::endl << std::endl;
4✔
93
                }
94

95
                return;
4✔
96
        }
97

98
        if (p.g.verbose > 0 || p.g.quiet != 1)
×
99
        {
NEW
100
                std::cout << "+ Creating the PDF... ";
×
NEW
101
                std::cout.flush();                
×
102
        }
103

104
        // Invoke gnuplot to create the PDF plot.
105
        // if option --supress-pdf-creation is provided to dnaplotwrapper, then don't
106
        // execute the bat/shell scripts to call gnuplot.
107
        plotDynaML->CreateSegmentationGraph(mode);
×
108

109
        if (p.g.verbose > 0 || p.g.quiet != 1)
×
110
        {
NEW
111
                std::cout << "done." << std::endl << std::endl;
×
NEW
112
                std::cout << "+ Open " << p.p._pdf_file_name << " to view the PDF " <<
×
NEW
113
                        str_mode << " histogram." << std::endl << std::endl;
×
NEW
114
                std::cout.flush();
×
115
        }
116
}
4✔
117

118
void ProcessGMTPlot(dna_plot* plotDynaML, project_settings& p, std::string& measurement_types)
27✔
119
{
120
        if (p.g.verbose > 0 || p.g.quiet != 1)
27✔
121
        {
122
                std::cout << "+ Preparing shell script and data files in GMT format... ";
27✔
123
                std::cout.flush();
27✔
124
        }        
125

126
        p.p._gmt_params.clear();
27✔
127
        p.p._gmt_params.push_back(string_string_pair("MAP_GRID_PEN_PRIMARY", "0.5p,128/128/128"));
54✔
128
        p.p._gmt_params.push_back(string_string_pair("MAP_FRAME_TYPE", "fancy"));
54✔
129
        p.p._gmt_params.push_back(string_string_pair("PS_MEDIA", "A0"));
54✔
130
        p.p._gmt_params.push_back(string_string_pair("MAP_FRAME_PEN", "1p"));
54✔
131
        
132
        p.p._separate_msrs.clear();
27✔
133

134
        if (!measurement_types.empty())
27✔
135
        {
136
                str_toupper<int>(measurement_types);
2✔
137
                for_each(measurement_types.begin(), measurement_types.end(),
2✔
138
                        [&p] (char& m) { p.p._separate_msrs.push_back(m); });
28✔
139
        }
140
        else
141
        {
142
                // the order of measurement types in _separate_msrs determines the order of measurement layers
143
                // last is on top
144

145
                // GPS point clusters
146
                p.p._separate_msrs.push_back('Y');                // Circle diameter is 3.0 * station circle diameter
25✔
147
                                                                                                // Largest circles (larger than P, R, Q)
148

149
                // astronomic azimuth
150
                p.p._separate_msrs.push_back('K');
25✔
151
                
152
                // position and height measurements
153
                // These measurements are printed as circles, the diameter of which is 
154
                // a multiple of the station circle diameter (as follows)
155
                p.p._separate_msrs.push_back('I');                // Circle diameter is 2.75 * station circle diameter
25✔
156
                p.p._separate_msrs.push_back('P');                // ''
25✔
157
                p.p._separate_msrs.push_back('J');                // Circle diameter is 2.4 * station circle diameter
25✔
158
                p.p._separate_msrs.push_back('Q');                // ''
25✔
159
                p.p._separate_msrs.push_back('H');                // Circle diameter is 1.7 * station circle diameter
25✔
160
                p.p._separate_msrs.push_back('R');                // ''
25✔
161
                
162
                // verticals, zeniths, angles, geodetic azimuths, directions
163
                p.p._separate_msrs.push_back('Z');
25✔
164
                p.p._separate_msrs.push_back('V');
25✔
165
                p.p._separate_msrs.push_back('A');
25✔
166
                p.p._separate_msrs.push_back('B');
25✔
167
                p.p._separate_msrs.push_back('D');
25✔
168
                
169
                // diff heights
170
                p.p._separate_msrs.push_back('L');
25✔
171
                
172
                // distances
173
                p.p._separate_msrs.push_back('S');
25✔
174
                p.p._separate_msrs.push_back('M');
25✔
175
                p.p._separate_msrs.push_back('E');
25✔
176
                p.p._separate_msrs.push_back('C');
25✔
177
                
178
                // GPS baselines
179
                p.p._separate_msrs.push_back('X');
25✔
180
                p.p._separate_msrs.push_back('G');
25✔
181
        }
182

183
        // prepare the schell scripts and data files
184
        plotDynaML->CreateGMTPlotEnvironment(&p);
27✔
185
        if (p.g.verbose > 0 || p.g.quiet != 1)
24✔
186
        {
187
                std::cout << "done." << std::endl << std::endl;
24✔
188

189
                std::cout << std::setw(PRINT_VAR_PAD) << "+ Plot details:" << std::endl;
24✔
190
                std::cout << std::setw(PRINT_VAR_PAD) << "  PDF file name:" << p.p._pdf_file_name << std::endl;
24✔
191
                if (p.p._export_png)
24✔
192
                        std::cout << std::setw(PRINT_VAR_PAD) << "  Export to png:" << "Yes" << std::endl;
2✔
193
                if (p.p._supress_pdf_creation || p.p._keep_gen_files)
24✔
194
                {
195
#if defined(_WIN32) || defined(__WIN32__)
196
                        if (p.p._plot_phased_blocks && p.p._plot_block_number < 1)
197
                                std::cout << std::setw(PRINT_VAR_PAD) << "  Batch files:" << p.p._gmt_cmd_file << "..." << std::endl;
198
                        else
199
                                std::cout << std::setw(PRINT_VAR_PAD) << "  Batch file:" << p.p._gmt_cmd_file << std::endl;
200
#elif defined(__linux) || defined(sun) || defined(__unix__) || defined(__APPLE__)
201
                        if (p.p._plot_phased_blocks && p.p._plot_block_number < 1)
×
NEW
202
                                std::cout << std::setw(PRINT_VAR_PAD) << "  Shell scripts:" << p.p._gmt_cmd_file << "..." << std::endl;
×
203
                        else
NEW
204
                                std::cout << std::setw(PRINT_VAR_PAD) << "  Shell script:" << p.p._gmt_cmd_file << std::endl;
×
205
#endif        
206
                }                
207
                if (!measurement_types.empty())
24✔
208
                        std::cout << std::setw(PRINT_VAR_PAD) << std::left << "  Measurement types: " << measurement_types << std::endl;
2✔
209
                if (p.p._plot_station_labels)
24✔
210
                        std::cout << std::setw(PRINT_VAR_PAD) << "  Label stations:" << "Yes" << std::endl;
3✔
211
                if (p.p._plot_alt_name)
24✔
212
                        std::cout << std::setw(PRINT_VAR_PAD) << "  Use alternate name:" << "Yes" << std::endl;
1✔
213
                if (p.p._plot_station_constraints)
24✔
214
                        std::cout << std::setw(PRINT_VAR_PAD) << "  Label constraints:" << "Yes" << std::endl;
1✔
215
                if (p.p._plot_correction_arrows)
24✔
216
                        std::cout << std::setw(PRINT_VAR_PAD) << "  Plot correction arrows:" << "Yes" << std::endl;
2✔
217
                if (p.p._plot_correction_labels)
24✔
218
                        std::cout << std::setw(PRINT_VAR_PAD) << "  Label corrections:" << "Yes" << std::endl;
2✔
219
                if (p.p._plot_error_ellipses)
24✔
220
                        std::cout << std::setw(PRINT_VAR_PAD) << "  Plot error ellipses:" << "Yes" << std::endl;
2✔
221
                if (p.p._plot_positional_uncertainty)
24✔
222
                        std::cout << std::setw(PRINT_VAR_PAD) << "  Plot positional uncertainty:" << "Yes" << std::endl;
2✔
223
                
224
                if (!are_floats_equal(p.p._correction_scale, 1.))
24✔
225
                        std::cout << std::setw(PRINT_VAR_PAD) << std::left << "  Scale correction arrows: " << std::fixed << std::setprecision(3) << p.p._correction_scale << std::endl;
2✔
226
                if (!are_floats_equal(p.p._pu_ellipse_scale, 1.))
24✔
227
                        std::cout << std::setw(PRINT_VAR_PAD) << std::left << "  Scale uncertainties/ellipses: " << std::fixed << std::setprecision(3) << p.p._pu_ellipse_scale << std::endl;
2✔
228
                                
229
                if (!p.p._bounding_box.empty())
24✔
230
                        std::cout << std::setw(PRINT_VAR_PAD) << std::left << "  Bounding box: " << p.p._bounding_box << std::endl;
4✔
231
                else
232
                {
233
                        if (!p.p._plot_station_centre.empty())
20✔
234
                                std::cout << std::setw(PRINT_VAR_PAD) << "  Centre on Station:" << p.p._plot_station_centre << std::endl;
1✔
235
                        else
236
                        {
237
                                if (!are_floats_equal(p.p._plot_centre_latitude, -999.))
19✔
238
                                        std::cout << std::setw(PRINT_VAR_PAD) << "  Centre latitude:" << std::fixed << std::setprecision(9) << FormatDmsString(DegtoDms(p.p._plot_centre_latitude), 4, true, true) << std::endl;
12✔
239
                                if (!are_floats_equal(p.p._plot_centre_longitude, -999.))
19✔
240
                                        std::cout << std::setw(PRINT_VAR_PAD) << "  Centre longitude:" << std::fixed << std::setprecision(9) << FormatDmsString(DegtoDms(p.p._plot_centre_longitude), 4, true, true) << std::endl;
12✔
241
                        }
242
                        if (!are_floats_equal(p.p._plot_area_radius, 5000.))
20✔
243
                                std::cout << std::setw(PRINT_VAR_PAD) << "  Area radius:" << std::fixed << std::setprecision(2) << p.p._plot_area_radius << " metres" << std::endl;
1✔
244
                }
245
                std::cout << std::setw(PRINT_VAR_PAD) << "  Map projection:" << projectionTypes[p.p._projection] << std::endl;
24✔
246
                std::cout << std::setw(PRINT_VAR_PAD) << "  Ground width:" << std::fixed << std::setprecision(4) << p.p._ground_width / 1000. << " kilometres" << std::endl;
24✔
247
                std::cout << std::setw(PRINT_VAR_PAD) << "  Page width:" << std::fixed << std::setprecision(2) << p.p._page_width << " centimetres" << std::endl;
24✔
248
                std::cout << std::setw(PRINT_VAR_PAD) << "  Coastline resolution:" << coastResolutionTypes[p.p._coasline_resolution] << std::endl;
24✔
249
                std::cout << std::setw(PRINT_VAR_PAD) << "  Scale:" << "1:" << std::fixed << std::setprecision(0) << p.p._plot_scale << std::endl;                                        
24✔
250
                std::cout << std::setw(PRINT_VAR_PAD) << "  Label font size:" << std::fixed << std::setprecision(0) << p.p._label_font_size << std::endl;
24✔
251
                
252
                std::cout << std::endl;
24✔
253
        }
254

255
        // Does the user not want to create the PDf plots?
256
        if (p.p._supress_pdf_creation)
24✔
257
        {
258
                if (p.g.verbose > 0 || p.g.quiet != 1)
×
259
                {
NEW
260
                        std::cout << "+ The input data files and " <<
×
261
#if defined(_WIN32) || defined(__WIN32__)
262
                        "batch file";
263
#elif defined(__linux) || defined(sun) || defined(__unix__) || defined(__APPLE__)
264
                        "shell script";
×
265
#endif
266
                        if (p.p._plot_phased_blocks && p.p._plot_block_number < 1)
×
NEW
267
                                std::cout << "s";
×
268

NEW
269
                        std::cout << " to create the final PDF plot" << std::endl << "  via GMT have been generated." << std::endl;
×
NEW
270
                        std::cout << "+ To configure the plot's font sizes, colours, scale, annotations, etc.," << std::endl <<
×
271
                                "  edit the " <<
272
#if defined(_WIN32) || defined(__WIN32__)
273
                        "batch file";
274
#elif defined(__linux) || defined(sun) || defined(__unix__) || defined(__APPLE__)
275
                        "shell script";
×
276
#endif
277
                        if (p.p._plot_phased_blocks && p.p._plot_block_number < 1)
×
NEW
278
                                std::cout << "s";
×
NEW
279
                        std::cout << " directly and execute as normal." << std::endl << std::endl;
×
280
                }
281

282
                return;
×
283
        }
284

285
        // create the PDF image..
286
        if (p.g.verbose > 0 || p.g.quiet != 1)
24✔
287
        {                                        
288
                std::cout << "+ Generating PDF via GMT... ";
24✔
289
                std::cout.flush();
24✔
290
        }
291

292
        // Invoke concurrent GMT process to create the PDF plot.
293
        // If phased, plotDynaML will aggregate all PDFs into a single
294
        // plot.
295
        //
296
        // if option --supress-pdf-creation is provided to dnaplotwrapper, then don't
297
        // execute the bat/shell scripts to call GMT.
298
        plotDynaML->CreateGMTPlot();
24✔
299

300
        if (p.g.verbose > 0 || p.g.quiet != 1)
24✔
301
        {
302
                std::cout << "done." << std::endl << std::endl <<
24✔
303
                        "+ Open " << p.p._pdf_file_name << " to view the final PDF plot." << std::endl << std::endl;
24✔
304
                std::cout.flush();
24✔
305
        }
306

307
}
308
        
309
int main(int argc, char* argv[])
48✔
310
{
311
        // create banner message
312
        std::string cmd_line_banner, tmp;
48✔
313
        fileproc_help_header(&cmd_line_banner);
48✔
314

315
        std::string stnfilename, msrfilename, measurement_types;
48✔
316
        
317
        project_settings p;
48✔
318
        
319
        boost::program_options::variables_map vm;
48✔
320
        boost::program_options::positional_options_description positional_options;
48✔
321
        
322
        boost::program_options::options_description standard_options("+ " + std::string(ALL_MODULE_STDOPT), PROGRAM_OPTIONS_LINE_LENGTH);
144✔
323
        boost::program_options::options_description config_options("+ " + std::string(PLOT_MODULE_CONFIG), PROGRAM_OPTIONS_LINE_LENGTH);
144✔
324
        boost::program_options::options_description titleblock_options("+ " + std::string(PLOT_MODULE_TITLEBLOCK), PROGRAM_OPTIONS_LINE_LENGTH);
144✔
325
        boost::program_options::options_description map_options("+ " + std::string(PLOT_MODULE_MAP), PROGRAM_OPTIONS_LINE_LENGTH);
144✔
326
        boost::program_options::options_description generic_options("+ " + std::string(ALL_MODULE_GENERIC), PROGRAM_OPTIONS_LINE_LENGTH);
144✔
327

328
        tmp = "+ ";
48✔
329
        tmp.append(__BINARY_NAME__).append(" usage:  ").append(__BINARY_NAME__).append(" ").append(NETWORK_NAME).append(" [options]");
48✔
330
        boost::program_options::options_description allowable_options(tmp, PROGRAM_OPTIONS_LINE_LENGTH);
48✔
331

332
        try {
48✔
333
                // Declare a group of options that will be 
334
                // allowed only on command line                
335
                generic_options.add_options()
48✔
336
                        (VERBOSE, boost::program_options::value<UINT16>(&p.g.verbose),
48✔
337
                                std::string("Give detailed information about what ").append(__BINARY_NAME__).append(" is doing.\n  0: No information (default)\n  1: Helpful information\n  2: Extended information\n  3: Debug level information").c_str())
96✔
338
                        (QUIET,
48✔
339
                                std::string("Suppresses all explanation of what ").append(__BINARY_NAME__).append(" is doing unless an error occurs").c_str())
96✔
340
                        (VERSION_V, "Display the current program version")
48✔
341
                        (HELP_H, "Show this help message")
48✔
342
                        (HELP_MODULE_H, boost::program_options::value<std::string>(),
48✔
343
                                "Provide help for a specific help category.")
344
                        ;
345

346
                standard_options.add_options()
48✔
347
                        (PROJECT_FILE_P, boost::program_options::value<std::string>(&p.g.project_file),
48✔
348
                                "Project file name. Full path to project file. If none specified, a new file is created using input-folder and network-name.")
349
                        (NETWORK_NAME_N, boost::program_options::value<std::string>(&p.g.network_name), 
48✔
350
                                "Network name. User defined name for all output files. Default is \"network#\".")
351
                        (INPUT_FOLDER_I, boost::program_options::value<std::string>(&p.g.input_folder),
48✔
352
                                "Path containing all input files")
353
                        (OUTPUT_FOLDER_O, boost::program_options::value<std::string>(&p.g.output_folder),                // default is ./,
48✔
354
                                "Path for all output files")
355
                        (BIN_STN_FILE, boost::program_options::value<std::string>(&p.i.bst_file),
48✔
356
                                "Binary station file name. Overrides network name.")
357
                        (BIN_MSR_FILE, boost::program_options::value<std::string>(&p.i.bms_file),
48✔
358
                                "Binary measurement file name. Overrides network name.")
359
                        ;
360

361
                // Declare a group of options that will be 
362
                // allowed both on command line and in
363
                // config file        
364
                config_options.add_options()
48✔
365
                        (PLOT_MSRS, boost::program_options::value<std::string>(&measurement_types),
48✔
366
                                "Plot the specified measurement types. arg is a non-delimited string of measurement types (eg \"GXY\").")
367
                        (PLOT_MSRS_IGNORED,
48✔
368
                                "Plot ignored measurements.")
369
                        (PLOT_BLOCKS,
48✔
370
                                "Plot the blocks of a segmented network in individual sheets.  Requires a corresponding segmentation file.")
371
                        (SEG_FILE, boost::program_options::value<std::string>(&p.s.seg_file),
48✔
372
                                "Network segmentation file. Filename overrides network name.")
373
                        (BLOCK_NUMBER, boost::program_options::value<UINT32>(&p.p._plot_block_number),
48✔
374
                                "When plotting phased adjustments, plot this block only. Zero (default) plots all blocks.")
375
                        (PLOT_STN_LABELS,
48✔
376
                                "Plot the station labels.")
377
                        (PLOT_ALT_NAME,
48✔
378
                                "Plot alternate station names.")
379
                        (PLOT_CONSTRAINT_LABELS,
48✔
380
                                "Plot the station constraints.")
381
                        (PLOT_CORRECTION_ARROWS,
48✔
382
                                "Plot arrows representing the direction and magnitude of corrections to the station coordinates.")
383
                        (PLOT_CORRECTION_LABELS,
48✔
384
                                "Plot correction labels.")
385
                        (OMIT_MEASUREMENTS,
48✔
386
                                "Do not print any measurements.")
387
                        (COMPUTE_CORRECTIONS,
48✔
388
                                "Compute corrections from binary station file.")
389
                        (PLOT_ERROR_ELLIPSES,
48✔
390
                                "Plot error ellipses.")
391
                        (PLOT_POSITIONAL_UNCERTAINTY,
48✔
392
                                "Plot positional uncertainty.")
393
                        (CORRECTION_SCALE, boost::program_options::value<double>(&p.p._correction_scale),
48✔
394
                                "The amount by which to scale the size of the correction arrows.")
395
                        (PU_ELLIPSE_SCALE, boost::program_options::value<double>(&p.p._pu_ellipse_scale),
48✔
396
                                "The amount by which to scale the size of error ellipses and positional uncertainty cirlces.")
397
                        (BOUNDING_BOX, boost::program_options::value<std::string>(&p.p._bounding_box),
48✔
398
                                "Plot stations and measurements within bounding box. arg is a comma delimited string \"lat1,lon1,lat2,lon2\" (in dd.mmss) defining the upper-left and lower-right limits.")
399
                        (PLOT_CENTRE_LAT, boost::program_options::value<double>(&p.p._plot_centre_latitude),
48✔
400
                                "Centre the plot according to this latitude. Format: dd.mmsssss")
401
                        (PLOT_CENTRE_LON, boost::program_options::value<double>(&p.p._plot_centre_longitude),
48✔
402
                                "Centre the plot according to this longitude. Format: ddd.mmsssss")
403
                        (PLOT_CENTRE_STATION, boost::program_options::value<std::string>(&p.p._plot_station_centre),
48✔
404
                                (std::string("The station name upon which to centre the plot. The plot area is circumscribed by ")+
192✔
405
                                std::string(PLOT_AREA_RADIUS)+std::string(".")).c_str())
240✔
406
                        (PLOT_AREA_RADIUS, boost::program_options::value<double>(&p.p._plot_area_radius),
48✔
407
                                (std::string("The radius (in metres) of an area to bound the plot.  Default is ")+
144✔
408
                                StringFromT(p.p._plot_area_radius)+std::string("m")).c_str())
240✔
409
                        (TECTONIC_PLATE_BDY_FILE, boost::program_options::value<std::string>(&p.r.tpb_file),
48✔
410
                                std::string("Plot global tectonic plate boundaries.").c_str())
96✔
411
                        (GRAPH_SEGMENTATION_STNS, 
48✔
412
                                "Plot a graph of the block stations resulting from network segmentation.")
413
                        (GRAPH_SEGMENTATION_MSRS, 
48✔
414
                                "Plot a graph of the block measurements resulting from network segmentation.")
415
                        (KEEP_FILES,
48✔
416
                                "Don't delete command and data files used to generate EPS and PDF plots.")
417
                        ;
418

419
                titleblock_options.add_options()
48✔
420
                        (OMIT_TITLE_BLOCK,
48✔
421
                                "Do not print a title block and measurements legend.")
422
                        (TITLEBLOCK_TITLE, boost::program_options::value<std::string>(&p.p._title),
48✔
423
                                "The title of the plot. Supply quotation marks if spaces are required. Default is the network name.")
424
                        (TITLEBLOCK_NAME, boost::program_options::value<std::string>(&p.p._title_block_name),
48✔
425
                                (std::string("The name of the organisational unit name.  Default is ")+
144✔
426
                                std::string(p.p._title_block_name)+std::string(".")).c_str())
240✔
427
                        (TITLEBLOCK_SUBNAME, boost::program_options::value<std::string>(&p.p._title_block_subname),
48✔
428
                                (std::string("The name of the organisational sub-unit unit name.  Default is ")+
144✔
429
                                std::string(p.p._title_block_subname)+std::string(".")).c_str())
240✔
430
                        ;
431

432
                // mapping options
433
                map_options.add_options()
48✔
434
                        //        0 Allow plot to determine the projection from the data spatial extents
435
                        //        1 World plot
436
                        //        2 Orthographic (globe plot)
437
                        //        3 Mercator
438
                        //        4 Transverse Mercator
439
                        //        5 Albers conic equal-area
440
                        //        6 Lambert conformal
441
                        //  7 General stereographic
442
                        //  8 Robinson Projection
443
                        (PROJECTION, boost::program_options::value<UINT16>(&p.p._projection),
48✔
444
                                std::string("Map projection type.\n").
96✔
445
                                append("  0: Let ").append(__BINARY_NAME__).append(" choose best projection (default)\n").
48✔
446
                                append("  1: ").append(projectionTypes[1]).append("\n").
48✔
447
                                append("  2: ").append(projectionTypes[2]).append("\n").
48✔
448
                                append("  3: ").append(projectionTypes[3]).append("\n").
48✔
449
                                append("  4: ").append(projectionTypes[4]).append("\n").
48✔
450
                                append("  5: ").append(projectionTypes[5]).append("\n").
48✔
451
                                append("  6: ").append(projectionTypes[6]).append("\n").
48✔
452
                                append("  7: ").append(projectionTypes[7]).append("\n").
48✔
453
                                append("  8: ").append(projectionTypes[8]).c_str())
48✔
454
                        (LABEL_FONT_SIZE, boost::program_options::value<double>(&p.p._label_font_size),
48✔
455
                                (std::string("Label font size for station names and constraints.  Default is ")+
144✔
456
                                StringFromT(p.p._label_font_size)+std::string(".")).c_str())
240✔
457
                        (MSR_LINE_WIDTH, boost::program_options::value<double>(&p.p._msr_line_width),
48✔
458
                                (std::string("Measurement line width.  Default is ")+
144✔
459
                                StringFromT(p.p._msr_line_width)+std::string(".")).c_str())
240✔
460
                        (DONT_CREATE_PDF,
48✔
461
                                "Don't create a pdf, just the command files.")
462
                        (EXPORT_PNG,
48✔
463
                                "Export the GMT plot to png at 300 dpi.")
464
                        ;
465

466
                allowable_options.add(standard_options).add(config_options).add(map_options).add(titleblock_options).add(generic_options);
48✔
467

468
                // add "positional options" to handle command line tokens which have no option name
469
                positional_options.add(NETWORK_NAME, -1);
48✔
470
                
471
                boost::program_options::command_line_parser parser(argc, argv);
48✔
472
                store(parser.options(allowable_options).positional(positional_options).run(), vm);
48✔
473
                notify(vm);
46✔
474
        } 
2✔
475
        catch (const std::exception& e) {
2✔
476
                std::cout << "- Error: " << e.what() << std::endl;
2✔
477
                std::cout << cmd_line_banner << allowable_options << std::endl;
2✔
478
                return EXIT_FAILURE;
2✔
479
        }
2✔
480

481
        catch (...) 
×
482
        {
NEW
483
                std::cout << "+ Exception of unknown type!\n";
×
484
                return EXIT_FAILURE;
×
485
        }
×
486

487
        if (argc < 2)
46✔
488
        {
489
                std::cout << std::endl << "- Nothing to do - no options provided. " << std::endl << std::endl;  
1✔
490
                std::cout << cmd_line_banner << allowable_options << std::endl;
1✔
491
                return EXIT_FAILURE;
492
        }
493

494
        if (vm.count(VERSION))
90✔
495
        {
496
                std::cout << cmd_line_banner << std::endl;
1✔
497
                return EXIT_SUCCESS;
498
        }
499

500
        if (vm.count(HELP))
88✔
501
        {
502
                std::cout << cmd_line_banner << allowable_options << std::endl;
1✔
503
                return EXIT_SUCCESS;
504
        }
505

506
        if (vm.count(HELP_MODULE))
86✔
507
        {
508
                std::cout << cmd_line_banner;
6✔
509
                std::string original_text = vm[HELP_MODULE].as<std::string>();
18✔
510
                std::string help_text = str_upper<std::string>(original_text);
6✔
511

512
                if (str_upper<std::string, char>(ALL_MODULE_STDOPT).find(help_text) != std::string::npos) {
18✔
513
                        std::cout << standard_options << std::endl;
1✔
514
                }
515
                else if (str_upper<std::string, char>(PLOT_MODULE_CONFIG).find(help_text) != std::string::npos) {
15✔
516
                        std::cout << config_options << std::endl;
1✔
517
                }
518
                else if (str_upper<std::string, char>(PLOT_MODULE_TITLEBLOCK).find(help_text) != std::string::npos) {
12✔
519
                        std::cout << titleblock_options << std::endl;
1✔
520
                }
521
                else if (str_upper<std::string, char>(PLOT_MODULE_MAP).find(help_text) != std::string::npos) {
9✔
522
                        std::cout << map_options << std::endl;
1✔
523
                }
524
                else if (str_upper<std::string, char>(ALL_MODULE_GENERIC).find(help_text) != std::string::npos) {
6✔
525
                        std::cout << generic_options << std::endl;
1✔
526
                }
527
                else {
528
                        std::cout << std::endl << "- Error: Help module '" <<
1✔
529
                                original_text << "' is not in the list of options." << std::endl;
6✔
530
                        return EXIT_FAILURE;
531
                }
532

533
                return EXIT_SUCCESS;
5✔
534
        }
12✔
535

536
        if (vm.count(QUIET))
74✔
537
                p.g.quiet = 1;
×
538
        else
539
                std::cout << std::endl << cmd_line_banner;
37✔
540

541
        if (!vm.count(NETWORK_NAME))
74✔
542
        {
543
                std::cout << std::endl << "- Nothing to do - no network name specified. " << std::endl << std::endl;  
2✔
544
                return EXIT_FAILURE;
545
        }
546

547
        // capture command line arguments
548
        for (int cmd_arg(0); cmd_arg<argc; ++cmd_arg)
222✔
549
        {
550
                 p.p.command_line_arguments += argv[cmd_arg];
187✔
551
                 p.p.command_line_arguments += " ";
187✔
552
        }
553

554
        // plot title
555
        if (!vm.count(TITLEBLOCK_TITLE))
70✔
556
                p.p._title = p.g.network_name;
34✔
557

558
        // plot ignored measurements?
559
        if (vm.count(PLOT_MSRS_IGNORED))
70✔
560
                p.p._plot_ignored_msrs = true;
×
561

562
        // Segmented network view?
563
        if (vm.count(PLOT_BLOCKS) || vm.count(BLOCK_NUMBER))
101✔
564
                p.p._plot_phased_blocks = true;
4✔
565

566
        // It doesn't make sense to plot a network, centred on a station or point, or
567
        // within a bounding box in phased mode, so swich phased off in these cases.
568
        if (vm.count(BOUNDING_BOX) || 
99✔
569
                vm.count(PLOT_CENTRE_LAT) || vm.count(PLOT_CENTRE_LON) ||
209✔
570
                vm.count(PLOT_CENTRE_STATION))
85✔
571
                p.p._plot_phased_blocks = false;
11✔
572

573
        // graph mode?
574
        bool graph_mode(false);
35✔
575
        bool graph_mode_stns(false);
35✔
576
        bool graph_mode_msrs(false);
35✔
577
        if (vm.count(GRAPH_SEGMENTATION_STNS) || vm.count(GRAPH_SEGMENTATION_MSRS))
105✔
578
        {
579
                if (vm.count(GRAPH_SEGMENTATION_STNS))
8✔
580
                        graph_mode_stns = true;
2✔
581
                if (vm.count(GRAPH_SEGMENTATION_MSRS))
8✔
582
                        graph_mode_msrs = true;
2✔
583
                p.p._plot_phased_blocks = true;
4✔
584
                graph_mode = true;
4✔
585
        }
586

587
        // correction arrows?
588
        if (vm.count(PLOT_CORRECTION_ARROWS))
70✔
589
                p.p._plot_correction_arrows = true;
3✔
590

591
        // compute corrections, or use corrections file
592
        if (vm.count(COMPUTE_CORRECTIONS))
70✔
593
                p.p._compute_corrections = true;
2✔
594

595
        // correction labels
596
        if (vm.count(PLOT_CORRECTION_LABELS))
70✔
597
                p.p._plot_correction_labels = true;
2✔
598

599
        // plot error ellipses?
600
        if (vm.count(PLOT_ERROR_ELLIPSES))
70✔
601
                p.p._plot_error_ellipses = true;
3✔
602

603
        // plot positional uncertainty?
604
        if (vm.count(PLOT_POSITIONAL_UNCERTAINTY))
70✔
605
                p.p._plot_positional_uncertainty = true;
2✔
606

607
        // has the user specified a projection
608
        if (vm.count(PROJECTION) && p.p._projection > 0)
70✔
609
        {
610
                p.p._user_defined_projection = true;
9✔
611
                if (p.p._projection > 8)
9✔
612
                        p.p._projection = bestProjection;                        
×
613
        }
614

615
        if (vm.count(TECTONIC_PLATE_BDY_FILE))
70✔
616
                p.p._plot_plate_boundaries = true;
2✔
617

618
        if (vm.count(OMIT_TITLE_BLOCK))
70✔
619
                p.p._omit_title_block = true;
2✔
620

621
        if (vm.count(OMIT_MEASUREMENTS))
70✔
622
                p.p._omit_measurements = true;
2✔
623

624
        if (vm.count(KEEP_FILES))
70✔
625
                p.p._keep_gen_files = true;
×
626

627
        if (vm.count(DONT_CREATE_PDF))
70✔
628
        {
629
                p.p._supress_pdf_creation = true;
4✔
630
                // to supress creation of PDF implies keeping the 
631
                // files to generate the plot manually
632
                p.p._keep_gen_files = true;
4✔
633
        }
634

635
        if (vm.count(EXPORT_PNG))
70✔
636
                p.p._export_png = true;
2✔
637

638
        //////////////////////////////////////////////////////
639
        // Form paths
640
        size_t lastindex;
35✔
641
        if ((lastindex = p.g.output_folder.find_last_of("/")) != std::string::npos)
35✔
642
                p.g.output_folder.pop_back();
×
643
        if ((lastindex = p.g.output_folder.find_last_of("\\")) != std::string::npos)
35✔
644
                p.g.output_folder.pop_back();
×
645
        if (boost::equals(p.g.output_folder.substr(0, 2), "./"))
105✔
646
                p.g.output_folder = p.g.output_folder.substr(2);
×
647
        if (boost::equals(p.g.output_folder.substr(0, 2), ".\\"))
105✔
648
                p.g.output_folder = p.g.output_folder.substr(2);
×
649

650
        // binary station file
651
        if (!p.i.bst_file.empty())
35✔
NEW
652
                p.i.bst_file = formPath<std::string>(p.g.input_folder, p.i.bst_file);
×
653
        else
654
                p.i.bst_file = formPath<std::string>(p.g.input_folder, p.g.network_name, "bst");
105✔
655

656
        // binary measurement file
657
        if (!p.i.bms_file.empty())
35✔
NEW
658
                p.i.bms_file = formPath<std::string>(p.g.input_folder, p.i.bms_file);
×
659
        else
660
                p.i.bms_file = formPath<std::string>(p.g.input_folder, p.g.network_name, "bms");
105✔
661

662
        // station map file
663
        p.i.map_file = formPath<std::string>(p.g.input_folder, p.g.network_name, "map");
105✔
664

665
        // segmentation file
666
        if (p.p._plot_phased_blocks)
35✔
667
        {
668
                if (vm.count(SEG_FILE))
16✔
NEW
669
                        p.s.seg_file = formPath<std::string>(p.g.input_folder, p.s.seg_file);
×
670
                else
671
                        p.s.seg_file = formPath<std::string>(p.g.input_folder, p.g.network_name, "seg");
24✔
672
        }
673

674
        // correction file
675
        if (p.p._plot_correction_arrows)
35✔
676
        {
677
                if (p.p._plot_phased_blocks)
3✔
678
                        p.o._cor_file = formPath<std::string>(p.g.input_folder, p.g.network_name, "phased.cor");
6✔
679
                else
680
                        p.o._cor_file = formPath<std::string>(p.g.input_folder, p.g.network_name, "simult.cor");
3✔
681
        }
682

683
        // adjusted positional uncertainty file
684
        if (p.p._plot_error_ellipses || p.p._plot_positional_uncertainty)
35✔
685
        {
686
                if (p.p._plot_phased_blocks)
3✔
687
                        p.o._apu_file = formPath<std::string>(p.g.input_folder, p.g.network_name, "phased.apu");
6✔
688
                else
689
                        p.o._apu_file = formPath<std::string>(p.g.input_folder, p.g.network_name, "simult.apu");
3✔
690
        }
691
        //
692
        //////////////////////////////////////////////////////
693

694
        if (p.g.quiet != 1)
35✔
695
        {        
696
                std::cout << std::endl << "+ Options:" << std::endl; 
35✔
697
                std::cout << std::setw(PRINT_VAR_PAD) << std::left << "  Network name: " <<  p.g.network_name << std::endl;
35✔
698
                std::cout << std::setw(PRINT_VAR_PAD) << std::left << "  Input folder: " << p.g.input_folder << std::endl;
35✔
699
                std::cout << std::setw(PRINT_VAR_PAD) << std::left << "  Output folder: " << p.g.output_folder << std::endl;
35✔
700
                std::cout << std::setw(PRINT_VAR_PAD) << std::left << "  Binary station file: " << p.i.bst_file << std::endl;
35✔
701
                std::cout << std::setw(PRINT_VAR_PAD) << std::left << "  Binary measurement file: " << p.i.bms_file << std::endl;
35✔
702
                if (p.p._plot_phased_blocks)
35✔
703
                        std::cout << std::setw(PRINT_VAR_PAD) << std::left << "  Segmentation file: " << p.s.seg_file << std::endl;
8✔
704
                if (p.p._plot_correction_arrows && !p.p._compute_corrections)
35✔
705
                        std::cout << std::setw(PRINT_VAR_PAD) << std::left << "  Corrections file: " << p.o._cor_file << std::endl;
1✔
706
                if (p.p._plot_error_ellipses || p.p._plot_positional_uncertainty)
35✔
707
                        std::cout << std::setw(PRINT_VAR_PAD) << std::left << "  Positional uncertainty file: " << p.o._apu_file << std::endl;
3✔
708
                std::cout << std::endl;
35✔
709
        }
710
        
711

712
        if (!boost::filesystem::exists(p.i.bst_file) || !boost::filesystem::exists(p.i.bms_file))
138✔
713
        {
714
                std::cout << std::endl << std::endl << "- Nothing to do: network";
1✔
715
                if (!vm.count(NETWORK_NAME))
2✔
NEW
716
                        std::cout << " name has not been specified, and" << std::endl << " ";
×
717
                
718
                std::cout << " files " << p.i.bst_file << " and " << p.i.bms_file << " do not exist." << std::endl << std::endl;  
1✔
719
                return EXIT_FAILURE;
720
        }
721

722
        if (p.p._plot_correction_arrows)
34✔
723
        {
724
                if (!p.p._compute_corrections)
3✔
725
                {
726
                        if (!boost::filesystem::exists(p.o._cor_file))
2✔
727
                        {
728
                                std::cout << std::endl << std::endl << 
1✔
729
                                        "- Error: The required corrections file does not exist:" << std::endl;  
1✔
730
                                std::cout << "         " << p.o._cor_file << std::endl << std::endl;
1✔
731
                                std::cout << "  Run:  'adjust " << p.g.network_name << " --" << OUTPUT_STN_COR_FILE;
1✔
732
                                if (p.p._plot_phased_blocks)
1✔
NEW
733
                                        std::cout << " --" << MODE_PHASED << "'";
×
734
                                else
735
                                        std::cout << "'";
1✔
736
                                std::cout << std::endl << "  to create a corrections file" << std::endl << std::endl;
1✔
737
                                return EXIT_FAILURE;
738
                        }
739
                }
740
        }
741

742
        if (p.p._plot_error_ellipses || p.p._plot_positional_uncertainty)
33✔
743
        {
744
                if (!boost::filesystem::exists(p.o._apu_file))
6✔
745
                {
746
                        std::cout << std::endl << std::endl << 
1✔
747
                                "- Error: The required positional uncertainty file does not exist:" << std::endl;  
1✔
748
                        std::cout << "         " << p.o._apu_file << std::endl << std::endl;
1✔
749
                        std::cout << "  Run:  '" << __adjust_app_name__ << " " << p.g.network_name << " --" << OUTPUT_POS_UNCERTAINTY;
1✔
750
                        if (p.p._plot_phased_blocks)
1✔
NEW
751
                                std::cout << " --" << MODE_PHASED << "'";
×
752
                        else
753
                                std::cout << "'";
1✔
754
                        std::cout << std::endl << "  to create a positional uncertainty file" << std::endl << std::endl;
1✔
755
                        return EXIT_FAILURE;
756
                }
757
        }
758

759
        // check existence of segmentation file - mandatory for:
760
        //  - plots of segmented network plots (generated by GMT)
761
        //  - graphs (generated by gnuplot)
762
        //
763
        if (p.p._plot_phased_blocks || graph_mode)
32✔
764
        {
765
                if (!boost::filesystem::exists(p.s.seg_file))
16✔
766
                {
767
                        std::cout << std::endl << std::endl << 
1✔
768
                                "- Error: The required segmentation file does not exist:" << std::endl;  
1✔
769
                        std::cout << "         " << p.s.seg_file << std::endl << std::endl;
1✔
770
                        std::cout << "  Run  '" << __segment_app_name__ << " " << p.g.network_name << "' to create a segmentation file" << std::endl << std::endl;
1✔
771
                        return EXIT_FAILURE;
772
                }
773

774
                if (boost::filesystem::last_write_time(p.s.seg_file) < boost::filesystem::last_write_time(p.i.bst_file) ||
21✔
775
                        boost::filesystem::last_write_time(p.s.seg_file) < boost::filesystem::last_write_time(p.i.bms_file))
13✔
776
                {
777
                        if (!vm.count(SEG_FILE))
8✔
778
                        {
779
                                // Has import been run after the segmentation file was created?
780
                                binary_file_meta_t bst_meta, bms_meta;
4✔
781
                                dna_io_bst bst;
4✔
782
                                dna_io_bms bms;
4✔
783
                                bst.load_bst_file_meta(p.i.bst_file, bst_meta);
4✔
784
                                bms.load_bms_file_meta(p.i.bms_file, bms_meta);
4✔
785

786
                                bool bst_meta_import(boost::iequals(bst_meta.modifiedBy, __import_app_name__) ||
8✔
787
                                        boost::iequals(bst_meta.modifiedBy, __import_dll_name__));
8✔
788
                                bool bms_meta_import(boost::iequals(bms_meta.modifiedBy, __import_app_name__) ||
8✔
789
                                        boost::iequals(bms_meta.modifiedBy, __import_dll_name__));
8✔
790

791
                                if ((bst_meta_import && (boost::filesystem::last_write_time(p.s.seg_file) < boost::filesystem::last_write_time(p.i.bst_file))) || 
8✔
792
                                        (bms_meta_import && (boost::filesystem::last_write_time(p.s.seg_file) < boost::filesystem::last_write_time(p.i.bms_file))))
4✔
793
                                {
NEW
794
                                        std::cout << std::endl << std::endl << 
×
NEW
795
                                                "- Error: The binary station and measurement files have been modified since" << std::endl <<
×
NEW
796
                                                "  the segmentation file was created:" << std::endl;
×
797

NEW
798
                                        time_t t_bst(boost::filesystem::last_write_time(p.i.bst_file)), t_bms(boost::filesystem::last_write_time(p.i.bms_file));
×
NEW
799
                                        time_t t_seg(boost::filesystem::last_write_time(p.s.seg_file));
×
800

NEW
801
                                        std::cout << "   " << leafStr<std::string>(p.i.bst_file) << "  last modified on  " << ctime(&t_bst);
×
NEW
802
                                        std::cout << "   " << leafStr<std::string>(p.i.bms_file) << "  last modified on  " << ctime(&t_bms) << std::endl;
×
NEW
803
                                        std::cout << "   " << leafStr<std::string>(p.s.seg_file) << "  created on  " << ctime(&t_seg) << std::endl;
×
NEW
804
                                        std::cout << "  Run '" << __segment_app_name__ << " " << p.g.network_name << " [options]' to re-create the segmentation file, or re-run" << std::endl << 
×
NEW
805
                                                "  the plot using the " << SEG_FILE << " option if this segmentation file must\n  be used." << std::endl << std::endl;
×
UNCOV
806
                                        return EXIT_FAILURE;
×
807
                                }
808
                        }
12✔
809
                }
810
        }
811

812
        try {
31✔
813

814
                if (p.g.verbose > 0 || p.g.quiet != 1)
31✔
815
                {
816
                        std::cout << "+ Loading network files... ";
31✔
817
                        std::cout.flush();
31✔
818
                }
819
                        
820
                dna_plot plotDynaML;
31✔
821
                plotDynaML.LoadNetworkFiles(p);
31✔
822
                
823
                if (p.g.verbose > 0 || p.g.quiet != 1)
31✔
824
                {
825
                        std::cout << "done." << std::endl << std::endl;
31✔
826
                        std::cout.flush();                        
31✔
827
                }
828

829
                // set up colours for each measurement
830
                p.p._msr_colours.clear();
31✔
831

832
                // Add colours.
833
                // http://w3schools.com/tags/ref_colorpicker.asp
834
                // see http://www.december.com/html/spec/colorhex.html
835
                // or http://www.yellowpipe.com/yis/tools/hex-to-rgb/color-converter.php
836
                // or http://www.easycalculation.com/color-coder.php
837
                // for converting rgb colours in hex to decimal, see:
838
                // http://www.yellowpipe.com/yis/tools/hex-to-rgb/color-converter.php
839
        
840
                //
841
                // All colours based on a palette:
842
                //   https://coolors.co/ffd275-235789-da5552-43aa8b-39a9db
843
                //
844
                
845
                p.p._msr_colours.push_back(string_string_pair("A", "#FFC07F"));                // mellow apricot, #FFC07F
62✔
846
                p.p._msr_colours.push_back(string_string_pair("B", "#FE5F55"));                // orange red crayola, #FE5F55
62✔
847
                p.p._msr_colours.push_back(string_string_pair("C", "#A393BF"));                // glossy grape, #A393BF
62✔
848
                p.p._msr_colours.push_back(string_string_pair("D", "#DA5552"));                // indian red, #DA5552
62✔
849
                p.p._msr_colours.push_back(string_string_pair("E", "#717568"));                // nickel, #717568
62✔
850
                p.p._msr_colours.push_back(string_string_pair("G", "#35A7FF"));                // blue jeans, #35A7FF
62✔
851
                p.p._msr_colours.push_back(string_string_pair("H", "#FF6B6B"));                // bittersweet, #FF6B6B
62✔
852
                p.p._msr_colours.push_back(string_string_pair("I", "#F7A1C4"));                // carnation pink, #F7A1C4
62✔
853
                p.p._msr_colours.push_back(string_string_pair("J", "#9AD4D6"));                // powder blue, #9AD4D6
62✔
854
                p.p._msr_colours.push_back(string_string_pair("K", "#FFA07A"));                // lightsalmon, #FFA07A
62✔
855
                p.p._msr_colours.push_back(string_string_pair("L", "#16DB93"));                // medium aquamarine, #16DB93
62✔
856
                p.p._msr_colours.push_back(string_string_pair("M", "#4C1C00"));                // seal brown, #4C1C00
62✔
857
                p.p._msr_colours.push_back(string_string_pair("P", "#FFD275"));                // orange yellow crayola, #FFD275
62✔
858
                p.p._msr_colours.push_back(string_string_pair("Q", "#DA627D"));                // blush, #DA627D
62✔
859
                p.p._msr_colours.push_back(string_string_pair("R", "#DBCBD8"));                // languid lavender, #DBCBD8
62✔
860
                p.p._msr_colours.push_back(string_string_pair("S", "#60492C"));                // dark broan, #60492C
62✔
861
                p.p._msr_colours.push_back(string_string_pair("V", "#235789"));                // bdazzled blue, #235789
62✔
862
                p.p._msr_colours.push_back(string_string_pair("X", "#6622CC"));                // french violet, #6622CC
62✔
863
                p.p._msr_colours.push_back(string_string_pair("Y", "#A9F0D1"));                // magic mint, #A9F0D1
62✔
864
                p.p._msr_colours.push_back(string_string_pair("Z", "#56A3A6"));                // cadet blue, #56A3A6
62✔
865
                p.p._msr_colours.push_back(string_string_pair("x", "#FF0000"));                // red, #FF0000 (destroyed marks)        
62✔
866
                
867
                
868
                if (graph_mode)
31✔
869
                {
870
                        if (graph_mode_stns)
4✔
871
                                ProcessGnuPlot(&plotDynaML, p, StationsMode);
2✔
872
                                
873
                        if (graph_mode_msrs)
4✔
874
                                ProcessGnuPlot(&plotDynaML, p, MeasurementsMode);
2✔
875
                        
876
                        return EXIT_SUCCESS;
4✔
877
                }
878

879
                // If not in graph mode, then generate GMT plot                
880
                if (!vm.count(LABEL_FONT_SIZE))
54✔
881
                        p.p._label_font_size = -1.0;                // determine best font according to plot size and map projection
26✔
882

883
                if (vm.count(PLOT_CENTRE_LAT))
54✔
884
                        p.p._plot_centre_latitude = DmstoDeg(p.p._plot_centre_latitude);
4✔
885
                if (vm.count(PLOT_CENTRE_LON))
54✔
886
                        p.p._plot_centre_longitude = DmstoDeg(p.p._plot_centre_longitude);
4✔
887

888
                if (vm.count(PLOT_STN_LABELS))
54✔
889
                        p.p._plot_station_labels = true;
3✔
890
                if (vm.count(PLOT_ALT_NAME))
54✔
891
                        p.p._plot_alt_name = true;
1✔
892
                if (vm.count(PLOT_CONSTRAINT_LABELS))
54✔
893
                        p.p._plot_station_constraints = true;
1✔
894

895
                // Create the GMT plot, or just the shell script(s) and data files
896
                ProcessGMTPlot(&plotDynaML, p, measurement_types);                        
27✔
897
        
898

899
        } 
31✔
900
        catch (const NetPlotException& e) {
3✔
901
                std::cout << std::endl << "- Error: " << e.what() << std::endl;
2✔
902
                return EXIT_FAILURE;
2✔
903
        } 
2✔
904
        catch (const std::runtime_error& e) {
1✔
905
                std::cout << "+ Exception of unknown type: " << e.what();
1✔
906
                return EXIT_FAILURE;
1✔
907
        }
1✔
908

909
        return EXIT_SUCCESS;
24✔
910
}
288✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc