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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
//! ZWO Mount Control - Rust library for controlling ZWO AM5/AM3 telescope mounts
//!
//! This library provides a comprehensive interface for controlling ZWO telescope mounts
//! via serial communication, with built-in support for satellite tracking using the
//! `space-dust` crate for TLE/SGP4 propagation.
//!
//! # Features
//!
//! - **GoTo/Slewing**: Command the mount to slew to any celestial coordinates
//! - **Manual Motion**: Control axis motion at various speeds (guide to max slew)
//! - **Tracking**: Enable/disable tracking with sidereal, lunar, solar, or custom rates
//! - **Alt-Az & Equatorial Modes**: Switch between altitude-azimuth and equatorial tracking
//! - **Autoguiding**: Send guide pulses for autoguiding applications
//! - **Satellite Tracking**: Track satellites using TLE data and SGP4 propagation
//! - **Mock Mount**: Test your application without physical hardware
//!
//! # Quick Start
//!
//! ## Connect to a Real Mount
//!
//! ```rust,ignore
//! use zwo_mount_control::{SerialMount, Mount, EquatorialPosition};
//!
//! // Connect via serial port (typical on Linux/Mac)
//! let mut mount = SerialMount::new("/dev/ttyUSB0");
//! mount.connect()?;
//!
//! // Get current position
//! let pos = mount.get_position()?;
//! println!("RA: {}h, Dec: {}°", pos.ra, pos.dec);
//!
//! // Slew to Vega
//! let vega = EquatorialPosition::from_hms_dms(18, 36, 56, 38, 47, 1);
//! mount.goto_equatorial(vega)?;
//! ```
//!
//! ## Use the Mock for Testing
//!
//! ```rust
//! use zwo_mount_control::{MockMount, Mount, EquatorialPosition};
//!
//! let mut mount = MockMount::new();
//! mount.connect().unwrap();
//! mount.unpark().unwrap();
//!
//! // Get current position
//! let pos = mount.get_position().unwrap();
//! println!("Position: {}", pos);
//! ```
//!
//! ## Satellite Tracking
//!
//! ```rust,ignore
//! use zwo_mount_control::{SatelliteTracker, MockMount, Mount};
//!
//! // ISS TLE data
//! let line1 = "1 25544U 98067A 24001.50000000 .00016717 00000-0 10270-3 0 9025";
//! let line2 = "2 25544 51.6400 208.9163 0006703 35.6028 75.3281 15.49560066429339";
//!
//! let mut tracker = SatelliteTracker::from_tle(line1, line2)?;
//!
//! // Set observer location (Los Angeles)
//! tracker.set_observer_location(34.0522, -118.2437, 71.0);
//!
//! // Find next pass
//! let pass = tracker.find_next_pass(chrono::Utc::now(), 24.0)?;
//! if let Some(p) = pass {
//! println!("Next pass: {}", p);
//! }
//!
//! // Track with a mount
//! let mut mount = MockMount::new();
//! mount.connect()?;
//! tracker.track_pass(&mut mount)?;
//! ```
//!
//! # Module Overview
//!
//! | Module | Description |
//! |--------|-------------|
//! | [`mount`] | Core `Mount` trait and mount status types |
//! | [`serial_mount`] | Serial port mount implementation |
//! | [`mock_mount`] | Simulated mount for testing |
//! | [`protocol`] | Serial command definitions |
//! | [`coordinates`] | Coordinate conversion utilities |
//! | [`satellite_tracker`] | Satellite tracking with TLE propagation |
//! | [`error`] | Error types |
//!
//! # Coordinate Systems
//!
//! The mount supports two coordinate systems:
//!
//! ## Equatorial Coordinates (RA/Dec)
//!
//! - **Right Ascension (RA)**: Decimal hours (0-24)
//! - **Declination (Dec)**: Decimal degrees (-90 to +90)
//!
//! ## Horizontal Coordinates (Az/Alt)
//!
//! - **Azimuth (Az)**: Degrees from North (0-360°, clockwise)
//! - **Altitude (Alt)**: Degrees above horizon (0-90°)
// Re-export main types for convenience
pub use ;
pub use ;
pub use MockMount;
pub use ;
pub use ;
pub use ;
pub use ;
/// Convenience function to create an RA value from hours, minutes, seconds.
///
/// # Example
/// ```
/// use zwo_mount_control::ra;
///
/// let ra_vega = ra(18, 36, 56.0);
/// assert!((ra_vega - 18.6155556).abs() < 0.0001);
/// ```
/// Convenience function to create a Dec value from degrees, minutes, seconds.
///
/// # Example
/// ```
/// use zwo_mount_control::dec;
///
/// let dec_vega = dec(38, 47, 1.0);
/// assert!((dec_vega - 38.7836111).abs() < 0.0001);
///
/// let dec_south = dec(-23, 26, 21.0);
/// assert!((dec_south - (-23.439167)).abs() < 0.0001);
/// ```
/// Library version
pub const VERSION: &str = env!;