Skip to content

add 'dominh set' and 'dominh info' to CLI#25

Draft
pdragy wants to merge 4 commits intogavanderhoorn:masterfrom
WILDER-SYSTEMS-LLC:master
Draft

add 'dominh set' and 'dominh info' to CLI#25
pdragy wants to merge 4 commits intogavanderhoorn:masterfrom
WILDER-SYSTEMS-LLC:master

Conversation

@pdragy
Copy link

@pdragy pdragy commented Jun 4, 2025

This extends the dominh CLI with 'set' and 'info' commands. 'set' may require controller to be in controlled start for some variables.

Usage: dominh [--no-upload] set [options] <host> <variable> <value>
Usage: dominh [--no-upload] info [options] [--short] <host>

Examples

dominh info 10.0.0.200
dominh info --short 10.0.0.200
dominh set 10.0.0.200 $SCR.$MAXNUMTASKS 6 

Other Notes:

  • You may need to escape/quote the variable names properly depending on your os shell environment.
  • 'set' was just a slight modification to 'get', not sure if this is actually a sane way to implement this. It worked for all variables we needed and tested, using controller firmware version v9.30 and v9.40.
  • 'info' is mostly copy-pasted from examples/print_controller_info.py. I added an optional --short flag. I also changed some of the terminal output to be fixed-width and padded, for better behaviour when chaining with other CLI commands like watch.
  • There is an outstanding issue, using info during controlled start produces an exception. This should probably be fixed, or at least the exception should be handled and produce more useful output for the user if it is the expected behavior. I believe it is an issue which existed before this commit, maybe even in the karel code. I think that running examples/print_controller_info.py in controlled start will also produce the same exception, though I am unable to test this now as I don't have access to a FANUC.


numregs = ', '.join([str(c.numreg(i + 1).val) for i in range(5)])

if (not args['--short']):
Copy link
Author

@pdragy pdragy Jun 4, 2025

Choose a reason for hiding this comment

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

nit: can we combine this and make 1 block for the '--short' flag?

Copy link
Author

Choose a reason for hiding this comment

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

probably yes, hesitant to do this without access to hardware or roboguide for testing

@gavanderhoorn
Copy link
Owner

Hi, thanks for the PR, really appreciated.

I'm going to need a little more time before I can review it. Just thought I'd let you know.

@pdragy
Copy link
Author

pdragy commented Jun 14, 2025

No problem, gives me time to re-work the commits and fix the bug, and maybe test again. I can un-draft the PR when it's ready.

@pdragy pdragy closed this Jun 14, 2025
@pdragy pdragy reopened this Jun 14, 2025
pdragy added 2 commits June 13, 2025 22:09
This updates the python versions in the github action. Fixes:
"Version 3.8 with arch x64 not found Available versions: 3.10.18 (x64)
3.11.13 (x64) 3.12.11 (x64) 3.13.4 (x64) 3.9.23 (x64)"
Fixes the lint issue: E721 do not compare types, for exact
checks use `is` / `is not`, for instance checks use `isinstance()``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants