comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Opening a .isv file
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Opening a .isv file [message #50672] Fri, 13 October 2006 14:44
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
Kenneth Bowman wrote:
> In article <1160763899.346746.133620@b28g2000cwb.googlegroups.com>,
> "mgalloy@gmail.com" <mgalloy@gmail.com> wrote:
>
>> Kenneth Bowman wrote:
>>> The ability to save the iTools state in a .isv file is extremely useful.
>>>
>>> To open a .isv file, however, one must start an iTool, then use the File...Open
>>> menu item interactively to navigate to the .isv file to open it.
>>>
>>> Is there a simple command-line way to do this, such as
>>>
>>> isv_open, filename
>>>
>>> where filename is the path to the file?
>>
>> What do you want to happen then, though? For the appropriate iTool to
>> start up and load that data set?
>
> I think I have already solved this (see my follow-up posting), but you raise
> an interesting question. Is there such thing as an appropriate iTool? Do
> I need to know which iTool to use to open an ISV file? Can't I open
> an ISV file with *any* iTool? Aren't all iTools really the same thing
> underneath? (Since I can add an image to a volume, or a line to surface, etc.)

Yes, they all morph into what is necessary to view the displayed data.
In your solution, it just says "iPlot" in the window titlebar, but the
tool can handle other types of data.

Mike
--
www.michaelgalloy.com
Re: Opening a .isv file [message #50673 is a reply to message #50672] Fri, 13 October 2006 13:46 Go to previous message
K. Bowman is currently offline  K. Bowman
Messages: 330
Registered: May 2000
Senior Member
In article <1160763899.346746.133620@b28g2000cwb.googlegroups.com>,
"mgalloy@gmail.com" <mgalloy@gmail.com> wrote:

> Kenneth Bowman wrote:
>> The ability to save the iTools state in a .isv file is extremely useful.
>>
>> To open a .isv file, however, one must start an iTool, then use the File...Open
>> menu item interactively to navigate to the .isv file to open it.
>>
>> Is there a simple command-line way to do this, such as
>>
>> isv_open, filename
>>
>> where filename is the path to the file?
>
> What do you want to happen then, though? For the appropriate iTool to
> start up and load that data set?

I think I have already solved this (see my follow-up posting), but you raise
an interesting question. Is there such thing as an appropriate iTool? Do
I need to know which iTool to use to open an ISV file? Can't I open
an ISV file with *any* iTool? Aren't all iTools really the same thing
underneath? (Since I can add an image to a volume, or a line to surface, etc.)

Ken
Re: Opening a .isv file [message #50674 is a reply to message #50673] Fri, 13 October 2006 11:22 Go to previous message
K. Bowman is currently offline  K. Bowman
Messages: 330
Registered: May 2000
Senior Member
In article <1160754314.429990.182420@h48g2000cwc.googlegroups.com>,
codepod@gmail.com wrote:

> Actually, an ISV file is just a save file that contains a portion of
> the iTools data/vis hierarchy. So you can just use restore.
>
> CP

I tried that, and RESTORE restores some data, but it does not open an
iTool window and display the visualization.

After a little thought I realized that one it is possible to control the iTool
interface programmatically to execute the Open operation, so here is a simple
program to do that.

To use,

IDL> isv_open_kpb, isvfile

where isvfile is the name of the .isv file.

I make no guarantees, as my object-oriented programming is severely limited,
but this seems to work.

Plus, it *has* to be good luck to offer this up on Friday the 13th.

Cheers, Ken Bowman



PRO ISV_OPEN_KPB, isvfile, $
ITOOL_ID = itool_id, $
VERBOSE = verbose

;+
;NAME:
; ISV_OPEN_KPB
;PURPOSE:
; Open an iTool visualization saved as an ISV file.
;CATEGORY:
; Graphics and display.
;CALLING SEQUENCE:
; ISV_OPEN_KPB, isvfile
;INPUT:
; isvfile : String containing name of ISV file to open.
;KEYWORDS:
; ITOOL_ID : On return this keyword contains the iTool ID of the newly created iTool.
; VERBOSE : If set, print verbose informational messages.
;OUTPUT:
; Opens iTool window and displays the saved visualization.
;MODIFICATION HISTORY:
; Kenneth P. Bowman, 2006-10-13.
;-

COMPILE_OPT IDL2 ;Set compiler options

IF (N_PARAMS() EQ 0) THEN begin
MESSAGE, 'You must provide the name of an ISV file.', /CONTINUE ;Error - no filename provided
RETURN
ENDIF

file = FILE_SEARCH(isvfile, COUNT = nfiles) ;Check that file exists
IF (nfiles EQ 0) THEN BEGIN
MESSAGE, 'File "' + isvfile + '" not found.', /CONTINUE ;Error - file does not exist
RETURN
ENDIF

iPlot, IDENTIFIER = itool_id, /DISABLE_SPLASH_SCREEN ;Create new iTool
temp = itGetCurrent(TOOL = itool_obj) ;Get iTool object reference

open_op_id = itool_obj -> FindIdentifiers('*OPEN*', /OPERATIONS) ;Get Open operator identifier
open_op_obj = itool_obj -> GetByIdentifier(open_op_id) ;Get Open operator object reference
open_op_obj -> SetProperty, SHOW_EXECUTION_UI = 0, $ ;Turn off Open operator user interface
FILENAME = isvfile ;Set ISV input file name
rc = itool_obj -> DoAction(open_op_id) ;Open ISV file

IF KEYWORD_SET(verbose) THEN PRINT, 'ISV file read from ', isvfile ;Completion message

END
Re: Opening a .isv file [message #50675 is a reply to message #50674] Fri, 13 October 2006 11:24 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
Kenneth Bowman wrote:
> The ability to save the iTools state in a .isv file is extremely useful.
>
> To open a .isv file, however, one must start an iTool, then use the File...Open
> menu item interactively to navigate to the .isv file to open it.
>
> Is there a simple command-line way to do this, such as
>
> isv_open, filename
>
> where filename is the path to the file?

What do you want to happen then, though? For the appropriate iTool to
start up and load that data set?

Mike
--
www.michaelgalloy.com
Re: Opening a .isv file [message #50678 is a reply to message #50674] Fri, 13 October 2006 08:45 Go to previous message
codepod is currently offline  codepod
Messages: 19
Registered: March 2006
Junior Member
Actually, an ISV file is just a save file that contains a portion of
the iTools data/vis hierarchy. So you can just use restore.

CP


Kenneth Bowman wrote:
> The ability to save the iTools state in a .isv file is extremely useful.
>
> To open a .isv file, however, one must start an iTool, then use the File...Open
> menu item interactively to navigate to the .isv file to open it.
>
> Is there a simple command-line way to do this, such as
>
> isv_open, filename
>
> where filename is the path to the file?
>
> Ken Bowman
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Reading CDF files on a Mac
Next Topic: Re: idl syntax validation

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:44:27 PDT 2025

Total time taken to generate the page: 0.19534 seconds