* Curtis L. Olson -- Tuesday 31 January 2006 17:52:
> If screen-capture is the exposed function name, then you should also be 
> able to just setup the telnet interface, telnet in, and type "run 
> screen-capture".

Ahh. Didn't know that.

Here's yet another possibility that works for almost all commands.
(See attachment). Put this into $FG_ROOT/Nasal/ and then in
telnet/http first write the args and finally the command name.
Example:

  set /sim/cmd/name screen-capture

  set /sim/cmd/args/dialog-name instrument-failures
  set /sim/cmd/name dialog-show

m.
# set appropriate args in /sim/cmd/args/ and then write the
# command name to /sim/cmd/name. Example:
#
# set /sim/cmd/arg/timeofday morning
# set /sim/cmd/name timeofday

cmd = args = nil;

INIT = func {
    cmd = props.globals.getNode("/sim/cmd/name", 1);
    args = props.globals.getNode("/sim/cmd/args", 1);
    args.setValues({
        "file"          : "",     # load, save, play-audio
        "dialog-name"   : "",     # dialog-show, dialog-close
        "object-name"   : "",     # dialog-update, dialog-apply
        "path"          : "",     # play-audio, panel-load, preferences-load
        "script"        : "",     # script, nasal
        "status"        : 0,      # exit
        "subsystem"     : "",     # reinit
        "write-all"     : 0,      # save
        "button"        : 0,      # panel-mouse-click
        "is-down"       : 0,      # panel-mouse-click
        "x-pos"         : 0,      # panel-mouse-click
        "y-pos"         : 0,      # panel-mouse-click
        "temp-degc"     : 0.0,    # set-sea-level-degc, set-oat-degc
        "altitude-ft"   : 0.0,    # set-oat-degc, set-dewpoint-degc
        "dewpoint-degc" : 0.0,    # set-dewpoint-sea-level-degc, 
set-dewpoint-degc
        "timeofday"     : "noon", # timeofday
        "targetnode"    : "",     # load_xml_to_proptree
        "filename"      : "",     # load_xml_to_proptree, save_xml_from_proptree
        "sourcenode"    : "",     # save_xml_from_proptree
    });
    setlistener(cmd, func { fgcommand(cmdarg().getValue(), args) } );
}

settimer(INIT, 0);

Reply via email to