Isis 3 Programmer 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
2005-08-03 Jeff Anderson - Original Version
2006-02-10 Jacob Danton - Added SerialNumber function
2006-02-13 Stuart Sides - Added checks to make sure all the serial number items have the same target.
2006-05-31 Tracie Sucharski - Added filename function that uses index instead of serial number.
2006-06-15 Jeff Anderson - Added GetIndex method
2006-06-22 Brendan George - Added functions to get index, modified/added functions to get filename and serial number, and modified so that index corresponds to order files are input.
2006-08-16 Brendan George - Added/fixed error checking in FileNameIndex() and SerialNumber(string filename).
2006-08-18 Brendan George - Modified to use Expanded FileName on input, allowing for filenames that use environment variables
2006-09-13 Steven Koechle - Added method to get the ObservationNumber when you give it an index
2008-01-10 Christopher Austin - Adapted for the new ObservationNumber class.
2008-10-30 Steven Lambright - Fixed problem with definition of struct Pair, pointed out by "novus0x2a" (Support Board Member)
2009-10-20 Jeannie Walldren - Added Progress flag to Constructor
2009-11-05 Jeannie Walldren - Modified number of maximum steps for Progress flag in Constructor
2010-09-09 Sharmila Prasad - Added API to delete serial# off of the list given Serial #
2010-11-24 Tracie Sucharski - Added bool def2filename parameter to the Add method. This will allow level 2 images to be added to a serial number list.
2012-07-12 Tracie Sucharski - Added new method Add, which takes a pre-composed serial number and a filename.
2016-06-02 Ian Humphrey - Removed SpacecraftInstrumentId method prototypes Fixes #3967.
2017-08-09 Adam Goins - Modified code to be consistent with ISIS coding standards Fixes #3991.
Definition at line 80 of file SerialNumberList.h.
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 |
Definition at line 20 of file SerialNumberList.cpp.
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" |
2009-10-20 Jeannie Walldren - Added Progress flag
2009-11-05 Jeannie Walldren - Modified number of maximum steps for Progress flag
Definition at line 40 of file SerialNumberList.cpp.
References _FILEINFO_, add(), Isis::Progress::CheckStatus(), m_checkTarget, m_target, Isis::Progress::SetMaximumSteps(), Isis::Progress::SetText(), Isis::toString(), and Isis::IException::User.
|
virtual |
Destructor.
Definition at line 71 of file SerialNumberList.cpp.
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." |
2007-06-04 Tracie Sucharski - Expand filename to include full path before adding to list.
2010-11-24 Tracie Sucharski - Added bool def2filename parameter. This will allow level 2 images to be added to a serial number list.
2010-11-29 Tracie Sucharski - Only read the Instrument group if m_checkTarget is True. If def2filename is True, check for Mapping group if Target does not exist.
Definition at line 115 of file SerialNumberList.cpp.
References _FILEINFO_, Isis::ObservationNumber::Compose(), Isis::SerialNumber::Compose(), Isis::FileName::expanded(), fileName(), Isis::PvlObject::findGroup(), Isis::PvlObject::findObject(), Isis::PvlObject::hasGroup(), Isis::PvlContainer::hasKeyword(), 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::QnetTool::openGround(), Isis::ShapeList::serialNumberList(), Isis::ImageList::serialNumberList(), SerialNumberList(), Isis::MatchTool::serialNumberList(), Isis::StereoTool::setFiles(), and Isis::ControlPointEditWidget::setGroundSourceInfo().
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." |
Definition at line 235 of file SerialNumberList.cpp.
References _FILEINFO_, Isis::FileName::expanded(), fileName(), Isis::PvlObject::findGroup(), Isis::PvlObject::findObject(), Isis::PvlObject::hasGroup(), Isis::PvlContainer::hasKeyword(), hasSerialNumber(), m_checkTarget, m_fileMap, m_pairs, m_serialMap, m_target, observationNumber(), serialNumber(), serialNumberIndex(), 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 |
Definition at line 211 of file SerialNumberList.cpp.
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." |
Definition at line 360 of file SerialNumberList.cpp.
References _FILEINFO_, hasSerialNumber(), m_pairs, m_serialMap, and Isis::IException::Programmer.
Referenced by add(), Isis::QnetTool::addMeasure(), Isis::ControlPointEditWidget::checkReference(), Isis::QnetTool::checkReference(), 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::ImageOverlapSet::HandleError(), Isis::InterestOperator::InterestByMeasure(), Isis::InterestOperator::InterestByPoint(), Isis::ControlPointEditWidget::loadGroundMeasure(), Isis::QnetTool::loadGroundMeasure(), Isis::QnetFileTool::loadImage(), Isis::MatchTool::loadMeasureTable(), Isis::QnetTool::loadMeasureTable(), Isis::ControlPointEditWidget::loadPoint(), Isis::MatchTool::loadPoint(), Isis::QnetTool::loadPoint(), Isis::ControlPointEditWidget::openReferenceRadius(), Isis::QnetTool::openReferenceRadius(), 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::ControlPointEditWidget::selectLeftMeasure(), Isis::MatchTool::selectLeftMeasure(), Isis::ControlPointEditWidget::selectRightMeasure(), Isis::MatchTool::selectRightMeasure(), Isis::MatchTool::serialNumberList(), Isis::QnetNewMeasureDialog::setFiles(), Isis::QnetFixedPointDialog::setFiles(), Isis::NewControlPointDialog::setFiles(), Isis::ControlNet::SetImages(), and Isis::ControlPointEditWidget::validateMeasureChange().
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." |
Definition at line 498 of file SerialNumberList.cpp.
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." |
2007-06-04 Tracie Sucharski - Expand filename to include full path before searching list.
2007-07-11 Stuart Sides - Fixed bug where the correct index was not returned.
Definition at line 478 of file SerialNumberList.cpp.
References _FILEINFO_, Isis::FileName::expanded(), m_fileMap, and Isis::IException::Programmer.
Referenced by Isis::QnetTool::addMeasure(), 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 |
Definition at line 334 of file SerialNumberList.cpp.
References m_serialMap.
Referenced by add(), Isis::MatchTool::deletePoint(), Isis::QnetTool::drawAllMeasurments(), fileName(), Isis::QnetTool::openGround(), Isis::ObservationNumberList::remove(), serialNumberIndex(), Isis::MatchTool::serialNumberList(), Isis::StereoTool::setFiles(), 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." |
Definition at line 429 of file SerialNumberList.cpp.
References _FILEINFO_, m_pairs, Isis::IException::Programmer, and Isis::toString().
Referenced by add(), Isis::ObservationNumberList::init(), 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." |
Definition at line 574 of file SerialNumberList.cpp.
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 |
Definition at line 82 of file SerialNumberList.cpp.
References fileName(), m_fileMap, m_pairs, m_serialMap, and serialNumberIndex().
Referenced by Isis::ControlPointEditWidget::clearGroundSource(), Isis::ControlNetFilter::CubeConvexHullFilter(), Isis::ControlNetFilter::CubeDistanceFilter(), Isis::ControlNetFilter::CubeNameExpressionFilter(), Isis::ControlNetFilter::CubeNumPointsFilter(), and Isis::MatchTool::serialNumberList().
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." |
Definition at line 387 of file SerialNumberList.cpp.
References _FILEINFO_, Isis::FileName::expanded(), fileNameIndex(), m_fileMap, m_pairs, and Isis::IException::Programmer.
Referenced by add(), Isis::QnetTool::addMeasure(), Isis::ControlMeasureEditWidget::blinkStartRight(), 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::ControlNetStatistics::InitSerialNumMap(), Isis::MatchTool::mouseButtonRelease(), Isis::QnetTool::mouseButtonRelease(), Isis::ObservationNumber::PossibleSerial(), possibleSerialNumbers(), Isis::ControlPointEditWidget::selectLeftMeasure(), Isis::MatchTool::selectLeftMeasure(), Isis::QnetTool::selectLeftMeasure(), Isis::ControlPointEditWidget::selectRightMeasure(), Isis::MatchTool::selectRightMeasure(), Isis::QnetTool::selectRightMeasure(), 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." |
Definition at line 407 of file SerialNumberList.cpp.
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." |
Definition at line 451 of file SerialNumberList.cpp.
References _FILEINFO_, hasSerialNumber(), m_serialMap, and Isis::IException::Programmer.
Referenced by add(), Isis::QnetTool::addMeasure(), Isis::ControlPointEditWidget::createTemporaryGroundMeasure(), Isis::QnetSetAprioriDialog::fillReferenceAprioriLineEdits(), Isis::QnetPointDistanceFilter::filter(), Isis::QnetTool::findPointLocation(), Isis::ObservationNumberList::observationNumberMapIndex(), remove(), and Isis::ControlPointEditWidget::setShapesForPoint().
int Isis::SerialNumberList::size | ( | ) | const |
How many serial number / filename combos are in the list.
Definition at line 345 of file SerialNumberList.cpp.
References m_pairs.
Referenced by Isis::QnetTool::addMeasure(), 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::QnetNavTool::filterList(), Isis::ImageOverlapSet::FindAllOverlaps(), Isis::ImageOverlapSet::FindImageOverlaps(), Isis::ControlNetStatistics::GenerateControlNetStats(), Isis::ObservationNumberList::init(), Isis::ControlNetStatistics::InitSerialNumMap(), Isis::BundleAdjust::numberOfImages(), Isis::ObservationNumber::PossibleSerial(), Isis::ControlNetStatistics::PrintImageStats(), Isis::ObservationNumberList::remove(), Isis::QnetNavTool::resetList(), Isis::QnetNewMeasureDialog::setFiles(), Isis::QnetFixedPointDialog::setFiles(), Isis::NewControlPointDialog::setFiles(), and Isis::ControlNet::SetImages().
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." |
Definition at line 520 of file SerialNumberList.cpp.
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." |
Definition at line 546 of file SerialNumberList.cpp.
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.
Definition at line 128 of file SerialNumberList.h.
Referenced by add(), and SerialNumberList().
|
protected |
Maps filenames to their positions in the list.
Definition at line 122 of file SerialNumberList.h.
Referenced by add(), fileNameIndex(), Isis::ObservationNumberList::observationNumber(), remove(), and serialNumber().
|
protected |
List of serial number Pair entities.
Definition at line 120 of file SerialNumberList.h.
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.
Definition at line 121 of file SerialNumberList.h.
Referenced by add(), fileName(), hasSerialNumber(), remove(), serialNumberIndex(), and spacecraftInstrumentId().
|
protected |
Target name that the files must have if m_checkTarget is true.
Definition at line 129 of file SerialNumberList.h.
Referenced by add(), and SerialNumberList().