Stimfit  0.13.15
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
cursorsdlg.h
Go to the documentation of this file.
00001 // This program is free software; you can redistribute it and/or
00002 // modify it under the terms of the GNU General Public License
00003 // as published by the Free Software Foundation; either version 2
00004 // of the License, or (at your option) any later version.
00005 
00006 // This program is distributed in the hope that it will be useful,
00007 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00008 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00009 // GNU General Public License for more details.
00010 
00011 // You should have received a copy of the GNU General Public License
00012 // along with this program; if not, write to the Free Software
00013 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00014 
00021 #ifndef _CURSORSDLG_H
00022 #define _CURSORSDLG_H
00023 
00028 #include "./../../stf.h"
00029 #include <wx/bookctrl.h>
00030 
00031 class wxStfDoc;
00032 
00034 class StfDll wxStfCursorsDlg : public wxDialog
00035 {
00036     DECLARE_EVENT_TABLE()
00037 
00038 private:
00039     wxNotebookPage* CreateMeasurePage();
00040     wxNotebookPage* CreatePeakPage();
00041     wxNotebookPage* CreateBasePage();
00042     wxNotebookPage* CreateDecayPage();
00043     wxNotebookPage* CreateLatencyPage();
00044 #ifdef WITH_PSLOPE
00045     wxNotebookPage* CreatePSlopePage();
00046 #endif
00047     wxFlexGridSizer*
00048         CreateCursorInput( wxPanel* nbPage, wxWindowID textC1, wxWindowID textC2,
00049                            wxWindowID comboU1, wxWindowID comboU2, std::size_t c1,
00050                            std::size_t c2 );
00051 
00052     int ReadCursor(wxWindowID textId, bool isTime) const;
00053     int ReadDeltaT(wxWindowID textId) const;
00054     void UpdateUnits(wxWindowID comboId, bool& setTime, wxWindowID textID);
00055     bool cursorMIsTime,
00056     cursor1PIsTime,cursor2PIsTime,
00057     cursor1BIsTime,cursor2BIsTime,
00058     cursor1DIsTime,cursor2DIsTime,
00059 #ifdef WITH_PSLOPE
00060     cursor1PSIsTime,cursor2PSIsTime,
00061 #endif
00062     cursor1LIsTime,cursor2LIsTime;
00063 
00064     wxStfDoc* actDoc;
00065     wxNotebook* m_notebook;
00066 
00067     void OnPageChanged( wxNotebookEvent& event );
00068     void OnComboBoxUM( wxCommandEvent& event );
00069     void OnComboBoxU1P( wxCommandEvent& event );
00070     void OnComboBoxU2P( wxCommandEvent& event );
00071     void OnComboBoxU1B( wxCommandEvent& event );
00072     void OnComboBoxU2B( wxCommandEvent& event );
00073     void OnComboBoxU1D( wxCommandEvent& event );
00074     void OnComboBoxU2D( wxCommandEvent& event );
00075     void OnComboBoxU1L( wxCommandEvent& event );
00076     void OnComboBoxU2L( wxCommandEvent& event );
00077 #ifdef WITH_PSLOPE
00078     void OnComboBoxU1PS( wxCommandEvent& event );
00079     void OnComboBoxU2PS( wxCommandEvent& event );
00080 #endif
00081     void OnRadioLatManualBeg( wxCommandEvent& event );
00082     void OnRadioLatManualEnd( wxCommandEvent& event );
00083     void OnRadioLatNonManualBeg( wxCommandEvent& event );
00084     void OnRadioLatNonManualEnd( wxCommandEvent& event );
00085 
00086 #ifdef WITH_PSLOPE
00087     void OnRadioPSManBeg( wxCommandEvent& event );
00088     void OnRadioPSEventBeg( wxCommandEvent& event );
00089     void OnRadioPSThrBeg( wxCommandEvent& event );
00090     void OnRadioPSt50Beg( wxCommandEvent& event );
00091 
00092     void OnRadioPSManEnd( wxCommandEvent& event );
00093     void OnRadioPSt50End( wxCommandEvent& event );
00094     void OnRadioPSDeltaT( wxCommandEvent& event );
00095     void OnRadioPSPeakEnd( wxCommandEvent& event );
00096 #endif
00097 
00098     void OnRadioAll( wxCommandEvent& event );
00099     void OnRadioMean( wxCommandEvent& event );
00100     void OnPeakcalcexec( wxCommandEvent& event );
00101     void OnBasetoslope( wxCommandEvent& event );
00102     void OnRTSlider( wxScrollEvent& event );
00103     
00105 
00107     bool OnOK();
00108 
00109 public:
00111 
00119     wxStfCursorsDlg( wxWindow* parent, wxStfDoc* initDoc, int id = wxID_ANY,
00120                      wxString title = wxT("Cursor settings"), wxPoint pos = wxDefaultPosition,
00121                      wxSize size = wxDefaultSize, int style = wxCAPTION );
00122 
00124 
00127     virtual void EndModal(int retCode);
00128 
00130 
00135     virtual bool TransferDataFromWindow();
00136 
00138 
00140     int GetCursorM() const;
00141 
00143 
00145     int GetCursor1P() const;
00146 
00148 
00150     int GetCursor2P() const;
00151 
00153 
00155     int GetCursor1B() const;
00156 
00158 
00160     int GetCursor2B() const;
00161 
00163 
00165     int GetCursor1D() const;
00166 
00168 
00170     int GetCursor2D() const;
00171 
00173 
00175     int GetCursor1L() const;
00176 
00178 
00180     int GetCursor2L() const;
00181 
00182 #ifdef WITH_PSLOPE
00183 
00184 
00186     int GetCursor1PS() const;
00187 
00189 
00191     int GetCursor2PS() const;
00192 #endif
00193 
00195 
00198     int GetPeakPoints() const;
00199 
00201 
00204     int GetRTFactor() const;
00205 
00207 
00209     void SetPeakPoints(int peakPoints);
00210 
00212 
00214     void SetRTFactor(int RTFactor);
00215 
00217 
00219     int GetDeltaT() const;
00220 
00222 
00224     void SetDeltaT(int DeltaT);
00225 
00227 
00229     stf::direction GetDirection() const;
00230 
00232 
00234     stf::latency_mode GetLatencyStartMode() const;
00235 
00237 
00239     stf::latency_mode GetLatencyEndMode() const;
00240 
00242 
00244     void SetLatencyStartMode(stf::latency_mode latencyBegMode);
00245 
00247 
00249     void SetLatencyEndMode(stf::latency_mode latencyEndMode);
00250 
00252 
00254     bool UsePeak4Latency() const;
00255 
00257 
00259     void SetPeak4Latency(int val);
00260     
00261 #ifdef WITH_PSLOPE
00262 
00263 
00265     stf::pslope_mode_beg GetPSlopeBegMode() const;
00266 
00268 
00270     stf::pslope_mode_end GetPSlopeEndMode() const;
00271 
00272 #endif // WITH_PSLOPE
00273 
00275 
00277     bool GetFromBase() const;
00278     
00280 
00282     void SetDirection(stf::direction direction);
00283 
00284 #ifdef WITH_PSLOPE
00285 
00286 
00288     void SetPSlopeEndMode(stf::pslope_mode_end pslopeEndMode);
00289 
00291 
00293     void SetPSlopeBegMode(stf::pslope_mode_beg pslopeBegMode);
00294 #endif // WITH_PSLOPE
00295 
00297 
00299     void SetFromBase(bool frombase);
00300     
00302 
00304     bool GetPeakAtEnd() const;
00305 
00307 
00309     bool GetStartFitAtPeak() const;
00310 
00312     void UpdateCursors();
00313 
00315 
00317     stf::cursor_type CurrentCursor() const;
00318 
00320 
00322     double GetSlope() const;
00323 
00325 
00327     void SetSlope( double slope );
00328 
00330 
00332     void SetSlopeUnits(const wxString& units);
00333 
00335 
00337     bool GetBaseToSlope() const;
00338 
00340 
00342     bool GetRuler() const;
00343 
00345 
00347     void SetActiveDoc(wxStfDoc* actDoc_) { actDoc = actDoc_; }
00348 };
00349 
00350 /* @} */
00351 
00352 #endif
00353 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines