summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-10-17 08:04:18 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-10-17 08:04:18 (GMT)
commit80b6a2ad16f3c1067a10a3014d77520d841842da (patch)
treefb522c4f080543d57dd518ca43bc2929620da697
parent96edfa0d780edaa1690c8fdda598fafbd18ae542 (diff)
Always make generated file sequence number last so we can easily parse it and lift artificial limit of 999
-rw-r--r--kstars/ekos/capture/capture.cpp16
-rw-r--r--kstars/indi/indiccd.cpp2
2 files changed, 9 insertions, 9 deletions
diff --git a/kstars/ekos/capture/capture.cpp b/kstars/ekos/capture/capture.cpp
index cab00f8..39d5a9f 100644
--- a/kstars/ekos/capture/capture.cpp
+++ b/kstars/ekos/capture/capture.cpp
@@ -1314,16 +1314,16 @@ void Capture::checkSeqBoundary(const QString &path)
seqFileCount++;
- tempName = tempName.remove(seqPrefix);
-
- if (tempName.startsWith("_"))
- tempName = tempName.remove(0, 1);
+ int lastUnderScoreIndex = tempName.lastIndexOf("_");
+ if (lastUnderScoreIndex > 0)
+ {
+ bool indexOK = false;
- bool indexOK = false;
- newFileIndex = tempName.mid(0, 3).toInt(&indexOK);
+ newFileIndex = tempName.mid(lastUnderScoreIndex+1).toInt(&indexOK);
+ if (indexOK && newFileIndex >= nextSequenceID)
+ nextSequenceID = newFileIndex + 1;
+ }
- if (indexOK && newFileIndex >= nextSequenceID)
- nextSequenceID = newFileIndex + 1;
}
currentCCD->setNextSequenceID(nextSequenceID);
diff --git a/kstars/indi/indiccd.cpp b/kstars/indi/indiccd.cpp
index ed4b25b..92b7bef 100644
--- a/kstars/indi/indiccd.cpp
+++ b/kstars/indi/indiccd.cpp
@@ -1160,7 +1160,7 @@ void CCD::processBLOB(IBLOB* bp)
if (ISOMode == false)
filename += seqPrefix + (seqPrefix.isEmpty() ? "" : "_") + QString("%1.%2").arg(QString().sprintf("%03d", nextSequenceID)).arg(QString(fmt));
else
- filename += seqPrefix + (seqPrefix.isEmpty() ? "" : "_") + QString("%1_%2.%3").arg(QString().sprintf("%03d", nextSequenceID)).arg(ts).arg(QString(fmt));
+ filename += seqPrefix + (seqPrefix.isEmpty() ? "" : "_") + QString("%1_%2.%3").arg(ts).arg(QString().sprintf("%03d", nextSequenceID)).arg(QString(fmt));
QFile fits_temp_file(filename);
if (!fits_temp_file.open(QIODevice::WriteOnly))