Skip to content

Commit 18f6bda

Browse files
Mike ProsserMike Prosser
authored andcommitted
expand enumerate_panels, add enter and exit, and add clear_value
1 parent dbcc6e0 commit 18f6bda

File tree

11 files changed

+463
-55
lines changed

11 files changed

+463
-55
lines changed

protos/ni/pythonpanel/v1/python_panel_service.proto

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ option ruby_package = "NI::PythonPanel::V1";
1616

1717
// Service interface for interacting with python panels
1818
service PythonPanelService {
19-
// Enumerate the panels available in the system
19+
// Enumerate the panels available in the system, including information about the state of the panels and what values they have.
2020
// Status Codes for errors:
2121
rpc EnumeratePanels(EnumeratePanelsRequest) returns (EnumeratePanelsResponse);
2222

@@ -37,6 +37,10 @@ service PythonPanelService {
3737
// - INVALID_ARGUMENT: The specified identifier contains invalid characters. Only alphanumeric characters and underscores are allowed.
3838
rpc SetValue(SetValueRequest) returns (SetValueResponse);
3939

40+
// Clear a value for a control on the panel
41+
// - INVALID_ARGUMENT: The specified identifier contains invalid characters. Only alphanumeric characters and underscores are allowed.
42+
rpc ClearValue(ClearValueRequest) returns (ClearValueResponse);
43+
4044
// Close a panel
4145
// Status Codes for errors:
4246
// - INVALID_ARGUMENT: The specified identifier contains invalid characters. Only alphanumeric characters and underscores are allowed.
@@ -46,9 +50,21 @@ service PythonPanelService {
4650
message EnumeratePanelsRequest {
4751
}
4852

53+
message PanelInformation
54+
{
55+
// Unique ID of the panel
56+
string panel_id = 1;
57+
58+
// Is the panel currently open?
59+
bool is_open = 2;
60+
61+
// IDs of all of the values associated with the panel
62+
repeated string value_ids = 3;
63+
}
64+
4965
message EnumeratePanelsResponse {
5066
// The list of panels available in the system
51-
repeated string panel_ids = 1;
67+
repeated PanelInformation panels = 1;
5268
}
5369

5470
message OpenPanelRequest {
@@ -89,6 +105,17 @@ message SetValueRequest {
89105
message SetValueResponse {
90106
}
91107

108+
message ClearValueRequest {
109+
// Unique ID of the panel
110+
string panel_id = 1;
111+
112+
// Unique ID of the value
113+
string value_id = 2;
114+
}
115+
116+
message ClearValueResponse {
117+
}
118+
92119
message ClosePanelRequest {
93120
// Unique ID of the panel
94121
string panel_id = 1;

src/ni/pythonpanel/v1/python_panel_service_pb2.py

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

src/ni/pythonpanel/v1/python_panel_service_pb2.pyi

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,47 @@ class EnumeratePanelsRequest(google.protobuf.message.Message):
2323

2424
global___EnumeratePanelsRequest = EnumeratePanelsRequest
2525

26+
@typing.final
27+
class PanelInformation(google.protobuf.message.Message):
28+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
29+
30+
PANEL_ID_FIELD_NUMBER: builtins.int
31+
IS_OPEN_FIELD_NUMBER: builtins.int
32+
VALUE_IDS_FIELD_NUMBER: builtins.int
33+
panel_id: builtins.str
34+
"""Unique ID of the panel"""
35+
is_open: builtins.bool
36+
"""Is the panel currently open?"""
37+
@property
38+
def value_ids(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
39+
"""IDs of all of the values associated with the panel"""
40+
41+
def __init__(
42+
self,
43+
*,
44+
panel_id: builtins.str = ...,
45+
is_open: builtins.bool = ...,
46+
value_ids: collections.abc.Iterable[builtins.str] | None = ...,
47+
) -> None: ...
48+
def ClearField(self, field_name: typing.Literal["is_open", b"is_open", "panel_id", b"panel_id", "value_ids", b"value_ids"]) -> None: ...
49+
50+
global___PanelInformation = PanelInformation
51+
2652
@typing.final
2753
class EnumeratePanelsResponse(google.protobuf.message.Message):
2854
DESCRIPTOR: google.protobuf.descriptor.Descriptor
2955

30-
PANEL_IDS_FIELD_NUMBER: builtins.int
56+
PANELS_FIELD_NUMBER: builtins.int
3157
@property
32-
def panel_ids(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
58+
def panels(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___PanelInformation]:
3359
"""The list of panels available in the system"""
3460

3561
def __init__(
3662
self,
3763
*,
38-
panel_ids: collections.abc.Iterable[builtins.str] | None = ...,
64+
panels: collections.abc.Iterable[global___PanelInformation] | None = ...,
3965
) -> None: ...
40-
def ClearField(self, field_name: typing.Literal["panel_ids", b"panel_ids"]) -> None: ...
66+
def ClearField(self, field_name: typing.Literal["panels", b"panels"]) -> None: ...
4167

4268
global___EnumeratePanelsResponse = EnumeratePanelsResponse
4369

@@ -147,6 +173,36 @@ class SetValueResponse(google.protobuf.message.Message):
147173

148174
global___SetValueResponse = SetValueResponse
149175

176+
@typing.final
177+
class ClearValueRequest(google.protobuf.message.Message):
178+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
179+
180+
PANEL_ID_FIELD_NUMBER: builtins.int
181+
VALUE_ID_FIELD_NUMBER: builtins.int
182+
panel_id: builtins.str
183+
"""Unique ID of the panel"""
184+
value_id: builtins.str
185+
"""Unique ID of the value"""
186+
def __init__(
187+
self,
188+
*,
189+
panel_id: builtins.str = ...,
190+
value_id: builtins.str = ...,
191+
) -> None: ...
192+
def ClearField(self, field_name: typing.Literal["panel_id", b"panel_id", "value_id", b"value_id"]) -> None: ...
193+
194+
global___ClearValueRequest = ClearValueRequest
195+
196+
@typing.final
197+
class ClearValueResponse(google.protobuf.message.Message):
198+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
199+
200+
def __init__(
201+
self,
202+
) -> None: ...
203+
204+
global___ClearValueResponse = ClearValueResponse
205+
150206
@typing.final
151207
class ClosePanelRequest(google.protobuf.message.Message):
152208
DESCRIPTOR: google.protobuf.descriptor.Descriptor

src/ni/pythonpanel/v1/python_panel_service_pb2_grpc.py

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ def __init__(self, channel):
3535
request_serializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.SetValueRequest.SerializeToString,
3636
response_deserializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.SetValueResponse.FromString,
3737
)
38+
self.ClearValue = channel.unary_unary(
39+
'/ni.pythonpanel.v1.PythonPanelService/ClearValue',
40+
request_serializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.ClearValueRequest.SerializeToString,
41+
response_deserializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.ClearValueResponse.FromString,
42+
)
3843
self.ClosePanel = channel.unary_unary(
3944
'/ni.pythonpanel.v1.PythonPanelService/ClosePanel',
4045
request_serializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.ClosePanelRequest.SerializeToString,
@@ -47,7 +52,7 @@ class PythonPanelServiceServicer(object):
4752
"""
4853

4954
def EnumeratePanels(self, request, context):
50-
"""Enumerate the panels available in the system
55+
"""Enumerate the panels available in the system, including information about the state of the panels and what values they have.
5156
Status Codes for errors:
5257
"""
5358
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
@@ -83,6 +88,14 @@ def SetValue(self, request, context):
8388
context.set_details('Method not implemented!')
8489
raise NotImplementedError('Method not implemented!')
8590

91+
def ClearValue(self, request, context):
92+
"""Clear a value for a control on the panel
93+
- INVALID_ARGUMENT: The specified identifier contains invalid characters. Only alphanumeric characters and underscores are allowed.
94+
"""
95+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
96+
context.set_details('Method not implemented!')
97+
raise NotImplementedError('Method not implemented!')
98+
8699
def ClosePanel(self, request, context):
87100
"""Close a panel
88101
Status Codes for errors:
@@ -115,6 +128,11 @@ def add_PythonPanelServiceServicer_to_server(servicer, server):
115128
request_deserializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.SetValueRequest.FromString,
116129
response_serializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.SetValueResponse.SerializeToString,
117130
),
131+
'ClearValue': grpc.unary_unary_rpc_method_handler(
132+
servicer.ClearValue,
133+
request_deserializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.ClearValueRequest.FromString,
134+
response_serializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.ClearValueResponse.SerializeToString,
135+
),
118136
'ClosePanel': grpc.unary_unary_rpc_method_handler(
119137
servicer.ClosePanel,
120138
request_deserializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.ClosePanelRequest.FromString,
@@ -199,6 +217,23 @@ def SetValue(request,
199217
options, channel_credentials,
200218
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
201219

220+
@staticmethod
221+
def ClearValue(request,
222+
target,
223+
options=(),
224+
channel_credentials=None,
225+
call_credentials=None,
226+
insecure=False,
227+
compression=None,
228+
wait_for_ready=None,
229+
timeout=None,
230+
metadata=None):
231+
return grpc.experimental.unary_unary(request, target, '/ni.pythonpanel.v1.PythonPanelService/ClearValue',
232+
ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.ClearValueRequest.SerializeToString,
233+
ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.ClearValueResponse.FromString,
234+
options, channel_credentials,
235+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
236+
202237
@staticmethod
203238
def ClosePanel(request,
204239
target,

src/ni/pythonpanel/v1/python_panel_service_pb2_grpc.pyi

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class PythonPanelServiceStub:
2525
ni.pythonpanel.v1.python_panel_service_pb2.EnumeratePanelsRequest,
2626
ni.pythonpanel.v1.python_panel_service_pb2.EnumeratePanelsResponse,
2727
]
28-
"""Enumerate the panels available in the system
28+
"""Enumerate the panels available in the system, including information about the state of the panels and what values they have.
2929
Status Codes for errors:
3030
"""
3131

@@ -58,6 +58,14 @@ class PythonPanelServiceStub:
5858
- INVALID_ARGUMENT: The specified identifier contains invalid characters. Only alphanumeric characters and underscores are allowed.
5959
"""
6060

61+
ClearValue: grpc.UnaryUnaryMultiCallable[
62+
ni.pythonpanel.v1.python_panel_service_pb2.ClearValueRequest,
63+
ni.pythonpanel.v1.python_panel_service_pb2.ClearValueResponse,
64+
]
65+
"""Clear a value for a control on the panel
66+
- INVALID_ARGUMENT: The specified identifier contains invalid characters. Only alphanumeric characters and underscores are allowed.
67+
"""
68+
6169
ClosePanel: grpc.UnaryUnaryMultiCallable[
6270
ni.pythonpanel.v1.python_panel_service_pb2.ClosePanelRequest,
6371
ni.pythonpanel.v1.python_panel_service_pb2.ClosePanelResponse,
@@ -74,7 +82,7 @@ class PythonPanelServiceAsyncStub:
7482
ni.pythonpanel.v1.python_panel_service_pb2.EnumeratePanelsRequest,
7583
ni.pythonpanel.v1.python_panel_service_pb2.EnumeratePanelsResponse,
7684
]
77-
"""Enumerate the panels available in the system
85+
"""Enumerate the panels available in the system, including information about the state of the panels and what values they have.
7886
Status Codes for errors:
7987
"""
8088

@@ -107,6 +115,14 @@ class PythonPanelServiceAsyncStub:
107115
- INVALID_ARGUMENT: The specified identifier contains invalid characters. Only alphanumeric characters and underscores are allowed.
108116
"""
109117

118+
ClearValue: grpc.aio.UnaryUnaryMultiCallable[
119+
ni.pythonpanel.v1.python_panel_service_pb2.ClearValueRequest,
120+
ni.pythonpanel.v1.python_panel_service_pb2.ClearValueResponse,
121+
]
122+
"""Clear a value for a control on the panel
123+
- INVALID_ARGUMENT: The specified identifier contains invalid characters. Only alphanumeric characters and underscores are allowed.
124+
"""
125+
110126
ClosePanel: grpc.aio.UnaryUnaryMultiCallable[
111127
ni.pythonpanel.v1.python_panel_service_pb2.ClosePanelRequest,
112128
ni.pythonpanel.v1.python_panel_service_pb2.ClosePanelResponse,
@@ -125,7 +141,7 @@ class PythonPanelServiceServicer(metaclass=abc.ABCMeta):
125141
request: ni.pythonpanel.v1.python_panel_service_pb2.EnumeratePanelsRequest,
126142
context: _ServicerContext,
127143
) -> typing.Union[ni.pythonpanel.v1.python_panel_service_pb2.EnumeratePanelsResponse, collections.abc.Awaitable[ni.pythonpanel.v1.python_panel_service_pb2.EnumeratePanelsResponse]]:
128-
"""Enumerate the panels available in the system
144+
"""Enumerate the panels available in the system, including information about the state of the panels and what values they have.
129145
Status Codes for errors:
130146
"""
131147

@@ -164,6 +180,16 @@ class PythonPanelServiceServicer(metaclass=abc.ABCMeta):
164180
- INVALID_ARGUMENT: The specified identifier contains invalid characters. Only alphanumeric characters and underscores are allowed.
165181
"""
166182

183+
@abc.abstractmethod
184+
def ClearValue(
185+
self,
186+
request: ni.pythonpanel.v1.python_panel_service_pb2.ClearValueRequest,
187+
context: _ServicerContext,
188+
) -> typing.Union[ni.pythonpanel.v1.python_panel_service_pb2.ClearValueResponse, collections.abc.Awaitable[ni.pythonpanel.v1.python_panel_service_pb2.ClearValueResponse]]:
189+
"""Clear a value for a control on the panel
190+
- INVALID_ARGUMENT: The specified identifier contains invalid characters. Only alphanumeric characters and underscores are allowed.
191+
"""
192+
167193
@abc.abstractmethod
168194
def ClosePanel(
169195
self,

0 commit comments

Comments
 (0)