Skip to content

Commit

Permalink
Ephys socket update - Add HTTP documentation (#40)
Browse files Browse the repository at this point in the history
* Add HTTP documentation

* Remove caching of dependencies
  • Loading branch information
bparks13 authored Apr 2, 2024
1 parent 0bd4655 commit 4192264
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/sphinx-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,7 @@ jobs:
run: |
python -m pip install --upgrade pipenv wheel
- id: cache-pipenv
uses: actions/cache@v1
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}

- name: Install dependencies
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: |
pipenv install --deploy --dev
Expand Down
19 changes: 18 additions & 1 deletion source/User-Manual/Plugins/Ephys-Socket.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,28 @@ An example Python script is included in the `Resources <https://github.com/open-
"**Variable**", "**Data Type**", "**Description**"
"Offset", "`int32`", "Integer defining the offset in the data stream. For TCP sockets, value must always be set to **0**."
"Number of Bytes", "`int32`", "Total number of bytes sent in each packet. Calculated as :code:`num_bytes = num_channels * num_samples * element_size`. This does **not** include the header bytes."
"Bit Depth", "int16", "Depth defines the OpenCV.Mat `Depth <https://github.com/horizongir/opencv.net/blob/main/src/OpenCV.Net/CoreTypes.cs#L93>`__, an enumeration defined as :code:`[U8, S8, U16, S16, S32, F32, F64]`, where U is 'unsigned', S is 'signed', F is 'float', and the number indicates the number of bits. For example, :code:`U16` means 'unsigned integer with 16 bits'. Note that the enumeration is zero-indexed, where :code:`U8 = 0`, and :code:`F64 = 6`"
"Bit Depth", "`int16`", "Depth defines the OpenCV.Mat `Depth <https://github.com/horizongir/opencv.net/blob/main/src/OpenCV.Net/CoreTypes.cs#L93>`__, an enumeration defined as :code:`[U8, S8, U16, S16, S32, F32, F64]`, where U is 'unsigned', S is 'signed', F is 'float', and the number indicates the number of bits. For example, :code:`U16` means 'unsigned integer with 16 bits'. Note that the enumeration is zero-indexed, where :code:`U8 = 0`, and :code:`F64 = 6`"
"Element Size", "`int32`", "Number of bytes needed for each sample. For :code:`U16`, :code:`element_size = 2`, while for :code:`F64`, :code:`element_size = 8`."
"Number of Channels", "`int32`", "Number of channels per packet."
"Number of Samples", "`int32`", "Number of samples sent per channel per packet."

.. note::

Pay attention to the order of data samples in the example script. Samples are not interleaved, but rather in each packet the samples for channel 1 are sent, followed by the samples for channel 2, and so on.

Remote Control
#################

Some Ephys Socket settings can be modified via the GUI's built-in HTTP server. Commands are sent as "config messages" to the Ephys Socket node.

.. note::

Parameters cannot be modified while acquisition is running, nor can they be modified if the port is connected. To change any settings remotely, the port must be disconnected in the GUI

The following commands are available:

1. :code:`ES INFO` : returns a JSON string containing information about all available variables (i.e., scale, offset, port, and frequency)
2. :code:`ES SCALE <data_scale>` : set the data scale
3. :code:`ES OFFSET <data_offset>` : set the data offset
4. :code:`ES PORT <port>` : set the port number
5. :code:`ES FREQUENCY <sample_rate>` : set the sampling frequency

0 comments on commit 4192264

Please sign in to comment.