Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions protos/ni/pythonpanel/v1/python_panel_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ option ruby_package = "NI::PythonPanel::V1";

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

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

// Clear a value for a control on the panel
// - INVALID_ARGUMENT: The specified identifier contains invalid characters. Only alphanumeric characters and underscores are allowed.
rpc ClearValue(ClearValueRequest) returns (ClearValueResponse);

// Close a panel
// Status Codes for errors:
// - INVALID_ARGUMENT: The specified identifier contains invalid characters. Only alphanumeric characters and underscores are allowed.
Expand All @@ -46,9 +50,21 @@ service PythonPanelService {
message EnumeratePanelsRequest {
}

message PanelInformation
{
// Unique ID of the panel
string panel_id = 1;

// Is the panel currently open?
bool is_open = 2;

// IDs of all of the values associated with the panel
repeated string value_ids = 3;
}

message EnumeratePanelsResponse {
// The list of panels available in the system
repeated string panel_ids = 1;
repeated PanelInformation panels = 1;
}

message OpenPanelRequest {
Expand Down Expand Up @@ -89,6 +105,17 @@ message SetValueRequest {
message SetValueResponse {
}

message ClearValueRequest {
// Unique ID of the panel
string panel_id = 1;

// Unique ID of the value
string value_id = 2;
}

message ClearValueResponse {
}

message ClosePanelRequest {
// Unique ID of the panel
string panel_id = 1;
Expand Down
48 changes: 27 additions & 21 deletions src/ni/pythonpanel/v1/python_panel_service_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 60 additions & 4 deletions src/ni/pythonpanel/v1/python_panel_service_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,47 @@ class EnumeratePanelsRequest(google.protobuf.message.Message):

global___EnumeratePanelsRequest = EnumeratePanelsRequest

@typing.final
class PanelInformation(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor

PANEL_ID_FIELD_NUMBER: builtins.int
IS_OPEN_FIELD_NUMBER: builtins.int
VALUE_IDS_FIELD_NUMBER: builtins.int
panel_id: builtins.str
"""Unique ID of the panel"""
is_open: builtins.bool
"""Is the panel currently open?"""
@property
def value_ids(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
"""IDs of all of the values associated with the panel"""

def __init__(
self,
*,
panel_id: builtins.str = ...,
is_open: builtins.bool = ...,
value_ids: collections.abc.Iterable[builtins.str] | None = ...,
) -> None: ...
def ClearField(self, field_name: typing.Literal["is_open", b"is_open", "panel_id", b"panel_id", "value_ids", b"value_ids"]) -> None: ...

global___PanelInformation = PanelInformation

@typing.final
class EnumeratePanelsResponse(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor

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

def __init__(
self,
*,
panel_ids: collections.abc.Iterable[builtins.str] | None = ...,
panels: collections.abc.Iterable[global___PanelInformation] | None = ...,
) -> None: ...
def ClearField(self, field_name: typing.Literal["panel_ids", b"panel_ids"]) -> None: ...
def ClearField(self, field_name: typing.Literal["panels", b"panels"]) -> None: ...

global___EnumeratePanelsResponse = EnumeratePanelsResponse

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

global___SetValueResponse = SetValueResponse

@typing.final
class ClearValueRequest(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor

PANEL_ID_FIELD_NUMBER: builtins.int
VALUE_ID_FIELD_NUMBER: builtins.int
panel_id: builtins.str
"""Unique ID of the panel"""
value_id: builtins.str
"""Unique ID of the value"""
def __init__(
self,
*,
panel_id: builtins.str = ...,
value_id: builtins.str = ...,
) -> None: ...
def ClearField(self, field_name: typing.Literal["panel_id", b"panel_id", "value_id", b"value_id"]) -> None: ...

global___ClearValueRequest = ClearValueRequest

@typing.final
class ClearValueResponse(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor

def __init__(
self,
) -> None: ...

global___ClearValueResponse = ClearValueResponse

@typing.final
class ClosePanelRequest(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
Expand Down
37 changes: 36 additions & 1 deletion src/ni/pythonpanel/v1/python_panel_service_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ def __init__(self, channel):
request_serializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.SetValueRequest.SerializeToString,
response_deserializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.SetValueResponse.FromString,
)
self.ClearValue = channel.unary_unary(
'/ni.pythonpanel.v1.PythonPanelService/ClearValue',
request_serializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.ClearValueRequest.SerializeToString,
response_deserializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.ClearValueResponse.FromString,
)
self.ClosePanel = channel.unary_unary(
'/ni.pythonpanel.v1.PythonPanelService/ClosePanel',
request_serializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.ClosePanelRequest.SerializeToString,
Expand All @@ -47,7 +52,7 @@ class PythonPanelServiceServicer(object):
"""

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

def ClearValue(self, request, context):
"""Clear a value for a control on the panel
- INVALID_ARGUMENT: The specified identifier contains invalid characters. Only alphanumeric characters and underscores are allowed.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def ClosePanel(self, request, context):
"""Close a panel
Status Codes for errors:
Expand Down Expand Up @@ -115,6 +128,11 @@ def add_PythonPanelServiceServicer_to_server(servicer, server):
request_deserializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.SetValueRequest.FromString,
response_serializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.SetValueResponse.SerializeToString,
),
'ClearValue': grpc.unary_unary_rpc_method_handler(
servicer.ClearValue,
request_deserializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.ClearValueRequest.FromString,
response_serializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.ClearValueResponse.SerializeToString,
),
'ClosePanel': grpc.unary_unary_rpc_method_handler(
servicer.ClosePanel,
request_deserializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.ClosePanelRequest.FromString,
Expand Down Expand Up @@ -199,6 +217,23 @@ def SetValue(request,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

@staticmethod
def ClearValue(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/ni.pythonpanel.v1.PythonPanelService/ClearValue',
ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.ClearValueRequest.SerializeToString,
ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.ClearValueResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

@staticmethod
def ClosePanel(request,
target,
Expand Down
32 changes: 29 additions & 3 deletions src/ni/pythonpanel/v1/python_panel_service_pb2_grpc.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class PythonPanelServiceStub:
ni.pythonpanel.v1.python_panel_service_pb2.EnumeratePanelsRequest,
ni.pythonpanel.v1.python_panel_service_pb2.EnumeratePanelsResponse,
]
"""Enumerate the panels available in the system
"""Enumerate the panels available in the system, including information about the state of the panels and what values they have.
Status Codes for errors:
"""

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

ClearValue: grpc.UnaryUnaryMultiCallable[
ni.pythonpanel.v1.python_panel_service_pb2.ClearValueRequest,
ni.pythonpanel.v1.python_panel_service_pb2.ClearValueResponse,
]
"""Clear a value for a control on the panel
- INVALID_ARGUMENT: The specified identifier contains invalid characters. Only alphanumeric characters and underscores are allowed.
"""

ClosePanel: grpc.UnaryUnaryMultiCallable[
ni.pythonpanel.v1.python_panel_service_pb2.ClosePanelRequest,
ni.pythonpanel.v1.python_panel_service_pb2.ClosePanelResponse,
Expand All @@ -74,7 +82,7 @@ class PythonPanelServiceAsyncStub:
ni.pythonpanel.v1.python_panel_service_pb2.EnumeratePanelsRequest,
ni.pythonpanel.v1.python_panel_service_pb2.EnumeratePanelsResponse,
]
"""Enumerate the panels available in the system
"""Enumerate the panels available in the system, including information about the state of the panels and what values they have.
Status Codes for errors:
"""

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

ClearValue: grpc.aio.UnaryUnaryMultiCallable[
ni.pythonpanel.v1.python_panel_service_pb2.ClearValueRequest,
ni.pythonpanel.v1.python_panel_service_pb2.ClearValueResponse,
]
"""Clear a value for a control on the panel
- INVALID_ARGUMENT: The specified identifier contains invalid characters. Only alphanumeric characters and underscores are allowed.
"""

ClosePanel: grpc.aio.UnaryUnaryMultiCallable[
ni.pythonpanel.v1.python_panel_service_pb2.ClosePanelRequest,
ni.pythonpanel.v1.python_panel_service_pb2.ClosePanelResponse,
Expand All @@ -125,7 +141,7 @@ class PythonPanelServiceServicer(metaclass=abc.ABCMeta):
request: ni.pythonpanel.v1.python_panel_service_pb2.EnumeratePanelsRequest,
context: _ServicerContext,
) -> typing.Union[ni.pythonpanel.v1.python_panel_service_pb2.EnumeratePanelsResponse, collections.abc.Awaitable[ni.pythonpanel.v1.python_panel_service_pb2.EnumeratePanelsResponse]]:
"""Enumerate the panels available in the system
"""Enumerate the panels available in the system, including information about the state of the panels and what values they have.
Status Codes for errors:
"""

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

@abc.abstractmethod
def ClearValue(
self,
request: ni.pythonpanel.v1.python_panel_service_pb2.ClearValueRequest,
context: _ServicerContext,
) -> typing.Union[ni.pythonpanel.v1.python_panel_service_pb2.ClearValueResponse, collections.abc.Awaitable[ni.pythonpanel.v1.python_panel_service_pb2.ClearValueResponse]]:
"""Clear a value for a control on the panel
- INVALID_ARGUMENT: The specified identifier contains invalid characters. Only alphanumeric characters and underscores are allowed.
"""

@abc.abstractmethod
def ClosePanel(
self,
Expand Down
Loading