Kstars

profilesettings.h
1/*
2 SPDX-FileCopyrightText: 2022 Jasem Mutlaq <mutlaqja@ikarustech.com>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "profileinfo.h"
10
11#include <QJsonArray>
12#include <QObject>
13#include <QSharedPointer>
14#include <QVariantMap>
15
16namespace Ekos
17{
18
19/**
20 * @brief The ProfileSettings class
21 *
22 * General-purpose class to encapsulate profile-specific settings in the database.
23 *
24 * The settings are stored as QVariant Map. Each element in the array should have the following format.
25 * {
26 * "id1": payload1,
27 * "id2", payload2,
28 * ...
29 * }
30 *
31 * 1. The ID is a unique number from the Settings enum.
32 * 2. The Payload is QVariant.
33 *
34 * @author Jasem Mutlaq
35 * @version 1.0
36 */
38{
40
41 public:
42
43 static ProfileSettings *Instance();
44 static void release();
45
46 // Settings
47 typedef enum
48 {
49 PrimaryOpticalTrain,
50
51 CaptureOpticalTrain,
52 FocusOpticalTrain,
53 MountOpticalTrain,
54 GuideOpticalTrain,
55 AlignOpticalTrain,
56 DarkLibraryOpticalTrain,
57 } Settings;
58
59 void setProfile(const QSharedPointer<ProfileInfo> &profile);
60
61 void setOneSetting(Settings id, const QVariant &value);
62 QVariant getOneSetting(Settings id);
63 void initSettings();
64 void setSettings(const QVariantMap &settings);
65 const QVariantMap &getSettings() const
66 {
67 return m_Settings;
68 }
69 uint32_t id() const
70 {
71 return m_Profile->id;
72 }
73
74 signals:
75 void updated();
76
77 private:
78
79 ProfileSettings(QObject *parent = nullptr);
80 static ProfileSettings *m_Instance;
81
83 QVariantMap m_Settings;
84};
85
86}
The ProfileSettings class.
Ekos is an advanced Astrophotography tool for Linux.
Definition align.cpp:83
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:16:40 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.