Skip to content
Open
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
10 changes: 5 additions & 5 deletions examples/check_chassis_battery.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,24 @@ def main(chassis_name: str) -> None:
reservation_timeout = 10.0

with Session.initialize_session_with_physical_channels(
None,
physical_channel_names=physical_channel_names,
connection_timeout=connection_timeout,
reservation_access=reservation_access,
reservation_group=reservation_group,
library=None,
connection_timeout=connection_timeout,
reservation_timeout=reservation_timeout,
) as session:
sensor_lower_critical = session.get_physical_channel_property_double(
physical_channel_names=physical_channel_names,
property_name="SensorLowerCritical",
physical_channel_names=physical_channel_names,
)
sensor_reading = session.get_physical_channel_property_double(
physical_channel_names=physical_channel_names,
property_name="SensorReading",
physical_channel_names=physical_channel_names,
)
health_state = session.get_physical_channel_property_string(
physical_channel_names=physical_channel_names,
property_name="HealthState",
physical_channel_names=physical_channel_names,
)
needs_replacement = sensor_reading < sensor_lower_critical

Expand Down
4 changes: 2 additions & 2 deletions examples/reset_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ def main(device_names: str) -> None:
reservation_timeout = 10.0

with Session.initialize_session_with_devices(
None,
device_names=device_names,
connection_timeout=connection_timeout,
reservation_access=reservation_access,
reservation_group=reservation_group,
library=None,
connection_timeout=connection_timeout,
reservation_timeout=reservation_timeout,
) as session:
session.reset_devices(device_names)
Expand Down
16 changes: 8 additions & 8 deletions examples/show_command_and_property_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ def get_command_and_property_tree(device_name: str) -> dict:
reservation_timeout = 10.0

with Session.initialize_session_with_devices(
None,
device_name,
connection_timeout,
reservation_access,
reservation_group,
reservation_timeout,
library=None,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for library. We now default this too.

connection_timeout=connection_timeout,
reservation_timeout=reservation_timeout,
) as session:

data = {
Expand All @@ -70,18 +70,18 @@ def get_command_and_property_tree(device_name: str) -> dict:
}

device_commands = session.get_device_property_string_array(
device_name,
DeviceProperty.COMMANDS,
device_name,
)

device_properties = session.get_device_property_string_array(
device_name,
DeviceProperty.PROPERTIES,
device_name,
)

device_physical_channels = session.get_device_property_string_array(
device_name,
DeviceProperty.PHYSICAL_CHANNELS,
device_name,
)

for physical_channel in device_physical_channels:
Expand Down Expand Up @@ -138,10 +138,10 @@ def get_command_and_property_tree(device_name: str) -> dict:
for physical_channel in device_physical_channels:

physical_channel_commands = session.get_physical_channel_property_string_array(
physical_channel, PhysicalChannelProperty.COMMANDS
PhysicalChannelProperty.COMMANDS, physical_channel
)
physical_channel_properties = session.get_physical_channel_property_string_array(
physical_channel, PhysicalChannelProperty.PROPERTIES
PhysicalChannelProperty.PROPERTIES, physical_channel

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bkeryan With $DefaultPhysChans and $DefaultDevices set, we have to put the physical_channel and device_name to the back. Feels a bit weird (I am still fine with it).
Alternative is having positional arguments default to None or "", then we error out if not set. But that will probably mess the docstring and IntelliSense. Thoughts?

)

for physical_channel_command in physical_channel_commands:
Expand Down
182 changes: 91 additions & 91 deletions generated/nislsc/session.py

Large diffs are not rendered by default.

Loading