66from ni_measurement_plugin_sdk_service .discovery import DiscoveryClient
77from ni_measurement_plugin_sdk_service .grpc .channelpool import GrpcChannelPool
88
9- from nipanel ._panel_client import PanelClient
9+ from nipanel ._panel_accessor import PanelAccessor
1010
1111
12- class Panel (ABC ):
12+ class Panel (PanelAccessor , ABC ):
1313 """This class allows you to open a panel and specify values for its controls."""
1414
15- _panel_client : PanelClient
16- _panel_id : str
1715 _panel_uri : str
1816
19- __slots__ = [ "_panel_client" , "_panel_id" , "_panel_uri" , "__weakref__" ]
17+ __slots__ = PanelAccessor . __slots__ + [ "_panel_uri" , "__weakref__" ]
2018
2119 def __init__ (
2220 self ,
@@ -29,22 +27,17 @@ def __init__(
2927 grpc_channel_pool : GrpcChannelPool | None = None ,
3028 grpc_channel : grpc .Channel | None = None ,
3129 ) -> None :
32- """Initialize the panel."""
33- self ._panel_client = PanelClient (
30+ """Initialize the Panel class."""
31+ super ().__init__ (
32+ panel_id = panel_id ,
3433 provided_interface = provided_interface ,
3534 service_class = service_class ,
3635 discovery_client = discovery_client ,
3736 grpc_channel_pool = grpc_channel_pool ,
3837 grpc_channel = grpc_channel ,
3938 )
40- self ._panel_id = panel_id
4139 self ._panel_uri = panel_uri
4240
43- @property
44- def panel_id (self ) -> str :
45- """Read-only accessor for the panel ID."""
46- return self ._panel_id
47-
4841 @property
4942 def panel_uri (self ) -> str :
5043 """Read-only accessor for the panel URI."""
@@ -53,23 +46,3 @@ def panel_uri(self) -> str:
5346 def open_panel (self ) -> None :
5447 """Open the panel."""
5548 self ._panel_client .open_panel (self ._panel_id , self ._panel_uri )
56-
57- def get_value (self , value_id : str ) -> object :
58- """Get the value for a control on the panel.
59-
60- Args:
61- value_id: The id of the value
62-
63- Returns:
64- The value
65- """
66- return self ._panel_client .get_value (self ._panel_id , value_id )
67-
68- def set_value (self , value_id : str , value : object ) -> None :
69- """Set the value for a control on the panel.
70-
71- Args:
72- value_id: The id of the value
73- value: The value
74- """
75- self ._panel_client .set_value (self ._panel_id , value_id , value )
0 commit comments