2
2
3
3
#if HEADLESS_CLIENT == 0
4
4
#if SUPPORT_POINTS_OF_INTEREST == 1
5
- struct PointOfInterest {
6
- const char * pDisplay;
5
+ struct PointOfInterest
6
+ {
7
+ const char *pDisplay;
7
8
byte hourRA;
8
9
byte minRA;
9
10
byte secRA;
@@ -14,89 +15,104 @@ struct PointOfInterest {
14
15
15
16
// Points of interest are sorted by DEC
16
17
PointOfInterest pointOfInterest[] = {
17
- // Name (15chars) RA (hms) DEC (dms)
18
- // 012345678901234
19
- { " >Polaris" , POLARIS_RA_HOUR, POLARIS_RA_MINUTE, POLARIS_RA_SECOND, 89 , 21 , 6 },
20
- { " >Veil Nebula" ,20 , 51 , 28 , 30 , 59 , 30 },
21
- { " >M81 Bodes Galxy" , 9 , 57 , 13 , 68 , 58 , 1 },
22
- { " >Cederblad 214" , 0 , 5 , 46 , 67 , 16 , 45 },
23
- { " >Heart Nebula" , 2 , 34 , 57 , 61 , 31 , 17 },
24
- { " >Navi" , 0 , 57 , 57 , 60 , 49 , 33 },
25
- { " >Soul Nebula" , 2 , 52 , 47 , 60 , 30 , 56 },
26
- { " >Elephant Trunk" ,21 , 39 , 44 , 57 , 35 , 31 },
27
- { " >Big Dipper" ,12 , 16 , 26 , 56 , 55 , 7 },
28
- { " >M101 Pinwheel" ,14 , 3 , 56 , 54 , 15 , 0 },
29
- { " >M51 Whirlpool" ,13 , 30 , 45 , 47 , 5 , 21 },
30
- { " >Deneb (Cygnus)" ,20 , 42 , 7 , 45 , 21 , 12 },
31
- { " >M63 Sunflower" ,13 , 16 , 45 , 41 , 55 , 14 },
32
- { " >M31 Andromeda" , 0 , 43 , 52 , 41 , 22 , 53 },
33
- { " >Vega" ,18 , 37 , 37 , 38 , 48 , 7 },
34
- { " >Arcturus" ,14 , 16 , 37 , 19 , 5 , 21 },
35
- { " >Altair" ,19 , 51 , 45 , 8 , 55 , 15 },
36
- { " >M42 Orion Nbula" , 5 , 36 , 18 , -5 , 22 , 44 },
37
- { " >Lagoon Nebula" ,18 , 5 , 2 , -24 , 22 , 52 },
18
+ // Name (15chars) RA (hms) DEC (dms)
19
+ // 0123456789012345
20
+ {" >Polaris" , POLARIS_RA_HOUR, POLARIS_RA_MINUTE, POLARIS_RA_SECOND, 89 , 21 , 6 },
21
+ {" >Veil Nebula" , 20 , 51 , 28 , 30 , 59 , 30 },
22
+ {" >M81 Bodes Galxy" , 9 , 57 , 13 , 68 , 58 , 1 },
23
+ {" >Cederblad 214" , 0 , 5 , 46 , 67 , 16 , 45 },
24
+ {" >Heart Nebula" , 2 , 34 , 57 , 61 , 31 , 17 },
25
+ {" >Navi" , 0 , 57 , 57 , 60 , 49 , 33 },
26
+ {" >Soul Nebula" , 2 , 52 , 47 , 60 , 30 , 56 },
27
+ {" >Elephant Trunk" , 21 , 39 , 44 , 57 , 35 , 31 },
28
+ {" >Big Dipper" , 12 , 16 , 26 , 56 , 55 , 7 },
29
+ {" >M101 Pinwheel" , 14 , 3 , 56 , 54 , 15 , 0 },
30
+ {" >M51 Whirlpool" , 13 , 30 , 45 , 47 , 5 , 21 },
31
+ {" >Deneb (Cygnus)" , 20 , 42 , 7 , 45 , 21 , 12 },
32
+ {" >M63 Sunflower" , 13 , 16 , 45 , 41 , 55 , 14 },
33
+ {" >M31 Andromeda" , 0 , 43 , 52 , 41 , 22 , 53 },
34
+ {" >Vega" , 18 , 37 , 37 , 38 , 48 , 7 },
35
+ {" >M33 Triangulum" , 1 , 35 , 02 , 30 , 46 , 5 },
36
+ {" >Pleiades 7Sistr" , 3 , 48 , 15 , 24 , 10 , 54 },
37
+ {" >Arcturus" , 14 , 16 , 37 , 19 , 5 , 21 },
38
+ {" >Altair" , 19 , 51 , 45 , 8 , 55 , 15 },
39
+ {" >M42 Orion Nbula" , 5 , 36 , 18 , -5 , 22 , 44 },
40
+ {" >Lagoon Nebula" , 18 , 5 , 2 , -24 , 22 , 52 },
38
41
39
- // Add new items above here, not below.
40
- { " >Home" , 0 , 0 , 0 , 90 , 0 , 0 },
41
- { " >Unpark" , 0 , 0 , 0 , 90 , 0 , 0 },
42
- { " >Park" , 0 , 0 , 0 , 90 , 0 , 0 },
43
- // And definitely don't add here.
42
+ // Add new items above here, not below.
43
+ { " >Home" , 0 , 0 , 0 , 90 , 0 , 0 },
44
+ { " >Unpark" , 0 , 0 , 0 , 90 , 0 , 0 },
45
+ { " >Park" , 0 , 0 , 0 , 90 , 0 , 0 },
46
+ // And definitely don't add here.
44
47
};
45
48
46
49
int currentPOI = 0 ;
47
50
int parkPOI = sizeof (pointOfInterest) / sizeof (pointOfInterest[0 ]) - 1 ;
48
51
int unparkPOI = sizeof (pointOfInterest) / sizeof (pointOfInterest[0 ]) - 2 ;
49
52
byte homePOI = sizeof (pointOfInterest) / sizeof (pointOfInterest[0 ]) - 3 ;
50
53
51
- bool processPOIKeys () {
54
+ bool processPOIKeys ()
55
+ {
52
56
byte key;
53
57
bool waitForRelease = false ;
54
- if (lcdButtons.keyChanged (&key)) {
58
+ if (lcdButtons.keyChanged (&key))
59
+ {
55
60
waitForRelease = true ;
56
- switch (key) {
57
- case btnSELECT: {
58
- mount.stopSlewing (ALL_DIRECTIONS);
59
- if (currentPOI == homePOI) {
60
- mount.goHome ();
61
- }
62
- else if (currentPOI == parkPOI) {
63
- mount.park ();
64
- }
65
- else if (currentPOI == unparkPOI) {
66
- mount.startSlewing (TRACKING);
67
- }
68
- else {
69
- PointOfInterest* poi = &pointOfInterest[currentPOI];
70
- mount.targetRA ().set (poi->hourRA , poi->minRA , poi->secRA );
71
- mount.targetDEC ().set (poi->degreeDEC - (NORTHERN_HEMISPHERE ? 90 : -90 ), poi->minDEC , poi->secDEC ); // internal DEC degree is 0 at celestial poles
72
- mount.startSlewingToTarget ();
73
- }
61
+ switch (key)
62
+ {
63
+ case btnSELECT:
64
+ {
65
+ mount.stopSlewing (ALL_DIRECTIONS);
66
+ if (currentPOI == homePOI)
67
+ {
68
+ mount.goHome ();
74
69
}
75
- break ;
76
-
77
- case btnLEFT:
78
- case btnDOWN: {
79
- currentPOI = adjustWrap (currentPOI, 1 , 0 , parkPOI);
70
+ else if (currentPOI == parkPOI)
71
+ {
72
+ mount.park ();
80
73
}
81
- break ;
82
-
83
- case btnUP: {
84
- currentPOI = adjustWrap (currentPOI, -1 , 0 , parkPOI);
74
+ else if (currentPOI == unparkPOI)
75
+ {
76
+ mount.startSlewing (TRACKING);
85
77
}
86
- break ;
87
-
88
- case btnRIGHT: {
89
- lcdMenu.setNextActive ();
78
+ else
79
+ {
80
+ PointOfInterest *poi = &pointOfInterest[currentPOI];
81
+ mount.targetRA ().set (poi->hourRA , poi->minRA , poi->secRA );
82
+ mount.targetDEC ().set (poi->degreeDEC - (NORTHERN_HEMISPHERE ? 90 : -90 ), poi->minDEC , poi->secDEC ); // internal DEC degree is 0 at celestial poles
83
+ mount.startSlewingToTarget ();
90
84
}
91
- break ;
85
+ }
86
+ break ;
87
+
88
+ case btnLEFT:
89
+ case btnDOWN:
90
+ {
91
+ currentPOI = adjustWrap (currentPOI, 1 , 0 , parkPOI);
92
+ }
93
+ break ;
94
+
95
+ case btnUP:
96
+ {
97
+ currentPOI = adjustWrap (currentPOI, -1 , 0 , parkPOI);
98
+ }
99
+ break ;
100
+
101
+ case btnRIGHT:
102
+ {
103
+ lcdMenu.setNextActive ();
104
+ }
105
+ break ;
92
106
}
93
107
}
94
108
95
109
return waitForRelease;
96
110
}
97
111
98
- void printPOISubmenu () {
99
- if (mount.isSlewingIdle ()) {
112
+ void printPOISubmenu ()
113
+ {
114
+ if (mount.isSlewingIdle ())
115
+ {
100
116
lcdMenu.printMenu (pointOfInterest[currentPOI].pDisplay );
101
117
}
102
118
}
0 commit comments