|
Isis 3 Programmer Reference
|
9 #include "SerialNumber.h"
10 #include "ObservationNumber.h"
11 #include "SerialNumberList.h"
12 #include "IException.h"
16 #include "PvlToPvlTranslationManager.h"
50 if(!snTemp.isEmpty()) {
88 return Compose(p, def2filename);
101 if(label.
findObject(
"IsisCube").hasGroup(
"CsmInfo")) {
102 static QString csmTransFile =
"$ISISROOT/appdata/translations/CsmSerialNumber.trn";
104 csmTranslator.
Auto(outLabel);
108 static QString missionTransFile =
"$ISISROOT/appdata/translations/MissionName2DataDir.trn";
110 missionXlater.SetLabel(label);
111 QString mission = missionXlater.
Translate(
"MissionName");
114 static QString instTransFile =
"$ISISROOT/appdata/translations/Instruments.trn";
116 instrumentXlater.SetLabel(label);
117 QString instrument = instrumentXlater.
Translate(
"InstrumentName");
126 static std::map<QString, PvlToPvlTranslationManager> missionTranslators;
129 QString key = mission +
"_" + instrument;
132 std::map<QString, PvlToPvlTranslationManager>::iterator translationIterator = missionTranslators.find(key);
135 if(translationIterator == missionTranslators.end()) {
138 FileName snFile((QString)
"$ISISROOT/appdata/translations/" + mission + instrument +
"SerialNumber.trn");
141 missionTranslators.insert(
145 translationIterator = missionTranslators.find(key);
147 translationIterator->second.SetLabel(label);
148 translationIterator->second.Auto(outLabel);
165 QString sn = snGroup[
"Keyword1"][0];
166 for(
int i = 2; i <= keys; i++) {
167 QString keyword = QString(
"Keyword%1").arg(i);
168 sn +=
"/" + snGroup[keyword][0];
186 QString filename = list.
fileName(sn);
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
A single keyword-value pair.
QString name() const
Returns the name of the file excluding the path and the attributes in the file name.
File name manipulation and expansion.
virtual QString Translate(QString translationGroupName, int findex=0)
Returns a translated value.
virtual ~SerialNumber()
Destroy a SerialNumber object.
static QString Compose(Pvl &label, bool def2filename=false)
Compose a SerialNumber from a PVL.
Container for cube-like labels.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Serial Number list generator.
Allows applications to translate simple text files.
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
Contains multiple PvlContainers.
SerialNumber()
Create an empty SerialNumber object.
PvlObjectIterator findObject(const QString &name, PvlObjectIterator beg, PvlObjectIterator end)
Find the index of object with a specified name, between two indexes.
static QString ComposeObservation(const QString &sn, SerialNumberList &list, bool def2filename=false)
Creates the ObservationNumber from a string representing the SerialNumber and a SerialList.
QString fileName() const
Returns the filename used to initialise the Pvl object.
static QString Compose(Pvl &label, bool def2filename=false)
Compose a ObservationNumber from a PVL.
IO Handler for Isis Cubes.
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
int keywords() const
Returns the number of keywords contained in the PvlContainer.
QString fileName(const QString &sn)
Return a filename given a serial number.
static QString CreateSerialNumber(PvlGroup &snGroup, int key)
Create the SerialNumber string by concatenating the keywords in the label with '/' in between serialN...
void Auto(Pvl &outputLabel)
Automatically translate all the output names found in the translation table If a output name does not...
This is free and unencumbered software released into the public domain.
static PvlGroup FindSerialTranslation(Pvl &label)
Get Groups by translating from correct Translation table.