Skip to content

Commit 29835f5

Browse files
author
Dilmi Wickramanayake
committed
Merge branch 'main' of https://github.com/ni/nipanel-python
2 parents c62c497 + 49c97c1 commit 29835f5

File tree

19 files changed

+376
-120
lines changed

19 files changed

+376
-120
lines changed

examples/all_types/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
## All Types Example
22

3-
This is an example for `nipanel` that demonstrates all supported data types
3+
This is an example for `nipanel` that demonstrates all supported data types.
44

55
### Feature
66

7-
- Demonstrates support for all data types
7+
- Demonstrates all supported data types
88

99
### Required Software
1010

1111
- Python 3.9 or later
1212

1313
### Usage
1414

15-
Run `poetry run python examples/all_types/all_types.py`
15+
```pwsh
16+
poetry install --with examples
17+
poetry run python examples/all_types/all_types.py
18+
```

examples/hello/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Hello
22

3-
This is a simple nipanel example that displays a Streamlit app.
3+
This is a simple `nipanel` example that displays a Streamlit app.
44

55
### Feature
66

@@ -12,4 +12,7 @@ This is a simple nipanel example that displays a Streamlit app.
1212

1313
### Usage
1414

15-
Run `poetry run python examples/hello/hello.py`
15+
```pwsh
16+
poetry install --with examples
17+
poetry run python examples/hello/hello.py
18+
```

examples/nidaqmx/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Prerequisites
1+
Prerequisites
22
===============
33
Requires a Physical or Simulated Device : https://github.com/ni/nidaqmx-python/blob/master/README.rst (Getting Started Section)
44

@@ -16,5 +16,7 @@ This is a nipanel example that displays an interactive Streamlit app and updates
1616

1717
### Usage
1818

19-
Run `poetry run examples/nidaqmx/nidaqmx_continuous_analog_input.py`
20-
19+
```pwsh
20+
poetry install --with examples
21+
poetry run examples/nidaqmx/nidaqmx_continuous_analog_input.py
22+
```

examples/niscope/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
Prerequisites
1+
Prerequisites
22
===============
33
Requires a Physical or Simulated Device. Refer to the [Getting Started Section](https://github.com/ni/nidaqmx-python/blob/master/README.rst) to learn how to create a simulated device. This example uses NI oscilloscopes/digitizers, which have the module numbering pattern _51xx_. One example is NI PXIe-5114.
4+
45
## Sample
56

67
This is a nipanel example that displays an interactive Streamlit app and updates and fetches data from device.
78

89
### Feature
910

10-
Script demonstrates NIScope waveform data getting continuously acquired.
11+
Script demonstrates NIScope waveform data getting continuously acquired.
1112
- Supports various data types
1213

1314
### Required Software
@@ -16,5 +17,7 @@ Script demonstrates NIScope waveform data getting continuously acquired.
1617

1718
### Usage
1819

19-
Run `poetry run examples/niscope/niscope_ex_fetch_forever.py`
20-
20+
```pwsh
21+
poetry install --with examples
22+
poetry run examples/niscope/niscope_ex_fetch_forever.py
23+
```

examples/performance_checker/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Performance checker Example
22

3-
This example measures the performance of a stremlit panel with a graph.
3+
This example measures the performance of a streamlit panel with a graph.
44

55
## Features
66

@@ -15,4 +15,7 @@ This example measures the performance of a stremlit panel with a graph.
1515

1616
### Usage
1717

18-
Run `poetry run python examples/performance_checker/performance_checker.py`
18+
```pwsh
19+
poetry install --with examples
20+
poetry run python examples/performance_checker/performance_checker.py
21+
```

examples/simple_graph/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Simple Graph Example
22

3-
This example demonstrates using nipanel with Streamlit to display a dynamic sine wave using the `streamlit-echarts` library.
3+
This example demonstrates using `nipanel` with Streamlit to display a dynamic sine wave using the `streamlit-echarts` library.
44

55
## Features
66

@@ -15,4 +15,7 @@ This example demonstrates using nipanel with Streamlit to display a dynamic sine
1515

1616
### Usage
1717

18-
Run `poetry run python examples/simple_graph/simple_graph.py`
18+
```pwsh
19+
poetry install --with examples
20+
poetry run python examples/simple_graph/simple_graph.py
21+
```

poetry.lock

Lines changed: 33 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protos/ni/pythonpanel/v1/python_panel_service.proto

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,18 @@ option ruby_package = "NI::PythonPanel::V1";
1818
service PythonPanelService {
1919
// Start a panel (or connect to if it has already been started)
2020
// Status Codes for errors:
21-
// - INVALID_ARGUMENT: The specified identifier contains invalid characters. Only alphanumeric characters and underscores are allowed.
22-
// - NOT_FOUND: the file for the panel was not found
21+
// - INVALID_ARGUMENT:
22+
// - The panel script filename doesn't end in .py.
23+
// - The panel identifier contains invalid characters. Only alphanumeric characters and underscores are allowed.
24+
// - NOT_FOUND:
25+
// - The panel script file was not found.
26+
// - The python executable file was not found.
2327
rpc StartPanel(StartPanelRequest) returns (StartPanelResponse);
2428

2529
// Stop a panel
2630
// Status Codes for errors:
27-
// - INVALID_ARGUMENT: The specified identifier contains invalid characters. Only alphanumeric characters and underscores are allowed.
31+
// - INVALID_ARGUMENT:
32+
// - The panel identifier contains invalid characters. Only alphanumeric characters and underscores are allowed.
2833
rpc StopPanel(StopPanelRequest) returns (StopPanelResponse);
2934

3035
// Enumerate the panels available in the system, including information about the state of the panels and what values they have.
@@ -33,12 +38,25 @@ service PythonPanelService {
3338

3439
// Get a value for a control on the panel
3540
// Status Codes for errors:
36-
// - INVALID_ARGUMENT: The specified identifier contains invalid characters. Only alphanumeric characters and underscores are allowed.
41+
// - INVALID_ARGUMENT:
42+
// - The panel identifier contains invalid characters. Only alphanumeric characters and underscores are allowed.
43+
// - The value identifier contains invalid characters. Only alphanumeric characters and underscores are allowed.
44+
// - NOT_FOUND:
45+
// - The value with the specified identifier was not found.
3746
rpc GetValue(GetValueRequest) returns (GetValueResponse);
3847

48+
// Try to get a value for a control on the panel
49+
// Status Codes for errors:
50+
// - INVALID_ARGUMENT:
51+
// - The panel identifier contains invalid characters. Only alphanumeric characters and underscores are allowed.
52+
// - The value identifier contains invalid characters. Only alphanumeric characters and underscores are allowed.
53+
rpc TryGetValue(TryGetValueRequest) returns (TryGetValueResponse);
54+
3955
// Set a value for a control on the panel
4056
// Status Codes for errors:
41-
// - INVALID_ARGUMENT: The specified identifier contains invalid characters. Only alphanumeric characters and underscores are allowed.
57+
// - INVALID_ARGUMENT:
58+
// - The panel identifier contains invalid characters. Only alphanumeric characters and underscores are allowed.
59+
// - The value identifier contains invalid characters. Only alphanumeric characters and underscores are allowed.
4260
rpc SetValue(SetValueRequest) returns (SetValueResponse);
4361
}
4462

@@ -98,6 +116,19 @@ message GetValueRequest {
98116

99117
message GetValueResponse {
100118
// The value
119+
google.protobuf.Any value = 1;
120+
}
121+
122+
message TryGetValueRequest {
123+
// Unique ID of the panel
124+
string panel_id = 1;
125+
126+
// Unique ID of value
127+
string value_id = 2;
128+
}
129+
130+
message TryGetValueResponse {
131+
// The value, if it was found
101132
optional google.protobuf.Any value = 1;
102133
}
103134

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ optional = true
6565
[tool.poetry.group.examples.dependencies]
6666
streamlit-echarts = ">=0.4.0"
6767
nidaqmx = { version = ">=0.8.0", allow-prereleases = true }
68+
niscope = "^1.4.9"
6869

6970
[build-system]
7071
requires = ["poetry-core>=1.8.0"]

src/ni/pythonpanel/v1/python_panel_service_pb2.py

Lines changed: 12 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)