Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
23 changes: 5 additions & 18 deletions protos/ni/pythonpanel/v1/python_panel_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,12 @@ option objc_class_prefix = "NIPP";
option php_namespace = "NI\\PythonPanel\\V1";
option ruby_package = "NI::PythonPanel::V1";

// Service interface for connecting to python panels
// Service interface for interacting with python panels
service PythonPanelService {
// Connect to a panel and open it
// Open a panel
// Status Codes for errors:
// - NOT_FOUND: the file for the panel was not found
rpc Connect(ConnectRequest) returns (ConnectResponse);

// Disconnect from a panel (does not close the panel)
// Status Codes for errors:
// - NOT_FOUND: the panel with the specified id was not found
rpc Disconnect(DisconnectRequest) returns (DisconnectResponse);
rpc OpenPanel(OpenPanelRequest) returns (OpenPanelResponse);

// Get a value for a control on the panel
// Status Codes for errors:
Expand All @@ -37,23 +32,15 @@ service PythonPanelService {
rpc SetValue(SetValueRequest) returns (SetValueResponse);
}

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

// Absolute path of the panel's file on disk, or network path to the file
string panel_uri = 2;
}

message ConnectResponse {
}

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

message DisconnectResponse {
message OpenPanelResponse {
}

message GetValueRequest {
Expand Down
34 changes: 15 additions & 19 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.

34 changes: 4 additions & 30 deletions src/ni/pythonpanel/v1/python_panel_service_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import typing
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor

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

PANEL_ID_FIELD_NUMBER: builtins.int
Expand All @@ -29,43 +29,17 @@ class ConnectRequest(google.protobuf.message.Message):
) -> None: ...
def ClearField(self, field_name: typing.Literal["panel_id", b"panel_id", "panel_uri", b"panel_uri"]) -> None: ...

global___ConnectRequest = ConnectRequest
global___OpenPanelRequest = OpenPanelRequest

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

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

global___ConnectResponse = ConnectResponse

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

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

global___DisconnectRequest = DisconnectRequest

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

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

global___DisconnectResponse = DisconnectResponse
global___OpenPanelResponse = OpenPanelResponse

@typing.final
class GetValueRequest(google.protobuf.message.Message):
Expand Down
70 changes: 17 additions & 53 deletions src/ni/pythonpanel/v1/python_panel_service_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


class PythonPanelServiceStub(object):
"""Service interface for connecting to python panels
"""Service interface for interacting with python panels
"""

def __init__(self, channel):
Expand All @@ -15,15 +15,10 @@ def __init__(self, channel):
Args:
channel: A grpc.Channel.
"""
self.Connect = channel.unary_unary(
'/ni.pythonpanel.v1.PythonPanelService/Connect',
request_serializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.ConnectRequest.SerializeToString,
response_deserializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.ConnectResponse.FromString,
)
self.Disconnect = channel.unary_unary(
'/ni.pythonpanel.v1.PythonPanelService/Disconnect',
request_serializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.DisconnectRequest.SerializeToString,
response_deserializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.DisconnectResponse.FromString,
self.OpenPanel = channel.unary_unary(
'/ni.pythonpanel.v1.PythonPanelService/OpenPanel',
request_serializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.OpenPanelRequest.SerializeToString,
response_deserializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.OpenPanelResponse.FromString,
)
self.GetValue = channel.unary_unary(
'/ni.pythonpanel.v1.PythonPanelService/GetValue',
Expand All @@ -38,27 +33,18 @@ def __init__(self, channel):


class PythonPanelServiceServicer(object):
"""Service interface for connecting to python panels
"""Service interface for interacting with python panels
"""

def Connect(self, request, context):
"""Connect to a panel and open it
def OpenPanel(self, request, context):
"""Open a panel
Status Codes for errors:
- NOT_FOUND: the file for the panel was not found
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def Disconnect(self, request, context):
"""Disconnect from a panel (does not close the panel)
Status Codes for errors:
- NOT_FOUND: the panel with the specified id was not found
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def GetValue(self, request, context):
"""Get a value for a control on the panel
Status Codes for errors:
Expand All @@ -80,15 +66,10 @@ def SetValue(self, request, context):

def add_PythonPanelServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'Connect': grpc.unary_unary_rpc_method_handler(
servicer.Connect,
request_deserializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.ConnectRequest.FromString,
response_serializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.ConnectResponse.SerializeToString,
),
'Disconnect': grpc.unary_unary_rpc_method_handler(
servicer.Disconnect,
request_deserializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.DisconnectRequest.FromString,
response_serializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.DisconnectResponse.SerializeToString,
'OpenPanel': grpc.unary_unary_rpc_method_handler(
servicer.OpenPanel,
request_deserializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.OpenPanelRequest.FromString,
response_serializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.OpenPanelResponse.SerializeToString,
),
'GetValue': grpc.unary_unary_rpc_method_handler(
servicer.GetValue,
Expand All @@ -108,28 +89,11 @@ def add_PythonPanelServiceServicer_to_server(servicer, server):

# This class is part of an EXPERIMENTAL API.
class PythonPanelService(object):
"""Service interface for connecting to python panels
"""Service interface for interacting with python panels
"""

@staticmethod
def Connect(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/Connect',
ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.ConnectRequest.SerializeToString,
ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.ConnectResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

@staticmethod
def Disconnect(request,
def OpenPanel(request,
target,
options=(),
channel_credentials=None,
Expand All @@ -139,9 +103,9 @@ def Disconnect(request,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/ni.pythonpanel.v1.PythonPanelService/Disconnect',
ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.DisconnectRequest.SerializeToString,
ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.DisconnectResponse.FromString,
return grpc.experimental.unary_unary(request, target, '/ni.pythonpanel.v1.PythonPanelService/OpenPanel',
ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.OpenPanelRequest.SerializeToString,
ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.OpenPanelResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

Expand Down
59 changes: 15 additions & 44 deletions src/ni/pythonpanel/v1/python_panel_service_pb2_grpc.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,18 @@ class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type:
...

class PythonPanelServiceStub:
"""Service interface for connecting to python panels"""
"""Service interface for interacting with python panels"""

def __init__(self, channel: typing.Union[grpc.Channel, grpc.aio.Channel]) -> None: ...
Connect: grpc.UnaryUnaryMultiCallable[
ni.pythonpanel.v1.python_panel_service_pb2.ConnectRequest,
ni.pythonpanel.v1.python_panel_service_pb2.ConnectResponse,
OpenPanel: grpc.UnaryUnaryMultiCallable[
ni.pythonpanel.v1.python_panel_service_pb2.OpenPanelRequest,
ni.pythonpanel.v1.python_panel_service_pb2.OpenPanelResponse,
]
"""Connect to a panel and open it
"""Open a panel
Status Codes for errors:
- NOT_FOUND: the file for the panel was not found
"""

Disconnect: grpc.UnaryUnaryMultiCallable[
ni.pythonpanel.v1.python_panel_service_pb2.DisconnectRequest,
ni.pythonpanel.v1.python_panel_service_pb2.DisconnectResponse,
]
"""Disconnect from a panel (does not close the panel)
Status Codes for errors:
- NOT_FOUND: the panel with the specified id was not found
"""

GetValue: grpc.UnaryUnaryMultiCallable[
ni.pythonpanel.v1.python_panel_service_pb2.GetValueRequest,
ni.pythonpanel.v1.python_panel_service_pb2.GetValueResponse,
Expand All @@ -58,26 +49,17 @@ class PythonPanelServiceStub:
"""

class PythonPanelServiceAsyncStub:
"""Service interface for connecting to python panels"""
"""Service interface for interacting with python panels"""

Connect: grpc.aio.UnaryUnaryMultiCallable[
ni.pythonpanel.v1.python_panel_service_pb2.ConnectRequest,
ni.pythonpanel.v1.python_panel_service_pb2.ConnectResponse,
OpenPanel: grpc.aio.UnaryUnaryMultiCallable[
ni.pythonpanel.v1.python_panel_service_pb2.OpenPanelRequest,
ni.pythonpanel.v1.python_panel_service_pb2.OpenPanelResponse,
]
"""Connect to a panel and open it
"""Open a panel
Status Codes for errors:
- NOT_FOUND: the file for the panel was not found
"""

Disconnect: grpc.aio.UnaryUnaryMultiCallable[
ni.pythonpanel.v1.python_panel_service_pb2.DisconnectRequest,
ni.pythonpanel.v1.python_panel_service_pb2.DisconnectResponse,
]
"""Disconnect from a panel (does not close the panel)
Status Codes for errors:
- NOT_FOUND: the panel with the specified id was not found
"""

GetValue: grpc.aio.UnaryUnaryMultiCallable[
ni.pythonpanel.v1.python_panel_service_pb2.GetValueRequest,
ni.pythonpanel.v1.python_panel_service_pb2.GetValueResponse,
Expand All @@ -97,30 +79,19 @@ class PythonPanelServiceAsyncStub:
"""

class PythonPanelServiceServicer(metaclass=abc.ABCMeta):
"""Service interface for connecting to python panels"""
"""Service interface for interacting with python panels"""

@abc.abstractmethod
def Connect(
def OpenPanel(
self,
request: ni.pythonpanel.v1.python_panel_service_pb2.ConnectRequest,
request: ni.pythonpanel.v1.python_panel_service_pb2.OpenPanelRequest,
context: _ServicerContext,
) -> typing.Union[ni.pythonpanel.v1.python_panel_service_pb2.ConnectResponse, collections.abc.Awaitable[ni.pythonpanel.v1.python_panel_service_pb2.ConnectResponse]]:
"""Connect to a panel and open it
) -> typing.Union[ni.pythonpanel.v1.python_panel_service_pb2.OpenPanelResponse, collections.abc.Awaitable[ni.pythonpanel.v1.python_panel_service_pb2.OpenPanelResponse]]:
"""Open a panel
Status Codes for errors:
- NOT_FOUND: the file for the panel was not found
"""

@abc.abstractmethod
def Disconnect(
self,
request: ni.pythonpanel.v1.python_panel_service_pb2.DisconnectRequest,
context: _ServicerContext,
) -> typing.Union[ni.pythonpanel.v1.python_panel_service_pb2.DisconnectResponse, collections.abc.Awaitable[ni.pythonpanel.v1.python_panel_service_pb2.DisconnectResponse]]:
"""Disconnect from a panel (does not close the panel)
Status Codes for errors:
- NOT_FOUND: the panel with the specified id was not found
"""

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