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