7#include "TrackingTable.h"
13#include "IException.h"
15#include "SpecialPixel.h"
17#include "TableField.h"
18#include "TableRecord.h"
40 for (
int i=0; i < table.
Records(); i++) {
42 QString nameField = QString(record[
"FileName"]).split(
"/").last();
43 QString extension(
FileName(nameField).extension());
44 int found = nameField.lastIndexOf(extension);
47 nameField.remove(found + 3);
50 QString serialNumber = QString(record[
"SerialNumber"]);
51 m_fileList.append(QPair<FileName, QString>(fileName, serialNumber));
76 if (
m_fileList[i].first.name().length() > fieldLength) {
77 fieldLength =
m_fileList[i].first.name().length();
79 if (
m_fileList[i].second.length() > fieldLength) {
89 dummyRecord += fileNameField;
90 dummyRecord += serialNumberField;
91 dummyRecord += indexField;
92 Table table(trackingTableName, dummyRecord);
99 indexField = (int) (i + VALID_MINUI4);
102 record += fileNameField;
103 record += serialNumberField;
104 record += indexField;
121 if (pixel < VALID_MINUI4) {
122 QString msg =
"Cannot convert pixel [" +
toString(pixel)
123 +
"] to a filename, pixel is below valid minimum ["
128 unsigned int index = pixel - VALID_MINUI4;
129 if (index >= (
unsigned int)
m_fileList.size()) {
130 QString msg =
"Cannot convert pixel [" +
toString(pixel)
131 +
"] to a filename, pixel is above valid maximum ["
152 if (QString::compare(
m_fileList[i].first.toString(), file.name()) == 0) {
153 return i + VALID_MINUI4;
159 m_fileList.append(QPair<FileName, QString>(file, serialNumber));
171 if (pixel < VALID_MINUI4) {
172 QString msg =
"Cannot convert pixel [" +
toString(pixel)
173 +
"] to a serial number, pixel is below valid minimum ["
178 unsigned int index = pixel - VALID_MINUI4;
179 if (index >= (
unsigned int)
m_fileList.size()) {
180 QString msg =
"Cannot convert pixel [" +
toString(pixel)
181 +
"] to a serial number, pixel is above valid maximum ["
209 m_fileList.append(QPair<FileName, QString>(file, serialNumber));
File name manipulation and expansion.
@ Programmer
This error is for when a programmer made an API call that was illegal.
Class for storing an Isis::Table's field information.
@ Integer
The values in the field are 4 byte integers.
@ Text
The values in the field are text strings with 1 byte per character.
Class for storing Table blobs information.
int Records() const
Returns the number of records.
QString pixelToSN(unsigned int pixel)
Returns the serial number that corresponds to a pixel value.
Table toTable()
Constrcts and returns a Table object based on values in m_fileList.
FileName pixelToFileName(unsigned int pixel)
Returns the FileName that corresponds to a pixel value.
TrackingTable()
Default constructor.
~TrackingTable()
Destroys the TrackingTable object.
QList< QPair< FileName, QString > > m_fileList
The list to keep track of images.
int fileNameToIndex(FileName file, QString serialNumber)
Returns the index of the filename/serialnumber combination.
unsigned int fileNameToPixel(FileName file, QString serialNumber)
Returns the pixel value of the filename/serialnumber combination.
This is free and unencumbered software released into the public domain.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Namespace for the standard library.