Kstars

profileinfo.cpp
1/*
2 SPDX-FileCopyrightText: 2016 Jasem Mutlaq <mutlaqja@ikarustech.com>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#include "profileinfo.h"
8
9ProfileInfo::ProfileInfo(int id, const QString &name)
10{
11 this->name = name;
12 this->id = id;
13 port = INDIWebManagerPort = guiderport = -1;
14}
15
16QString ProfileInfo::mount() const
17{
18 if (drivers.contains("Mount"))
19 return drivers["Mount"];
20 else
21 return QString();
22}
23
24QString ProfileInfo::ccd() const
25{
26 if (drivers.contains("CCD"))
27 return drivers["CCD"];
28 else
29 return QString();
30}
31
32QString ProfileInfo::guider() const
33{
34 if (drivers.contains("Guider"))
35 return drivers["Guider"];
36 else
37 return QString();
38}
39
40QString ProfileInfo::focuser() const
41{
42 if (drivers.contains("Focuser"))
43 return drivers["Focuser"];
44 else
45 return QString();
46}
47
48QString ProfileInfo::filter() const
49{
50 if (drivers.contains("Filter"))
51 return drivers["Filter"];
52 else
53 return QString();
54}
55
56QString ProfileInfo::dome() const
57{
58 if (drivers.contains("Dome"))
59 return drivers["Dome"];
60 else
61 return QString();
62}
63
64QString ProfileInfo::weather() const
65{
66 if (drivers.contains("Weather"))
67 return drivers["Weather"];
68 else
69 return QString();
70}
71
72QString ProfileInfo::ao() const
73{
74 if (drivers.contains("AO"))
75 return drivers["AO"];
76 else
77 return QString();
78}
79
80QString ProfileInfo::aux1() const
81{
82 if (drivers.contains("Aux1"))
83 return drivers["Aux1"];
84 else
85 return QString();
86}
87
88QString ProfileInfo::aux2() const
89{
90 if (drivers.contains("Aux2"))
91 return drivers["Aux2"];
92 else
93 return QString();
94}
95
96QString ProfileInfo::aux3() const
97{
98 if (drivers.contains("Aux3"))
99 return drivers["Aux3"];
100 else
101 return QString();
102}
103
104QString ProfileInfo::aux4() const
105{
106 if (drivers.contains("Aux4"))
107 return drivers["Aux4"];
108 else
109 return QString();
110}
111
112QJsonObject ProfileInfo::toJson() const
113{
114 return
115 {
116 {"name", name},
117 {"auto_connect", autoConnect},
118 {"port_selector", portSelector},
119 {"mode", host.isEmpty() ? "local" : "remote"},
120 {"remote_host", host},
121 {"remote_port", port},
122 {"indihub", indihub},
123 {"guiding", guidertype},
124 {"remote_guiding_host", guiderhost},
125 {"remote_guiding_port", guiderport},
126 {"use_web_manager", INDIWebManagerPort != -1},
127 {"mount", mount()},
128 {"ccd", ccd()},
129 {"guider", guider()},
130 {"focuser", focuser()},
131 {"filter", filter()},
132 {"ao", ao()},
133 {"dome", dome()},
134 {"weather", weather()},
135 {"aux1", aux1()},
136 {"aux2", aux2()},
137 {"aux3", aux3()},
138 {"aux4", aux4()},
139 {"remote", remotedrivers},
140 };
141}
QString name(StandardAction id)
bool contains(const Key &key) const const
bool isEmpty() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 24 2024 11:49:20 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.