Skip to content

Add FFI routines for datafolder export #2439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

t-b
Copy link
Collaborator

@t-b t-b commented Jun 5, 2025

FFI_GetSweepBrowserTitles() returns a text wave with all sweep browser titles.

FFI_SavePSXDataFolderToHDF5 takes a full filepath to a non-existing file and a sweep browser title. It will then save all psx datafolders it can find in it.

@timjarsky
Copy link
Collaborator

@t-b with

FFI_SavePSXDataFolderToHDF5("C:\\Users\\timj\\Downloads", "Browser")

I get:

FFI_SavePSXDataFolderToHDF5("C:\Users\timj\Downloads", "Browser")
  !!! Assertion FAILED !!!
  Message: "Could not find SweepBrowser with given title: Browser"
  Please provide the following information if you contact the MIES developers:
  ################################
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Stacktrace:
  FFI_SavePSXDataFolderToHDF5(...)#L195 [MIES_ForeignFunctionInterface.ipf]
AB_GetSweepBrowserWindowFromTitle(...)#L3276 [MIES_AnalysisBrowser.ipf]
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Time: 2025-06-09T10:08:19-07:00
  Locked device: [- none -]
  Current sweep: [- none -]
  DAQ: [- none -]
  Testpulse: [- none -]
  Acquisition state: [- none -]
  Experiment: 2022_07_29_120535_v1 (Packed)
  Igor Pro version: 9.0.6.1 (56565)
  MIES version:
  Release_2.9_20250502-135-g9bc5d8922
Date and time of last commit: 2025-06-06T19:12:23+02:00
Submodule status: 
-f7e1cfa52796165f589ab628174a0c4307459b92 Packages/IPNWB
-7dece9a54731855b702ee6002650af72e8a3daa4 Packages/doc/doxygen-filter-ipf
-af3d04fa8c3caf7a85b11ea22bc22018c774b77c Packages/igortest
  ################################

I confirmed the window title:

•getwindow kwTopWin, title
•print s_value
Browser 

I also tried:

•FFI_SaveDataFolderToHDF5("C:\Users\timj\Downloads", "root:sweepBrowser:FormulaData:psx:")
While executing HDF5CreateFile, H5Fcreate failed.
While executing HDF5CreateFile, H5Fcreate failed.
  HDF5 library function H5FD__sec2_open(): unable to open file: name = 'C:\Users	imj\Downloads', errno = 22, error message = 'Invalid argument', flags = 15, o_flags = 502
  HDF5 library function H5FD_open(): open failed
  HDF5 library function H5F_open(): unable to open file: time = Mon Jun  9 10:11:25 2025
, name = 'C:\Users	imj\Downloads', tent_flags = 15
  HDF5 library function H5Fcreate(): unable to create file
•FFI_SaveDataFolderToHDF5("C:\\Users\\timj\\Downloads", "root:sweepBrowser:FormulaData:psx:")
While executing HDF5CreateFile, H5Fcreate failed.
While executing HDF5CreateFile, H5Fcreate failed.
  HDF5 library function H5FD__sec2_open(): unable to open file: name = 'C:\Users\timj\Downloads', errno = 13, error message = 'Permission denied', flags = 15, o_flags = 502
  HDF5 library function H5FD_open(): open failed
  HDF5 library function H5F_open(): unable to open file: time = Mon Jun  9 10:12:10 2025
, name = 'C:\Users\timj\Downloads', tent_flags = 15
  HDF5 library function H5Fcreate(): unable to create file
  
  ```

@t-b t-b force-pushed the feature/2439-routines-for-hdf5-export branch from b35d920 to 187c66c Compare June 9, 2025 20:04
@t-b
Copy link
Collaborator Author

t-b commented Jun 9, 2025

Added an assertion so that we catch cases where users pass a folder

@t-b
Copy link
Collaborator Author

t-b commented Jun 9, 2025

Of course we can also change it to allow passing a folder, we figure a file name and return that. No problem.

@t-b t-b force-pushed the feature/2439-routines-for-hdf5-export branch from 187c66c to e42c7c2 Compare June 10, 2025 10:42
@t-b t-b force-pushed the feature/2439-routines-for-hdf5-export branch from e42c7c2 to be00266 Compare July 22, 2025 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants