Warning, file /education/kstars/kstars/ekos/focus/sensorgraphic.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002     SPDX-FileCopyrightText: 2023 John Evans <john.e.evans.email@googlemail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "aberrationinspectorutils.h"
0010 #include <QtWidgets/QWidget>
0011 
0012 // The SensorGraphic class renders a graphic of a camera sensor with the mosaic tiles drawn on it.
0013 // The tiles occupy the correct proportion and position of the sensor.
0014 // Each tile is labelled appropriately, e.g. T = top, TL = top left.
0015 // There is a highlight method where a single tile is highlighted in its appropriate colour.
0016 //
0017 // SensorGraphic behaves like a tooltip. Tooltips seem to only allow text. This class creates a popup window.
0018 // It is a subclass of QWidget where the paintEvent method has been reimplemented.
0019 //
0020 namespace Ekos
0021 {
0022 
0023 class SensorGraphic : public QWidget
0024 {
0025     public:
0026         /**
0027          * @brief create a SensorGraphic with the associated dimensions
0028          * @param parent widget
0029          * @param sensor width (pixels)
0030          * @param sensor height (pixels)
0031          * @param tile size
0032          */
0033         SensorGraphic(const QWidget *parent, const int SW, const int SH, const int tileSize);
0034         ~SensorGraphic();
0035 
0036         /**
0037          * @brief set the tile to highlight
0038          * @param highlight
0039          */
0040         void setHighlight(int highlight);
0041 
0042         /**
0043          * @brief set the tiles to use
0044          * @param useTile array
0045          */
0046         void setTiles(bool useTile[NUM_TILES]);
0047 
0048     protected:
0049         /**
0050          * @brief implemented paintEvent
0051          * @param paint event
0052          */
0053         void paintEvent(QPaintEvent *) override;
0054 
0055     private:
0056         const QWidget * m_Parent;
0057         int m_Highlight { 0 };
0058 
0059         // Picture variables
0060         int m_PW { 0 };
0061         int m_PH { 0 };
0062 
0063         // Sensor variables
0064         int m_SW { 0 };
0065         int m_SH { 0 };
0066         int m_tileSize { 0 };
0067 
0068         // Path to picture resource
0069         QString m_picturePath { ":/icons/sensorgraphic.png" };
0070 
0071         bool m_useTile[NUM_TILES] = { true, true, true, true, true, true, true, true, true };
0072 };
0073 
0074 }