From f23bf24ecd96ef7fd3431227f44929c427c0059a Mon Sep 17 00:00:00 2001 From: "Felt, Nicholas" Date: Thu, 31 Oct 2024 16:00:58 -0700 Subject: [PATCH] docs: Update the example code to show all the input arguments --- examples/scopes/tekscope/save_screenshot.py | 19 +++++++++++++------ .../drivers/scopes/tekscope/tekscope.py | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/examples/scopes/tekscope/save_screenshot.py b/examples/scopes/tekscope/save_screenshot.py index 66f27551..7146ff3e 100644 --- a/examples/scopes/tekscope/save_screenshot.py +++ b/examples/scopes/tekscope/save_screenshot.py @@ -5,24 +5,31 @@ with DeviceManager(verbose=True) as dm: # Add a scope - scope: MSO6B = dm.add_scope("192.168.0.1") + scope: MSO6B = dm.add_scope("192.168.1.5") # Send some commands scope.add_new_math("MATH1", "CH1") # add MATH1 to CH1 scope.turn_channel_on("CH2") # turn on channel 2 scope.set_and_check(":HORIZONTAL:SCALE", 100e-9) # adjust horizontal scale - # Save a screenshot as a timestamped file, will create a screenshot on the device, + # Save a screenshot as a timestamped file. This will create a screenshot on the device, # copy it to the current working directory on the local machine, # and then delete the screenshot file from the device. scope.save_screenshot() - # Save a screenshot as example.png, will create a screenshot on the device, + # Save a screenshot as "example.png". This will create a screenshot on the device, # copy it to the current working directory on the local machine, # and then delete the screenshot file from the device. scope.save_screenshot("example.png") - # Save a screenshot as example.jpg, will create a screenshot on the device, - # copy it to ./images/example.jpg on the local machine, + # Save a screenshot as "example.jpg". This will create a screenshot on the device + # using INVERTED colors in the "./device_folder" folder, + # copy it to "./images/example.jpg" on the local machine, # but this time the screenshot file on the device will not be deleted. - scope.save_screenshot("example.jpg", local_folder="./images", keep_device_file=True) + scope.save_screenshot( + "example.jpg", + colors="INVERTED", + local_folder="./images", + device_folder="./device_folder", + keep_device_file=True, + ) diff --git a/src/tm_devices/drivers/scopes/tekscope/tekscope.py b/src/tm_devices/drivers/scopes/tekscope/tekscope.py index 24f6cb33..b3aeddaf 100644 --- a/src/tm_devices/drivers/scopes/tekscope/tekscope.py +++ b/src/tm_devices/drivers/scopes/tekscope/tekscope.py @@ -734,7 +734,7 @@ def _save_screenshot( (local_folder / filename).write_bytes(data) if not keep_device_file: self.write(f"FILESYSTEM:DELETE {device_filepath_string}", opc=True) - time.sleep(0.5) # wait to ensure the file is deleted + time.sleep(0.2) # wait to ensure the file is deleted def _reboot(self) -> None: """Reboot the device."""