File indexing completed on 2024-05-19 14:58:12
0001 /* 0002 SPDX-FileCopyrightText: 2023 Joseph McGee <joseph.mcgee@sbcglobal.net> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #ifndef OPTIMALSUBEXPOSURECALCULATOR_H 0010 #define OPTIMALSUBEXPOSURECALCULATOR_H 0011 #include <QAbstractItemModel> 0012 #include <QVector> 0013 #include "imagingcameradata.h" 0014 #include "calculatedgainsubexposuretime.h" 0015 #include "cameraexposureenvelope.h" 0016 #include "optimalexposuredetail.h" 0017 0018 QT_BEGIN_NAMESPACE 0019 namespace OptimalExposure 0020 { 0021 0022 0023 class OptimalSubExposureCalculator 0024 { 0025 public: 0026 OptimalSubExposureCalculator(); 0027 OptimalSubExposureCalculator(double aNoiseTolerance, double aSkyQuality, double aFocalRatio, double aFilterCompensation, 0028 ImagingCameraData &aCalculationImagingCameraData); 0029 0030 CameraExposureEnvelope calculateCameraExposureEnvelope(); 0031 // OptimalExposureDetail calculateSubExposureDetail(int aSelectedGainValue); 0032 OptimalExposureDetail calculateSubExposureDetail(); 0033 0034 double getANoiseTolerance(); 0035 void setANoiseTolerance(double newNoiseTolerance); 0036 0037 double getASkyQuality(); 0038 void setASkyQuality(double newSkyQuality); 0039 0040 double getAFocalRatio(); 0041 void setAFocalRatio(double newFocalRatio); 0042 0043 double getAFilterCompensation(); 0044 void setAFilterCompensation(double newFilterCompensation); 0045 0046 ImagingCameraData &getImagingCameraData(); 0047 void setImagingCameraData(ImagingCameraData &aNewCalculationImagingCameraData); 0048 0049 0050 int getASelectedGain(); 0051 void setASelectedGain(int newSelectedGain); 0052 0053 int getASelectedCameraReadMode() const; 0054 void setASelectedCameraReadMode(int aNewSelectedCameraReadMode); 0055 0056 protected: 0057 double aNoiseTolerance; 0058 double aSkyQuality; 0059 double aFocalRatio; 0060 double aFilterCompensation; 0061 int aSelectedGain = 0; 0062 int aSelectedCameraReadMode = 0; 0063 ImagingCameraData anImagingCameraData; 0064 0065 0066 private: 0067 double calculateCFactor(double noiseTolerance); 0068 double calculateLightPollutionElectronBaseRate(double skyQuality); 0069 double calculateLightPolutionForOpticFocalRatio(double lightPollutionElectronBaseRate, double aFocalRatio, 0070 double AFilterCompensation); 0071 QVector<CalculatedGainSubExposureTime> calculateGainSubExposureVector(double cFactor, 0072 double lightPollutionForOpticFocalRatio); 0073 0074 0075 }; 0076 0077 } 0078 QT_END_NAMESPACE 0079 0080 #endif // OPTIMALSUBEXPOSURECALCULATOR_H