Isis 3 Programmer Reference
Isis::ObservationNumber Class Reference

Serial Number composer. More...

#include <ObservationNumber.h>

Inheritance diagram for Isis::ObservationNumber:
Inheritance graph
Collaboration diagram for Isis::ObservationNumber:
Collaboration graph

Public Member Functions

 ObservationNumber ()
 Create an empty SerialNumber object. More...
 
virtual ~ObservationNumber ()
 Destroy a SerialNumber object. More...
 
std::vector< QString > PossibleSerial (const QString &on, SerialNumberList &list)
 Creates a vector of plasible SerialNumbers from a string representing the ObservationNumber and a SerialList. More...
 

Static Public Member Functions

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

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. More...
 

Static Private Member Functions

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

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
2008-??-?? Christopher Austin
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:
2008-01-08 Christpher Austin - Original Version, a derivative of the previous SerialNumber class
History:
2008-05-09 Steven Lambright - Optimized the FindObservationTranslation method

Definition at line 60 of file ObservationNumber.h.

Constructor & Destructor Documentation

◆ ObservationNumber()

Isis::ObservationNumber::ObservationNumber ( )

Create an empty SerialNumber object.

Definition at line 13 of file ObservationNumber.cpp.

◆ ~ObservationNumber()

Isis::ObservationNumber::~ObservationNumber ( )
virtual

Destroy a SerialNumber object.

Definition at line 18 of file ObservationNumber.cpp.

Member Function Documentation

◆ Compose() [1/3]

QString Isis::ObservationNumber::Compose ( Pvl label,
bool  def2filename = false 
)
static

Compose a ObservationNumber from a PVL.

Parameters
labelA pvl formatted label to be used to generate the serial number

Definition at line 25 of file ObservationNumber.cpp.

References Isis::SerialNumber::CreateSerialNumber(), Isis::PvlContainer::fileName(), FindObservationTranslation(), and Isis::FileName::name().

Referenced by Isis::SerialNumberList::add(), Compose(), Isis::SerialNumber::ComposeObservation(), and Isis::Image::observationNumber().

◆ Compose() [2/3]

QString Isis::ObservationNumber::Compose ( Cube cube,
bool  def2filename = false 
)
static

Compose a SerialNumber fPvlGroup snGrouprom a Cube.

Parameters
cubeAn opened Isis cube

Definition at line 56 of file ObservationNumber.cpp.

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

◆ Compose() [3/3]

QString Isis::ObservationNumber::Compose ( const QString &  filename,
bool  def2filename = false 
)
static

Compose a SerialNumber from a file.

Parameters
filenamea filename to open

Definition at line 65 of file ObservationNumber.cpp.

References Compose().

◆ ComposeObservation()

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

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

Parameters
snthe string representing the SerialNumber
listthe SerialNumberList
def2filenameIf 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().

◆ CreateSerialNumber()

QString Isis::SerialNumber::CreateSerialNumber ( PvlGroup snGroup,
int  keys 
)
staticprotectedinherited

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

Parameters
snGroupA PvlGroup containing the keywords to concatenate
keysthe number of strings to contatenate

Definition at line 153 of file SerialNumber.cpp.

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

◆ FindObservationTranslation()

PvlGroup Isis::ObservationNumber::FindObservationTranslation ( Pvl label)
staticprivate

Get Groups by translating from correct Translation table.

Parameters
labelA pvl formatted label to be used to generate the serial number

Definition at line 75 of file ObservationNumber.cpp.

References Isis::FileName::expanded(), Isis::PvlObject::findGroup(), Isis::FileName::highestVersion(), Isis::PvlContainer::keywords(), Isis::toString(), and Isis::PvlToPvlTranslationManager::Translate().

Referenced by Compose().

◆ PossibleSerial()

std::vector< QString > Isis::ObservationNumber::PossibleSerial ( const QString &  on,
SerialNumberList list 
)

Creates a vector of plasible SerialNumbers from a string representing the ObservationNumber and a SerialList.

Parameters
onthe string representing the ObservationNumber
listthe SerialNumberList

Definition at line 146 of file ObservationNumber.cpp.

References Isis::SerialNumberList::serialNumber(), and Isis::SerialNumberList::size().


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