Kstars

mosaictilesmodel.cpp
1/*
2 SPDX-FileCopyrightText: 2022 Jasem Mutlaq <mutlaqja@ikarustech.com>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#include <QQuickView>
8#include <klocalizedcontext.h>
9#include <klocalizedstring.h>
10#include <QQmlContext>
11
12#include "mosaictilesmodel.h"
13#include "Options.h"
14#include "ekos_scheduler_debug.h"
15
16namespace Ekos
17{
18
19MosaicTilesModel::MosaicTilesModel(QObject *parent) : QObject(parent)
20{
21 m_FocalLength = Options::telescopeFocalLength();
22 m_CameraSize.setWidth(Options::cameraWidth());
23 m_CameraSize.setHeight(Options::cameraHeight());
24 m_PixelSize.setWidth(Options::cameraPixelWidth());
25 m_PixelSize.setHeight(Options::cameraPixelHeight());
26 m_PositionAngle = Options::cameraRotation();
27}
28
29void MosaicTilesModel::setPositionAngle(double value)
30{
31 m_PositionAngle = std::fmod(value * -1 + 360.0, 360.0);
32}
33
34void MosaicTilesModel::setOverlap(double value)
35{
36 m_Overlap = (value < 0) ? 0 : (1 < value) ? 1 : value;
37}
38
39MosaicTilesModel::~MosaicTilesModel()
40{
41}
42
43std::shared_ptr<MosaicTilesModel::OneTile> MosaicTilesModel::oneTile(int row, int col)
44{
45 int offset = row * m_GridSize.width() + col;
46
47 if (offset < 0 || offset >= m_Tiles.size())
48 return nullptr;
49
50 return m_Tiles[offset];
51}
52
53bool MosaicTilesModel::toXML(const QTextStream &output)
54{
55 Q_UNUSED(output)
56 return false;
57}
58
59bool MosaicTilesModel::fromXML(XMLEle *root)
60{
61 Q_UNUSED(root)
62 return false;
63}
64
65bool MosaicTilesModel::toJSON(QJsonObject &output)
66{
67 Q_UNUSED(output)
68 return false;
69}
70
71bool MosaicTilesModel::fromJSON(const QJsonObject &input)
72{
73 Q_UNUSED(input)
74 return false;
75}
76
77void MosaicTilesModel::appendTile(const OneTile &value)
78{
79 m_Tiles.append(std::make_shared<OneTile>(value));
80}
81
82void MosaicTilesModel::appendEmptyTile()
83{
84 m_Tiles.append(std::make_shared<OneTile>());
85}
86
87void MosaicTilesModel::clearTiles()
88{
89 m_Tiles.clear();
90}
91
92}
Ekos is an advanced Astrophotography tool for Linux.
Definition align.cpp:83
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.