Skip to content

Conversation

@hexfet
Copy link
Owner

@hexfet hexfet commented Jan 31, 2018

No description provided.

hexfet and others added 30 commits January 22, 2016 15:55
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
vegarwe and others added 14 commits October 8, 2016 18:25
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 `/`
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
@hexfet hexfet merged commit 2b4f7ee into hexfet:master Jan 31, 2018
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.

8 participants