Skip to content

Commit

Permalink
Extend TDMS support
Browse files Browse the repository at this point in the history
  • Loading branch information
neurodroid committed Jun 4, 2018
1 parent 56d0dd8 commit 2b6d0bc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
16 changes: 16 additions & 0 deletions dist/windows/nsis/installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,12 @@ Section "Uninstall"
ReadRegStr $R0 HKCR ".atf" "AM_OLD_VALUE"
WriteRegStr HKCR ".atf" "" $R0

; --> .tdms
ReadRegStr $R0 HKCR ".tdms" ""
StrCmp $R0 "${REG_NAME}" 0 +3
ReadRegStr $R0 HKCR ".tdms" "AM_OLD_VALUE"
WriteRegStr HKCR ".tdms" "" $R0

SetDetailsPrint textonly
DetailPrint "Successfully uninstalled stimfit"
SetDetailsPrint listonly
Expand Down Expand Up @@ -518,6 +524,16 @@ Section ".atf (Axon text file)" SecAssATF
already_stf:
SectionEnd

; --> .tdms
Section ".tdms (Mantis TDMS file)" SecAssTDMS
ReadRegStr $R0 HKCR ".tdms" ""
StrCmp $R0 "${REG_NAME}" already_stf no_stf
no_stf:
WriteRegStr HKCR ".tdms" "AM_OLD_VALUE" $R0
WriteRegStr HKCR ".tdms" "" "${REG_NAME}"
already_stf:
SectionEnd

SubSectionEnd

;--------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/stimfit/gui/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ class StfDll wxStfApp: public wxApp
// Pointer to the cursors settings dialog box
wxStfCursorsDlg* CursorsDialog;
wxDocTemplate* m_cfsTemplate, *m_hdf5Template, *m_txtTemplate,*m_abfTemplate,
*m_atfTemplate,*m_axgTemplate,*m_sonTemplate, *m_hekaTemplate, *m_intanTemplate, *m_biosigTemplate;
*m_atfTemplate,*m_axgTemplate,*m_sonTemplate, *m_hekaTemplate, *m_intanTemplate, *m_tdmsTemplate, *m_biosigTemplate;
stfnum::storedFunc storedLinFunc;
// wxMenu* m_file_menu;
wxString m_fileToLoad;
Expand Down
6 changes: 4 additions & 2 deletions src/stimfit/gui/doc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ bool wxStfDoc::OnOpenDocument(const wxString& filename) {
if (wxDocument::OnOpenDocument(filename)) { //calls base class function

#ifndef TEST_MINIMAL
#if (defined(WITH_BIOSIG) || defined(WITH_BIOSIG2) && !defined(__WXMAC__))
#if 0 //(defined(WITH_BIOSIG) || defined(WITH_BIOSIG2) && !defined(__WXMAC__))
// Detect type of file according to filter:
wxString filter(GetDocumentTemplate()->GetFileFilter());
#else
Expand Down Expand Up @@ -728,6 +728,7 @@ bool wxStfDoc::SaveAs() {
filters += wxT("CED filing system (*.dat;*.cfs)|*.dat;*.cfs|");
filters += wxT("Axon text file (*.atf)|*.atf|");
filters += wxT("Igor binary wave (*.ibw)|*.ibw|");
filters += wxT("Mantis TDMS file (*.tdms)|*.tdms|");
filters += wxT("Text file series (*.txt)|*.txt|");
#if (defined(WITH_BIOSIG) || defined(WITH_BIOSIG2))
filters += wxT("GDF file (*.gdf)|*.gdf");
Expand All @@ -747,7 +748,8 @@ bool wxStfDoc::SaveAs() {
case 1: type=stfio::cfs; break;
case 2: type=stfio::atf; break;
case 3: type=stfio::igor; break;
case 4: type=stfio::ascii; break;
case 4: type=stfio::tdms; break;
case 5: type=stfio::ascii; break;
#if (defined(WITH_BIOSIG) || defined(WITH_BIOSIG2))
default: type=stfio::biosig;
#else
Expand Down

0 comments on commit 2b6d0bc

Please sign in to comment.