OpenCPN Partial API docs
Loading...
Searching...
No Matches
tcds_ascii_harmonic.h
Go to the documentation of this file.
1/**************************************************************************
2 * Copyright (C) 2013 by David S. Register *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, see <https://www.gnu.org/licenses/>. *
16 **************************************************************************/
17
24#ifndef TCDS_ASCII_HARMONIC_H_
25#define TCDS_ASCII_HARMONIC_H_
26
27#include <stdio.h>
28#include <vector>
29
30#include <wx/string.h>
31
32#include "tc_data_factory.h"
33#include "station_data.h"
34#include "idx_entry.h"
35
36#define linelen 300
37
39public:
42
43 TC_Error_Code LoadData(const wxString &data_file_path);
44
45 int GetMaxIndex() { return num_IDX; };
46 IDX_entry *GetIndexEntry(int n_index);
47 TC_Error_Code LoadHarmonicData(IDX_entry *pIDX);
48
49 int pIDX_Ref;
50
51private:
52 long IndexFileIO(int func, long value);
53 TC_Error_Code init_index_file();
54 TC_Error_Code build_IDX_entry(IDX_entry *pIDX);
55 TC_Error_Code LoadHarmonicConstants(const wxString &data_file_path);
56 int read_next_line(FILE *fp, char linrec[linelen], int end_ok);
57 int skipnl(FILE *fp);
58 char *nojunk(char *line);
59 int slackcmp(char *a, char *b);
60
61 void free_cst();
62 void free_nodes();
63 void free_epochs();
64 void free_data();
65
66 ArrayOfStationData m_msd_array;
67
68 wxString m_indexfile_name;
69 wxString m_harmfile_name;
70 wxString m_last_reference_not_found;
71
72 char index_line_buffer[1024];
73 FILE *m_IndexFile;
74 std::vector<abbr_entry> m_abbreviation_array;
75 ArrayOfIDXEntry m_IDX_array;
76
77 int num_IDX;
78 int num_nodes;
79 int num_csts;
80 int num_epochs;
81 double *m_cst_speeds;
82 double **m_cst_nodes;
83 double **m_cst_epochs;
84 double *m_work_buffer;
85 int m_first_year;
86};
87
88#endif // TCDS_ASCII_HARMONIC_H_
Represents an index entry for tidal and current data.
Definition idx_entry.h:48
Tidal data container.
Amplitude measurement container.
Tide and current data container.