-
Notifications
You must be signed in to change notification settings - Fork 1
/
profileinfo.cpp
146 lines (129 loc) · 3.05 KB
/
profileinfo.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
/* Profile Info
Copyright (C) 2016 Jasem Mutlaq ([email protected])
This application is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
*/
#include "profileinfo.h"
ProfileInfo::ProfileInfo(int id, const QString &name)
{
this->name = name;
this->id = id;
port = INDIWebManagerPort = guiderport = -1;
}
QString ProfileInfo::mount() const
{
if (drivers.contains("Mount"))
return drivers["Mount"];
else
return QString();
}
QString ProfileInfo::ccd() const
{
if (drivers.contains("CCD"))
return drivers["CCD"];
else
return QString();
}
QString ProfileInfo::guider() const
{
if (drivers.contains("Guider"))
return drivers["Guider"];
else
return QString();
}
QString ProfileInfo::focuser() const
{
if (drivers.contains("Focuser"))
return drivers["Focuser"];
else
return QString();
}
QString ProfileInfo::filter() const
{
if (drivers.contains("Filter"))
return drivers["Filter"];
else
return QString();
}
QString ProfileInfo::dome() const
{
if (drivers.contains("Dome"))
return drivers["Dome"];
else
return QString();
}
QString ProfileInfo::weather() const
{
if (drivers.contains("Weather"))
return drivers["Weather"];
else
return QString();
}
QString ProfileInfo::ao() const
{
if (drivers.contains("AO"))
return drivers["AO"];
else
return QString();
}
QString ProfileInfo::aux1() const
{
if (drivers.contains("Aux1"))
return drivers["Aux1"];
else
return QString();
}
QString ProfileInfo::aux2() const
{
if (drivers.contains("Aux2"))
return drivers["Aux2"];
else
return QString();
}
QString ProfileInfo::aux3() const
{
if (drivers.contains("Aux3"))
return drivers["Aux3"];
else
return QString();
}
QString ProfileInfo::aux4() const
{
if (drivers.contains("Aux4"))
return drivers["Aux4"];
else
return QString();
}
QJsonObject ProfileInfo::toJson() const
{
return
{
{"name", name},
{"auto_connect", autoConnect},
{"mode", host.isEmpty() ? "local" : "remote"},
{"remote_host", host},
{"remote_port", port},
{"indihub", indihub},
{"guiding", guidertype},
{"remote_guiding_host", guiderhost},
{"remote_guiding_port", guiderport},
{"use_web_manager", INDIWebManagerPort != -1},
{"primary_scope", primaryscope},
{"guide_scope", guidescope},
{"mount", mount()},
{"ccd", ccd()},
{"guider", guider()},
{"focuser", focuser()},
{"filter", filter()},
{"ao", ao()},
{"dome", dome()},
{"weather", weather()},
{"aux1", aux1()},
{"aux2", aux2()},
{"aux3", aux3()},
{"aux4", aux4()},
{"remote", remotedrivers},
};
}