Skip to content

Commit d88fdf1

Browse files
authored
Add explainer diagrams (#413)
1 parent 277a540 commit d88fdf1

File tree

4 files changed

+78
-6
lines changed

4 files changed

+78
-6
lines changed

docs/development/adding_a_manipulator.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
By the end of this section, you will be able to add a manipulator platform to Ephys Link and control it using the server
2-
API. This is a software development guide and assumes you have experience with Python.
2+
API. This is a software development guide and assumes you have experience with Python. It is encouraged to
3+
read [how the system works first](../home/how_it_works.md) before proceeding.
34

45
## Set Up for Development
56

67
1. Fork the [Ephys Link repository](https://github.com/VirtualBrainLab/ephys-link).
7-
2. Follow the instructions for [installing Ephys Link for development](index.md/#installing-for-development) to get all
8+
2. Follow the instructions for [installing Ephys Link for development](index.md#installing-for-development) to get all
89
the necessary dependencies and tools set up. In this case, you'll want to clone your fork.
910

1011
## Create a Manipulator Binding

docs/home/how_it_works.md

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,74 @@
11
This section provides an overview of how Ephys Link works. It is intended for users who want to understand the
22
software's architecture and how it interacts with other systems.
33

4-
!!! warning "Under Construction"
4+
## Why Ephys Link?
55

6-
This documentation page is still under construction. Please come back later for more information!
6+
There exists many manipulator platforms in neuroscience research, each with their own API and software. This diversity
7+
makes it difficult for tool developers to support multiple platforms. Ephys Link aims to solve this problem by providing
8+
a unified API for interacting with manipulators. This allows developers to write code that works with any manipulator
9+
supported by Ephys Link.
710

11+
## Ephys Link Architecture
12+
13+
```mermaid
14+
flowchart LR
15+
n1["Client Application"]
16+
n3["Manipulator 1"]
17+
n4["Manipulator 2"]
18+
subgraph s1["Ephys Link"]
19+
n6["Rectangle"]
20+
n2["Server"]
21+
end
22+
n6["Bindings"] ---|" Manipulator 1 API "| n3
23+
n1 ---|" Send Request "| n2
24+
n2 ---|" Callback Response "| n1
25+
n6 ---|" Manipulator 2 API "| n4
26+
n3 --- n6
27+
n4 --- n6
28+
n2 ---|" Parse Request "| n6
29+
n6 ---|" Send Response "| n2
30+
```
31+
32+
This diagram shows the high-level architecture of Ephys Link. Ephys Link acts as an intermediary between client
33+
applications and manipulators.
34+
35+
Within Ephys Link, there is a server component that handled external communication and there are the bindings for each
36+
proprietary manipulator platform API. The server passes requests from client applications to the appropriate manipulator
37+
bindings which convert the requests to the appropriate manipulator API calls.
38+
39+
## Example Message Flow
40+
41+
Consider the following example of a request to move a manipulator to a specific position:
42+
43+
```mermaid
44+
sequenceDiagram
45+
participant C as Client Application
46+
box Ephys Link
47+
participant S as Server
48+
participant B as Bindings
49+
end
50+
participant M as Manipulator Platform
51+
C ->> S: Move manipulator to position (x, y, z)
52+
S ->> B: set_position(x, y, z)
53+
B ->> M: move(a, b, c, d)
54+
loop Update Position
55+
C -->> S: Get current position
56+
S -->> B: get_position()
57+
B -->> M: position()
58+
M -->> B: Now at (a, b, c, d)
59+
B -->> S: Now at (x, y, z)
60+
S -->> C: Now at (x, y, z)
61+
end
62+
M ->> B: Completed move, at (a, b, c, d)
63+
B ->> S: Completed move, at (x, y, z)
64+
S ->> C: Completed move, at (x, y, z)
65+
```
66+
67+
Some things to notice:
68+
69+
- The client application only ever speaks in (x, y, z) coordinates, never in the native manipulator platform's
70+
coordinate system. The binding handles the conversion.
71+
- While one command is being fulfilled, the client application can still query the manipulator's current position.
72+
Later, the manipulator can report when it is done and complete the movement request.
73+
- The manipulator often has a different API than Ephys Link (`move` vs `set_position`), but the binding handles the
74+
translation.

docs/home/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ pipx install ephys-link
3434

3535
## Install for Development
3636

37-
See [development documentation](../development/index.md/#installing-for-development) for more information.
37+
See [development documentation](../development/index.md#installing-for-development) for more information.

mkdocs.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ markdown_extensions:
5252
- attr_list
5353
- md_in_html
5454
- pymdownx.details
55-
- pymdownx.superfences
55+
- pymdownx.superfences:
56+
custom_fences:
57+
- name: mermaid
58+
class: mermaid
59+
format: !!python/name:pymdownx.superfences.fence_code_format
5660
- pymdownx.highlight:
5761
anchor_linenums: true
5862
line_spans: __span

0 commit comments

Comments
 (0)