File indexing completed on 2024-04-21 03:43:33

0001 /*
0002     SPDX-FileCopyrightText: 2022 Jasem Mutlaq <mutlaqja@ikarustech.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <QDialog>
0010 
0011 class QQuickView;
0012 class QQuickItem;
0013 class QQmlContext;
0014 
0015 namespace Ekos
0016 {
0017 
0018 class MosaicPlanner : public QWidget
0019 {
0020         Q_OBJECT
0021         Q_PROPERTY(double focalLength MEMBER m_FocalLength NOTIFY focalLengthChanged)
0022         Q_PROPERTY(QSize cameraSize MEMBER m_CameraSize NOTIFY cameraSizeChanged)
0023         Q_PROPERTY(QSizeF pixelSize MEMBER m_PixelSize NOTIFY pixelSizeChanged)
0024         Q_PROPERTY(QSize gridSize MEMBER m_GridSize NOTIFY gridSizeChanged)
0025         Q_PROPERTY(double overlap MEMBER m_Overlap NOTIFY overlapChanged)
0026 
0027     public:
0028         MosaicPlanner(QWidget *parent = nullptr);
0029         ~MosaicPlanner() override;
0030 
0031         // Return Camera Field of View in arcminutes
0032         Q_INVOKABLE QSizeF cameraFOV() const
0033         {
0034             return m_cameraFOV;
0035         }
0036         // Return Mosaic Field of View in arcminutes
0037         Q_INVOKABLE QSizeF mosaicFOV() const
0038         {
0039             return m_MosaicFOV;
0040         }
0041 
0042     public:        
0043 
0044     protected:
0045 
0046     signals:
0047         void focalLengthChanged();
0048         void cameraSizeChanged();
0049         void pixelSizeChanged();
0050         void gridSizeChanged();
0051         void overlapChanged();
0052 
0053     private:
0054 
0055         QQuickView *m_BaseView = nullptr;
0056         QQuickItem *m_BaseObj  = nullptr;
0057         QQmlContext *m_Ctxt    = nullptr;
0058 
0059         double m_FocalLength {0};
0060         QSize m_CameraSize;
0061         QSizeF m_PixelSize, m_cameraFOV {60.1, 44.5}, m_MosaicFOV;
0062         QSize m_GridSize {1,1};
0063         double m_Overlap {10};
0064 };
0065 }