Commit 5f14516d authored by Jasem Mutlaq's avatar Jasem Mutlaq
Browse files

Only use frameType no need for frameName unless we are saving it

parent 3cc402b4
......@@ -1564,7 +1564,7 @@ void Capture::addJob(bool preview)
constructPrefix(imagePrefix);
job->setPrefixSettings(prefixIN->text(), filterCheck->isChecked(), expDurationCheck->isChecked(), ISOCheck->isChecked());
job->setFrameType(frameTypeCombo->currentIndex(), frameTypeCombo->currentText());
job->setFrameType(static_cast<CCDFrameType>(frameTypeCombo->currentIndex()));
job->setFullPrefix(imagePrefix);
if (filterSlot != NULL && currentFilter != NULL)
......@@ -2576,6 +2576,7 @@ bool Capture::saveSequenceQueue(const QString &path)
QFile file;
QString rawPrefix;
bool filterEnabled, expEnabled, tsEnabled;
const QMap<QString,CCDFrameType> frameTypes = { {"Light" , FRAME_LIGHT}, {"Dark", FRAME_DARK}, {"Bias", FRAME_BIAS}, {"Flat", FRAME_FLAT}};
file.setFileName(path);
......@@ -2615,7 +2616,7 @@ bool Capture::saveSequenceQueue(const QString &path)
if (job->getTargetFilter() >= 0)
//outstream << "<Filter>" << job->getTargetFilter() << "</Filter>" << endl;
outstream << "<Filter>" << job->getFilterName() << "</Filter>" << endl;
outstream << "<Type>" << frameTypeCombo->itemText(job->getFrameType()) << "</Type>" << endl;
outstream << "<Type>" << frameTypes.key(job->getFrameType()) << "</Type>" << endl;
outstream << "<Prefix>" << endl;
//outstream << "<CompletePrefix>" << job->getPrefix() << "</CompletePrefix>" << endl;
outstream << "<RawPrefix>" << rawPrefix << "</RawPrefix>" << endl;
......
......@@ -34,7 +34,8 @@ SequenceJob::SequenceJob()
{
statusStrings = QStringList() << i18n("Idle") << i18n("In Progress") << i18n("Error") << i18n("Aborted") << i18n("Complete");
status = JOB_IDLE;
exposure=count=delay=frameType=targetFilter=isoIndex=-1;
exposure=count=delay=targetFilter=isoIndex=-1;
frameType=FRAME_LIGHT;
currentTemperature=targetTemperature=INVALID_TEMPERATURE;
captureFilter=FITS_NONE;
preview=false;
......@@ -193,7 +194,7 @@ SequenceJob::CAPTUREResult SequenceJob::capture(bool noCaptureFilter)
return CAPTURE_BIN_ERROR;
}
activeChip->setFrameType(frameTypeName);
activeChip->setFrameType(frameType);
activeChip->setCaptureMode(FITS_NORMAL);
if (noCaptureFilter)
......@@ -224,10 +225,9 @@ void SequenceJob::setTargetFilter(int pos, const QString & name)
filter = name;
}
void SequenceJob::setFrameType(int type, const QString & name)
void SequenceJob::setFrameType(CCDFrameType type)
{
frameType = type;
frameTypeName = name;
}
double SequenceJob::getExposeLeft() const
......
......@@ -70,8 +70,8 @@ class SequenceJob : public QObject
const QString &getFilterName() { return filter; }
void setFrameType(int type, const QString & name);
int getFrameType() { return frameType;}
void setFrameType(CCDFrameType type);
CCDFrameType getFrameType() { return frameType;}
void setCaptureFilter(FITSScale capFilter) { captureFilter = capFilter; }
FITSScale getCaptureFilter() { return captureFilter;}
......@@ -166,8 +166,7 @@ private:
ISD::GDInterface *activeFilter;
double exposure;
int frameType;
QString frameTypeName;
CCDFrameType frameType;
int targetFilter;
int currentFilter;
......
......@@ -4879,7 +4879,7 @@ SequenceJob * Scheduler::processJobInfo(XMLEle *root, SchedulerJob *schedJob)
XMLEle *ep;
XMLEle *subEP;
const QMap<QString,int> frameTypes = { {"Light" , FRAME_LIGHT}, {"Dark", FRAME_DARK}, {"Bias", FRAME_BIAS}, {"Flat", FRAME_FLAT}};
const QMap<QString,CCDFrameType> frameTypes = { {"Light" , FRAME_LIGHT}, {"Dark", FRAME_DARK}, {"Bias", FRAME_BIAS}, {"Flat", FRAME_FLAT}};
SequenceJob *job = new SequenceJob();
QString rawPrefix, frameType, filterType;
......@@ -4900,7 +4900,7 @@ SequenceJob * Scheduler::processJobInfo(XMLEle *root, SchedulerJob *schedJob)
else if (!strcmp(tagXMLEle(ep), "Type"))
{
frameType = QString(pcdataXMLEle(ep));
job->setFrameType(frameTypes[frameType], frameType);
job->setFrameType(frameTypes[frameType]);
}
else if (!strcmp(tagXMLEle(ep), "Prefix"))
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment