feat: add simplified syntax to camera control scripts
- Update camera_control.py to support 'property value' syntax * camera_control.py gain → gets current gain value * camera_control.py gain 33 → sets gain to 33 * Add --host, --port, and --timeout parameters * Remove argcomplete dependency to simplify requirements * Maintain backward compatibility with existing commands - Update launch-ids.py to support simplified property setting at startup * launch-ids.py exposure 16 → launches with 16ms exposure * launch-ids.py framerate 30 → launches with 30fps framerate * launch-ids.py gain 50 → launches with gain set to 50 * Preserve traditional flag syntax for full backward compatibility Both scripts now provide intuitive property-based syntax while maintaining all existing functionality and command-line options.
This commit is contained in:
parent
02dc12a5c4
commit
969d716283
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# /// script
|
# /// script
|
||||||
# requires-python = ">=3.8"
|
# requires-python = ">=3.8"
|
||||||
# dependencies = ["argcomplete"]
|
# dependencies = []
|
||||||
# ///
|
# ///
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@ -34,10 +34,6 @@ import socket
|
|||||||
import time
|
import time
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
try:
|
|
||||||
import argcomplete
|
|
||||||
except ImportError:
|
|
||||||
argcomplete = None
|
|
||||||
|
|
||||||
def send_command(command, host="127.0.0.1", port=5001, timeout=1.0):
|
def send_command(command, host="127.0.0.1", port=5001, timeout=1.0):
|
||||||
"""Send a command and return the response"""
|
"""Send a command and return the response"""
|
||||||
@ -154,9 +150,6 @@ Examples:
|
|||||||
metavar='SECONDS',
|
metavar='SECONDS',
|
||||||
help='Timeout for UDP requests in seconds (default: 1.0)')
|
help='Timeout for UDP requests in seconds (default: 1.0)')
|
||||||
|
|
||||||
# Enable tab completion if argcomplete is available
|
|
||||||
if argcomplete:
|
|
||||||
argcomplete.autocomplete(parser)
|
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user