sim_pin: support option --title title_string
Signed-off-by: Dewey Garrett <dgarrett@panix.com>
This commit is contained in:
parent
45e6e66590
commit
9e2397632b
3 changed files with 30 additions and 4 deletions
|
|
@ -27,7 +27,11 @@
|
||||||
\fBsim_pin\fR \- gui for displaying and setting one or more Hal inputs
|
\fBsim_pin\fR \- gui for displaying and setting one or more Hal inputs
|
||||||
|
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B \fBsim_pin\fR \fIname1\fR [\fIname2\fR [\fIname3\fR ...]]
|
.B \fBsim_pin\fR \fI[Options]\fR \fIname1\fR [\fIname2\fR [\fIname3\fR ...]]
|
||||||
|
|
||||||
|
\fIOptions\fR:
|
||||||
|
\fB--help\fR (shows help text)
|
||||||
|
\fB--title title_string\fR
|
||||||
|
|
||||||
For bit items, the name may include a /mode= specifier:
|
For bit items, the name may include a /mode= specifier:
|
||||||
\fInamei\fR\fB/mode=\fR[\fBpulse\fR | \fBtoggle\fR | \fBhold\fR]
|
\fInamei\fR\fB/mode=\fR[\fBpulse\fR | \fBtoggle\fR | \fBhold\fR]
|
||||||
|
|
|
||||||
|
|
@ -160,7 +160,11 @@ sim_pin is a command line utility to display and update any number of
|
||||||
writable pins, parameters or signals. Usage:
|
writable pins, parameters or signals. Usage:
|
||||||
----
|
----
|
||||||
Usage:
|
Usage:
|
||||||
sim_pin name1 [name2 ...] &
|
sim_pin [Options] name1 [name2 ...] &
|
||||||
|
|
||||||
|
Options:
|
||||||
|
--help (this text)
|
||||||
|
--title title_string (window title, default: sim_pin)
|
||||||
|
|
||||||
Note: LinuxCNC (or a standalone Hal application) must be running
|
Note: LinuxCNC (or a standalone Hal application) must be running
|
||||||
A named item can specify a pin, param, or signal
|
A named item can specify a pin, param, or signal
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,11 @@ if [catch {package require Hal} msg] {
|
||||||
proc usage {} {
|
proc usage {} {
|
||||||
puts "
|
puts "
|
||||||
Usage:
|
Usage:
|
||||||
$::SP(progname) name1 \[name2 ...\] &
|
$::SP(progname) \[Options\] name1 \[name2 ...\] &
|
||||||
|
|
||||||
|
Options:
|
||||||
|
--help (this text)
|
||||||
|
--title title_string (window title, default: $::SP(progname))
|
||||||
|
|
||||||
Note: LinuxCNC (or a standalone Hal application) must be running
|
Note: LinuxCNC (or a standalone Hal application) must be running
|
||||||
A named item can specify a pin, param, or signal
|
A named item can specify a pin, param, or signal
|
||||||
|
|
@ -514,13 +518,27 @@ if [catch {
|
||||||
set ::SP(iprefix) "Initial=" ;# initial value prefix
|
set ::SP(iprefix) "Initial=" ;# initial value prefix
|
||||||
set ::SP(prefix) "Current=" ;# current value prefix
|
set ::SP(prefix) "Current=" ;# current value prefix
|
||||||
set ::SP(pulse,ms) 200 ;# pulse duration
|
set ::SP(pulse,ms) 200 ;# pulse duration
|
||||||
wm title . $::SP(progname)
|
set ::SP(title) $::SP(progname)
|
||||||
|
|
||||||
|
set currentarg [lindex $::argv 0]
|
||||||
|
while {[string first "-" $currentarg] == 0} {
|
||||||
|
switch -- $currentarg {
|
||||||
|
--help {usage}
|
||||||
|
--title {set ::SP(title) [lindex $::argv 1]
|
||||||
|
set ::argv [lreplace $::argv 0 0]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set ::argv [lreplace $::argv 0 0]
|
||||||
|
set currentarg [lindex $::argv 0]
|
||||||
|
}
|
||||||
|
|
||||||
foreach itemname $::argv {
|
foreach itemname $::argv {
|
||||||
if [add_item_to_gui $::SP(id) $itemname] {
|
if [add_item_to_gui $::SP(id) $itemname] {
|
||||||
incr ::SP(id)
|
incr ::SP(id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wm title . $::SP(title)
|
||||||
if {$::SP(id) < 1} usage
|
if {$::SP(id) < 1} usage
|
||||||
update_current_values
|
update_current_values
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue