saleae / logic2-automation

Logic2 Automation API
https://saleae.github.io/logic2-automation/
Apache License 2.0
19 stars 8 forks source link

No GUI error or Python exception when `legacy_export_analyzer` called with non-existant directory #47

Open pfroud opened 4 months ago

pfroud commented 4 months ago

I hope submitting separate issues for these is helpful to keep track, and not annoying!!!

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.legacy_export_analyzer("non_existent_directory/file.csv", spi_analyzer,
                                       automation.RadixType.HEXADECIMAL)

The Logic GUI shows a popup message which says "export complete":

"analyzer export completed" message

And no Python exception is thrown.

As far as I can tell, nothing was actually exported.

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"}