![]() |
![]() |
![]() |
![]() |
3 REFERENCE
3.1 PROGRAMS
This section provides detailed descriptions of the utilities in the ist module, which are:.
Utility to convert MIDAS tables to OLDB table attributes.
istTbl2Db converts MIDAS tables into a table attribute of
the on-line database. The table file accepted is not a
direct MIDAS table file format but only a FITS binary table
file. MIDAS can be used to convert a table file to this format.
The attribute name specified will be used to generate a OLDB
table attribute with the same field names as used in the FITS
binary table. If a mapping of a field is not possible the
loading of the table will fail.
The single operations of the utility are logged in the CCS
logging system and can be retrieved via the logMonitor.
-t <fitsTableFile> Name of the MIDAS FITS binary table file.
-p <point.attribute> Name of the database attribute.
-v Enable verbose mode. Operation logs are
redirected to standard output.
-d Delete previous database entry.
The current version maps table fields types one to one. If a field
in the FITS binary table is of a type not supported by the on-line
database e.g. array elements then the conversion will fail and the
table is not generated.
Convert MIDAS table file:
$ inmidas
Midas 001> OUTTAP/FITS example.tbl example.fits
Midas 002> exit
$ istTbl2Db -t example.fits -p :EXAMPLE.table
Writes table data to the attribute ":EXAMPLE.table"
3.2 FUNCTIONS
This section provides detailed descriptions of the functions in the ist module, which are:.
Function to query available disk space on device file or mounted directory.
Incr Tcl widget to visualize free disk space.
Incr Tcl widget to control instrument functions with elements e.g. filter wheel.
Tcl support procedures handling menus and dialogs
#include "ist.h"
ccsCOMPL_STAT istDiskSpace (char *diskName,
vltUINT32 *totalSize,
vltUINT32 *freeSize,
vltUINT32 *percent,
ccsERROR *error)
istDiskSpace returns disk space information of the disk or
mounted directory specified by diskName.
diskName <IN> name of root directory of interest
totalSize <OUT> Total size of physical disk space in Kbytes (1024 bytes)
If NULL, the related information is not returned
freeSize <OUT> Size of free disk space in Kbytes (1024 bytes)
If NULL, the related information is not returned
percent <OUT> Free disk space in percent of total available
If NULL, the related information is not returned
error <OUT> Error structure
FAILURE and error returns with one of the following errors:
istERR_ACCESS , Access permissions denied
istERR_INVALID_DISK , Invalid disk or directory specified
istERR_DISK_IO , Disk I/O error
istDiskMon is a panel editor class that can be inserted when
developing a control panel. It displays a barchart with the
current disk space usage of the disk entered in the entry field
below. The disk space is queried by sending a query command to
the istServer.
The disk name can either be entered by typing into the entry
field or setting the environment INS_DISK. When this environement
is set the entry field is locked and the disk name can not be
changed.
The radio buttons "Percent" and "MByte" toggle the free disk
space value in the respective unit.
When the update button is checked in the disk space is queried
periodically.
Options represent public variables of the object and can be set with:
<object-name> configure -<Option> <Value> ...
istDiskMon accepts following configuration options:
-diskName <file> Filename of the disk monitored.
-diskUpdate <0|1> Toggle the update checkbutton. 1 = update the
widget with diskUpdateFreq. 0 = don't update.
-diskUpdateFreq <sec> Update frequency in seconds (default 5).
-percent <0|1> Show value in percent (default).
-MByte <0|1> Show value in MByte.
-smallLayout <0|1> Change layout to a smaller size with widget
controls in a seperate dialog window.
-cfgWinGeometry <geo> Define the geometry of the seperate configuration
dialog window. Only relevant when -smallLayout
is true.
In this example the auto_path is assumed set correctly.
seqWish> istDiskMon .diskMonitor
seqWish> pack .diskMonitor
seqWish> .diskMonitor -diskName "/diskc" -mByte 1
seqWish> .diskMonitor -diskUpdate 1 -diskUpdateFreq 5
ist3State is a mega widget which defines a three state button area.
The ist3State can be used for instrumentation panel which control an
instrument function such as a filter wheel.
The ist3State widget defines a set of elements which are controled by
buttons. The individual buttons have three states: unselected, selected
and accepted.
In unselected state the element button looks like other default buttons.
In selected state the button color changes (default skyBlue) and font
changes. Only one element can be selected at a time. The selection is
done by pressing the button. A selection is equal to a setup parameter.
If a selection variable is passed (-selectVariable) this variable is
updated with the current selection.
In accpeted state the button color (default gold) changes and the font
is larger then the other states in order to clearly show what the current
status of the element is. If a accept variable is passed (-selectVariable)
this variable is updated with the current accepted value.
Callbacks can be specified in order to control the selection.
The title of the ist3State button area is also a button which can be used
to activate a function which could be a dialog showing more details of a
function.
The user create a widget of this class (called instance) by :
ist3State <widget-name> <config-parameters>
where :
<widget-name> is any valid TK widget name
<config-parameters> sequence of widget resources
Standard widget resources can be set using :
<widget-name> configure <resource-name> <value>
The current value of the widget resources is returned by :
<name-of-instance> cget <resource-name>
select <no>
Changes the state of an element numbert <no> to selected.
accept
Changes the state of the selected element to accepted.
clear
Clear the selection.
now <no>
Indicates the temporay position of a moving functions.
Feature not supported yet !
selectItem
Returns the currently selected item text string.
selectNo
Returns the currently selected item number.
keyword
Returns the short FITS keyword of the element function.
accepted
Returns the currently accepted item number.
disable
Disable the selection of element buttons.
enable
Enable the selection of element buttons.
elements <list of element names>
current <element name>
label <function name>
keyword <short FITS keyword>
selectCB <callback function> - function has 2 parameters: keyword value
detailCB <callback function> - function has no parameters
selectBg <color> - rgb color e.g. blue
selectFont <font> - X11 font name
acceptBg <color> - named color see rgb.txt
acceptFont <font> - see above.
labelBg <color> - see above.
labelFg <color> - see above.
labelFont <font> - see above.
nowBg <color> - see above.
nowFont <font> - see above.
orient <h/v> - h = horizontal v = vertical layout
index <number> - start of numbering index default 0
selectVariable <var> - variable set with selected value
acceptVariable <var> - variable set with accepted value
lblWidth <width> - label width in number of characters
statusDb <attr> - database point and attribute name
Create an instance
ist3State .myFunction -label myFunction -current Open \
-elements {Open Closed J K} -keyword "INS.OPTI-1" \
-selectCB funcSelect
proc funcSelect { keyword value } {
puts "Function: $keyword has value: $value"
}
istSupport is a series of support functions for developing instrument
GUI panels. There usage cover various area such as:
- dynamic menus
- window manager handling
istMenuReadFile is a function that can add menu items which are described
in a menu file. The menu file is located in the $VLTDATA/config directory
and allows to add the menu elements: separator, command, checkbutton or
radiobutton.
The menu file has the following syntax:
menu <menu name> separator
menu <menu name> command <text> <proc>
menu <menu name> checkbutton <text> <proc> <var>
menu <menu name> radiobutton <text> <proc> <var>
The <menu name> must already exist in the panel generated by panel editor.
istWindowOnTop is a procedure to allow windows to stay on top on the
master panel. This is especially usefull when developping dialog windows
where you want to avoid that the dialog 'disappears' behind the main
panel.
istClassDialog build a dialog window out of a panel editor class.
Example of menu file:
____________________________________________________________________
menu Options command "Profile ..." isouifProfile
menu Options command "INS User ..." istDummyCmd
menu Options separator
menu Options radiobutton "No TCS" isouifTcsMode tcsMode
menu Options radiobutton "TCS present" isouifTcsMode tcsMode
menu Status command "ICS ..." {isouifStatus ICS}
menu Status command "DCS ..." {isouifStatus DCS}
menu Status command "TCS ..." {isouifStatus TCS}
menu Commands command SETUP isouifSetup
menu Commands separator
menu Commands command START isouifStart
menu Commands separator
menu Commands command STOP isouifStop
menu Commands separator
menu Commands command ABORT isouifAbort
___________________________________________________________________
Example of using istClassDialog:
istClassDialog testPanelClass_uifClass test "This is a test dialog"
![]() Quadralay Corporation http://www.webworks.com Voice: (512) 719-3399 Fax: (512) 719-3606 sales@webworks.com |
![]() |
![]() |
![]() |
![]() |