Commit 0d395c11 authored by Jasem Mutlaq's avatar Jasem Mutlaq

Add DSLR settings dialog to let user edit missing info for new setups

parent 27de2d8c
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22">
<defs id="defs3051">
<style type="text/css" id="current-color-scheme">
.ColorScheme-Text {
color:#f2f2f2;
}
</style>
</defs>
<path
style="fill:currentColor;fill-opacity:1;stroke:none"
d="M 16 4 L 16 5 L 2 5 L 2 18 L 20 18 L 20 5 L 19 5 L 19 4 L 16 4 z M 3 6 L 19 6 L 19 17 L 3 17 L 3 6 z M 8.5 7 A 4.5 4.5 0 0 0 4 11.5 A 4.5 4.5 0 0 0 8.5 16 A 4.5 4.5 0 0 0 13 11.5 A 4.5 4.5 0 0 0 8.5 7 z M 8.5 8 A 3.5 3.5 0 0 1 12 11.5 A 3.5 3.5 0 0 1 8.5 15 A 3.5 3.5 0 0 1 5 11.5 A 3.5 3.5 0 0 1 8.5 8 z "
id="rect4211"
class="ColorScheme-Text"
/>
</svg>
......@@ -28,6 +28,7 @@
#include "capture.h"
#include "sequencejob.h"
#include "dslrinfodialog.h"
#include "indi/driverinfo.h"
#include "indi/indifilter.h"
......@@ -608,16 +609,25 @@ void Capture::checkCCD(int ccdNum)
ISOCombo->addItems(isoList);
ISOCombo->setCurrentIndex(targetChip->getISOIndex());
if (currentCCD->getTransferFormat() == ISD::CCD::FORMAT_FITS)
appendLogText(i18n("Using FITS transfer format from DSLR camera. Configure DSLR transfer format in options."));
else
appendLogText(i18n("Using native transfer format from DSLR camera. Configure DSLR transfer format in options."));
int currentDSLRTransferOption = Options::dSLRFormatFITS() ? ISD::CCD::FORMAT_FITS : ISD::CCD::FORMAT_NATIVE;
if (currentDSLRTransferOption != lastDSLRTransforFormat)
{
if (currentDSLRTransferOption == ISD::CCD::FORMAT_FITS)
appendLogText(i18n("Using FITS transfer format from DSLR camera. Configure DSLR transfer format in options."));
else
appendLogText(i18n("Using native transfer format from DSLR camera. Configure DSLR transfer format in options."));
lastDSLRTransforFormat = currentDSLRTransferOption;
}
double pixelX=0, pixelY=0;
bool rc = targetChip->getPixelSize(pixelX, pixelY);
if (rc == false || pixelX == 0 || pixelY == 0)
{
appendLogText(i18n("DSLR CCD Information is incomplete. Please update CCD Information in Image Info section in the INDI Control Panel."));
DSLRInfo infoDialog(this, currentCCD);
infoDialog.exec();
//appendLogText(i18n("DSLR CCD Information is incomplete. Please update CCD Information in Image Info section in the INDI Control Panel."));
}
}
......
......@@ -597,6 +597,8 @@ private:
int16_t lastFilterOffset=0;
QList<OAL::Filter *> m_filterList;
int lastDSLRTransforFormat=-1;
};
}
......
/* DSLR Info Dialog
Copyright (C) 2017 Jasem Mutlaq (mutlaqja@ikarustech.com)
This application is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
*/
#include <KMessageBox>
#include <KLocalizedString>
#include "dslrinfodialog.h"
#include "Options.h"
DSLRInfo::DSLRInfo(QWidget *parent, ISD::CCD *ccd) : QDialog(parent)
{
setupUi(this);
currentCCD = ccd;
connect(buttonBox, SIGNAL(accepted()), this, SLOT(save()));
DSLRIcon->setPixmap(QIcon::fromTheme("camera-photo", QIcon(":/icons/breeze/default/camera-photo.svg")).pixmap(48,48));
}
void DSLRInfo::save()
{
int w = maxWidth->value();
int h = maxHeight->value();
double x = pixelX->value();
double y = pixelY->value();
if (w == 0 || h == 0 || x == 0 || y == 0)
{
KMessageBox::error(0, i18n("Invalid values. Please set all values."));
return;
}
ISD::CCDChip *primaryChip = currentCCD->getChip(ISD::CCDChip::PRIMARY_CCD);
primaryChip->setImageInfo(w, h, x, y, 8);
currentCCD->setConfig(SAVE_CONFIG);
}
/* DSLR Info Dialog
Copyright (C) 2017 Jasem Mutlaq (mutlaqja@ikarustech.com)
This application is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
*/
#ifndef DSLRINFODIALOG_H
#define DSLRINFODIALOG_H
#include <QDialog>
#include <indidevapi.h>
#include "ui_dslrinfo.h"
#include "indi/indiccd.h"
class DSLRInfo : public QDialog, public Ui::DSLRInfo
{
Q_OBJECT
public:
explicit DSLRInfo(QWidget *parent, ISD::CCD *ccd);
protected slots:
void save();
private:
ISD::CCD *currentCCD=NULL;
};
#endif
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