Skip to content

Commit 4e0c463

Browse files
committed
Update documentation with image
Added image to clearify how PyStageLinQ is used. Also updated the readthedocs config files.
1 parent 870a042 commit 4e0c463

9 files changed

+915
-2
lines changed

docs/PyStageLinQflow.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# PyStageLinQ call flow
2+
The following picture shows the intended way to interact with Statemap using PyStageLinQ:
3+
4+
![PyStageLinQ usage flowchart](charts/PyStageLinQ usage flowchart.png)

docs/charts/PyStageLinQ internal flow.graphml

Lines changed: 365 additions & 0 deletions
Large diffs are not rendered by default.
59.2 KB
Loading

docs/charts/PyStageLinQ usage flowchart.graphml

Lines changed: 487 additions & 0 deletions
Large diffs are not rendered by default.
51.4 KB
Loading

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
# -- Project information -----------------------------------------------------
2020

2121
project = "PyStageLinQ"
22-
copyright = "2022, Jaxcie"
22+
copyright = "2024, Jaxcie"
2323
author = "Jaxcie"
2424

2525
# The full version, including alpha/beta/rc tags
26-
release = "0.1.0"
26+
release = "0.0.0"
2727

2828
# -- General configuration ---------------------------------------------------
2929

docs/quickstart.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
PyStageLinQ is a Python library for ineracting with StageLinQ devices over IP. It is distributed over PyPi and currently
2+
supports the StateMap functionality.
3+
4+
# Installation
5+
`pip install PyStageLinQ`
6+
7+
# Example usage
8+
Here follow an example of how PyStageLinQ can be used:
9+
10+
```python
11+
from PyStageLinQ import EngineServices, PyStageLinQ
12+
PrimeGo = None
13+
14+
# Callback for when PyStageLinQ as found a StageLinQ device. This will print out information about the found device
15+
# and if lets the user decide if they want to subscribe to a service or not.
16+
17+
def new_device_found_callback(ip, discovery_frame, service_list):
18+
# Print device info and supplied services
19+
print(
20+
f"Found new Device on ip {ip}: Device name: {discovery_frame.device_name}, ConnectionType: {discovery_frame.connection_type}, SwName: {discovery_frame.sw_name}, "
21+
f"SwVersion: {discovery_frame.sw_version}, port: {discovery_frame.Port}")
22+
23+
if len(service_list) > 0:
24+
print("Services found in device:")
25+
else:
26+
print("No services found")
27+
28+
for service in service_list:
29+
print(f"\t{service.service} on port {service.port}")
30+
31+
32+
# Request StateMap service
33+
for service in service_list:
34+
if service.service == "StateMap":
35+
PrimeGo.subscribe_to_statemap(service, EngineServices.prime_go, state_map_data_print)
36+
37+
38+
# Callback for when data has arrived from a StageLinQ device. It is up to the user what to do with this information.
39+
40+
def state_map_data_print(data):
41+
for message in data:
42+
print(message)
43+
44+
# Example main function, starting PyStageLinQ.
45+
if __name__ == "__main__":
46+
global PrimeGo
47+
48+
# Run PyStageLinQ on all available network interfaces
49+
PrimeGo = PyStageLinQ.PyStageLinQ(new_device_found_callback, name="Jaxcie StagelinQ")
50+
PrimeGo.start()
51+
```

docs/readme_link.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Quickstart
22
************
33

4+
.. include:: quickstart.md
5+
:parser: myst_parser.sphinx_
6+
47
.. include:: ../README.md
58
:parser: myst_parser.sphinx_
69

10+
11+

make_release.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ echo "Version detected from git tag: $new_ver"
88

99
echo "Updating pyproject.toml"
1010
sed -i 's/version = "0.0.0"/version = "'$new_ver'"/' pyproject.toml
11+
sed -i 's/release = "0.0.0"/release = "'$new_ver'"/' docs/conf.py
1112

1213

1314
rm dist/* -f

0 commit comments

Comments
 (0)