27#ifndef _CONNECT_DIALOG_H
28#define _CONNECT_DIALOG_H
30#include <wx/checkbox.h>
31#include <wx/listctrl.h>
32#include <wx/radiobut.h>
33#include <wx/stattext.h>
37#include "conn_params.h"
53 void RecalculateSize(
void);
54 void SetInitialSettings(
void);
60 void OnSelectDatasource(wxListEvent &event);
61 void OnAddDatasourceClick(wxCommandEvent &event);
62 void OnRemoveDatasourceClick(wxCommandEvent &event);
64 void OnTypeSerialSelected(wxCommandEvent &event);
65 void OnTypeNetSelected(wxCommandEvent &event);
66 void OnTypeGPSSelected(wxCommandEvent &event);
67 void OnTypeBTSelected(wxCommandEvent &event);
68 void OnTypeCANSelected(wxCommandEvent &event);
70 void OnNetProtocolSelected(wxCommandEvent &event);
71 void OnBaudrateChoice(wxCommandEvent &event) { OnConnValChange(event); }
72 void OnProtocolChoice(wxCommandEvent &event);
73 void OnCrcCheck(wxCommandEvent &event) { OnConnValChange(event); }
74 void OnRbAcceptInput(wxCommandEvent &event);
75 void OnRbIgnoreInput(wxCommandEvent &event);
76 void OnBtnIStcs(wxCommandEvent &event);
77 void OnCbInput(wxCommandEvent &event);
78 void OnCbOutput(wxCommandEvent &event);
79 void OnRbOutput(wxCommandEvent &event);
80 void OnBtnOStcs(wxCommandEvent &event);
81 void OnConnValChange(wxCommandEvent &event);
82 void OnValChange(wxCommandEvent &event);
83 void OnUploadFormatChange(wxCommandEvent &event);
84 void OnShowGpsWindowCheckboxClick(wxCommandEvent& event);
86 void OnDiscoverButton(wxCommandEvent &event);
87 void UpdateDiscoverStatus(wxString stat);
88 void OnPriorityDialog(wxCommandEvent &event);
91 void SetDefaultConnectionParams(
void);
92 void SetDSFormRWStates();
93 void SetDSFormOptionVizStates();
94 void FillSourceList();
95 void UpdateSourceList(
bool bResort);
96 bool SortSourceList(
void);
98 void ClearNMEAForm(
void);
99 void SetNMEAFormToSerial(
void);
100 void SetNMEAFormToNet(
void);
101 void SetNMEAFormToGPS(
void);
102 void SetNMEAFormToBT(
void);
103 void SetNMEAFormToCAN(
void);
104 void SetNMEAFormForProtocol();
106 void ShowNMEACommon(
bool visible);
107 void ShowNMEASerial(
bool visible);
108 void ShowNMEANet(
bool visible);
109 void ShowNMEAGPS(
bool visible);
110 void ShowNMEABT(
bool visible);
111 void ShowNMEACAN(
bool visible);
113 void OnScanBTClick(wxCommandEvent &event);
114 void onBTScanTimer(wxTimerEvent &event);
115 void StopBTScan(
void);
118 wxScrolledWindow *m_container;
121 wxGridSizer *gSizerNetProps, *gSizerSerProps;
122 wxTextCtrl *m_tNetAddress, *m_tNetPort, *m_tFilterSec, *m_tcInputStc;
123 wxTextCtrl *m_tcOutputStc, *m_TalkerIdText;
124 wxCheckBox *m_cbCheckCRC, *m_cbGarminHost, *m_cbGarminUploadHost,
125 *m_cbCheckSKDiscover;
126 wxCheckBox *m_cbFurunoGP3X, *m_cbNMEADebug, *m_cbFilterSogCog, *m_cbInput;
127 wxCheckBox *m_cbOutput, *m_cbAPBMagnetic;
128 wxComboBox *m_comboPort;
129 wxStdDialogButtonSizer *m_sdbSizerDlgButtons;
130 wxButton *m_ButtonSKDiscover, *m_ButtonPriorityDialog;
131 wxStaticText *m_StaticTextSKServerStatus;
133 wxButton *m_buttonAdd, *m_buttonRemove, *m_buttonScanBT, *m_btnInputStcList;
134 wxButton *m_btnOutputStcList, *m_sdbSizerDlgButtonsOK;
135 wxButton *m_sdbSizerDlgButtonsApply, *m_sdbSizerDlgButtonsCancel;
136 wxStaticBoxSizer *sbSizerConnectionProps, *sbSizerInFilter;
137 wxStaticBoxSizer *sbSizerOutFilter;
138 wxRadioButton *m_rbTypeSerial, *m_rbTypeNet, *m_rbTypeInternalGPS;
139 wxRadioButton *m_rbTypeInternalBT, *m_rbNetProtoTCP, *m_rbNetProtoUDP;
140 wxRadioButton *m_rbNetProtoGPSD, *m_rbIAccept, *m_rbIIgnore, *m_rbOAccept;
141 wxRadioButton *m_rbNetProtoSignalK;
142 wxRadioButton *m_rbOIgnore, *m_rbTypeCAN;
143 wxStaticText *m_stBTPairs, *m_stNetProto, *m_stNetAddr, *m_stNetPort;
144 wxStaticText *m_stSerPort, *m_stSerBaudrate, *m_stSerProtocol;
145 wxStaticText *m_stPriority, *m_stFilterSec, *m_stPrecision;
146 wxStaticText *m_stTalkerIdText;
147 wxStaticText *m_stNetComment, *m_stSerialComment, *m_stCANSource;
148 wxTextCtrl *m_tNetComment, *m_tSerialComment;
149 wxStaticBox *m_sbConnEdit;
150 wxChoice *m_choiceBTDataSources, *m_choiceBaudRate, *m_choiceSerialProtocol;
151 wxChoice *m_choicePriority, *m_choicePrecision, *m_choiceCANSource;
152 wxScrolledWindow *m_scrollWinConnections;
153 wxBoxSizer *boxSizerConnections;
156 bool connectionsaved;
157 bool m_connection_enabled;
158 bool m_bNMEAParams_shown;
159 int m_btNoChangeCounter, m_btlastResultCount, m_BTscanning;
160 wxArrayString m_BTscan_results;
161 wxTimer m_BTScanTimer;
162 wxArrayString m_choice_CANSource_choices;
164 DECLARE_EVENT_TABLE()
171 explicit SentenceListDlg(wxWindow *parent, FilterDirection dir, ListType type,
172 const wxArrayString &list);
173 wxString GetSentences(
void);
176 void OnAddClick(wxCommandEvent &event);
177 void OnDeleteClick(wxCommandEvent &event);
178 void OnCLBSelect(wxCommandEvent &event);
179 void OnCheckAllClick(wxCommandEvent &event);
180 void OnClearAllClick(wxCommandEvent &event);
182 void Populate(
const wxArrayString &list);
183 wxString GetBoxLabel(
void)
const;
185 wxCheckListBox *m_clbSentences;
189 FilterDirection m_dir;
190 wxArrayString m_sentences;