USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::SerialNumber Class Reference
[Control Networks]

Serial Number composer. More...

#include <SerialNumber.h>

Inheritance diagram for Isis::SerialNumber:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 SerialNumber ()
 Create an empty SerialNumber object.
virtual ~SerialNumber ()
 Destroy a SerialNumber object.

Static Public Member Functions

static QString Compose (Pvl &label, bool def2filename=false)
 Compose a SerialNumber from a PVL.
static QString Compose (Cube &cube, bool def2filename=false)
 Compose a SerialNumber from a Cube.
static QString Compose (const QString &filename, bool def2filename=false)
 Compose a SerialNumber from a file.
static QString ComposeObservation (const QString &sn, SerialNumberList &list, bool def2filename=false)
 Creates the ObservationNumber from a string representing the SerialNumber and a SerialList.

Static Protected Member Functions

static QString CreateSerialNumber (PvlGroup &snGroup, int key)
 Create the SerialNumber string by concatenating the keywords in the label with '/' in between serialNumber groups and the number of observationKeys.

Static Private Member Functions

static PvlGroup FindSerialTranslation (Pvl &label)
 Get Groups by translating from correct Translation table.

Detailed Description

Serial Number composer.

A Serial Number is a unique identification for some object such as an Isis cube. A Serial Number for a specific object must be repeatable. This class is intended to be used to create all Serial Numbers for Isis.

Author:
2005-07-28 Stuart Sides

For internal use only.

Todo:
This is only a temporary version. The code needs to be modified to use a PVL file to determine which keywords to use to create the Serial Number
History:
2005-07-28 Stuart Sides Original version
History:
2005-08-02 Jeff Anderson added new static methods for serial number composition from a cube or filename
History:
2006-01-24 Jacob Danton Updated the SerialNumber Compose method to use .trn files specific to the mission
History:
2006-06-15 Kris Becker Added the return of the filename as the fallback default condition. "Unknown" will still be returned if the input source is a label created in memory and does not have a valid serial number signature and it was not read in from a file. Add a test for this to the unitTest.
History:
2006-12-08 Stuart Sides Added parameter the the Compose methods to allow or disallow defaulting to the filename. This parameter has a default of false. Which will cause "Unknown" to be returned for files where a SN could not be correctly produced.
History:
2007-07-09 Steven Lambright Changed missions translation filename from Missions.trn to MissionName2DataDir.trn
History:
2007-09-11 Steven Koechle Added three ComposeObservation methods and made code reusable by seperating existing code into two private methods.
History:
2007-09-13 Steven Koechle Fixed boolean paramaters passed into FindSerialTranslation
History:
2008-01-10 Christpher Austin Removed the use of the system default file in FindSerialTranslation() and detached ObservationNumber functionality into its own class
History:
2008-05-09 Steven Lambright Optimized the FindSerialTranslation method
History:
2008-05-18 Steven Lambright Fixed documentation

Definition at line 85 of file SerialNumber.h.


Constructor & Destructor Documentation

Isis::SerialNumber::SerialNumber (  ) 

Create an empty SerialNumber object.

Definition at line 17 of file SerialNumber.cpp.

Isis::SerialNumber::~SerialNumber (  )  [virtual]

Destroy a SerialNumber object.

Definition at line 22 of file SerialNumber.cpp.


Member Function Documentation

QString Isis::SerialNumber::Compose ( const QString &  filename,
bool  def2filename = false 
) [static]

Compose a SerialNumber from a file.

Parameters:
filename a filename to open
def2filename If a serial number could not be found, try to return the filename
Returns:
Calculated SerialNumber or FileName

Reimplemented in Isis::ObservationNumber.

Definition at line 80 of file SerialNumber.cpp.

References Compose().

QString Isis::SerialNumber::Compose ( Cube cube,
bool  def2filename = false 
) [static]

Compose a SerialNumber from a Cube.

Parameters:
cube An opened Isis cub
def2filename If a serial number could not be found, try to return the filename
Returns:
Calculated SerialNumber or FileName

Reimplemented in Isis::ObservationNumber.

Definition at line 67 of file SerialNumber.cpp.

References Compose(), and Isis::Cube::label().

QString Isis::SerialNumber::Compose ( Pvl label,
bool  def2filename = false 
) [static]

Compose a SerialNumber from a PVL.

Parameters:
label A pvl formatted label to be used to generate the serial number
def2filename If a serial number could not be found, try to return the filename
Returns:
Calculated SerialNumber or FileName

Reimplemented in Isis::ObservationNumber.

Definition at line 32 of file SerialNumber.cpp.

References CreateSerialNumber(), Isis::PvlContainer::FileName(), and FindSerialTranslation().

Referenced by Isis::SerialNumberList::Add(), Compose(), ComposeObservation(), Isis::ChipViewport::paintEvent(), Isis::StereoTool::paintViewport(), Isis::MatchTool::serialNumberList(), Isis::StereoTool::setFiles(), and Isis::ProcessMosaic::SetMosaicOrigin().

QString Isis::SerialNumber::ComposeObservation ( const QString &  sn,
SerialNumberList list,
bool  def2filename = false 
) [static]

Creates the ObservationNumber from a string representing the SerialNumber and a SerialList.

Parameters:
sn the string representing the SerialNumber
list the SerialNumberList
def2filename If a serial number could not be found, try to return the filename
Returns:
Calculated SerialNumber or FileName

Definition at line 174 of file SerialNumber.cpp.

References Compose(), and Isis::SerialNumberList::FileName().

QString Isis::SerialNumber::CreateSerialNumber ( PvlGroup snGroup,
int  keys 
) [static, protected]

Create the SerialNumber string by concatenating the keywords in the label with '/' in between serialNumber groups and the number of observationKeys.

Parameters:
snGroup A PvlGroup containing the keywords to concatenate
keys the number of strings to contatenate

Definition at line 153 of file SerialNumber.cpp.

Referenced by Compose(), and Isis::ObservationNumber::Compose().

PvlGroup Isis::SerialNumber::FindSerialTranslation ( Pvl label  )  [static, private]

Get Groups by translating from correct Translation table.

Parameters:
label A pvl formatted label to be used to generate the serial number

Definition at line 91 of file SerialNumber.cpp.

References Isis::PvlObject::FindGroup(), Isis::PvlContainer::Keywords(), Isis::toString(), and Isis::PvlTranslationManager::Translate().

Referenced by Compose().


The documentation for this class was generated from the following files: