Actually, there is pretty easy way to do this.  It's not elegant, but it
gets the job done.  I do this usually in "turnkey" applications (e.g.,
-image or -kiosk mode).    I don't start DX from the command line, but
start it from a shell script, which has arguments (e.g., information that
identifies data files or directories).  In the script the arguments are
parsed and the results are stuffed in a file with a fixed name.  In DX I
then Import the contents of the file (or run a shell script that gets the
information).  Then I do some further fiddling (e.g., with Format), which
is then passed to another Import to either read the file I want or run a
program that gets the data.  In cases where the default caching behavior is
not desired, I set the caching of the appropriate modules by hand.  With
cascading Imports that run external programs or scripts, you get DX to do a
lot more thaen would be typical by just reading files.

Ordinarily I don't use -program either.  However, with the Windows binary
on the web site, X fonts/colors don't appear in the typical DX fashion.  My
workaround has been to run dxui from the DOS command line.  In that case
you need -program to tell the ui your net.  This is something that the dx
script does for you...


Chris Pelkie <[EMAIL PROTECTED]>@opendx.watson.ibm.com on 01/19/2001
07:38:29 AM

Please respond to [email protected]

Sent by:  [EMAIL PROTECTED]


To:   [email protected]
cc:
Subject:  Re: [opendx-users] Command Line Parameters for .net



>Hi!
>
>I have the following problem: I have an OpenDX-program General.net
>which I use to view different data files. The way I usualy work is the
>following:
>I call 'dx -program General.net' then I use a FileSelector to select
>the data-file I want to view. Then I execute the program.
>The way I would like to work is:
>'dx -program General.net -execute_on_change *something* datafile'
>where *something* is the part i don't know about.
>
>Is there a way to achive this (or something similar).
>I havn't found anything like this in the manuals.
>
>(Note:I would still like to edit the program with the VPE)
>


There is no trivial way to do this. Unlike many other command-line driven
programs you are familiar with, any DX net can contain an arbitrary number
of Import/ImportSpreadsheet/ReadImage "input ports" (if you want to think
of them like that). There is no mechanism to assign an arbitrary number of
command-line parameters to these ports in the correct order. So it's not
like a simpler Unix utility where you can just pipe stdin.

I don't think I've ever used -program: I've always used "dx -edit
General.net" (saves a couple keystrokes anyway (:-)  ). This puts you into
the edit/execute mode (it comes up in "end execution" mode initially,
though you correctly know how to bring it up in "execute on change").

Frankly, you are doing what I've been doing for over 10 years: start the DX
editor with a given net, change parameters to taste, then execute. If you
are trying to make an end-user deliverable, I think you will have to either
use a generic name for the data file and externally, and in advance of
starting DX, make the currently desired file have that name, or show the
user how to use FileSelector (or learn how to use DXLink). The generic
filename solution has a weakness in that you must then teach the user how
to do a Reset Connection (a very scary sounding, but quite benign
proposition) if you externally change the data in the same-named file after
DX has loaded and cached an earlier version under that name.

I did not explain how to hack a script since you say you want to continue
to edit in the VPE (my preferred method also). Probably obvious to you that
given a script, you could easily parameterize the input name by passing it
in via a shell script. This >could< be done to the saved net file itself,
by the way, such that you change the net just before DX opens it. That is a
relatively thin sheet of ice to venture onto but it will work.

Chris Pelkie
Vice President/Scientific Visualization Producer
Conceptual Reality Presentations, Inc.
30 West Meadow Drive
Ithaca, NY 14850
[EMAIL PROTECTED]




Reply via email to