HiRISE

HiRISE.HiPlan.HOGG
Class Flight_Settings

java.lang.Object
  extended by HiRISE.HiPlan.HOGG.Flight_Settings

public class Flight_Settings
extends Object

A utility class describing the current flight state of HiRISE. A PVL description file contains the list of inactive CCDs and the current active electronics side.

The file is found in resources/Flight_Settings.pvl, located at the location of the HOGG package as determined by the class loader. If the file cannot be read, or if it is missing parameters, or if the parameters contain bad values, the hasError() method returns true. If this is the case, the settings methods may not return correct values. Check the hasError() method before first using this class's shared instance.

Version:
2.5
Author:
Christian Schaller - UA/PIRL

Nested Class Summary
static class Flight_Settings.Side
          An enumeration defining the redundant electronics "sides" of HiRISE.
 
Field Summary
static String ACTION_LABEL
           
static String ACTIVE_SIDE
          The name of the parameter whose value is the active HiRISE electronics side.
static int FAILURE
          Exit status for an unsuccessful operation.
static String FILENAME
          The flight settings PVL file.
static String ID
          Class identification name with source code version and date.
static String INACTIVE_CCDS
          The name of the parameter whose value is the set of inactive HiRISE CCDs.
static int SUCCESS
          Exit status for a successful operation.
 
Method Summary
 Flight_Settings.Side getActiveSide()
          Gets the active electronics side of HiRISE.
 String getErrorMessage()
          Gets the error message associated with any errors in the flight settings file.
 List<String> getInactiveCcds()
          Gets a list of inactive CCDs.
static Flight_Settings getInstance()
          Gets the shared flight settings instance.
 String getSettingsFilename()
          Gets the full pathname to the settings file.
 boolean hasError()
          Indicates whether the flight settings have an error.
 boolean isInactiveCcd(String ccd)
          Indicates whether the specified CCD is inactive.
 boolean isInactiveCpmm(int cpmm)
          Indicates whether the specified CPMM is inactive.
static void main(String[] args)
           
static Action makeViewerAction(Component parent)
           
static void showSettingsDialog(Component parent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final String ID
Class identification name with source code version and date.

See Also:
Constant Field Values

FILENAME

public static final String FILENAME
The flight settings PVL file. This file is located in the resources directory of the HOGG package as determined by the class loader.

See Also:
Constant Field Values

ACTIVE_SIDE

public static final String ACTIVE_SIDE
The name of the parameter whose value is the active HiRISE electronics side. Only values of the Flight_Settings.Side enum are allowed, although they are not case-sensitive.

See Also:
Constant Field Values

INACTIVE_CCDS

public static final String INACTIVE_CCDS
The name of the parameter whose value is the set of inactive HiRISE CCDs. Only valid HiRISE CCD names are allowed.

See Also:
Instrument.CCD_NAMES, Constant Field Values

ACTION_LABEL

public static final String ACTION_LABEL
See Also:
Constant Field Values

SUCCESS

public static final int SUCCESS
Exit status for a successful operation.

See Also:
Constant Field Values

FAILURE

public static final int FAILURE
Exit status for an unsuccessful operation.

See Also:
Constant Field Values
Method Detail

getActiveSide

public Flight_Settings.Side getActiveSide()
Gets the active electronics side of HiRISE.

Note that if hasError() is true, this method returns the default value of Flight_Settings.Side.SIDE_A, which may not be correct. Check the error flag before using this method.

Returns:
the active side.

getInactiveCcds

public List<String> getInactiveCcds()
Gets a list of inactive CCDs. The list may be empty, but it will not be null.

Note that if hasError() is true, this method returns the default empty list, which may not be correct. Check the error flag after getting the shared instance.

Returns:
the list of inactive CCDs, which may be empty.

isInactiveCcd

public boolean isInactiveCcd(String ccd)
Indicates whether the specified CCD is inactive. If it is, this method returns true. If it is not inactive, or if the CCD name is not a valid HiRISE CCD name, this method returns false.

Note that if hasError() is true, this method returns false for all CCD names, which may not be correct. Check the error flag after getting the shared instance.

Parameters:
ccd - the CCD name.
Returns:
true if the CCD is inactive; false if not or if the name is invalid.

isInactiveCpmm

public boolean isInactiveCpmm(int cpmm)
Indicates whether the specified CPMM is inactive. If it is, this method returns true. If it is not inactive, or if the CPMM number is out of range, this method returns false.

Note that if hasError() is true, this method returns false for all CPMM numbers, which may not be correct. Check the error flag after getting the shared instance.

Parameters:
cpmm - the CPMM number.
Returns:
true if the CPMM is inactive; false if not or if the number is out of range.

hasError

public boolean hasError()
Indicates whether the flight settings have an error. An error occurs when the settings FILENAME cannot be read, or when it is missing a parameter, or when a parameter has an invalid value. If this method returns true, the getErrorMessage() method returns the associated error message.

IMPORTANT: If this method returns true, then the methods describing the flight settings may not return correct values.

Returns:
true if there was an error with the settings file.

getErrorMessage

public String getErrorMessage()
Gets the error message associated with any errors in the flight settings file.

Returns:
the error message or null if there are no errors in the flight settings file.

getSettingsFilename

public String getSettingsFilename()
Gets the full pathname to the settings file.

Returns:
the flight settings filename.

getInstance

public static Flight_Settings getInstance()
Gets the shared flight settings instance.

IMPORTANT: Before using the shared instance, check the hasError() method. If it returns true, there was a problem with the flight settings file and the methods describing the settings may not return correct values.

Returns:
the shared flight settings instance.

makeViewerAction

public static Action makeViewerAction(Component parent)

showSettingsDialog

public static void showSettingsDialog(Component parent)

main

public static void main(String[] args)

HiRISE

Copyright (C) Arizona Board of Regents on behalf of the Planetary Image Research Laboratory, Lunar and Planetary Laboratory at the University of Arizona