stella.jview
Class JOffTails

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by mysql.AbstractSql
                  extended by stella.sql.NightlyStatistic
                      extended by stella.sql.OffLimitAlarm
                          extended by stella.sql.OffLimitVisual
                              extended by stella.jview.JOffTails
All Implemented Interfaces:
ActionListener, Cloneable, EventListener, Displayable, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, Refreshing, ResourceSupplying

public class JOffTails
extends OffLimitVisual
implements Displayable, Refreshing, ActionListener, ExitCleaning

Uses an offset alert statistic to provide a one-look health display of the two telescopes plus environment conditions.


Nested Class Summary
static class JOffTails.Client
          In this evocation, we act as a gesture client.
static class JOffTails.Server
          In this evocation, we act as a gesture server.
private static class JOffTails.TenerifeMosaic
          In the event queue, there is no time for lengthy image transfers.
 
Nested classes/interfaces inherited from class stella.sql.OffLimitVisual
OffLimitVisual.Flavor, OffLimitVisual.Signal
 
Nested classes/interfaces inherited from class stella.sql.NightlyStatistic
NightlyStatistic.Duty, NightlyStatistic.Env, NightlyStatistic.Night
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private  JPanel body
          The panel holding the telescope displays with card-layout for env.
private  Map<String,JButton> buttons
          References to all buttons, telescope ones augmented like 'STELLA:'
private static String DEFDATEFIELD
          The default target name field in the database
private static String DEFDONETABLE
          The name of the field holding the object-id.
private static String DEFDURATIONFIELD
          The default target name field in the database
private static String DEFHOSTS
          Default hosts=localhost.
private static String DEFLIGHTSWITCH
          Default rmi access to the bay switch.
private static String DEFMERITFIELD
          The default target name field in the database
private static String DEFPRINTFORMAT
          Default print format for signal values.
private static String DEFSUCCESSFIELD
          The default target name field in the database
private static String DEFTAILFILES
          For each telescope, this is the list of log tails.
private static int DEFTAILLENGTH
          Default tail length.
private static String DEFTAILTABS
          For each log file, this is the tab name.
private static String DEFTAILUSERHOST
          For each telescope we have a user@host during logtail.
private static String DEFTELMOSAIC
          Default propertizable of telescopes to labels.
private static String DEFTELRULE
          Default propertizable of telescopes to labels.
private static String DEFUNIQUENAME
          The default target name field in the database
private static String FIRST
          Stupid ruler for first card component.
static String KEY_ACCOUNTS
          The telescope-to-hosts name list.
static String KEY_DATEFIELD
          The key to the target name in the database.
static String KEY_DONETABLE
          The name of the field holding the object-id.
static String KEY_DURATIONFIELD
          The key to the target name in the database.
static String KEY_ENVCANVAS
          The pointer to the properties for the environment plot canvas.
static String KEY_ENVRULE
          If set, the value is propertized and merged into env canvas props.
static String KEY_HOSTS
          The list of hosts that should be scanned to radiate pick events.
static String KEY_LIGHTSWITCH
          The rmi query for the bay lightswitch.
static String KEY_MERITFIELD
          The key to the target name in the database.
static String KEY_PRINTFORMAT
          The print format for signal values displayed at buttons.
static String KEY_SUCCESSFIELD
          The key to the target name in the database.
static String KEY_TAILFILES
          The regular expression we pipe to the grep command.
static String KEY_TAILLENGTH
          The number of tailing lines to grep.
static String KEY_TAILTABS
          The number of tailing lines to grep.
static String KEY_TAILUSERHOST
          The double-linked list of log-files per telescope for scouting.
static String KEY_TELCANVAS
          The pointer to the properties for the environment plot canvas.
static String KEY_TELMOSAIC
          The labels for the telescope mosaics.
static String KEY_TELRULE
          If set, the value is propertized and merged into env canvas props.
static String KEY_UNIQUENAME
          The key to the target name in the database.
private  JButton lastenv
          The last environment button pressed.
private  Map<String,JButton> lasttel
          The last telescope button pressed.
private  Map<String,JLogField> logfields
          Reference of login/logfile to logfield.
private  Map<String,JPanel> mosaic
          References to all telescope baycam mosaics.
private  List<Registry> registries
          A list of registries on hosts that might contain pick event listeners.
private static String SECOND
          Stupid ruler for second card component.
private  Map<String,List<String>> telurl
          References from all telescopes to their labels.
 
Fields inherited from class stella.sql.OffLimitVisual
KEY_REDAVENV, KEY_REDAVTEL, KEY_REDMINMAXENV, KEY_REDMINMAXTEL, KEY_REDSIGMAENV, KEY_YELLOWAVENV, KEY_YELLOWAVTEL, KEY_YELLOWMINMAXENV, KEY_YELLOWMINMAXTEL, KEY_YELLOWSIGMAENV
 
Fields inherited from class stella.sql.OffLimitAlarm
KEY_DONELIST, KEY_DONENAMES, KEY_DONEWHERE, KEY_ENVLIST, KEY_ENVNAMES, KEY_JOINTLIST, KEY_JOINTNAMES, KEY_JOINTWHERE, KEY_OBSLIST, KEY_OBSNAMES, KEY_OBSWHERE, KEY_SCILIST, KEY_SCINAMES, KEY_SCIWHERE, KEY_TELESCOPE, NULL, TELESCOPESEPARATOR
 
Fields inherited from class stella.sql.NightlyStatistic
DEFPASSWORD, DEFUSERNAME, KEY_RISETWILIGHT, KEY_SETTWILIGHT
 
Fields inherited from class mysql.AbstractSql
KEY_TABLE
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Constructor Summary
JOffTails(Map<String,String> prop)
          Constructs a new JOffLimit object that is updated at regular intervals.
 
Method Summary
 void actionPerformed(ActionEvent ae)
          Deal with the button events.
private  boolean displayAndShow(JPanel card, double[] x, double[] y, List<Object> keys, String label)
          The panel deliverd has a card layout, with a jdatacanvas as the second component.
 void exit()
          This method is called whenever a clean-up before a shutdown is necessarry.
private  Map<String,String> getDataCanvasProperties(String urlkey, String overrulekey)
          From the two keys, we construct the data canvas properties by first using either the default or the canvas resource (if latter is non-null), then, if an overrule is present, we augment these properties with the additional mappings.
private  Map<String,String> getDefaultDataCanvasProperties()
          This provides a default canvas property collection.
 Icon getIcon()
          If we have an icon in the properties.
 long getRefreshInterval()
          Update every day.
 Component getRepresentation()
          Returns a JPanel like
 boolean isFixedRate()
          Fixed delay.
static void main(String[] arg)
          We create a master frame, where we enter the offlimit panel.
 void refresh()
          On refresh, we update the signal lists.
private  void retail(String command)
          Issues a LogParser sshtail on the login plus file specified in the command.
private  void treatPick(HistoryAware.Pick click)
          This pick is selected.
private  void treatUnique(Object unique)
          This method is called if a object was selected in a telescope plot.
private  void updateButtonLabel(OffLimitVisual.Signal sign, JButton on)
          We update the button layout according to the signal.
private  void updateLabels()
          We update the labels on all buttons.
 
Methods inherited from class stella.sql.OffLimitVisual
gather, getEnvironmentSignals, getTelescopeSignals
 
Methods inherited from class stella.sql.OffLimitAlarm
addDone, addEnvironment, addJoint, addObs, clearStats, convertToStatistic, extractUnique, getAverageEnvOffs, getAverageTelOffs, getEnvStatistic, getEnvTimes, getMinMaxEnvOffs, getMinMaxTelOffs, getSigmaEnvOffs, getSigmaTelOffs, getSpanEnvOffs, getSpanTelOffs, getTelescopeKeys, getTelescopes, getTelescopeStatistic, getTelescopeTimes, init, telescopeDoubleMapping, telescopeVectorMapping, vectorMapping
 
Methods inherited from class stella.sql.NightlyStatistic
duskToDawn, duskToDawn, getDone, getDone, getDone, getEnvironment, getEnvironment, getEnvironment, getExposureTimeSum, getJoint, getJoint, getJoint, getNightCount, getObs, getObs, getObs, getRoofOpenCount, getScienceTimeSum
 
Methods inherited from class mysql.AbstractSql
getPassword, getTable, getUserName, isEntry
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
Methods inherited from class util.PropertyResources
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 
Methods inherited from interface util.PropertySupplying
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 

Field Detail

KEY_LIGHTSWITCH

public static final String KEY_LIGHTSWITCH
The rmi query for the bay lightswitch.

See Also:
Constant Field Values

KEY_PRINTFORMAT

public static final String KEY_PRINTFORMAT
The print format for signal values displayed at buttons.

See Also:
Constant Field Values

KEY_ENVCANVAS

public static final String KEY_ENVCANVAS
The pointer to the properties for the environment plot canvas.

See Also:
Constant Field Values

KEY_ENVRULE

public static final String KEY_ENVRULE
If set, the value is propertized and merged into env canvas props.

See Also:
Constant Field Values

KEY_TELCANVAS

public static final String KEY_TELCANVAS
The pointer to the properties for the environment plot canvas.

See Also:
Constant Field Values

KEY_TELRULE

public static final String KEY_TELRULE
If set, the value is propertized and merged into env canvas props.

See Also:
Constant Field Values

KEY_TELMOSAIC

public static final String KEY_TELMOSAIC
The labels for the telescope mosaics.

See Also:
Constant Field Values

KEY_DONETABLE

public static final String KEY_DONETABLE
The name of the field holding the object-id.

See Also:
Constant Field Values

KEY_UNIQUENAME

public static final String KEY_UNIQUENAME
The key to the target name in the database.

See Also:
Constant Field Values

KEY_DATEFIELD

public static final String KEY_DATEFIELD
The key to the target name in the database.

See Also:
Constant Field Values

KEY_DURATIONFIELD

public static final String KEY_DURATIONFIELD
The key to the target name in the database.

See Also:
Constant Field Values

KEY_SUCCESSFIELD

public static final String KEY_SUCCESSFIELD
The key to the target name in the database.

See Also:
Constant Field Values

KEY_MERITFIELD

public static final String KEY_MERITFIELD
The key to the target name in the database.

See Also:
Constant Field Values

KEY_HOSTS

public static final String KEY_HOSTS
The list of hosts that should be scanned to radiate pick events.

See Also:
Constant Field Values

KEY_ACCOUNTS

public static final String KEY_ACCOUNTS
The telescope-to-hosts name list.

See Also:
Constant Field Values

KEY_TAILUSERHOST

public static final String KEY_TAILUSERHOST
The double-linked list of log-files per telescope for scouting.

See Also:
Constant Field Values

KEY_TAILFILES

public static final String KEY_TAILFILES
The regular expression we pipe to the grep command.

See Also:
Constant Field Values

KEY_TAILTABS

public static final String KEY_TAILTABS
The number of tailing lines to grep.

See Also:
Constant Field Values

KEY_TAILLENGTH

public static final String KEY_TAILLENGTH
The number of tailing lines to grep.

See Also:
Constant Field Values

FIRST

private static final String FIRST
Stupid ruler for first card component.

See Also:
Constant Field Values

SECOND

private static final String SECOND
Stupid ruler for second card component.

See Also:
Constant Field Values

DEFLIGHTSWITCH

private static final String DEFLIGHTSWITCH
Default rmi access to the bay switch.

See Also:
Constant Field Values

DEFPRINTFORMAT

private static final String DEFPRINTFORMAT
Default print format for signal values.

See Also:
Constant Field Values

DEFTELMOSAIC

private static final String DEFTELMOSAIC
Default propertizable of telescopes to labels.

See Also:
Constant Field Values

DEFTELRULE

private static final String DEFTELRULE
Default propertizable of telescopes to labels.

See Also:
Constant Field Values

DEFDONETABLE

private static final String DEFDONETABLE
The name of the field holding the object-id.

See Also:
Constant Field Values

DEFUNIQUENAME

private static final String DEFUNIQUENAME
The default target name field in the database

See Also:
Constant Field Values

DEFDATEFIELD

private static final String DEFDATEFIELD
The default target name field in the database

See Also:
Constant Field Values

DEFDURATIONFIELD

private static final String DEFDURATIONFIELD
The default target name field in the database

See Also:
Constant Field Values

DEFSUCCESSFIELD

private static final String DEFSUCCESSFIELD
The default target name field in the database

See Also:
Constant Field Values

DEFMERITFIELD

private static final String DEFMERITFIELD
The default target name field in the database

See Also:
Constant Field Values

DEFHOSTS

private static final String DEFHOSTS
Default hosts=localhost.

See Also:
Constant Field Values

DEFTAILUSERHOST

private static final String DEFTAILUSERHOST
For each telescope we have a user@host during logtail.

See Also:
Constant Field Values

DEFTAILFILES

private static final String DEFTAILFILES
For each telescope, this is the list of log tails.

See Also:
Constant Field Values

DEFTAILTABS

private static final String DEFTAILTABS
For each log file, this is the tab name.

See Also:
Constant Field Values

DEFTAILLENGTH

private static final int DEFTAILLENGTH
Default tail length.

See Also:
Constant Field Values

registries

private List<Registry> registries
A list of registries on hosts that might contain pick event listeners.


buttons

private Map<String,JButton> buttons
References to all buttons, telescope ones augmented like 'STELLA:'


lastenv

private JButton lastenv
The last environment button pressed.


lasttel

private Map<String,JButton> lasttel
The last telescope button pressed.


mosaic

private Map<String,JPanel> mosaic
References to all telescope baycam mosaics.


telurl

private Map<String,List<String>> telurl
References from all telescopes to their labels.


logfields

private Map<String,JLogField> logfields
Reference of login/logfile to logfield.


body

private JPanel body
The panel holding the telescope displays with card-layout for env.

Constructor Detail

JOffTails

public JOffTails(Map<String,String> prop)
Constructs a new JOffLimit object that is updated at regular intervals.

Method Detail

getIcon

public Icon getIcon()
If we have an icon in the properties.

Specified by:
getIcon in interface Displayable

getRepresentation

public Component getRepresentation()
Returns a JPanel like

Specified by:
getRepresentation in interface Displayable

treatUnique

private void treatUnique(Object unique)
This method is called if a object was selected in a telescope plot.


treatPick

private void treatPick(HistoryAware.Pick click)
This pick is selected.


retail

private void retail(String command)
Issues a LogParser sshtail on the login plus file specified in the command. Looks up the log field and does the update there.


getDataCanvasProperties

private Map<String,String> getDataCanvasProperties(String urlkey,
                                                   String overrulekey)
From the two keys, we construct the data canvas properties by first using either the default or the canvas resource (if latter is non-null), then, if an overrule is present, we augment these properties with the additional mappings.


getDefaultDataCanvasProperties

private Map<String,String> getDefaultDataCanvasProperties()
This provides a default canvas property collection.


exit

public void exit()
Description copied from interface: ExitCleaning
This method is called whenever a clean-up before a shutdown is necessarry. The shutdown (or any comparable process) blocks until this method returns.

Specified by:
exit in interface ExitCleaning

actionPerformed

public void actionPerformed(ActionEvent ae)
Deal with the button events.

Specified by:
actionPerformed in interface ActionListener

displayAndShow

private boolean displayAndShow(JPanel card,
                               double[] x,
                               double[] y,
                               List<Object> keys,
                               String label)
The panel deliverd has a card layout, with a jdatacanvas as the second component. We grab this datacanvas, show the new data on it and make sure that it is visible. On success, we return true;


refresh

public void refresh()
On refresh, we update the signal lists.

Specified by:
refresh in interface Refreshing

isFixedRate

public boolean isFixedRate()
Fixed delay.

Specified by:
isFixedRate in interface Refreshing
See Also:
Timer

getRefreshInterval

public long getRefreshInterval()
Update every day.

Specified by:
getRefreshInterval in interface Refreshing

updateLabels

private void updateLabels()
We update the labels on all buttons.


updateButtonLabel

private void updateButtonLabel(OffLimitVisual.Signal sign,
                               JButton on)
We update the button layout according to the signal. The color defines the background of the button, the label is the flavour plus the value.


main

public static void main(String[] arg)
We create a master frame, where we enter the offlimit panel.