Changeset View
Changeset View
Standalone View
Standalone View
kstars/ekos/observatory/observatorydomemodel.cpp
- This file was added.
1 | /* Ekos Observatory Module | ||||
---|---|---|---|---|---|
2 | Copyright (C) Wolfgang Reissenberger <sterne-jaeger@t-online.de> | ||||
3 | | ||||
4 | This application is free software; you can redistribute it and/or | ||||
5 | modify it under the terms of the GNU General Public | ||||
6 | License as published by the Free Software Foundation; either | ||||
7 | version 2 of the License, or (at your option) any later version. | ||||
8 | */ | ||||
9 | | ||||
10 | #include "observatorydomemodel.h" | ||||
11 | | ||||
12 | namespace Ekos | ||||
13 | { | ||||
14 | | ||||
15 | void ObservatoryDomeModel::initModel(Dome *dome) | ||||
16 | { | ||||
17 | mDome = dome; | ||||
18 | | ||||
19 | connect(mDome, &Dome::ready, this, &ObservatoryDomeModel::ready); | ||||
20 | connect(mDome, &Dome::newStatus, this, &ObservatoryDomeModel::newStatus); | ||||
21 | connect(mDome, &Dome::newShutterStatus, this, &ObservatoryDomeModel::newShutterStatus); | ||||
22 | | ||||
23 | } | ||||
24 | | ||||
25 | | ||||
26 | ISD::Dome::Status ObservatoryDomeModel::status() | ||||
27 | { | ||||
28 | if (mDome == nullptr) | ||||
29 | return ISD::Dome::DOME_IDLE; | ||||
30 | | ||||
31 | return mDome->status(); | ||||
32 | } | ||||
33 | | ||||
34 | ISD::Dome::ShutterStatus ObservatoryDomeModel::shutterStatus() | ||||
35 | { | ||||
36 | if (mDome == nullptr) | ||||
37 | return ISD::Dome::SHUTTER_UNKNOWN; | ||||
38 | | ||||
39 | return mDome->shutterStatus(); | ||||
40 | } | ||||
41 | | ||||
42 | void ObservatoryDomeModel::park() | ||||
43 | { | ||||
44 | if (mDome == nullptr) | ||||
45 | return; | ||||
46 | | ||||
47 | emit newLog("Parking dome..."); | ||||
48 | mDome->park(); | ||||
49 | } | ||||
50 | | ||||
51 | | ||||
52 | void ObservatoryDomeModel::unpark() | ||||
53 | { | ||||
54 | if (mDome == nullptr) | ||||
55 | return; | ||||
56 | | ||||
57 | emit newLog("Unparking dome..."); | ||||
58 | mDome->unpark(); | ||||
59 | } | ||||
60 | | ||||
61 | void ObservatoryDomeModel::openShutter() | ||||
62 | { | ||||
63 | if (mDome == nullptr) | ||||
64 | return; | ||||
65 | | ||||
66 | emit newLog("Opening shutter..."); | ||||
67 | mDome->controlShutter(true); | ||||
68 | } | ||||
69 | | ||||
70 | void ObservatoryDomeModel::closeShutter() | ||||
71 | { | ||||
72 | if (mDome == nullptr) | ||||
73 | return; | ||||
74 | | ||||
75 | emit newLog("Closing shutter..."); | ||||
76 | mDome->controlShutter(false); | ||||
77 | } | ||||
78 | | ||||
79 | } |