OpenCPN Partial API docs
Loading...
Searching...
No Matches
ais_target_list_dlg.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 __AISTARGETLISTDIALOG_H__
25#define __AISTARGETLISTDIALOG_H__
26
27#include <memory>
28
29#include <wx/aui/framemanager.h>
30#include <wx/button.h>
31#include <wx/checkbox.h>
32#include <wx/listctrl.h>
33#include <wx/panel.h>
34#include <wx/spinctrl.h>
35#include <wx/stattext.h>
36#include <wx/textctrl.h>
37
38#include "model/ais_target_data.h"
39#include "model/ais_decoder.h"
40
41#include "OCPNListCtrl.h"
42
43#define ID_AIS_TARGET_LIST 10003
44#define ID_RCLK_UNDOCK 7035
45
46class OCPNListCtrl; // circular
47
48class AISTargetListDialog; // forward
50
51WX_DEFINE_SORTED_ARRAY_INT(int, ArrayOfMMSI);
52
57class AISTargetListDialog : public wxPanel {
58 DECLARE_CLASS(AISTargetListDialog)
59
60public:
61 AISTargetListDialog(wxWindow *parent, wxAuiManager *auimgr,
62 AisDecoder *pdecoder);
64
65 void Shutdown(void);
66 void OnClose(wxCloseEvent &event);
67 void Disconnect_decoder();
68
69 void RecalculateSize(void);
70 void SetColorScheme();
71 void UpdateAISTargetList(); // Rebuild AIS target list
72 void UpdateNVAISTargetList();
73 void CopyMMSItoClipBoard(int);
74 void CenterToTarget(bool);
75 std::shared_ptr<AisTargetData> GetpTarget(unsigned int list_item);
76
77 OCPNListCtrl *m_pListCtrlAISTargets;
78 AisDecoder *m_pdecoder;
79
80 ArrayOfMMSI *m_pMMSI_array;
81
82private:
83 void CreateControls(void);
84
85 void OnPaneClose(wxAuiManagerEvent &event);
86 void UpdateButtons();
87 void OnTargetSelected(wxListEvent &event);
88 void DoTargetQuery(int mmsi);
89 void OnTargetDefaultAction(wxListEvent &event);
90 void OnTargetQuery(wxCommandEvent &event);
91 void OnTargetListColumnClicked(wxListEvent &event);
92 void OnTargetScrollTo(wxCommandEvent &event);
93 void OnTargetScrollToClose(wxCommandEvent &event);
94 void OnTargetCreateWpt(wxCommandEvent &event);
95 void OnShowAllTracks(wxCommandEvent &event);
96 void OnHideAllTracks(wxCommandEvent &event);
97 void OnToggleTrack(wxCommandEvent &event);
98 void OnCopyMMSI(wxCommandEvent &event);
99 void OnLimitRange(wxCommandEvent &event);
100 void OnCloseButton(wxCommandEvent &event);
101 void OnAutosortCB(wxCommandEvent &event);
102 void OnRightClickContext(wxCommandEvent &event);
103 void OnContextUndock(wxCommandEvent &event);
104
105 wxWindow *m_pparent;
106 wxAuiManager *m_pAuiManager;
107 wxButton *m_pButtonInfo;
108 wxButton *m_pButtonJumpTo;
109 wxButton *m_pButtonJumpTo_Close;
110 wxButton *m_pButtonCreateWpt;
111 wxButton *m_pButtonHideAllTracks;
112 wxButton *m_pButtonShowAllTracks;
113 wxButton *m_pButtonToggleTrack;
114 wxButton *m_pButtonCopyMMSI;
115 wxStaticText *m_pStaticTextRange;
116 wxSpinCtrl *m_pSpinCtrlRange;
117 wxStaticText *m_pStaticTextCount;
118 wxTextCtrl *m_pTextTargetCount;
119 wxButton *m_pButtonOK;
120 wxCheckBox *m_pCBAutosort;
121
122 bool m_bautosort_force;
123
124 DECLARE_EVENT_TABLE()
125};
126
127#endif
Class AisDecoder and helpers.
AISTargetListDialog * g_pAISTargetList
Global instance.
Dialog for displaying a list of AIS targets.
A custom list control for displaying AIS target information.