Commit 2b48cfda authored by Jasem Mutlaq's avatar Jasem Mutlaq

Keep track of target transfer format when changing CCDs

parent 07f1579e
......@@ -597,6 +597,7 @@ void Capture::checkCCD(int ccdNum)
QStringList isoList = targetChip->getISOList();
ISOCombo->clear();
transferFormatCombo->disconnect();
transferFormatCombo->clear();
if (isoList.isEmpty())
......@@ -616,6 +617,12 @@ void Capture::checkCCD(int ccdNum)
// DSLRs have two transfer formats
transferFormatCombo->addItem(i18n("FITS"));
transferFormatCombo->addItem(i18n("Native"));
transferFormatCombo->setCurrentIndex(currentCCD->getTargetTransferFormat());
// Keep track of TARGET transfer format when changing CCDs (FITS or NATIVE). Actual format is not changed until capture
connect(transferFormatCombo, static_cast<void (QComboBox::*) (int)>(&QComboBox::activated), this, [&](int index)
{
currentCCD->setTransformFormat(static_cast<ISD::CCD::TransferFormat>(index));
});
double pixelX=0, pixelY=0;
bool rc = targetChip->getPixelSize(pixelX, pixelY);
......
......@@ -857,7 +857,7 @@ CCD::CCD(GDInterface *iPtr) : DeviceDecorator(iPtr)
normalTabID = calibrationTabID = focusTabID = guideTabID = alignTabID = -1;
guideChip = NULL;
transferFormat = FORMAT_FITS;
transferFormat = targetTransferFormat = FORMAT_FITS;
}
CCD::~CCD()
......@@ -1756,6 +1756,16 @@ void CCD::addFITSKeywords(QString filename)
#endif
}
TransferFormat CCD::getTargetTransferFormat() const
{
return targetTransferFormat;
}
void CCD::setTargetTransferFormat(const TransferFormat &value)
{
targetTransferFormat = value;
}
void CCD::FITSViewerDestroyed()
{
fv = NULL;
......
......@@ -203,6 +203,9 @@ public:
CCDChip * getChip(CCDChip::ChipType cType);
void setFITSDir(const QString &dir) { fitsDir = dir;}
TransferFormat getTargetTransferFormat() const;
void setTargetTransferFormat(const TransferFormat &value);
public slots:
void FITSViewerDestroyed();
void StreamWindowHidden();
......@@ -236,7 +239,7 @@ private:
ISD::ST4 *ST4Driver;
int normalTabID, calibrationTabID, focusTabID, guideTabID, alignTabID;
CCDChip *primaryChip, *guideChip;
TransferFormat transferFormat;
TransferFormat transferFormat, targetTransferFormat;
TelescopeType telescopeType = TELESCOPE_PRIMARY;
QPointer<FITSViewer> fv;
......
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