forked from ppannuto/python-saleae
-
Notifications
You must be signed in to change notification settings - Fork 0
Pull changes from upstream #1
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fix command string to load saved file
When calling get_active_channels, on the Logic Pro 8, there is a chance that TRUE will be returned instead of the expected digital_channels. without this check, the assert will crash out. This occurs when changing the trigger of the channel after performing a capture. Signed-off-by: Malcolm Prinn <malcolm.prinn@intel.com>
get_active_channels: Handle TRUE response from device
Saleae removed the old blog post, they replaced it with an updated one for v1.2.5, but it's probably better to just point to the stable github repo.
Also update the trove classifiers to cover Python versions that the library seems to support correctly
[ci skip]
- Changed _build(self, s), now also supports lists as its argument
n.b. use a UserWarning instead of a DeprecationWarning since the latter is silenced by the default and would somewhat defeat the point
Occasionally, on the Logic Pro 8, the response to the 'GET_ACTIVE_CHANNELS' command will return either 'TRUE' or an empty string. This occurs when changing the trigger of the channel after performing a capture. Signed-off-by: Malcolm Prinn <malcolm.prinn@intel.com>
get_active_channels: Handle 'TRUE' or blank response
- add data_response keyword arg to export_analyzer() method
Using type(list) doesn't work for all possible types and isinstance() is a safer way to check this. This was happening with Python 2.7.10 when passing a list of specific digital channels to the _build() routine in export_data2() but could also happen in other places in the code.
The old Logic8 devices do not support the get_active_channels command. On these devices there are always only 8 active digital channels so we should just return that otherwise the export_data and export_data2 code will fail to work.
Issue #23: Fix a problem building strings from lists
Fix the get_active_channels function for old Logic8's
- Check `list` types more robustly internally - Return static channel list for old Saleae devices instead of failing
EXPORT_ANALYZER data response
- Add support for returning analyzer data to this library by
passing `data_response=True` to `export_analyzer`
Much like user mprinn's commit (9758969), when changing the trigger type, the command 'GET_CONNECTED_DEVICES' only returns 'TRUE' for saleae Logic Pro 16 instead of a list of connected devices. Used in : set_trigger_one_channel -> get_active_channels -> get_active_device -> get_connected_devices, after a capture. Squash of commits from PR. Closes #26.
- Handle `TRUE` response from `GET_CONNECTED_DEVICES`
Response to command 'GET_CONNECTED_DEVICES' can vary from '' to 'True\n' or a previous command response. This is an improved and sturdier version of commit 288d8ef
get_connected_devices: Sturdier handling response
- #27 From @vegarwe: Fix `display_base` for `export_data2` - #28 From @Tris-ares: Handle unexpected responses to `get_connected_devices` Thanks all!
A bit experimental, tested on mac and unix. Hopefully useful if your script wants to clean up when it's done
If the Logic software isn't already running, try to open it automatically for the user
* Fix windows path formatting if a windows path is applied * Fix windows path formatting if a windows path is applied (2/2)
I misread that Travis report, silly me. What good is CI if you ignore it? According to SO, Windows will also accept `/` as a path separater, so the easiest way to fix this is just to convert windows `\`s to `/`
Looks like Logic 4 doesn't support setting channels over the scripting server: https://github.com/saleae/SaleaeSocketApi/blob/master/SaleaeSocketApi/SocketApi.cs#L899 Closes #33.
Otherwise, export of the specified channels didn't work on my Saleae Logic Pro 8 with 1.2.12 software version.
Added a DIGITAL_ONLY and ANALOG_ONLY options to the export_data2()
I made an additional investigation of the export process and here is my results. The main conclusion is - we should take into account what channels are **Active** and what channels are asked to **Export**. Only this way we can choose the right combination of options. NOTE: Tested only on my Saleae Logic Pro 8 with 1.2.12 software version. ## `export_data2()` results relative to enabled and exported channels | Enabled channels | Exported channels | Correct command | | ---------------- | ----------------- | ---------------------------------------- | | Analog | Analog | ' ' (None) | | | Digital | Wrong combination | | | Both | Wrong combination | | | | | | Digital | Analog | Wrong combination | | | Digital | ' ' (None) | | | Both | Wrong combination | | | | | | Both | Analog | ANALOG_ONLY (ANALOG_AND_DIGITAL also works) | | | Digital | DIGITAL_ONLY | | | Both | ANALOG_AND_DIGITAL | ## Examples **Analog** enabled and **analog** exported: ```python s.set_active_channels([], [2, 3]) s.export_data2(filename, digital_channels=None, analog_channels=[3]) ``` **Digital** enabled and **digital** exported: ```python s.set_active_channels([0, 1], []) s.export_data2(filename, digital_channels=[0], analog_channels=None) ``` **Both** enabled ```python s.set_active_channels([0, 1], [2, 3]) ``` and: - **analog** exported: ```python s.export_data2(filename, digital_channels=None, analog_channels=[3]) ``` - **digital** exported: ```python s.export_data2(filename, digital_channels=[0], analog_channels=None) ``` - **both** exported ``` python s.export_data2(filename, digital_channels=[0], analog_channels=[3]) ```
Additional investigations of the export process
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.