7#include "ObservationNumber.h"
12#include "PvlToPvlTranslationManager.h"
42 if(!snTemp.isEmpty()) {
73 return Compose(p, def2filename);
85 static QString missionTransFile =
"$ISISROOT/appdata/translations/MissionName2DataDir.trn";
87 missionXlater.SetLabel(label);
88 QString mission = missionXlater.
Translate(
"MissionName");
91 static QString instTransFile =
"$ISISROOT/appdata/translations/Instruments.trn";
93 instrumentXlater.SetLabel(label);
94 QString instrument = instrumentXlater.
Translate(
"InstrumentName");
101 static std::map<QString, std::pair<PvlToPvlTranslationManager, PvlKeyword> > missionTranslators;
102 QString key = mission +
"_" + instrument;
103 std::map<QString, std::pair<PvlToPvlTranslationManager, PvlKeyword> >
::iterator
104 translationIterator = missionTranslators.find(key);
106 if(translationIterator == missionTranslators.end()) {
108 FileName snFile((QString)
"$ISISROOT/appdata/translations/" + mission +
109 instrument +
"SerialNumber.trn");
114 if(translation.
hasKeyword(
"ObservationKeys")) {
115 observationKeys = translation[
"ObservationKeys"];
119 missionTranslators.insert(
120 std::pair<QString, std::pair<PvlToPvlTranslationManager, PvlKeyword> >
124 translationIterator = missionTranslators.find(key);
127 translationIterator->second.first.SetLabel(label);
128 translationIterator->second.first.Auto(outLabel);
132 if(!translationIterator->second.second.name().isEmpty()) {
133 snGroup += translationIterator->second.second;
151 std::vector<QString> sn;
152 for(
int i = 0; i < list.
size(); i++) {
IO Handler for Isis Cubes.
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
File name manipulation and expansion.
QString name() const
Returns the name of the file excluding the path and the attributes in the file name.
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
ObservationNumber()
Create an empty SerialNumber object.
virtual ~ObservationNumber()
Destroy a SerialNumber object.
std::vector< QString > PossibleSerial(const QString &on, SerialNumberList &list)
Creates a vector of plasible SerialNumbers from a string representing the ObservationNumber and a Ser...
static QString Compose(Pvl &label, bool def2filename=false)
Compose a ObservationNumber from a PVL.
static PvlGroup FindObservationTranslation(Pvl &label)
Get Groups by translating from correct Translation table.
QString fileName() const
Returns the filename used to initialise the Pvl object.
int keywords() const
Returns the number of keywords contained in the PvlContainer.
Contains multiple PvlContainers.
Container for cube-like labels.
A single keyword-value pair.
bool hasKeyword(const QString &kname, FindOptions opts) const
See if a keyword is in the current PvlObject, or deeper inside other PvlObjects and Pvlgroups within ...
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Allows applications to translate simple text files.
virtual QString Translate(QString translationGroupName, int findex=0)
Returns a translated value.
static QString CreateSerialNumber(PvlGroup &snGroup, int key)
Create the SerialNumber string by concatenating the keywords in the label with '/' in between serialN...
Serial Number list generator.
QString serialNumber(const QString &filename)
Return a serial number given a filename.
int size() const
How many serial number / filename combos are in the list.
This is free and unencumbered software released into the public domain.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.