OpenCPN Partial API docs
Loading...
Searching...
No Matches
senc_manager.h
Go to the documentation of this file.
1
/***************************************************************************
2
* Copyright (C) 2010 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 SENCMGR_H_
25
#define SENCMGR_H_
26
27
#include <vector>
28
29
#include <wx/event.h>
30
#include <wx/string.h>
31
#include <wx/thread.h>
32
33
#include "
s57chart.h
"
34
35
class
SENCThreadManager
;
// forward
36
extern
SENCThreadManager
*
g_SencThreadManager
;
38
extern
const
wxEventType
wxEVT_OCPN_BUILDSENCTHREAD
;
40
class
SENCBuildThread
;
// forward
41
42
typedef
enum
{
43
THREAD_INACTIVE = 0,
44
THREAD_PENDING,
45
THREAD_STARTED,
46
THREAD_FINISHED
47
} SENCThreadStatus;
48
49
typedef
enum
{
50
SENC_BUILD_INACTIVE = 0,
51
SENC_BUILD_PENDING,
52
SENC_BUILD_STARTED,
53
SENC_BUILD_DONE_NOERROR,
54
SENC_BUILD_DONE_ERROR,
55
} EVENTSENCResult;
56
57
//----------------------------------------------------------------------------
58
// s57 Chart Thread based SENC job ticket
59
//----------------------------------------------------------------------------
60
class
SENCJobTicket
{
61
public
:
62
SENCJobTicket
();
63
~SENCJobTicket
() {}
64
65
s57chart
*m_chart;
66
wxString m_FullPath000;
67
wxString m_SENCFileName;
68
double
ref_lat, ref_lon;
69
double
m_LOD_meters;
70
71
SENCBuildThread
*m_thread;
72
73
SENCThreadStatus m_status;
74
EVENTSENCResult m_SENCResult;
75
};
76
77
//----------------------------------------------------------------------------
78
// s57 Chart Thread based SENC creator status message
79
//----------------------------------------------------------------------------
80
class
OCPN_BUILDSENC_ThreadEvent
:
public
wxEvent {
81
public
:
82
OCPN_BUILDSENC_ThreadEvent
(wxEventType commandType = wxEVT_NULL,
int
id
= 0);
83
~OCPN_BUILDSENC_ThreadEvent
();
84
85
// required for sending with wxPostEvent()
86
wxEvent *Clone()
const
;
87
88
int
stat;
89
EVENTSENCResult type;
90
SENCJobTicket
*m_ticket;
91
92
private
:
93
};
94
101
class
SENCThreadManager
:
public
wxEvtHandler {
102
public
:
103
SENCThreadManager
();
104
~SENCThreadManager
();
105
106
void
OnEvtThread(
OCPN_BUILDSENC_ThreadEvent
&event);
107
108
SENCThreadStatus ScheduleJob(
SENCJobTicket
*ticket);
109
void
FinishJob(
SENCJobTicket
*ticket);
110
void
StartTopJob();
111
bool
IsChartInTicketlist(
s57chart
*chart);
112
bool
SetChartPointer(
s57chart
*chart,
void
*new_ptr);
113
int
GetJobCount();
114
115
int
m_max_jobs;
116
117
std::vector<SENCJobTicket *> ticket_list;
118
};
119
120
//----------------------------------------------------------------------------
121
// s57 Chart Thread based SENC creator
122
//----------------------------------------------------------------------------
123
class
SENCBuildThread
:
public
wxThread {
124
public
:
125
SENCBuildThread
(
SENCJobTicket
*ticket,
SENCThreadManager
*manager);
126
void
*Entry();
127
128
wxString m_FullPath000;
129
wxString m_SENCFileName;
130
s57chart
*m_chart;
131
SENCThreadManager
*m_manager;
132
SENCJobTicket
*m_ticket;
133
};
134
135
#endif
// SENCMGR_H_
OCPN_BUILDSENC_ThreadEvent
Definition
senc_manager.h:80
SENCBuildThread
Definition
senc_manager.h:123
SENCJobTicket
Definition
senc_manager.h:60
SENCThreadManager
Manager for S57 chart SENC creation threads.
Definition
senc_manager.h:101
s57chart
Represents an S57 format electronic navigational chart in OpenCPN.
Definition
s57chart.h:90
s57chart.h
S57 Chart Object.
wxEVT_OCPN_BUILDSENCTHREAD
const wxEventType wxEVT_OCPN_BUILDSENCTHREAD
Global instance.
Definition
senc_manager.cpp:49
g_SencThreadManager
SENCThreadManager * g_SencThreadManager
Global instance.
Definition
senc_manager.cpp:39
gui
include
gui
senc_manager.h
Generated on Thu Oct 9 2025 02:28:12 for OpenCPN Partial API docs by
1.9.8