Skip to content
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

When export_raw_data_csv or export_raw_data_binary is called with non-existent direcroy, no Python exception and wrong Logic GUI error message #45

Open
pfroud opened this issue May 24, 2024 · 0 comments

Comments

@pfroud
Copy link

pfroud commented May 24, 2024

from saleae import automation
with automation.Manager.connect() as manager:
    device_configuration = automation.LogicDeviceConfiguration(
        enabled_digital_channels=[0, 1, 2, 3],
        digital_sample_rate=10_000_000
    )
    capture_configuration = automation.CaptureConfiguration(
        capture_mode=automation.TimedCaptureMode(duration_seconds=1.0)
    )
    with manager.start_capture(
            device_id='F4241',
            device_configuration=device_configuration,
            capture_configuration=capture_configuration) as capture:
        capture.wait()
        spi_analyzer = capture.add_analyzer('SPI', label=f'Test Analyzer', settings={
            'MISO': 0,
            'Clock': 1,
            'Enable': 2,
            'Bits per Transfer': '8 Bits per Transfer (Standard)'
        })
        capture.export_raw_data_csv(directory="non_existent_directory", digital_channels=[0, 1, 2, 3])
        # the same behavior happens if you call capture.export_raw_data_binary("non_existent_directory")

The Logic GUI shows a popup message which says "failed to create directory":

"failed to create directory" message

but I think the error message should say "directory not found" because in capture.py it says:

Note, the directory parameter is a specific folder that must already exist, and should not include a filename.

Also, the Python program does not throw an exception.

Logic version information:

{"Environment":"production","Branch":"master","Commit":"a59be960fd362c11b73b4cb5105f39676631e868","Version":"2.4.14","AutomationVersion":"1.0.0","MachineID":"19aa4ba2-11aa-4b08-86cc-ecac4ec55058","PID":3572,"LaunchId":"1dd197ae-82fd-4a00-b21f-a8744627229e","Architecture":"x64"}

@pfroud pfroud changed the title When export_raw_data_csv called with non-existent direcroy, no Python exception and wrong Logic GUI error message When export_raw_data_csv or export_raw_data_binary is called with non-existent direcroy, no Python exception and wrong Logic GUI error message May 24, 2024
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

No branches or pull requests

1 participant