Isis 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. | |
SerialNumberList (const QString &list, bool checkTarget=true, Progress *progress=NULL) | |
Creates a SerialNumberList from a list of filenames. | |
virtual | ~SerialNumberList () |
Destructor. | |
void | add (const QString &filename, bool def2filename=false) |
Adds a new filename / serial number pair to the SerialNumberList. | |
void | add (const QString &serialNumber, const QString &filename) |
Adds a new filename / and pre-composed serial number pair to the SerialNumberList. | |
void | add (const char *serialNumber, const char *filename) |
Overloaded add method that takes char * parameters. | |
bool | hasSerialNumber (QString sn) |
Determines whether or not the requested serial number exists in the list. | |
void | remove (const QString &sn) |
Remove the specified serial number from the list. | |
int | size () const |
How many serial number / filename combos are in the list. | |
QString | fileName (const QString &sn) |
Return a filename given a serial number. | |
QString | fileName (int index) |
Return the filename at the given index. | |
QString | serialNumber (const QString &filename) |
Return a serial number given a filename. | |
QString | serialNumber (int index) |
Return a serial number given an index. | |
QString | observationNumber (int index) |
Return a observation number given an index. | |
QString | spacecraftInstrumentId (int index) |
Return the spacecraftname/instrumentid at the given index. | |
QString | spacecraftInstrumentId (const QString &sn) |
Return the spacecraftname/instrumentid given a serial number. | |
int | serialNumberIndex (const QString &sn) |
Return a list index given a serial number. | |
int | fileNameIndex (const QString &filename) |
Return a list index given a filename. | |
std::vector< QString > | possibleSerialNumbers (const QString &on) |
Return possible serial numbers given an observation number. | |
Protected Attributes | |
std::vector< Pair > | m_pairs |
List of serial number Pair entities. | |
std::map< QString, int > | m_serialMap |
Maps serial numbers to their positions in the list. | |
std::map< QString, int > | m_fileMap |
Maps filenames to their positions in the list. | |
bool | m_checkTarget |
Specifies whether or not to check to make sure the target names match between files added to the serialnumber list. | |
QString | m_target |
Target name that the files must have if m_checkTarget is true | |
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 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().
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::findObject(), hasSerialNumber(), m_checkTarget, m_fileMap, m_pairs, m_serialMap, m_target, serialNumberIndex(), and Isis::IException::User.
Referenced by add(), Isis::ControlNetGraphicsItem::buildChildren(), Isis::BundleAdjust::BundleAdjust(), Isis::ImageList::serialNumberList(), Isis::ShapeList::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::findObject(), hasSerialNumber(), m_checkTarget, m_fileMap, m_pairs, m_serialMap, m_target, observationNumber(), serialNumber(), serialNumberIndex(), and Isis::IException::User.
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(), add(), Isis::SerialNumber::ComposeObservation(), Isis::ControlPointEditWidget::createControlPoint(), 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::BundleAdjust::fileName(), Isis::QnetCubeNameFilter::filter(), Isis::InterestOperator::FindCnetRef(), Isis::InterestOperator::FindOverlapByImageFootPrint(), Isis::ControlNetStatistics::GenerateImageStats(), Isis::BundleAdjust::imageLists(), 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::NewControlPointDialog::setFiles(), Isis::QnetFixedPointDialog::setFiles(), Isis::LidarData::SetImages(), 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(), add(), fileName(), serialNumberIndex(), Isis::LidarData::SetImages(), 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(), 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::MatchTool::mouseButtonRelease(), Isis::QnetTool::mouseButtonRelease(), Isis::ObservationNumber::PossibleSerial(), possibleSerialNumbers(), Isis::StereoTool::rubberBandComplete(), Isis::QnetNewMeasureDialog::setFiles(), Isis::LidarData::SetImages(), 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(), 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::QnetTool::createFixedPoint(), Isis::QnetTool::createPoint(), Isis::ControlNetFilter::CubeConvexHullFilter(), Isis::ControlNetFilter::CubeDistanceFilter(), Isis::ControlNetFilter::CubeNameExpressionFilter(), Isis::ControlNetFilter::CubeNumPointsFilter(), Isis::ControlNetStatistics::GenerateControlNetStats(), Isis::BundleAdjust::imageLists(), Isis::BundleAdjust::numberOfImages(), Isis::ObservationNumber::PossibleSerial(), Isis::ControlNetStatistics::PrintImageStats(), Isis::ObservationNumberList::remove(), Isis::QnetNavTool::resetList(), Isis::NewControlPointDialog::setFiles(), Isis::LidarData::SetImages(), Isis::ControlNet::SetImages(), and Isis::ControlNetGraphicsItem::snToFileName().
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.
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().
|
protected |
Specifies whether or not to check to make sure the target names match between files added to the serialnumber list.
Referenced by add(), add(), SerialNumberList(), and SerialNumberList().
|
protected |
Maps filenames to their positions in the list.
Referenced by add(), add(), fileNameIndex(), Isis::ObservationNumberList::observationNumber(), remove(), and serialNumber().
|
protected |
List of serial number Pair entities.
Referenced by add(), add(), fileName(), fileName(), Isis::ObservationNumberList::hasObservationNumber(), Isis::ObservationNumberList::observationNumber(), Isis::ObservationNumberList::observationNumber(), observationNumber(), Isis::ObservationNumberList::possibleFileNames(), possibleSerialNumbers(), remove(), serialNumber(), serialNumber(), size(), spacecraftInstrumentId(), and spacecraftInstrumentId().
|
protected |
Maps serial numbers to their positions in the list.
Referenced by add(), add(), fileName(), hasSerialNumber(), remove(), serialNumberIndex(), and spacecraftInstrumentId().
|
protected |
Target name that the files must have if m_checkTarget is true
Referenced by add(), add(), SerialNumberList(), and SerialNumberList().