Stimfit @PACKAGE_VERSION@
Loading...
Searching...
No Matches
cursorsdlg.h
Go to the documentation of this file.
1// This program is free software; you can redistribute it and/or
2// modify it under the terms of the GNU General Public License
3// as published by the Free Software Foundation; either version 2
4// of the License, or (at your option) any later version.
5
6// This program is distributed in the hope that it will be useful,
7// but WITHOUT ANY WARRANTY; without even the implied warranty of
8// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9// GNU General Public License for more details.
10
11// You should have received a copy of the GNU General Public License
12// along with this program; if not, write to the Free Software
13// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
14
20
21#ifndef _CURSORSDLG_H
22#define _CURSORSDLG_H
23
27
28#include "./../../stf.h"
29#include <wx/bookctrl.h>
30#include <wx/tokenzr.h>
31#include <fstream>
32#include <sstream>
33#include <iostream>
34#include <wx/aui/aui.h>
35
36class wxStfDoc;
37
40{
41 DECLARE_EVENT_TABLE()
42
43private:
44 wxNotebookPage* CreateMeasurePage();
45 wxNotebookPage* CreatePeakPage();
46 wxNotebookPage* CreateBasePage();
47 wxNotebookPage* CreateDecayPage();
48 wxNotebookPage* CreateLatencyPage();
49#ifdef WITH_PSLOPE
50 wxNotebookPage* CreatePSlopePage();
51#endif
52 wxFlexGridSizer*
53 CreateCursorInput( wxPanel* nbPage, wxWindowID textC1, wxWindowID textC2,
54 wxWindowID comboU1, wxWindowID comboU2, std::size_t c1,
55 std::size_t c2 );
56
57 int ReadCursor(wxWindowID textId, bool isTime) const;
58 void WriteCursor(wxWindowID textID, bool isTime, long cursor) const;
59 int ReadDeltaT(wxWindowID textId) const;
60 void UpdateUnits(wxWindowID comboId, bool& setTime, wxWindowID textID);
61 bool cursorMIsTime,
62 cursor1PIsTime,cursor2PIsTime,
63 cursor1BIsTime,cursor2BIsTime,
64 cursor1DIsTime,cursor2DIsTime,
65#ifdef WITH_PSLOPE
66 cursor1PSIsTime,cursor2PSIsTime,
67#endif
68 cursor1LIsTime,cursor2LIsTime;
69
70 wxStfDoc* actDoc;
71 wxAuiNotebook* m_notebook;
72
73 void OnPageChanged( wxAuiNotebookEvent& event );
74 void OnComboBoxUM( wxCommandEvent& event );
75 void OnComboBoxU1P( wxCommandEvent& event );
76 void OnComboBoxU2P( wxCommandEvent& event );
77 void OnComboBoxU1B( wxCommandEvent& event );
78 void OnComboBoxU2B( wxCommandEvent& event );
79 void OnComboBoxU1D( wxCommandEvent& event );
80 void OnComboBoxU2D( wxCommandEvent& event );
81 void OnComboBoxU1L( wxCommandEvent& event );
82 void OnComboBoxU2L( wxCommandEvent& event );
83#ifdef WITH_PSLOPE
84 void OnComboBoxU1PS( wxCommandEvent& event );
85 void OnComboBoxU2PS( wxCommandEvent& event );
86#endif
87 void OnRadioLatManualBeg( wxCommandEvent& event );
88 void OnRadioLatManualEnd( wxCommandEvent& event );
89 void OnRadioLatNonManualBeg( wxCommandEvent& event );
90 void OnRadioLatNonManualEnd( wxCommandEvent& event );
91
92#ifdef WITH_PSLOPE
93 void OnRadioPSManBeg( wxCommandEvent& event );
94 void OnRadioPSEventBeg( wxCommandEvent& event );
95 void OnRadioPSThrBeg( wxCommandEvent& event );
96 void OnRadioPSt50Beg( wxCommandEvent& event );
97
98 void OnRadioPSManEnd( wxCommandEvent& event );
99 void OnRadioPSt50End( wxCommandEvent& event );
100 void OnRadioPSDeltaT( wxCommandEvent& event );
101 void OnRadioPSPeakEnd( wxCommandEvent& event );
102#endif
103
104 void OnRadioAll( wxCommandEvent& event );
105 void OnRadioMean( wxCommandEvent& event );
106 void OnPeakcalcexec( wxCommandEvent& event );
107 void OnLoadCursorConf( wxCommandEvent& event );
108 void OnSaveCursorConf( wxCommandEvent& event );
109 void OnBasetoslope( wxCommandEvent& event );
110 void OnRTSlider( wxScrollEvent& event );
111 void OnPeakAtEnd( wxCommandEvent& event );
112 void OnStartFitAtPeak( wxCommandEvent& event );
113
115
117 bool IsCSRSyntax( wxFileConfig* crs_file );
118
120
122 bool OnOK();
123
124public:
126
134 wxStfCursorsDlg( wxWindow* parent, wxStfDoc* initDoc, int id = wxID_ANY,
135 wxString title = wxT("Cursor settings"), wxPoint pos = wxDefaultPosition,
136 wxSize size = wxDefaultSize, int style = wxCAPTION );
137
139
142 virtual void EndModal(int retCode);
143
145
151
153
155 int GetCursorM() const;
156
158
160 int GetCursor1P() const;
161
163
165 int GetCursor2P() const;
166
168
170 int GetCursor1B() const;
171
173
175 int GetCursor2B() const;
176
178
180 int GetCursor1D() const;
181
183
185 int GetCursor2D() const;
186
188
190 int GetCursor1L() const;
191
193
195 int GetCursor2L() const;
196
197#ifdef WITH_PSLOPE
199
201 int GetCursor1PS() const;
202
204
206 int GetCursor2PS() const;
207#endif
208
210
212
213 int GetPeakPoints() const;
214
216
218
219 int GetRTFactor() const;
220
222
224 void SetPeakAtEnd( bool is_end);
225
227
229 void SetPeakPoints(int peakPoints);
230
232
234 void SetRTFactor(int RTFactor);
235
237
239 int GetDeltaT() const;
240
242
244 void SetDeltaT(int DeltaT);
245
246
248
250 void SetStartFitAtPeak( bool is_peak);
251
253
256
258
261
263
266
268
271
273
276
277#ifdef WITH_PSLOPE
279
281 stf::pslope_mode_beg GetPSlopeBegMode() const;
282
284
286 stf::pslope_mode_end GetPSlopeEndMode() const;
287
288#endif // WITH_PSLOPE
289
291
293 bool GetFromBase() const;
294
296
299
300#ifdef WITH_PSLOPE
302
304 void SetPSlopeEndMode(stf::pslope_mode_end pslopeEndMode);
305
307
309 void SetPSlopeBegMode(stf::pslope_mode_beg pslopeBegMode);
310#endif // WITH_PSLOPE
311
313
315 void SetFromBase(bool frombase);
316
318
321
323
326
328
330 bool GetPeakAtEnd() const;
331
333
335 bool GetStartFitAtPeak() const;
336
339
341
344
346
348 double GetSlope() const;
349
351
353 void SetSlope( double slope );
354
356
359
361
363 bool GetBaseToSlope() const;
364
366
368 bool GetRuler() const;
369
371
373 void SetRuler(bool value);
374
376
378 bool LoadCursorConf( const wxString& filepath );
379
381
383 bool SaveCursorConf( const wxString& filepath );
384
386
388 void SetActiveDoc(wxStfDoc* actDoc_) { actDoc = actDoc_; }
389};
390
391/* @} */
392
393#endif
394
WORD TSTime TpMarker WORD size
Definition Son.h:337
short short TpShort TpDType TpStr units
Definition cfs.h:249
See http://www.wxwidgets.org/manuals/stable/wx_wxcommandevent.html (wxWidgets documentation)
See http://www.wxwidgets.org/manuals/stable/wx_wxdialog.html (wxWidgets documentation)
See http://www.wxwidgets.org/manuals/stable/wx_wxpoint.html (wxWidgets documentation)
See http://www.wxwidgets.org/manuals/stable/wx_wxsize.html (wxWidgets documentation)
The document class, derived from both wxDocument and Recording.
Definition doc.h:35
See http://www.wxwidgets.org/manuals/stable/wx_wxstring.html (wxWidgets documentation)
See http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html (wxWidgets documentation)
direction
The direction of peak calculations.
Definition stfnum.h:530
latency_mode
Latency cursor settings.
Definition stf.h:387
baseline_method
Methods for Baseline computation.
Definition stfnum.h:538
cursor_type
Mouse cursor types.
Definition stf.h:364
void SetStartFitAtPeak(bool is_peak)
Sets whether the left decay cursor should be at the peak of the trace.
void SetPeakPoints(int peakPoints)
Sets the number of points used for the binned average during peak detection.
void SetDeltaT(int DeltaT)
Sets the number of points used for the distance from the first PSlope cursor.
void SetRuler(bool value)
Sets whether an additional vertical ruler should be drawn through the measurement cursor.
bool GetStartFitAtPeak() const
Indicates whether to always start a fit at the current peak position.
void UpdateCursors()
Updates the cursor entries in the Cursors Settings menu.
void SetActiveDoc(wxStfDoc *actDoc_)
Sets the currently active document.
Definition cursorsdlg.h:388
stf::latency_mode GetLatencyStartMode() const
Gets the mode of Latency for the beginning of the latency cursor.
double GetSlope() const
Get the slope at which the baseline should be fixed.
stf::cursor_type CurrentCursor() const
Retrieve the current cursor notebook page.
int GetCursor1D() const
Get the left fit cursor x-position.
int GetPeakPoints() const
Gets the number of points used for the binned average during peak detection.
int GetRTFactor() const
Gets the lower factor (e.g 20) used to calculate the rise time.
int GetDeltaT() const
Gets the distance to the first PSlope cursor in number of points.
bool GetFromBase() const
Indicates whether to use the baseline as a reference for AP kinetics.
void SetLatencyEndMode(stf::latency_mode latencyEndMode)
Sets the latency mode of the right latency cursor.
virtual bool TransferDataFromWindow()
Called when data should be transferred from the non-modal dialog (e.g. when OK is pressed)
int GetCursor2D() const
Get the right fit cursor x-position.
int GetCursor1L() const
Get the left latency cursor x-position.
void SetLatencyStartMode(stf::latency_mode latencyBegMode)
Sets the latency mode of the left latency cursor.
int GetCursor2B() const
Get the right base cursor x-position.
bool LoadCursorConf(const wxString &filepath)
Load a cursor configuration file (*csr) in the Cursor Settings menu.
stfnum::direction GetDirection() const
Gets the direction of peak calculations.
void SetPeakAtEnd(bool is_end)
Sets whether the right peak cursor should be at the end of the trace.
wxStfCursorsDlg(wxWindow *parent, wxStfDoc *initDoc, int id=wxID_ANY, wxString title=wxT("Cursor settings"), wxPoint pos=wxDefaultPosition, wxSize size=wxDefaultSize, int style=wxCAPTION)
Constructor.
void SetFromBase(bool frombase)
Sets the reference for AP kinetics measurements.
int GetCursor1P() const
Get the left peak cursor x-position.
int GetCursorM() const
Get the measurement cursor x-position.
void SetDirection(stfnum::direction direction)
Sets the direction of peak calculations.
int GetCursor2P() const
Get the right peak cursor x-position.
stf::latency_mode GetLatencyEndMode() const
Gets the mode of Latency of the last latency cursor.
int GetCursor2L() const
Get the right latency cursor x-position.
bool GetBaseToSlope() const
Indicates whether the baseline should be fixed to a certain slope.
void SetSlopeUnits(const wxString &units)
Set the units of the slope.
void SetSlope(double slope)
Set the threshold slope.
bool GetRuler() const
Indicates whether an additional vertical ruler is drawn through the measurement cursor.
bool SaveCursorConf(const wxString &filepath)
Save a cursor configuration file (*csr) from the Cursor Settings menu.
void SetRTFactor(int RTFactor)
Set the lower value (e.g 20) to compute the rise-time. The high value is simply 100-lower value.
void SetBaselineMethod(enum stfnum::baseline_method)
Sets the reference for baseline measurement.
enum stfnum::baseline_method GetBaselineMethod() const
Indiates whether baseline is computed as mean or as median.
int GetCursor1B() const
Get the left base cursor x-position.
bool GetPeakAtEnd() const
Indicates whether the right peak cursor should always be at the end of the trace.
virtual void EndModal(int retCode)
Called upon ending a modal dialog.
#define StfDll
Defines dll export or import functions for Windows.
Definition stf.h:55