Isis 3 Developer Reference
Isis::SerialNumberList Class Reference

Serial Number list generator. More...

#include <SerialNumberList.h>

Inheritance diagram for Isis::SerialNumberList:
Inheritance graph
Collaboration diagram for Isis::SerialNumberList:
Collaboration graph

Classes

struct  Pair
 A serial number list entity that contains the filename serial number pair. More...
 

Public Member Functions

 SerialNumberList (bool checkTarget=true)
 Creates an empty SerialNumberList. More...
 
 SerialNumberList (const QString &list, bool checkTarget=true, Progress *progress=NULL)
 Creates a SerialNumberList from a list of filenames. More...
 
virtual ~SerialNumberList ()
 Destructor. More...
 
void add (const QString &filename, bool def2filename=false)
 Adds a new filename / serial number pair to the SerialNumberList. More...
 
void add (const QString &serialNumber, const QString &filename)
 Adds a new filename / and pre-composed serial number pair to the SerialNumberList. More...
 
void add (const char *serialNumber, const char *filename)
 Overloaded add method that takes char * parameters. More...
 
bool hasSerialNumber (QString sn)
 Determines whether or not the requested serial number exists in the list. More...
 
void remove (const QString &sn)
 Remove the specified serial number from the list. More...
 
int size () const
 How many serial number / filename combos are in the list. More...
 
QString fileName (const QString &sn)
 Return a filename given a serial number. More...
 
QString fileName (int index)
 Return the filename at the given index. More...
 
QString serialNumber (const QString &filename)
 Return a serial number given a filename. More...
 
QString serialNumber (int index)
 Return a serial number given an index. More...
 
QString observationNumber (int index)
 Return a observation number given an index. More...
 
QString spacecraftInstrumentId (int index)
 Return the spacecraftname/instrumentid at the given index. More...
 
QString spacecraftInstrumentId (const QString &sn)
 Return the spacecraftname/instrumentid given a serial number. More...
 
int serialNumberIndex (const QString &sn)
 Return a list index given a serial number. More...
 
int fileNameIndex (const QString &filename)
 Return a list index given a filename. More...
 
std::vector< QString > possibleSerialNumbers (const QString &on)
 Return possible serial numbers given an observation number. More...
 

Protected Attributes

std::vector< Pairm_pairs
 List of serial number Pair entities. More...
 
std::map< QString, int > m_serialMap
 Maps serial numbers to their positions in the list. More...
 
std::map< QString, int > m_fileMap
 Maps filenames to their positions in the list. More...
 
bool m_checkTarget
 Specifies whether or not to check to make sure the target names match between files added to the serialnumber list. More...
 
QString m_target
 Target name that the files must have if m_checkTarget is true. More...
 

Detailed Description

Serial Number list generator.

Create a list of serial numbers from a list of files

Author
2005-08-03 Jeff Anderson

Constructor & Destructor Documentation

◆ SerialNumberList() [1/2]

Isis::SerialNumberList::SerialNumberList ( bool  checkTarget = true)

Creates an empty SerialNumberList.

Parameters
checkTargetSpecifies whether or not to check to make sure the target names match between files added to the serialnumber list

References m_checkTarget, and m_target.

◆ SerialNumberList() [2/2]

Isis::SerialNumberList::SerialNumberList ( const QString &  listfile,
bool  checkTarget = true,
Progress progress = NULL 
)

Creates a SerialNumberList from a list of filenames.

Parameters
listfileThe list of files to be given serial numbers
checkTargetSpecifies whether or not to check to make sure the target names match between files added to the serialnumber list
progressMonitors progress of serial number creation
Exceptions
IException::User"Can't open or invalid file list"

References _FILEINFO_, add(), Isis::Progress::CheckStatus(), m_checkTarget, m_target, Isis::Progress::SetMaximumSteps(), Isis::Progress::SetText(), Isis::toString(), and Isis::IException::User.

◆ ~SerialNumberList()

Isis::SerialNumberList::~SerialNumberList ( )
virtual

Destructor.

Member Function Documentation

◆ add() [1/3]

void Isis::SerialNumberList::add ( const QString &  filename,
bool  def2filename = false 
)

Adds a new filename / serial number pair to the SerialNumberList.

Parameters
filenameThe filename to be added
def2filenameIf a serial number could not be found, try to return the filename
Exceptions
IException::User"Unable to find Instrument or Mapping group for comparing target."
IException::User"Unable to find Instrument group for comparing target."
IException::User"Target name from file does not match."
IException::User"Invalid serial number [Unknown] from file."
IException::User"Duplicate serial number from files [file1] and [file2]."
IException::User"FileName cannot be added to serial number list."

References _FILEINFO_, Isis::ObservationNumber::Compose(), Isis::SerialNumber::Compose(), Isis::FileName::expanded(), fileName(), Isis::SerialNumberList::Pair::filename, Isis::PvlObject::findGroup(), Isis::PvlObject::findObject(), Isis::PvlObject::hasGroup(), Isis::PvlContainer::hasKeyword(), hasSerialNumber(), Isis::SerialNumberList::Pair::instrumentId, m_checkTarget, m_fileMap, m_pairs, m_serialMap, m_target, Isis::SerialNumberList::Pair::observationNumber, Isis::SerialNumberList::Pair::serialNumber, serialNumberIndex(), Isis::SerialNumberList::Pair::spacecraftName, and Isis::IException::User.

Referenced by add(), Isis::ControlNetGraphicsItem::buildChildren(), Isis::BundleAdjust::BundleAdjust(), Isis::ShapeList::serialNumberList(), Isis::ImageList::serialNumberList(), and SerialNumberList().

◆ add() [2/3]

void Isis::SerialNumberList::add ( const QString &  serialNumber,
const QString &  filename 
)

Adds a new filename / and pre-composed serial number pair to the SerialNumberList.

Parameters
serialNumberthe serial number to be added
filenamethe filename to be added
Exceptions
IException::User"Unable to find Instrument or Mapping group for comparing target."
IException::User"Target name from file does not match."
IException::User"Invalid serial number [Unknown] from file."
IException::User"Duplicate serial number from files [file1] and [file2]."
IException::User"Unable to find Instrument group need for performing bundle adjustment."
IException::User"Unable to find Spacecraftname or InstrumentId keywords needed for performing bundle adjustment."
IException::User"[SerialNumber, FileName] can not be added to serial number list."
Author
2012-07-12 Tracie Sucharski

References _FILEINFO_, Isis::FileName::expanded(), fileName(), Isis::SerialNumberList::Pair::filename, Isis::PvlObject::findGroup(), Isis::PvlObject::findObject(), Isis::PvlObject::hasGroup(), Isis::PvlContainer::hasKeyword(), hasSerialNumber(), Isis::SerialNumberList::Pair::instrumentId, m_checkTarget, m_fileMap, m_pairs, m_serialMap, m_target, observationNumber(), Isis::SerialNumberList::Pair::observationNumber, serialNumber(), Isis::SerialNumberList::Pair::serialNumber, serialNumberIndex(), Isis::SerialNumberList::Pair::spacecraftName, and Isis::IException::User.

◆ add() [3/3]

void Isis::SerialNumberList::add ( const char *  serialNumber,
const char *  filename 
)

Overloaded add method that takes char * parameters.

Adds a new filename / serial number pair to the SerialNumberList

Parameters
serialNumberThe serial number to be added
filenameThe filename to be added
See also
add(QString, QString)

References add(), and serialNumber().

◆ fileName() [1/2]

QString Isis::SerialNumberList::fileName ( const QString &  sn)

Return a filename given a serial number.

Parameters
snThe serial number of the desired filename
Exceptions
IException::Programmer"Unable to get the FileName. The given serial number does not exist in the list."
Returns
QString The filename matching the input serial number

References _FILEINFO_, hasSerialNumber(), m_pairs, m_serialMap, and Isis::IException::Programmer.

Referenced by add(), Isis::SerialNumber::ComposeObservation(), Isis::ControlPointEditWidget::createControlPoint(), Isis::QnetPointCubeNameFilter::createCubeList(), Isis::QnetTool::createFixedPoint(), Isis::QnetTool::createPoint(), Isis::ControlNetFilter::CubeConvexHullFilter(), Isis::ControlNetFilter::CubeDistanceFilter(), Isis::ControlNetFilter::CubeNameExpressionFilter(), Isis::ControlNetFilter::CubeNumPointsFilter(), Isis::ControlPointEditWidget::deletePoint(), Isis::MatchTool::deletePoint(), Isis::QnetTool::deletePoint(), Isis::QnetCubeNameFilter::filter(), Isis::InterestOperator::FindCnetRef(), Isis::ImageOverlapSet::FindImageOverlaps(), Isis::ControlNetStatistics::GenerateImageStats(), Isis::InterestOperator::InterestByMeasure(), Isis::InterestOperator::InterestByPoint(), Isis::QnetFileTool::loadImage(), Isis::ControlNetFilter::PointCubeNamesFilter(), Isis::ControlNetFilter::PointDistanceFilter(), Isis::ControlNetFilter::PointLatLonFilter(), Isis::ControlNetFilter::PointMeasurePropertiesFilter(), Isis::ControlNetFilter::PrintCubeFileSerialNum(), Isis::ControlNetStatistics::PrintImageStats(), Isis::InterestOperator::ProcessLocked_Point_Reference(), remove(), Isis::QnetNewMeasureDialog::setFiles(), Isis::QnetFixedPointDialog::setFiles(), Isis::NewControlPointDialog::setFiles(), Isis::ControlNet::SetImages(), Isis::ChipViewportsWidget::setPoint(), and Isis::ControlNetGraphicsItem::snToFileName().

◆ fileName() [2/2]

QString Isis::SerialNumberList::fileName ( int  index)

Return the filename at the given index.

Parameters
indexThe index of the desired filename
Exceptions
IException::Programmer"Unable to get the FileName. The given index is invalid."
Returns
QString The filename at the given index

References _FILEINFO_, m_pairs, Isis::IException::Programmer, and Isis::toString().

◆ fileNameIndex()

int Isis::SerialNumberList::fileNameIndex ( const QString &  filename)

Return a list index given a filename.

Parameters
filenameThe filename to be searched for
Exceptions
IException::Programmer"Unable to get the FileName index. The given file name does not exist in the list."
Returns
int The index of the input filename

References _FILEINFO_, Isis::FileName::expanded(), m_fileMap, and Isis::IException::Programmer.

Referenced by Isis::ControlPointEditWidget::createControlPoint(), Isis::QnetTool::createFixedPoint(), Isis::QnetTool::createPoint(), Isis::ObservationNumberList::observationNumber(), and serialNumber().

◆ hasSerialNumber()

bool Isis::SerialNumberList::hasSerialNumber ( QString  sn)

Determines whether or not the requested serial number exists in the list.

Parameters
snThe serial number to be checked for
Returns
bool

References m_serialMap.

Referenced by add(), Isis::MatchTool::deletePoint(), fileName(), Isis::ObservationNumberList::remove(), serialNumberIndex(), Isis::ControlNet::SetImages(), and spacecraftInstrumentId().

◆ observationNumber()

QString Isis::SerialNumberList::observationNumber ( int  index)

Return a observation number given an index.

Parameters
indexThe index of the desired observation number
Exceptions
IException::Programmer"Unable to get the ObservationNumber. The given index is invalid."
Returns
QString The observation number returned

References _FILEINFO_, m_pairs, Isis::IException::Programmer, and Isis::toString().

Referenced by add(), and possibleSerialNumbers().

◆ possibleSerialNumbers()

std::vector< QString > Isis::SerialNumberList::possibleSerialNumbers ( const QString &  on)

Return possible serial numbers given an observation number.

Parameters
onThe observation number of the possible serial number
Exceptions
IException::Programmer"Unable to get the possible serial numbers. The given observation number does not exist in the list."
Returns
vector<QString> The list of possible serial numbers matching the input observation number

References _FILEINFO_, m_pairs, observationNumber(), Isis::IException::Programmer, and serialNumber().

◆ remove()

void Isis::SerialNumberList::remove ( const QString &  sn)

Remove the specified serial number from the list.

Parameters
snName of serial number to remove
Author
2010-09-09 Sharmila Prasad

References fileName(), m_fileMap, m_pairs, m_serialMap, and serialNumberIndex().

Referenced by Isis::ControlNetFilter::CubeConvexHullFilter(), Isis::ControlNetFilter::CubeDistanceFilter(), Isis::ControlNetFilter::CubeNameExpressionFilter(), and Isis::ControlNetFilter::CubeNumPointsFilter().

◆ serialNumber() [1/2]

◆ serialNumber() [2/2]

QString Isis::SerialNumberList::serialNumber ( int  index)

Return a serial number given an index.

Parameters
indexThe index of the desired serial number
Exceptions
IException::Programmer"Unable to get the SerialNumber. The given index is invalid."
Returns
QString The serial number returned

References _FILEINFO_, m_pairs, Isis::IException::Programmer, and Isis::toString().

◆ serialNumberIndex()

int Isis::SerialNumberList::serialNumberIndex ( const QString &  sn)

Return a list index given a serial number.

Parameters
snThe serial number searched for
Exceptions
IException::Programmer"Unable to get the SerialNumber index. The given serial number does not exist in the list."
Returns
int The index of the serial number

References _FILEINFO_, hasSerialNumber(), m_serialMap, and Isis::IException::Programmer.

Referenced by add(), Isis::QnetPointDistanceFilter::filter(), Isis::ObservationNumberList::observationNumberMapIndex(), and remove().

◆ size()

◆ spacecraftInstrumentId() [1/2]

QString Isis::SerialNumberList::spacecraftInstrumentId ( int  index)

Return the spacecraftname/instrumentid at the given index.

Parameters
indexThe index of the desired spacecraftname/instrumentid
Exceptions
IException::Programmer"Unable to get the Spacecraft InstrumentId. The given index is invalid."
Returns
QString The spacecraftname/instrumentid at the given index

References _FILEINFO_, m_pairs, Isis::IException::Programmer, and Isis::toString().

◆ spacecraftInstrumentId() [2/2]

QString Isis::SerialNumberList::spacecraftInstrumentId ( const QString &  sn)

Return the spacecraftname/instrumentid given a serial number.

Parameters
snThe serial number of the desired spacecraftname/instrumentid
Exceptions
IException::Programmer"Unable to get the Spacecraft InstrumentId. The given serial number does not exist in the list."
Returns
QString The spacecraftname/instrumentid matching the input serial number

References _FILEINFO_, hasSerialNumber(), m_pairs, m_serialMap, and Isis::IException::Programmer.

Member Data Documentation

◆ m_checkTarget

bool Isis::SerialNumberList::m_checkTarget
protected

Specifies whether or not to check to make sure the target names match between files added to the serialnumber list.

Referenced by add(), and SerialNumberList().

◆ m_fileMap

std::map<QString, int> Isis::SerialNumberList::m_fileMap
protected

Maps filenames to their positions in the list.

Referenced by add(), fileNameIndex(), Isis::ObservationNumberList::observationNumber(), remove(), and serialNumber().

◆ m_pairs

◆ m_serialMap

std::map<QString, int> Isis::SerialNumberList::m_serialMap
protected

Maps serial numbers to their positions in the list.

Referenced by add(), fileName(), hasSerialNumber(), remove(), serialNumberIndex(), and spacecraftInstrumentId().

◆ m_target

QString Isis::SerialNumberList::m_target
protected

Target name that the files must have if m_checkTarget is true.

Referenced by add(), and SerialNumberList().


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