Isis 3 Developer Reference
|
Serial Number list generator. More...
#include <SerialNumberList.h>
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< Pair > | m_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... | |
Serial Number list generator.
Create a list of serial numbers from a list of files
Isis::SerialNumberList::SerialNumberList | ( | bool | checkTarget = true | ) |
Creates an empty SerialNumberList.
checkTarget | Specifies 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.
Isis::SerialNumberList::SerialNumberList | ( | const QString & | listfile, |
bool | checkTarget = true , |
||
Progress * | progress = NULL |
||
) |
Creates a SerialNumberList from a list of filenames.
listfile | The list of files to be given serial numbers |
checkTarget | Specifies whether or not to check to make sure the target names match between files added to the serialnumber list |
progress | Monitors progress of serial number creation |
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.
|
virtual |
Destructor.
void Isis::SerialNumberList::add | ( | const QString & | filename, |
bool | def2filename = false |
||
) |
Adds a new filename / serial number pair to the SerialNumberList.
filename | The filename to be added |
def2filename | If a serial number could not be found, try to return the filename |
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().
void Isis::SerialNumberList::add | ( | const QString & | serialNumber, |
const QString & | filename | ||
) |
Adds a new filename / and pre-composed serial number pair to the SerialNumberList.
serialNumber | the serial number to be added |
filename | the filename to be added |
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." |
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.
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
serialNumber | The serial number to be added |
filename | The filename to be added |
References add(), and serialNumber().
QString Isis::SerialNumberList::fileName | ( | const QString & | sn | ) |
Return a filename given a serial number.
sn | The serial number of the desired filename |
IException::Programmer | "Unable to get the FileName. The given serial number does not exist in the list." |
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().
QString Isis::SerialNumberList::fileName | ( | int | index | ) |
Return the filename at the given index.
index | The index of the desired filename |
IException::Programmer | "Unable to get the FileName. The given index is invalid." |
References _FILEINFO_, m_pairs, Isis::IException::Programmer, and Isis::toString().
int Isis::SerialNumberList::fileNameIndex | ( | const QString & | filename | ) |
Return a list index given a filename.
filename | The filename to be searched for |
IException::Programmer | "Unable to get the FileName index. The given file name does not exist in the list." |
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().
bool Isis::SerialNumberList::hasSerialNumber | ( | QString | sn | ) |
Determines whether or not the requested serial number exists in the list.
sn | The serial number to be checked for |
References m_serialMap.
Referenced by add(), Isis::MatchTool::deletePoint(), fileName(), Isis::ObservationNumberList::remove(), serialNumberIndex(), Isis::ControlNet::SetImages(), and spacecraftInstrumentId().
QString Isis::SerialNumberList::observationNumber | ( | int | index | ) |
Return a observation number given an index.
index | The index of the desired observation number |
IException::Programmer | "Unable to get the ObservationNumber. The given index is invalid." |
References _FILEINFO_, m_pairs, Isis::IException::Programmer, and Isis::toString().
Referenced by add(), and possibleSerialNumbers().
std::vector< QString > Isis::SerialNumberList::possibleSerialNumbers | ( | const QString & | on | ) |
Return possible serial numbers given an observation number.
on | The observation number of the possible serial number |
IException::Programmer | "Unable to get the possible serial numbers. The given observation number does not exist in the list." |
References _FILEINFO_, m_pairs, observationNumber(), Isis::IException::Programmer, and serialNumber().
void Isis::SerialNumberList::remove | ( | const QString & | sn | ) |
Remove the specified serial number from the list.
sn | Name of serial number to remove |
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().
QString Isis::SerialNumberList::serialNumber | ( | const QString & | filename | ) |
Return a serial number given a filename.
filename | The filename to be matched |
IException::Programmer | "Unable to get the SerialNumber. The given file name does not exist in the list." |
References _FILEINFO_, Isis::FileName::expanded(), fileNameIndex(), m_fileMap, m_pairs, and Isis::IException::Programmer.
Referenced by add(), Isis::ControlPointEditWidget::createControlPoint(), Isis::QnetTool::createFixedPoint(), Isis::QnetTool::createPoint(), Isis::ControlNetFilter::CubeConvexHullFilter(), Isis::ControlNetFilter::CubeDistanceFilter(), Isis::ControlNetFilter::CubeNameExpressionFilter(), Isis::ControlNetFilter::CubeNumPointsFilter(), Isis::QnetCubeDistanceFilter::filter(), Isis::QnetPointCubeNameFilter::filter(), Isis::ImageOverlapSet::FindImageOverlaps(), Isis::MatchTool::mouseButtonRelease(), Isis::QnetTool::mouseButtonRelease(), Isis::ObservationNumber::PossibleSerial(), possibleSerialNumbers(), Isis::StereoTool::rubberBandComplete(), Isis::QnetNewMeasureDialog::setFiles(), and Isis::ControlNet::SetImages().
QString Isis::SerialNumberList::serialNumber | ( | int | index | ) |
Return a serial number given an index.
index | The index of the desired serial number |
IException::Programmer | "Unable to get the SerialNumber. The given index is invalid." |
References _FILEINFO_, m_pairs, Isis::IException::Programmer, and Isis::toString().
int Isis::SerialNumberList::serialNumberIndex | ( | const QString & | sn | ) |
Return a list index given a serial number.
sn | The serial number searched for |
IException::Programmer | "Unable to get the SerialNumber index. The given serial number does not exist in the list." |
References _FILEINFO_, hasSerialNumber(), m_serialMap, and Isis::IException::Programmer.
Referenced by add(), Isis::QnetPointDistanceFilter::filter(), Isis::ObservationNumberList::observationNumberMapIndex(), and remove().
int Isis::SerialNumberList::size | ( | ) | const |
How many serial number / filename combos are in the list.
References m_pairs.
Referenced by 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::ImageOverlapSet::FindAllOverlaps(), Isis::ImageOverlapSet::FindImageOverlaps(), Isis::ControlNetStatistics::GenerateControlNetStats(), Isis::BundleAdjust::numberOfImages(), Isis::ObservationNumber::PossibleSerial(), Isis::ControlNetStatistics::PrintImageStats(), Isis::ObservationNumberList::remove(), Isis::QnetNavTool::resetList(), Isis::QnetNewMeasureDialog::setFiles(), Isis::QnetFixedPointDialog::setFiles(), Isis::NewControlPointDialog::setFiles(), Isis::ControlNet::SetImages(), and Isis::ControlNetGraphicsItem::snToFileName().
QString Isis::SerialNumberList::spacecraftInstrumentId | ( | int | index | ) |
Return the spacecraftname/instrumentid at the given index.
index | The index of the desired spacecraftname/instrumentid |
IException::Programmer | "Unable to get the Spacecraft InstrumentId. The given index is invalid." |
References _FILEINFO_, m_pairs, Isis::IException::Programmer, and Isis::toString().
QString Isis::SerialNumberList::spacecraftInstrumentId | ( | const QString & | sn | ) |
Return the spacecraftname/instrumentid given a serial number.
sn | The serial number of the desired spacecraftname/instrumentid |
IException::Programmer | "Unable to get the Spacecraft InstrumentId. The given serial number does not exist in the list." |
References _FILEINFO_, hasSerialNumber(), m_pairs, m_serialMap, and Isis::IException::Programmer.
|
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().
|
protected |
Maps filenames to their positions in the list.
Referenced by add(), fileNameIndex(), Isis::ObservationNumberList::observationNumber(), remove(), and serialNumber().
|
protected |
List of serial number Pair entities.
Referenced by add(), fileName(), Isis::ObservationNumberList::hasObservationNumber(), Isis::ObservationNumberList::observationNumber(), observationNumber(), Isis::ObservationNumberList::possibleFileNames(), possibleSerialNumbers(), remove(), serialNumber(), size(), and spacecraftInstrumentId().
|
protected |
Maps serial numbers to their positions in the list.
Referenced by add(), fileName(), hasSerialNumber(), remove(), serialNumberIndex(), and spacecraftInstrumentId().
|
protected |
Target name that the files must have if m_checkTarget is true.
Referenced by add(), and SerialNumberList().