Kstars

fileutilitycameradata.cpp
1/*
2 SPDX-FileCopyrightText: 2023 Joseph McGee <joseph.mcgee@sbcglobal.net>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#include <stdio.h>
8#include <string.h>
9#include <QLoggingCategory>
10#include <QDialog>
11#include <QDir>
12#include <QFile>
13#include <QtNetwork/QNetworkAccessManager>
14#include <QtNetwork/QNetworkRequest>
15#include <QtNetwork/QNetworkReply>
16#include <QStandardPaths>
17#include <QUrl>
18#include <QTimer>
19#include <QIODevice>
20#include <QDirIterator>
21#include <QXmlStreamWriter>
22#include <QXmlStreamReader>
23#include "fileutilitycameradata.h"
24#include "imagingcameradata.h"
25#include "cameragainreadnoise.h"
26#include "exposurecalculatordialog.h"
27#include <ekos_capture_debug.h>
28#include <sstream>
29#include <kspaths.h>
30
31/*
32 * Direct access to files on KDE/kstars git repository:
33 */
34QString const OptimalExposure::FileUtilityCameraData::cameraDataRemoteRepositoryList
35 = "https://api.github.com/repos/KDE/kstars/git/trees/master:kstars%2Fdata%2Fcameradata";
36
37QString const OptimalExposure::FileUtilityCameraData::cameraDataRemoteRepository
38 = "https://raw.githubusercontent.com/KDE/kstars/master/kstars/data/cameradata/";
39
40QString const OptimalExposure::FileUtilityCameraData::cameraApplicationDataRepository
42
43QString const OptimalExposure::FileUtilityCameraData::cameraLocalDataRepository
44 = QDir(KSPaths::writableLocation(QStandardPaths::AppLocalDataLocation)).filePath("kstars/cameradata/");
45
46QStringList OptimalExposure::FileUtilityCameraData::getAvailableCameraFilesList()
47{
48 QStringList cameraDataFiles;
49 QStringList dirs;
50
51
52 dirs << KSPaths::locateAll(QStandardPaths::GenericDataLocation,
53 QString::fromLatin1("kstars/cameradata"),
55
56 Q_FOREACH (const QString &dir, dirs)
57 {
58 QDirIterator it(dir, QStringList() << QLatin1String("*.xml"));
59
60 while (it.hasNext())
61 {
62 cameraDataFiles.append(it.next());
63 }
64 }
65
66 return(cameraDataFiles);
67}
68
69
70QString OptimalExposure::FileUtilityCameraData::cameraIdToCameraDataFileName(QString cameraId)
71{
72
73 // Replace spaces with "_" in the file name
74 QString aCameraDataFile = cameraId.replace(" ", "_");
75
76 if(!aCameraDataFile.endsWith(".xml"))
77 {
78 aCameraDataFile += ".xml";
79 }
80
81 return(aCameraDataFile);
82}
83
84QString OptimalExposure::FileUtilityCameraData::cameraDataFileNameToCameraId(QString cameraDataFileName)
85{
86 QFileInfo cameraDataFileInfo(cameraDataFileName);
87
88 // QString aCameraId = cameraDataFileName;
89
90 QString aCameraId = cameraDataFileInfo.baseName();
91
92 if(aCameraId.endsWith(".xml"))
93 aCameraId.truncate(aCameraId.length() - 4);
94
95 aCameraId = aCameraId.replace("_", " ");
96 return(aCameraId);
97}
98
99
100void OptimalExposure::FileUtilityCameraData::downloadRepositoryCameraDataFileList(
101 QDialog *aDialog)
102
103{
104
105 qCInfo(KSTARS_EKOS_CAPTURE) << "cameraDataRemoteRepositoryList: " <<
106 OptimalExposure::FileUtilityCameraData::cameraDataRemoteRepositoryList;
107 qCInfo(KSTARS_EKOS_CAPTURE) << "cameraDataRemoteRepository: " <<
108 OptimalExposure::FileUtilityCameraData::cameraDataRemoteRepository;
109 // qCInfo(KSTARS_EKOS_CAPTURE) << "cameraApplicationDataRepository: " << OptimalExposure::FileUtilityCameraData::cameraApplicationDataRepository;
110 qCInfo(KSTARS_EKOS_CAPTURE) << "cameraLocalDataRepository: " <<
111 OptimalExposure::FileUtilityCameraData::cameraLocalDataRepository;
112
113 // Using git tree to access camera file list, this approach requires parsing the tree
114 // string collect the xml (camera data) file names.
115
116 FileUtilityCameraDataDialog *activeDialog = static_cast<FileUtilityCameraDataDialog *> (aDialog);
117 activeDialog->setANetworkAccessManager(new QNetworkAccessManager(activeDialog));
118
119 QString aCameraDataRemoteFolderURL = OptimalExposure::FileUtilityCameraData::cameraDataRemoteRepositoryList;
120 qCInfo(KSTARS_EKOS_CAPTURE) << "Attempting access of camera data file repository " << aCameraDataRemoteFolderURL;
121
122 QNetworkRequest activeRequest = QNetworkRequest(QUrl(aCameraDataRemoteFolderURL));
123 activeDialog->setRequest(&activeRequest);
124 activeDialog->setReply(activeDialog->getANetworkAccessManager()->get(activeRequest));
125
126 QNetworkReply *activeReply = activeDialog->getReply();
127 QTimer::singleShot(60000, activeReply, [activeReply] //Time-out is 60 seconds
128 {
129 activeReply->abort();
130 activeReply->deleteLater();
131 qCCritical(KSTARS_EKOS_CAPTURE) << "CameraDataFile Download Timed out.";
132 });
133
134 QVector<QString> *availableCameraDataFiles = new QVector<QString>();
135
136 activeDialog->connect(activeReply, &QNetworkReply::finished,
137 activeDialog,
138 [availableCameraDataFiles, activeReply, activeDialog]
139 {
140 // qCInfo(KSTARS_EKOS_CAPTURE) << "The Camera Data File List download is finished";
141 activeReply->deleteLater();
142 if (activeReply->error() != QNetworkReply::NoError)
143 {
144 qCCritical(KSTARS_EKOS_CAPTURE) << "An error occurred in the Camera Data File List download";
145 return;
146 }
147
148 // Parse out the filenames from the tree
149 std::string responseDataStr = activeReply->readAll().toStdString();
150
151 // qCInfo(KSTARS_EKOS_CAPTURE) << "Camera Data File Github Tree:\n" << QString::fromStdString(responseDataStr);
152
153 std::string startdelimiter = "[";
154 std::string stopdelimiter = "]";
155 std::string treeStr = responseDataStr.substr(responseDataStr.find(startdelimiter) + 1, responseDataStr.find(stopdelimiter) - responseDataStr.find(startdelimiter));
156
157 std::vector <std::string> tokens;
158 std::stringstream responseDataStream(treeStr);
159
160 std::string intermediate;
161
162 while(getline(responseDataStream, intermediate, ','))
163 {
164 tokens.push_back(intermediate);
165 }
166
167 // Find the camera file name
168 for(std::size_t i = 0; i < tokens.size(); i++)
169 {
170 if(tokens[i].find("path") != std::string::npos)
171 {
172
173 std::string aCameraDataFileStr = tokens[i].substr(9, tokens[i].length() - 14);
174 // std::cout << aCameraDataFileStr << '\n';
175
176 QString aCameraDataFile = QString::fromStdString(aCameraDataFileStr);
177
178 availableCameraDataFiles->append(aCameraDataFile);
179
180 }
181 }
182 activeDialog->setAvailableCameraDataFiles(*availableCameraDataFiles);
183 activeDialog->refreshCameraList();
184 });
185
186 activeDialog->connect(activeReply, &QNetworkReply::downloadProgress,
187 activeDialog, []
188 {
189 qCInfo(KSTARS_EKOS_CAPTURE) << "The Camera Data File List download is in progress";
190 });
191 activeDialog->connect(activeReply, &QNetworkReply::errorOccurred,
192 activeDialog, []
193 {
194 qCCritical(KSTARS_EKOS_CAPTURE) << "The Camera Data File List download had an error";
195 });
196 activeDialog->connect(activeReply, &QNetworkReply::destroyed,
197 activeDialog, []
198 {
199 qCInfo(KSTARS_EKOS_CAPTURE) << "The Camera Data File List connection was destroyed";
200 });
201
202 qCInfo(KSTARS_EKOS_CAPTURE) << "The Camera Data File List length is " << availableCameraDataFiles->length();
203
204
205}
206
207void OptimalExposure::FileUtilityCameraData::downloadCameraDataFile(
208 QString cameraId,
209 QDialog *aDialog)
210{
211
212 FileUtilityCameraDataDialog *activeDialog = static_cast<FileUtilityCameraDataDialog *> (aDialog);
213
214 activeDialog->setANetworkAccessManager(new QNetworkAccessManager(activeDialog));
215
216 QDir filePath = OptimalExposure::FileUtilityCameraData::cameraLocalDataRepository;
217 filePath.mkpath(".");
218
219 QString cameraDataFileName = cameraIdToCameraDataFileName(cameraId);
220
221 // File in remote repository
222 QString aCameraDataDownloadURL = OptimalExposure::FileUtilityCameraData::cameraDataRemoteRepository
223 + cameraDataFileName;
224
225 // File for local storage
226 QString aCameraDataLocalFileName = OptimalExposure::FileUtilityCameraData::cameraLocalDataRepository
227 + cameraDataFileName;
228
229 //QString aCameraDataLocalFileName = KSPaths::locate(QStandardPaths::AppLocalDataLocation,
230 // QString("cameradata/%1").arg(cameraDataFileName));
231
232
233
234 qCInfo(KSTARS_EKOS_CAPTURE) << "Attempting Download Camera Data from "
235 << aCameraDataDownloadURL << "\n\tto " << aCameraDataLocalFileName;
236
237 QNetworkRequest activeRequest = QNetworkRequest(QUrl(aCameraDataDownloadURL));
238 activeDialog->setRequest(&activeRequest);
239
240 activeDialog->setReply(activeDialog->getANetworkAccessManager()->get(activeRequest));
241 QNetworkReply *activeReply = activeDialog->getReply();
242 QTimer::singleShot(60000, activeReply, [activeReply] //Time-out is 60 seconds
243 {
244 activeReply->abort();
245 activeReply->deleteLater();
246 qCCritical(KSTARS_EKOS_CAPTURE) << Q_FUNC_INFO << "CameraDataFile Download Timed out.";
247 });
248 activeDialog->connect(activeReply, &QNetworkReply::finished,
249 activeDialog,
250 [aCameraDataLocalFileName, activeReply, activeDialog]
251 {
252 activeReply->deleteLater();
253 if (activeReply->error() != QNetworkReply::NoError)
254 {
255 qCCritical(KSTARS_EKOS_CAPTURE)
256 << "An error occurred in the Camera Data File download of "
257 << aCameraDataLocalFileName;
258 return;
259 }
260 QFile aCameraDataFile(aCameraDataLocalFileName);
261 if(aCameraDataFile.open(QIODevice::ReadWrite | QIODevice::Truncate))
262 {
263 QByteArray responseData = activeReply->readAll();
264 if (aCameraDataFile.write(responseData))
265 {
266 aCameraDataFile.close();
267 qCInfo(KSTARS_EKOS_CAPTURE) << "The Camera Data File download of "
268 << aCameraDataLocalFileName << " is finished";
269 activeDialog->decrementDownloadFileCounter();
270 }
271 else
272 {
273 qCCritical(KSTARS_EKOS_CAPTURE) << "The Camera Data File download of "
274 << aCameraDataLocalFileName << " was not completed";
275 }
276 }
277 });
278 activeDialog->connect(activeReply, &QNetworkReply::downloadProgress,
279 activeDialog, [aCameraDataLocalFileName]
280 {
281 qCInfo(KSTARS_EKOS_CAPTURE) << "The Camera Data File download of "
282 << aCameraDataLocalFileName << " is in progress";
283 });
284 activeDialog->connect(activeReply, &QNetworkReply::errorOccurred,
285 activeDialog, [aCameraDataLocalFileName]
286 {
287 qCInfo(KSTARS_EKOS_CAPTURE) << "The Camera Data File download of "
288 << aCameraDataLocalFileName << " had an error";
289 });
290 activeDialog->connect(activeReply, &QNetworkReply::destroyed,
291 activeDialog, [aCameraDataLocalFileName]
292 {
293 qCInfo(KSTARS_EKOS_CAPTURE) << "The Camera Data File connection for " << aCameraDataLocalFileName << " was destroyed";
294 });
295
296}
297
298
299int OptimalExposure::FileUtilityCameraData::readCameraDataFile(QString aCameraDataFile,
300 OptimalExposure::ImagingCameraData *anImagingCameraData)
301{
302 // QString aCameraDataFile = OptimalExposure::FileUtilityCameraData::cameraApplicationDataRepository +
303 // cameraIdToCameraDataFileName(cameraId);
304
305 // qCInfo(KSTARS_EKOS_CAPTURE) << "Opening... " + aCameraDataFile;
306
307 QFile file(aCameraDataFile);
308 if(file.open(QIODevice::ReadOnly | QIODevice::Text))
309 {
310 // qCInfo(KSTARS_EKOS_CAPTURE) << "Reading... " + aCameraDataFile;
311 QXmlStreamReader xmlReader(&file);
312
313 if (xmlReader.readNextStartElement())
314 {
315 // qCInfo(KSTARS_EKOS_CAPTURE) << "xmlReader start element name: " << xmlReader.name();
316 if (xmlReader.name().toString() == "ExposureCalculatorCameraData")
317 {
318 // qCInfo(KSTARS_EKOS_CAPTURE) << "Found aCamera Element...";
319
320 QVector<OptimalExposure::CameraGainReadMode> *aCameraGainReadModeVector
322
323 while(xmlReader.readNextStartElement())
324 {
325 // qCInfo(KSTARS_EKOS_CAPTURE) << "xmlReader start element name: " << xmlReader.name();
326 if (xmlReader.name().toString() == "CameraDataClassVersion")
327 {
328 int aDataClassVersion = xmlReader.readElementText().toInt();
329 anImagingCameraData->setDataClassVersion(aDataClassVersion);
330 }
331
332 if (xmlReader.name().toString() == "CameraId")
333 {
334 // qCInfo(KSTARS_EKOS_CAPTURE) << "Found aCameraId Element...";
335 QString aCameraIdString = xmlReader.readElementText();
336 // qCInfo(KSTARS_EKOS_CAPTURE) << "Read element text..." + aCameraIdString;
337 anImagingCameraData->setCameraId(aCameraIdString);
338 }
339
340 if (xmlReader.name().toString() == "SensorType")
341 {
342 // qCInfo(KSTARS_EKOS_CAPTURE) << "Found SensorType Element...";
343 QString aSensorType = xmlReader.readElementText();
344 // qCInfo(KSTARS_EKOS_CAPTURE) << "Read element text..." + aSensorType;
345 if(aSensorType == "COLOR")
346 anImagingCameraData->setSensorType(OptimalExposure::SENSORTYPE_COLOR);
347
348 if(aSensorType == "MONOCHROME")
349 anImagingCameraData->setSensorType(OptimalExposure::SENSORTYPE_MONOCHROME);
350 }
351
352 if (xmlReader.name().toString() == "GainSelectionType")
353 {
354 // qCInfo(KSTARS_EKOS_CAPTURE) << "Found GainSelectionType Element...";
355 QString aGainSelectionType = xmlReader.readElementText();
356 // qCInfo(KSTARS_EKOS_CAPTURE) << "Read element text..." + aGainSelectionType;
357 if(aGainSelectionType == "NORMAL")
358 anImagingCameraData->setGainSelectionType(OptimalExposure::GAIN_SELECTION_TYPE_NORMAL);
359 if(aGainSelectionType == "ISO_DISCRETE")
360 anImagingCameraData->setGainSelectionType(OptimalExposure::GAIN_SELECTION_TYPE_ISO_DISCRETE);
361 if(aGainSelectionType == "FIXED")
362 anImagingCameraData->setGainSelectionType(OptimalExposure::GAIN_SELECTION_TYPE_FIXED);
363 }
364
365
366 // GainSelection collection // For GAIN_SELECTION_TYPE_NORMAL the collection represents min and max,
367 // for GAIN_SELECTION_TYPE_ISO_DISCRETE, the collection is the discrete list of of gain/iso values.
368 // Note that the data available for GainReadNoiseValue may not match a camera discrete gain/iso values,
369 // so this collection resolves that.
370
371 if (xmlReader.name().toString() == "CameraGainSelections")
372 {
373 QVector<int> *aGainSelectionVector = new QVector<int>();
374
375 int aGainSelection = 0;
376 while(xmlReader.readNext() && !(xmlReader.name() == QString("CameraGainSelections") && xmlReader.isEndElement()))
377 {
378 // qCInfo(KSTARS_EKOS_CAPTURE) << "xmlReader.name() = " << xmlReader.name();
379 if (xmlReader.name().toString() == "GainSelection")
380 {
381 // qCInfo(KSTARS_EKOS_CAPTURE) << "xmlReader.name() = " << xmlReader.name();
382 QString aGainSelectionString = xmlReader.readElementText();
383 aGainSelection = aGainSelectionString.toInt();
384 // qCInfo(KSTARS_EKOS_CAPTURE) << "a Found GainSelection text: " << aGainSelection;
385
386 // qCInfo(KSTARS_EKOS_CAPTURE) << "Adding GainSelection to Vector " << QString::number(aGainSelection);
387
388 aGainSelectionVector->push_back(aGainSelection);
389 }
390 }
391 anImagingCameraData->setGainSelectionRange(*aGainSelectionVector);
392 }
393
394 if (xmlReader.name().toString() == "CameraGainReadMode")
395 {
396 OptimalExposure::CameraGainReadMode *aCameraGainReadMode = new OptimalExposure::CameraGainReadMode();
397
398 while(xmlReader.readNext() && !(xmlReader.name().toString() == "CameraGainReadMode" && xmlReader.isEndElement()))
399 {
400 // qCInfo(KSTARS_EKOS_CAPTURE) << "xmlReader.name() = " << xmlReader.name();
401 if (xmlReader.name().toString() == "GainReadModeNumber")
402 {
403 QString aGainReadModeNumberString = xmlReader.readElementText();
404 aCameraGainReadMode->setCameraGainReadModeNumber(aGainReadModeNumberString.toInt());
405 }
406 if (xmlReader.name().toString() == "GainReadModeName")
407 {
408 aCameraGainReadMode->setCameraGainReadModeName(xmlReader.readElementText());
409 }
410
411 // CameraGainReadNoise collection
412 if (xmlReader.name().toString() == "CameraGainReadNoise")
413 {
414 // qCInfo(KSTARS_EKOS_CAPTURE) << "Found CameraGainReadNoise Element...";
415 // QString aCameraGainReadNoise = xmlReader.readElementText();
416 // // qCInfo(KSTARS_EKOS_CAPTURE) << "Read element ..." + aCameraGainReadNoise;
417
418 QVector<OptimalExposure::CameraGainReadNoise> *aCameraGainReadNoiseVector
420
421
422 // Iterate for Gain Read-Noise data
423 int aGain = 0;
424 double aReadNoise = 0.0;
425 while(xmlReader.readNext() && !(xmlReader.name().toString() == "CameraGainReadNoise" && xmlReader.isEndElement()) )
426 {
427 // qCInfo(KSTARS_EKOS_CAPTURE) << "xmlReader.name() = " << xmlReader.name();
428
429 if (xmlReader.isEndElement())
430 // qCInfo(KSTARS_EKOS_CAPTURE) << "At end of = " << xmlReader.name();
431
432
433 if (xmlReader.name().toString() == "GainReadNoiseValue")
434 {
435 // qCInfo(KSTARS_EKOS_CAPTURE) << "Found GainReadNoiseValue Element...";
436 }
437
438 if (xmlReader.name().toString() == "Gain")
439 {
440 // qCInfo(KSTARS_EKOS_CAPTURE) << "Found Gain Element...";
441 QString aGainString = xmlReader.readElementText();
442 aGain = aGainString.toInt();
443 // qCInfo(KSTARS_EKOS_CAPTURE) << "a Found Gain text: " << aGain;
444 }
445
446 if (xmlReader.name().toString() == "ReadNoise")
447 {
448 // qCInfo(KSTARS_EKOS_CAPTURE) << "Found ReadNoise Element...";
449 QString aReadNoiseString = xmlReader.readElementText();
450 aReadNoise = aReadNoiseString.toDouble();
451 // qCInfo(KSTARS_EKOS_CAPTURE) << "a Found ReadNoise text: " << aReadNoise;
452
453 // Add this to a vector
454 // qCInfo(KSTARS_EKOS_CAPTURE) << "Adding Gain Read-Noise to Vector " << QString::number(aGain) << " " << QString::number(aReadNoise) ;
455 aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(aGain, aReadNoise)));
456 }
457 }
458 aCameraGainReadMode->setCameraGainReadNoiseVector(*aCameraGainReadNoiseVector);
459 aCameraGainReadModeVector->push_back(*aCameraGainReadMode);
460 }
461 anImagingCameraData->setCameraGainReadModeVector(*aCameraGainReadModeVector);
462 }
463 // qCInfo(KSTARS_EKOS_CAPTURE) << "Finished reading mode ";
464 }
465
466 }
467 // qCInfo(KSTARS_EKOS_CAPTURE) << "Read xml data for " + anImagingCameraData->getCameraId();
468
469 }
470 else
471 {
472 qCCritical(KSTARS_EKOS_CAPTURE) << "Read Failed";
473 xmlReader.raiseError(QObject::tr("Incorrect file"));
474 }
475 }
476 else
477 {
478 qCCritical(KSTARS_EKOS_CAPTURE) << "Read Initial Element Failed,";
479 }
480 }
481 else
482 {
483 qCCritical(KSTARS_EKOS_CAPTURE)
484 << "Cannot open file for reading " << file.errorString();
485 }
486
487 file.close();
488 return 0;
489}
490
491int OptimalExposure::FileUtilityCameraData::writeCameraDataFile(OptimalExposure::ImagingCameraData *anImagingCameraData)
492{
493
494 if(QDir().mkpath(cameraLocalDataRepository))
495 {
496 // Replace spaces with "_" in the file name
497 QString aCameraDataFile = cameraLocalDataRepository + cameraIdToCameraDataFileName(anImagingCameraData->getCameraId());
498
499 QFile file(aCameraDataFile);
501 {
502
503 QXmlStreamWriter xmlWriter(&file);
504 xmlWriter.setAutoFormatting(true);
505 xmlWriter.writeStartDocument();
506
507 xmlWriter.writeStartElement("ExposureCalculatorCameraData");
508
509 xmlWriter.writeTextElement("CameraDataClassVersion", QString::number(anImagingCameraData->getDataClassVersion()));
510
511 xmlWriter.writeTextElement("CameraId", anImagingCameraData->getCameraId() );
512
513 switch(anImagingCameraData->getSensorType())
514 {
515 case OptimalExposure::SENSORTYPE_MONOCHROME:
516 xmlWriter.writeTextElement("SensorType", QString("MONOCHROME"));
517 break;
518 case OptimalExposure::SENSORTYPE_COLOR:
519 xmlWriter.writeTextElement("SensorType", QString("COLOR"));
520 break;
521 }
522
523 switch(anImagingCameraData->getGainSelectionType())
524 {
525 case OptimalExposure::GAIN_SELECTION_TYPE_NORMAL:
526 xmlWriter.writeTextElement("GainSelectionType", QString("NORMAL"));
527 break;
528 case OptimalExposure::GAIN_SELECTION_TYPE_ISO_DISCRETE:
529 xmlWriter.writeTextElement("GainSelectionType", QString("ISO_DISCRETE"));
530 break;
531 case OptimalExposure::GAIN_SELECTION_TYPE_FIXED:
532 xmlWriter.writeTextElement("GainSelectionType", QString("FIXED"));
533 break;
534 }
535
536 xmlWriter.writeStartElement("CameraGainSelections");
537 QVector<int> aGainSelectionRange = anImagingCameraData->getGainSelectionRange();
538 for(int gs = 0; gs < aGainSelectionRange.count(); gs++)
539 {
540 // xmlWriter.writeStartElement("GainSelection");
541 xmlWriter.writeTextElement("GainSelection", QString::number(anImagingCameraData->getGainSelectionRange()[gs]));
542 // xmlWriter.writeEndElement();
543 }
544 xmlWriter.writeEndElement();
545
546 // Iterate through values of anImagingCameraData->CameraGainReadModeVector
547
548 xmlWriter.writeStartElement("CameraGainReadMode");
549 QVector<OptimalExposure::CameraGainReadMode> aCameraGainReadModeVector =
550 anImagingCameraData->getCameraGainReadModeVector();
551 for(QVector<OptimalExposure::CameraGainReadMode>::iterator readMode = aCameraGainReadModeVector.begin();
552 readMode != aCameraGainReadModeVector.end(); ++readMode)
553 {
554 xmlWriter.writeTextElement("GainReadModeNumber", QString::number(readMode->getCameraGainReadModeNumber()));
555 xmlWriter.writeTextElement("GainReadModeName", readMode->getCameraGainReadModeName());
556 // xmlWriter.writeStartElement("GainReadModeNumber");
557 // xmlWriter.writeEndElement();
558 // xmlWriter.writeStartElement("GainReadModeName");
559 // xmlWriter.writeEndElement();
560 // Iterate through values of readMode->CameraGainReadNoiseVector
561 xmlWriter.writeStartElement("CameraGainReadNoise");
562 QVector<OptimalExposure::CameraGainReadNoise> aCameraGainReadNoiseVector =
563 readMode->getCameraGainReadNoiseVector();
564
565 for(QVector<OptimalExposure::CameraGainReadNoise>::iterator readNoisePair = aCameraGainReadNoiseVector.begin();
566 readNoisePair != aCameraGainReadNoiseVector.end(); ++readNoisePair)
567 {
568 xmlWriter.writeStartElement("GainReadNoiseValue");
569 xmlWriter.writeTextElement("Gain", QString::number(readNoisePair->getGain()));
570 xmlWriter.writeTextElement("ReadNoise", QString::number(readNoisePair->getReadNoise()));
571 xmlWriter.writeEndElement();
572 }
573 xmlWriter.writeEndElement();
574
575 }
576 xmlWriter.writeEndElement();
577 xmlWriter.writeEndElement();
578 xmlWriter.writeEndDocument();
579 file.close();
580
581 }
582 else
583 {
584 qCCritical(KSTARS_EKOS_CAPTURE)
585 << "Cannot open camera data file for writing " << file.errorString();
586 }
587 }
588 return 0;
589
590
591}
592
593
594// Make example camera data files
595//void OptimalExposure::FileUtilityCameraData::buildCameraDataFile()
596//{
597// /*
598// * camera naming should try match the Camera device name (cameraId) present in KStars.
599// * A cameraId in KStars appears to consist of a device label (or driver id) and the camera model.
600// *
601// * For example:
602// * a "ZWO ASI-071 MC Pro"
603// *
604// * The usb id is "ZWO ASI071MC Pro", but KStars uses a driver prefix ("ZWO CCD") in the cameraId.
605// * cameraId = "ZWO CCD ASI071MC Pro";
606// *
607// * The file utility code will replace spaces with underscore on writes, and vice-versa on reads.
608// * So the xml file would be "ZWO_CCD_ASI071MC_Pro.xml"
609// *
610// * But for many of these examples the kstars cameraId was not available (I do not own all these cameras).
611// * So guesses were made for the cameraId of most of these cameras.
612// *
613// *
614// *
615// * Manufacturers:
616// cat indidrivers.xml | grep -i driver | grep -i ccd
617// <driver name="CCD Simulator">indi_simulator_ccd</driver>
618// <driver name="V4L2 CCD">indi_v4l2_ccd</driver>
619// <driver name="Apogee CCD">indi_apogee_ccd</driver>
620// <driver name="ZWO CCD">indi_asi_ccd</driver>
621// <driver name="ZWO Camera">indi_asi_single_ccd</driver>
622// <driver name="Atik">indi_atik_ccd</driver>
623// <driver name="Cam90 CCD">indi_cam90_ccd</driver>
624// <driver name="DSI">indi_dsi_ccd</driver>
625// <driver name="FireFly MV">indi_ffmv_ccd</driver>
626// <driver name="Starfish CCD">indi_fishcamp_ccd</driver>
627// <driver name="FLI Kepler">indi_kepler_ccd</driver>
628// <driver name="FLI CCD">indi_fli_ccd</driver>
629// <driver name="Canon DSLR">indi_canon_ccd</driver>
630// <driver name="Nikon DSLR">indi_nikon_ccd</driver>
631// <driver name="Pentax DSLR">indi_pentax_ccd</driver>
632// <driver name="Sony DSLR">indi_sony_ccd</driver>
633// <driver name="Fuji DSLR">indi_fuji_ccd</driver>
634// <driver name="GPhoto CCD">indi_gphoto_ccd</driver>
635// <driver name="iNova PLX">indi_inovaplx_ccd</driver>
636// <driver name="MI CCD">indi_mi_ccd_usb</driver>
637// <driver name="MI CCD">indi_mi_ccd_eth</driver>
638// <driver name="Nightscape CCD">indi_nightscape_ccd</driver>
639// <driver name="Orion SSG3">indi_orion_ssg3_ccd</driver>
640// <driver name="PlayerOne CCD">indi_playerone_ccd</driver>
641// <driver name="QHY CCD">indi_qhy_ccd</driver>
642// <driver name="QSI CCD">indi_qsi_ccd</driver>
643// <driver name="SBIG CCD">indi_sbig_ccd</driver>
644// <driver name="SBIG CCD">indi_sbig_ccd</driver>
645// <driver name="SVBONY CCD">indi_svbony_ccd</driver>
646// <driver name="SX CCD">indi_sx_ccd</driver>
647// <driver name="Toupcam">indi_toupcam_ccd</driver>
648// <driver name="Altair">indi_altair_ccd</driver>
649// <driver name="Bressercam">indi_bressercam_ccd</driver>
650// <driver name="Mallincam">indi_mallincam_ccd</driver>
651// <driver name="Nncam">indi_nncam_ccd</driver>
652// <driver name="Ogmacam">indi_ogmacam_ccd</driver>
653// <driver name="OmegonPro">indi_omegonprocam_ccd</driver>
654// <driver name="StartshootG">indi_starshootg_ccd</driver>
655// <driver name="Tscam">indi_tscam_ccd</driver>
656// <driver name="Nncam">indi_nncam_ccd</driver>
657// <driver name="INDI Webcam">indi_webcam_ccd</driver>
658
659// grep -iR "device label" | grep -i " CCD"
660// indidrivers.xml: <device label="DMK CCD" manufacturer="DMK">
661// indidrivers.xml: <device label="V4L2 CCD" manufacturer="Web Cameras">
662// indidrivers.xml: <device label="Apogee CCD" manufacturer="Andor">
663// indidrivers.xml: <device label="ZWO CCD" mdpd="true" manufacturer="ZWO">
664// indidrivers.xml: <device label="Atik CCD" mdpd="true" manufacturer="Atik">
665// indidrivers.xml: <device label="Cam90 CCD" mdpd="true">
666// indidrivers.xml: <device label="Starfish CCD">
667// indidrivers.xml: <device label="FLI CCD" manufacturer="Finger Lakes Instruments">
668// indidrivers.xml: <device label="GPhoto CCD" manufacturer="DSLRs">
669// indidrivers.xml: <device label="MI CCD (USB)" manufacturer="Moravian Instruments">
670// indidrivers.xml: <device label="MI CCD (ETH)" manufacturer="Moravian Instruments">
671// indidrivers.xml: <device label="Nightscape 8300 CCD" mdpd="true" manufacturer="Celestron">
672// indidrivers.xml: <device label="PlayerOne CCD" mdpd="true" manufacturer="PlayerOne">
673// indidrivers.xml: <device label="QHY CCD" mdpd="true" manufacturer="QHY">
674// indidrivers.xml: <device label="QSI CCD" manufacturer="QSI">
675// indidrivers.xml: <device label="SBIG CCD" manufacturer="Diffraction Limited">
676// indidrivers.xml: <device label="SVBONY CCD" mdpd="true" manufacturer="SVBONY">
677// indidrivers.xml: <device label="SX CCD" mdpd="true" manufacturer="Starlight XPress">
678
679// */
680
681// // Define and re-use for each camera instance
682// QString cameraId;
683// int readModeNumber = 0;
684// QString readModeName;
685// QVector<OptimalExposure::CameraGainReadNoise> *aCameraGainReadNoiseVector;
686// QVector<OptimalExposure::CameraGainReadMode> *aCameraGainReadModeVector;
687
688// QVector<int> *gainSelection;
689// OptimalExposure::ImagingCameraData *anImagingCameraData;
690
691// // This QHY camera has selectable read modes, with distinct read-noise data.
692// // The indi driver may provide a "Read Mode" selectoin on the indi panel.
693// // The xml data files are revised to handle multiple read-modes for a camera
694// // in a single file.
695
696// // #0 Photographic, #1 High Gain, #2 Extended Full Well and #3 Extended Full Well 2CMSIT.
697
698// // Research: Is the same read-noise is used in both Mono and Color versions?
699
700// cameraId = "QHY CCD 268M";
701// aCameraGainReadModeVector = new QVector<OptimalExposure::CameraGainReadMode>();
702
703// aCameraGainReadNoiseVector = new QVector<OptimalExposure::CameraGainReadNoise>();
704// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(0, 7.25)));
705// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(5, 7.1)));
706// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(10, 6.78)));
707// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(15, 6.74)));
708// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(20, 6.74)));
709// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(25, 2.8)));
710// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(30, 2.63)));
711// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(35, 2.7)));
712// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(40, 2.57)));
713// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(45, 2.55)));
714// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(50, 2.52)));
715// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(55, 2.35)));
716// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(60, 2.07)));
717// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(65, 2.05)));
718// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(70, 2.04)));
719// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(75, 2.06)));
720// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(80, 2.03)));
721// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(85, 2.01)));
722// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(90, 2)));
723// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(95, 1.99)));
724// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(100, 2)));
725// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(105, 1.97)));
726// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(110, 1.96)));
727// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(115, 1.95)));
728// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(120, 1.94)));
729// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(125, 1.93)));
730// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(130, 1.92)));
731// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(135, 1.89)));
732// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(140, 1.9)));
733// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(145, 1.89)));
734// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(150, 1.85)));
735// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(155, 1.82)));
736// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(160, 1.81)));
737// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(165, 1.8)));
738// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(170, 1.79)));
739// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(175, 1.75)));
740// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(180, 1.74)));
741// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(185, 1.7)));
742// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(190, 1.68)));
743// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(195, 1.67)));
744// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(200, 1.62)));
745// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(205, 1.59)));
746// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(210, 1.56)));
747// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(215, 1.53)));
748// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(220, 1.48)));
749// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(225, 1.44)));
750// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(230, 1.41)));
751// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(235, 1.36)));
752// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(240, 1.32)));
753// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(245, 1.26)));
754// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(250, 1.17)));
755// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(255, 1.12)));
756// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(260, 1.03)));
757// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(265, 0.92)));
758// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(270, 0.79)));
759// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(275, 0.62)));
760// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(280, 0.6)));
761// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(285, 0.7)));
762
763// readModeNumber = 0;
764// readModeName = "Photographic";
765
766// aCameraGainReadModeVector->push_back(*(new OptimalExposure::CameraGainReadMode(readModeNumber, readModeName,
767// *aCameraGainReadNoiseVector)));
768
769// aCameraGainReadNoiseVector = new QVector<OptimalExposure::CameraGainReadNoise>();
770
771// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(5, 3.6)));
772// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(10, 3.58)));
773// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(15, 3.64)));
774// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(20, 3.63)));
775// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(25, 3.63)));
776// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(30, 3.58)));
777// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(35, 3.49)));
778// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(40, 3.39)));
779// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(45, 3.43)));
780// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(50, 3.53)));
781// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(55, 3.43)));
782// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(60, 1.69)));
783// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(65, 1.69)));
784// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(70, 1.67)));
785// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(75, 1.67)));
786// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(80, 1.63)));
787// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(85, 1.6)));
788// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(90, 1.57)));
789// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(95, 1.53)));
790// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(100, 1.25)));
791// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(105, 1.22)));
792// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(110, 1.22)));
793// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(115, 1.21)));
794// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(120, 1.2)));
795// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(125, 1.2)));
796// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(130, 1.19)));
797// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(135, 1.18)));
798// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(140, 1.17)));
799// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(145, 1.15)));
800// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(150, 1.14)));
801// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(155, 1.14)));
802// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(160, 1.13)));
803// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(165, 1.12)));
804// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(170, 1.11)));
805// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(175, 1.09)));
806// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(180, 1.09)));
807// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(185, 1.08)));
808// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(190, 1.06)));
809// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(195, 1.06)));
810// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(200, 1.03)));
811// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(205, 1.01)));
812// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(210, 0.98)));
813// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(215, 0.99)));
814// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(220, 0.96)));
815// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(225, 0.97)));
816// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(230, 0.92)));
817// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(235, 0.93)));
818// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(240, 0.87)));
819// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(245, 0.87)));
820// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(250, 0.8)));
821// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(255, 0.79)));
822// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(260, 0.8)));
823// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(265, 0.7)));
824// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(270, 0.71)));
825// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(275, 0.7)));
826// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(280, 0.69)));
827// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(285, 0.69)));
828
829// readModeNumber = 1;
830// readModeName = "High Gain";
831
832// aCameraGainReadModeVector->push_back(*(new OptimalExposure::CameraGainReadMode(readModeNumber, readModeName,
833// *aCameraGainReadNoiseVector)));
834
835// aCameraGainReadNoiseVector = new QVector<OptimalExposure::CameraGainReadNoise>();
836// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(0, 7.56)));
837// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(5, 7.48)));
838// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(10, 7.41)));
839// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(15, 7.34)));
840// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(20, 7.22)));
841// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(25, 7.15)));
842// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(30, 7.01)));
843// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(35, 6.83)));
844// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(40, 6.69)));
845// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(45, 6.6)));
846// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(50, 6.64)));
847// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(55, 6.72)));
848// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(60, 6.86)));
849// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(65, 6.93)));
850// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(70, 6.73)));
851// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(75, 6.44)));
852// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(80, 6.55)));
853// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(85, 6.06)));
854// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(90, 6.16)));
855// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(95, 5.75)));
856// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(100, 5.36)));
857// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(105, 5.34)));
858// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(110, 5.34)));
859// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(115, 5.35)));
860// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(120, 5.34)));
861// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(125, 5.3)));
862// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(130, 5.22)));
863// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(135, 5.18)));
864// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(140, 5.09)));
865// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(145, 5.04)));
866// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(150, 4.96)));
867// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(155, 4.9)));
868// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(160, 4.85)));
869// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(165, 4.77)));
870// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(170, 4.71)));
871// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(175, 4.62)));
872// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(180, 4.57)));
873// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(185, 4.46)));
874// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(190, 4.4)));
875// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(195, 4.32)));
876// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(200, 4.2)));
877// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(205, 4.1)));
878// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(210, 4.02)));
879// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(215, 3.95)));
880// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(220, 3.79)));
881// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(225, 3.71)));
882// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(230, 3.58)));
883// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(235, 3.53)));
884// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(240, 3.41)));
885// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(245, 3.26)));
886// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(250, 3.14)));
887// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(255, 3.04)));
888// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(260, 2.87)));
889// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(265, 2.8)));
890// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(270, 2.62)));
891// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(275, 2.5)));
892// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(280, 2.34)));
893// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(285, 2.18)));
894
895// readModeNumber = 2;
896// readModeName = "Extended Full Well";
897
898// aCameraGainReadModeVector->push_back(*(new OptimalExposure::CameraGainReadMode(readModeNumber, readModeName,
899// *aCameraGainReadNoiseVector)));
900
901// aCameraGainReadNoiseVector = new QVector<OptimalExposure::CameraGainReadNoise>();
902// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(0, 5.89)));
903// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(5, 5.82)));
904// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(10, 5.82)));
905// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(15, 5.73)));
906// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(20, 5.66)));
907// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(25, 5.58)));
908// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(30, 5.44)));
909// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(35, 5.39)));
910// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(40, 5.26)));
911// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(45, 5.17)));
912// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(50, 5.17)));
913// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(55, 5.25)));
914// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(60, 5.34)));
915// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(65, 5.43)));
916// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(70, 5.33)));
917// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(75, 5.08)));
918// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(80, 5.05)));
919// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(85, 4.81)));
920// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(90, 4.85)));
921// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(95, 4.55)));
922// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(100, 4.26)));
923// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(105, 4.25)));
924// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(110, 4.23)));
925// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(115, 4.26)));
926// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(120, 4.26)));
927// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(125, 4.23)));
928// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(130, 4.18)));
929// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(135, 4.15)));
930// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(140, 4.08)));
931// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(145, 4.09)));
932// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(150, 4.05)));
933// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(155, 4.01)));
934// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(160, 3.98)));
935// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(165, 3.96)));
936// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(170, 3.91)));
937// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(175, 3.87)));
938// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(180, 3.83)));
939// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(185, 3.8)));
940// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(190, 3.76)));
941// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(195, 3.68)));
942// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(200, 3.64)));
943// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(205, 3.57)));
944// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(210, 3.51)));
945// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(215, 3.44)));
946// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(220, 3.39)));
947// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(225, 3.33)));
948// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(230, 3.25)));
949// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(235, 3.2)));
950// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(240, 3.13)));
951// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(245, 3.03)));
952// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(250, 2.99)));
953// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(255, 2.87)));
954// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(260, 2.77)));
955// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(265, 2.72)));
956// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(270, 2.58)));
957// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(275, 2.5)));
958// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(280, 2.37)));
959// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(285, 2.22)));
960
961// readModeNumber = 3;
962// readModeName = "Extended Full Well 2CMSIT";
963// aCameraGainReadModeVector->push_back(*(new OptimalExposure::CameraGainReadMode(readModeNumber, readModeName,
964// *aCameraGainReadNoiseVector)));
965
966// gainSelection = new QVector<int>( { 0, 285 } );
967// anImagingCameraData = new OptimalExposure::ImagingCameraData(cameraId, OptimalExposure::SENSORTYPE_MONOCHROME,
968// OptimalExposure::GAIN_SELECTION_TYPE_NORMAL, *gainSelection, *aCameraGainReadModeVector);
969// anImagingCameraData->setDataClassVersion(1);
970// OptimalExposure::FileUtilityCameraData::writeCameraDataFile(anImagingCameraData);
971
972// cameraId = "ZWO CCD ASI071MC Pro";
973// aCameraGainReadNoiseVector = new QVector<OptimalExposure::CameraGainReadNoise>();
974// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(0, 3.28)));
975// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(50, 2.78)));
976// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(100, 2.58)));
977// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(150, 2.39)));
978// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(200, 2.29)));
979// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(250, 2.27)));
980
981// readModeNumber = 0;
982// readModeName = "Standard";
983// aCameraGainReadModeVector = new QVector<OptimalExposure::CameraGainReadMode>();
984// aCameraGainReadModeVector->push_back(*(new OptimalExposure::CameraGainReadMode(readModeNumber, readModeName,
985// *aCameraGainReadNoiseVector)));
986
987// gainSelection = new QVector<int>( { 0, 250 } );
988// anImagingCameraData = new OptimalExposure::ImagingCameraData(cameraId, OptimalExposure::SENSORTYPE_COLOR,
989// OptimalExposure::GAIN_SELECTION_TYPE_NORMAL, *gainSelection, *aCameraGainReadModeVector);
990
991// anImagingCameraData->setDataClassVersion(1);
992// OptimalExposure::FileUtilityCameraData::writeCameraDataFile(anImagingCameraData);
993
994
995
996
997// // usb id is "ZWO ASI178MC"
998// cameraId = "ZWO CCD ASI178MC";
999// aCameraGainReadNoiseVector = new QVector<OptimalExposure::CameraGainReadNoise>();
1000// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(0, 2.23)));
1001// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(50, 1.92)));
1002// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(100, 1.74)));
1003// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(150, 1.58)));
1004// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(200, 1.45)));
1005// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(250, 1.39)));
1006// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(300, 1.38)));
1007// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(400, 1.35)));
1008
1009// readModeNumber = 0;
1010// readModeName = "Standard";
1011// aCameraGainReadModeVector = new QVector<OptimalExposure::CameraGainReadMode>();
1012// aCameraGainReadModeVector->push_back(*(new OptimalExposure::CameraGainReadMode(readModeNumber, readModeName,
1013// *aCameraGainReadNoiseVector)));
1014
1015
1016// gainSelection = new QVector<int>( { 0, 400 } );
1017// anImagingCameraData = new OptimalExposure::ImagingCameraData(cameraId, OptimalExposure::SENSORTYPE_COLOR,
1018// OptimalExposure::GAIN_SELECTION_TYPE_NORMAL, *gainSelection, *aCameraGainReadModeVector);
1019
1020// anImagingCameraData->setDataClassVersion(1);
1021// OptimalExposure::FileUtilityCameraData::writeCameraDataFile(anImagingCameraData);
1022
1023
1024// cameraId = "ZWO CCD ASI6200MM";
1025// aCameraGainReadNoiseVector = new QVector<OptimalExposure::CameraGainReadNoise>();
1026
1027// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(0, 3.6)));
1028// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(50, 3.5)));
1029// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(99, 3.38)));
1030// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(100, 1.55))); // pronounced step
1031// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(150, 1.5)));
1032// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(200, 1.45)));
1033// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(250, 1.42)));
1034// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(300, 1.40)));
1035// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(350, 1.41)));
1036// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(400, 1.32)));
1037// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(450, 1.39)));
1038// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(470, 1.25)));
1039
1040// readModeNumber = 0;
1041// readModeName = "Standard";
1042// aCameraGainReadModeVector = new QVector<OptimalExposure::CameraGainReadMode>();
1043// aCameraGainReadModeVector->push_back(*(new OptimalExposure::CameraGainReadMode(readModeNumber, readModeName,
1044// *aCameraGainReadNoiseVector)));
1045
1046// gainSelection = new QVector<int>( { 0, 470 } );
1047
1048// // qCInfo(KSTARS_EKOS_CAPTURE) << "aCameraGainReadNoiseVector size: " << aCameraGainReadNoiseVector->size();
1049// anImagingCameraData = new OptimalExposure::ImagingCameraData(cameraId, OptimalExposure::SENSORTYPE_MONOCHROME,
1050// OptimalExposure::GAIN_SELECTION_TYPE_NORMAL, *gainSelection, *aCameraGainReadModeVector);
1051// anImagingCameraData->setDataClassVersion(1);
1052// OptimalExposure::FileUtilityCameraData::writeCameraDataFile(anImagingCameraData);
1053
1054// cameraId = "ZWO CCD ASI1600MM";
1055// aCameraGainReadNoiseVector = new QVector<OptimalExposure::CameraGainReadNoise>();
1056// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(0, 3.62)));
1057// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(50, 2.5)));
1058// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(100, 1.85)));
1059// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(150, 1.72)));
1060// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(200, 1.40)));
1061// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(250, 1.32)));
1062// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(300, 1.30)));
1063
1064// readModeNumber = 0;
1065// readModeName = "Standard";
1066// aCameraGainReadModeVector = new QVector<OptimalExposure::CameraGainReadMode>();
1067// aCameraGainReadModeVector->push_back(*(new OptimalExposure::CameraGainReadMode(readModeNumber, readModeName,
1068// *aCameraGainReadNoiseVector)));
1069
1070
1071// gainSelection = new QVector<int>( { 0, 300 } );
1072// anImagingCameraData = new OptimalExposure::ImagingCameraData(cameraId, OptimalExposure::SENSORTYPE_MONOCHROME,
1073// OptimalExposure::GAIN_SELECTION_TYPE_NORMAL, *gainSelection, *aCameraGainReadModeVector);
1074// anImagingCameraData->setDataClassVersion(1);
1075// OptimalExposure::FileUtilityCameraData::writeCameraDataFile(anImagingCameraData);
1076
1077
1078// cameraId = "ZWO CCD ASI224MC";
1079// aCameraGainReadNoiseVector = new QVector<OptimalExposure::CameraGainReadNoise>();
1080// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(0, 3.09)));
1081// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(20, 2.71)));
1082// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(59, 2.26)));
1083// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(60, 1.6))); // pronounced step
1084// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(70, 1.54)));
1085// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(100, 1.34)));
1086// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(150, 1.14)));
1087// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(250, 0.93)));
1088// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(300, 0.86)));
1089
1090// readModeNumber = 0;
1091// readModeName = "Standard";
1092// aCameraGainReadModeVector = new QVector<OptimalExposure::CameraGainReadMode>();
1093// aCameraGainReadModeVector->push_back(*(new OptimalExposure::CameraGainReadMode(readModeNumber, readModeName,
1094// *aCameraGainReadNoiseVector)));
1095
1096
1097// gainSelection = new QVector<int>( { 0, 300 } );
1098// anImagingCameraData = new OptimalExposure::ImagingCameraData(cameraId, OptimalExposure::SENSORTYPE_COLOR,
1099// OptimalExposure::GAIN_SELECTION_TYPE_NORMAL, *gainSelection, *aCameraGainReadModeVector);
1100// anImagingCameraData->setDataClassVersion(1);
1101// OptimalExposure::FileUtilityCameraData::writeCameraDataFile(anImagingCameraData);
1102
1103// cameraId = "ZWO CCD ASI120MC"; // formerly "ZWOASI-120MC" but now assuming a standard naming convention from ZWO
1104// aCameraGainReadNoiseVector = new QVector<OptimalExposure::CameraGainReadNoise>();
1105// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(0, 6.35)));
1106// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(10, 6.41)));
1107// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(15, 6.5)));
1108// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(16, 4.63))); // pronounced step
1109// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(20, 4.67))); // a rise after the step down
1110// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(31, 4.7))); // another step
1111// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(32, 3.87)));
1112// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(47, 3.95))); // rise after the step down
1113// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(48, 3.7)));
1114// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(63, 3.68))); // another step
1115// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(64, 3.54)));
1116// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(75, 3.66))); // rise after a step down
1117// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(87, 3.62)));
1118// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(100, 3.62)));
1119
1120// readModeNumber = 0;
1121// readModeName = "Standard";
1122
1123// aCameraGainReadModeVector = new QVector<OptimalExposure::CameraGainReadMode>();
1124// aCameraGainReadModeVector->push_back(*(new OptimalExposure::CameraGainReadMode(readModeNumber, readModeName,
1125// *aCameraGainReadNoiseVector)));
1126
1127
1128// gainSelection = new QVector<int>( { 0, 100 } );
1129// anImagingCameraData = new OptimalExposure::ImagingCameraData(cameraId, OptimalExposure::SENSORTYPE_COLOR,
1130// OptimalExposure::GAIN_SELECTION_TYPE_NORMAL, *gainSelection, *aCameraGainReadModeVector);
1131// anImagingCameraData->setDataClassVersion(1);
1132// OptimalExposure::FileUtilityCameraData::writeCameraDataFile(anImagingCameraData);
1133
1134// cameraId = "ZWO CCD ASI183MC Pro"; // (The same read-noise is used in both Mono and Color)
1135// aCameraGainReadNoiseVector = new QVector<OptimalExposure::CameraGainReadNoise>();
1136// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(0, 3.00)));
1137// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(50, 2.6)));
1138// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(100, 2.22)));
1139// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(150, 2.02)));
1140// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(200, 1.84)));
1141// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(250, 1.75)));
1142// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(270, 1.68)));
1143// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(300, 1.58)));
1144
1145// readModeNumber = 0;
1146// readModeName = "Standard";
1147
1148// aCameraGainReadModeVector = new QVector<OptimalExposure::CameraGainReadMode>();
1149// aCameraGainReadModeVector->push_back(*(new OptimalExposure::CameraGainReadMode(readModeNumber, readModeName,
1150// *aCameraGainReadNoiseVector)));
1151
1152
1153// gainSelection = new QVector<int>( { 0, 300 } );
1154// anImagingCameraData = new OptimalExposure::ImagingCameraData(cameraId, OptimalExposure::SENSORTYPE_COLOR,
1155// OptimalExposure::GAIN_SELECTION_TYPE_NORMAL, *gainSelection, *aCameraGainReadModeVector);
1156// anImagingCameraData->setDataClassVersion(1);
1157// OptimalExposure::FileUtilityCameraData::writeCameraDataFile(anImagingCameraData);
1158
1159// cameraId = "ZWO CCD ASI183MM Pro"; // The same read-noise is used in both Mono and Color
1160// aCameraGainReadNoiseVector = new QVector<OptimalExposure::CameraGainReadNoise>();
1161// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(0, 3.00)));
1162// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(50, 2.6)));
1163// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(100, 2.22)));
1164// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(150, 2.02)));
1165// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(200, 1.84)));
1166// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(250, 1.75)));
1167// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(270, 1.68)));
1168// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(300, 1.58)));
1169
1170// readModeNumber = 0;
1171// readModeName = "Standard";
1172
1173// aCameraGainReadModeVector = new QVector<OptimalExposure::CameraGainReadMode>();
1174// aCameraGainReadModeVector->push_back(*(new OptimalExposure::CameraGainReadMode(readModeNumber, readModeName,
1175// *aCameraGainReadNoiseVector)));
1176
1177
1178// gainSelection = new QVector<int>( { 0, 300 } );
1179// anImagingCameraData = new OptimalExposure::ImagingCameraData(cameraId, OptimalExposure::SENSORTYPE_MONOCHROME,
1180// OptimalExposure::GAIN_SELECTION_TYPE_NORMAL, *gainSelection, *aCameraGainReadModeVector);
1181// anImagingCameraData->setDataClassVersion(1);
1182// OptimalExposure::FileUtilityCameraData::writeCameraDataFile(anImagingCameraData);
1183
1184
1185
1186// cameraId = "ZWO CCD ASI2600MM Pro"; // formerly "ZWOASI-2600MM" but now assuming a standard naming convention from ZWO
1187// aCameraGainReadNoiseVector = new QVector<OptimalExposure::CameraGainReadNoise>();
1188// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(0, 3.28)));
1189// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(50, 3.06)));
1190// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(99, 2.88)));
1191// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(100, 1.46)));
1192// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(150, 1.42)));
1193// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(200, 1.42)));
1194// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(250, 1.35)));
1195// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(300, 1.35)));
1196// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(350, 1.25)));
1197// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(400, 1.17)));
1198// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(450, 1.11)));
1199// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(460, 1.03)));
1200
1201// readModeNumber = 0;
1202// readModeName = "Standard";
1203// aCameraGainReadModeVector = new QVector<OptimalExposure::CameraGainReadMode>();
1204// aCameraGainReadModeVector->push_back(*(new OptimalExposure::CameraGainReadMode(readModeNumber, readModeName,
1205// *aCameraGainReadNoiseVector)));
1206
1207
1208// gainSelection = new QVector<int>( { 0, 460 } );
1209// anImagingCameraData = new OptimalExposure::ImagingCameraData(cameraId, OptimalExposure::SENSORTYPE_MONOCHROME,
1210// OptimalExposure::GAIN_SELECTION_TYPE_NORMAL, *gainSelection, *aCameraGainReadModeVector);
1211// anImagingCameraData->setDataClassVersion(1);
1212// OptimalExposure::FileUtilityCameraData::writeCameraDataFile(anImagingCameraData);
1213
1214
1215
1216// cameraId = "ZWO CCD ASI290MM Mini"; //
1217// aCameraGainReadNoiseVector = new QVector<OptimalExposure::CameraGainReadNoise>();
1218
1219// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(0, 3.23)));
1220// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(50, 2.66)));
1221// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(59, 2.62)));
1222// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(60, 1.66)));
1223// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(100, 1.45)));
1224// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(150, 1.29)));
1225// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(200, 1.13)));
1226// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(250, 1.11)));
1227// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(300, 1.01)));
1228// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(350, 0.96)));
1229
1230// readModeNumber = 0;
1231// readModeName = "Standard";
1232// aCameraGainReadModeVector = new QVector<OptimalExposure::CameraGainReadMode>();
1233// aCameraGainReadModeVector->push_back(*(new OptimalExposure::CameraGainReadMode(readModeNumber, readModeName,
1234// *aCameraGainReadNoiseVector)));
1235
1236
1237// gainSelection = new QVector<int>( { 0, 350 } );
1238// anImagingCameraData = new OptimalExposure::ImagingCameraData(cameraId, OptimalExposure::SENSORTYPE_MONOCHROME,
1239// OptimalExposure::GAIN_SELECTION_TYPE_NORMAL, *gainSelection, *aCameraGainReadModeVector);
1240// anImagingCameraData->setDataClassVersion(1);
1241// OptimalExposure::FileUtilityCameraData::writeCameraDataFile(anImagingCameraData);
1242
1243
1244
1245
1246
1247
1248
1249
1250// cameraId = "QHY CCD 533M"; // Assuming the QHY cameraId appear similar to ZWO
1251// aCameraGainReadNoiseVector = new QVector<OptimalExposure::CameraGainReadNoise>();
1252// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(0, 3.34)));
1253// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(5, 3.3)));
1254// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(10, 3.32)));
1255// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(15, 3.4)));
1256// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(20, 3.3)));
1257// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(25, 3.22)));
1258// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(30, 3.19)));
1259// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(35, 3.09)));
1260// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(40, 3.18)));
1261// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(45, 3.12)));
1262// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(50, 3.05)));
1263// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(55, 2.93)));
1264// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(60, 1.66))); // pronounced step
1265// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(65, 1.6)));
1266// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(70, 1.56)));
1267// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(75, 1.54)));
1268// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(80, 1.51)));
1269// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(85, 1.45)));
1270// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(90, 1.4)));
1271// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(95, 1.34)));
1272
1273// readModeNumber = 0;
1274// readModeName = "Standard";
1275
1276// aCameraGainReadModeVector = new QVector<OptimalExposure::CameraGainReadMode>();
1277// aCameraGainReadModeVector->push_back(*(new OptimalExposure::CameraGainReadMode(readModeNumber, readModeName,
1278// *aCameraGainReadNoiseVector)));
1279
1280
1281// gainSelection = new QVector<int>( { 0, 95 } );
1282// anImagingCameraData = new OptimalExposure::ImagingCameraData(cameraId, OptimalExposure::SENSORTYPE_MONOCHROME,
1283// OptimalExposure::GAIN_SELECTION_TYPE_NORMAL, *gainSelection, *aCameraGainReadModeVector);
1284// anImagingCameraData->setDataClassVersion(1);
1285// OptimalExposure::FileUtilityCameraData::writeCameraDataFile(anImagingCameraData);
1286
1287
1288
1289// cameraId = "MI CCD C3"; // Not sure how Moravian cameras appear on USB or KStars, need research.
1290// aCameraGainReadNoiseVector = new QVector<OptimalExposure::CameraGainReadNoise>();
1291// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(0, 3.51)));
1292// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(2749, 3.15)));
1293// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(2750, 1.46)));
1294// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(4030, 1.39)));
1295
1296// readModeNumber = 0;
1297// readModeName = "Standard";
1298
1299// aCameraGainReadModeVector = new QVector<OptimalExposure::CameraGainReadMode>();
1300// aCameraGainReadModeVector->push_back(*(new OptimalExposure::CameraGainReadMode(readModeNumber, readModeName,
1301// *aCameraGainReadNoiseVector)));
1302
1303// gainSelection = new QVector<int>( { 0, 4030 } );
1304// anImagingCameraData = new OptimalExposure::ImagingCameraData(cameraId, OptimalExposure::SENSORTYPE_MONOCHROME,
1305// OptimalExposure::GAIN_SELECTION_TYPE_NORMAL, *gainSelection, *aCameraGainReadModeVector);
1306// anImagingCameraData->setDataClassVersion(1);
1307// OptimalExposure::FileUtilityCameraData::writeCameraDataFile(anImagingCameraData);
1308
1309
1310// // DSLR Read-noise for ISO values data found at: https://www.photonstophotos.net/Charts/RN_e.htm
1311
1312// // For a Nikon D5000 usb id reads "Nikon Corp. D5000", Kstars shows "Nikon DSLR DSC D5000 (PTP mode)"
1313// cameraId = "Nikon DSLR DSC D5000 (PTP mode)";
1314// aCameraGainReadNoiseVector = new QVector<OptimalExposure::CameraGainReadNoise>();
1315// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(100, 7.727))); // log2 value 2.95
1316// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(126, 7.674))); // log2 value 2.94
1317// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(159, 7.727))); // log2 value 2.95
1318// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(200, 6.320))); // log2 value 2.36)
1319// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(251, 5.134))); // log2 value 2.36)
1320// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(318, 5.169))); // log2 value 2.37
1321// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(400, 4.532))); // log2 value 2.18
1322// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(503, 4.79))); // log2 value 2.26
1323// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(636, 5.169))); // log2 value 2.37
1324// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(800, 4.925))); // log2 value 2.3
1325// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(1006, 4.891))); // log2 value 2.29
1326// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(1273, 4.724))); // log2 value 2.24
1327// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(1600, 4.5))); // log2 value 2.17
1328// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(2011, 4.028))); // log2 value 2.01
1329// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(2546, 3.34))); // log2 value 1.74
1330// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(3200, 2.969))); // log2 value 1.57
1331// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(4022, 2.828))); // log2 value 1.5
1332// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(5091, 2.789))); // log2 value 1.48
1333// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(6400, 2.732))); // log2 value 1.45
1334
1335// readModeNumber = 0;
1336// readModeName = "Standard";
1337// aCameraGainReadModeVector = new QVector<OptimalExposure::CameraGainReadMode>();
1338// aCameraGainReadModeVector->push_back(*(new OptimalExposure::CameraGainReadMode(readModeNumber, readModeName,
1339// *aCameraGainReadNoiseVector)));
1340
1341
1342// // Unfortunately this data from www.photonstophotos.net does not align precisely with the discrete values for the ISO in the camera.
1343// // So, the proof of concept code, which needs a list of iso values will use an array from the file.
1344// // The following array would likely come from Ekos with getActiveChip()->getISOList() ?
1345
1346// gainSelection = new QVector<int>( { 100, 125, 160, 250, 320, 400, 500, 640, 800, 1000, 1250, 1600, 2000, 2500, 3200, 4000, 5000, 6400 } );
1347// anImagingCameraData = new OptimalExposure::ImagingCameraData(cameraId, OptimalExposure::SENSORTYPE_COLOR,
1348// OptimalExposure::GAIN_SELECTION_TYPE_ISO_DISCRETE, *gainSelection, *aCameraGainReadModeVector);
1349// anImagingCameraData->setDataClassVersion(1);
1350// OptimalExposure::FileUtilityCameraData::writeCameraDataFile(anImagingCameraData);
1351
1352
1353// // Driver id is "Canon DSLR"
1354// cameraId = "Canon DSLR EOS Ra"; // Not sure how Canon cameras appear on USB, or KStars need research.
1355
1356// aCameraGainReadNoiseVector = new QVector<OptimalExposure::CameraGainReadNoise>();
1357// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(100, 9.063))); // log2 value 3.18
1358// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(126, 10.2)));
1359// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(159, 5.58)));
1360// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(200, 4.96)));
1361// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(251, 5.46)));
1362// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(318, 3.14)));
1363// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(400, 3.18)));
1364// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(503, 3.34)));
1365// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(636, 2.41)));
1366// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(800, 2.41)));
1367// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(1006, 2.48)));
1368// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(1273, 1.92)));
1369// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(1600, 1.91)));
1370// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(2011, 1.91)));
1371// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(2546, 1.65)));
1372// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(3200, 1.67)));
1373// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(4022, 1.68)));
1374// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(5091, 1.4)));
1375// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(6400, 1.38)));
1376// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(8045, 1.36)));
1377// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(10183, 1.38)));
1378// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(12800, 1.38)));
1379// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(16090, 1.38)));
1380// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(20366, 1.34)));
1381// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(25600, 1.33)));
1382// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(32180, 1.35)));
1383// aCameraGainReadNoiseVector->push_back(*(new OptimalExposure::CameraGainReadNoise(40731, 1.34)));
1384
1385
1386// readModeNumber = 0;
1387// readModeName = "Standard";
1388
1389// aCameraGainReadModeVector = new QVector<OptimalExposure::CameraGainReadMode>();
1390// aCameraGainReadModeVector->push_back(*(new OptimalExposure::CameraGainReadMode(readModeNumber, readModeName,
1391// *aCameraGainReadNoiseVector)));
1392
1393// gainSelection = new QVector<int>( { 100, 125, 160, 200, 250, 320, 400, 500, 640, 800, 1000, 1250, 1600, 2000, 2500, 3200, 4000, 5000, 6400, 8000, 10200, 12800, 16000, 20400, 25600, 32000, 40000 } );
1394
1395// anImagingCameraData = new OptimalExposure::ImagingCameraData(cameraId, OptimalExposure::SENSORTYPE_COLOR,
1396// OptimalExposure::GAIN_SELECTION_TYPE_ISO_DISCRETE, *gainSelection, *aCameraGainReadModeVector);
1397// anImagingCameraData->setDataClassVersion(1);
1398// OptimalExposure::FileUtilityCameraData::writeCameraDataFile(anImagingCameraData);
1399
1400
1401
1402//}
1403
KIOCORE_EXPORT MkpathJob * mkpath(const QUrl &url, const QUrl &baseUrl=QUrl(), JobFlags flags=DefaultFlags)
KGuiItem find()
std::string toStdString() const const
QString filePath(const QString &fileName) const const
bool mkpath(const QString &dirPath) const const
QByteArray readAll()
void append(QList< T > &&value)
iterator begin()
qsizetype count() const const
iterator end()
void push_back(parameter_type value)
QNetworkReply * get(const QNetworkRequest &request)
virtual void abort()=0
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
NetworkError error() const const
void errorOccurred(QNetworkReply::NetworkError code)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void deleteLater()
void destroyed(QObject *obj)
QString tr(const char *sourceText, const char *disambiguation, int n)
bool endsWith(QChar c, Qt::CaseSensitivity cs) const const
QString fromLatin1(QByteArrayView str)
QString fromStdString(const std::string &str)
qsizetype length() const const
QString number(double n, char format, int precision)
QString & replace(QChar before, QChar after, Qt::CaseSensitivity cs)
double toDouble(bool *ok) const const
int toInt(bool *ok, int base) const const
void truncate(qsizetype position)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.