dji_log_parser/frame/
home.rs

1use serde::Serialize;
2#[cfg(target_arch = "wasm32")]
3use tsify_next::Tsify;
4
5use crate::record::home::{CompassCalibrationState, GoHomeMode, IOCMode};
6
7#[derive(Serialize, Debug, Default, Clone)]
8#[serde(rename_all = "camelCase")]
9#[cfg_attr(target_arch = "wasm32", derive(Tsify))]
10pub struct FrameHome {
11    /// Home point latitude in degrees
12    pub latitude: f64,
13    /// Home point longitude in degrees
14    pub longitude: f64,
15    /// Home point altitude in meters
16    pub altitude: f32,
17    /// Max allowed height in meters
18    pub height_limit: f32,
19    /// Indicates if home point is recorded
20    pub is_home_record: bool,
21    /// Current return-to-home mode
22    #[cfg_attr(target_arch = "wasm32", tsify(optional))]
23    pub go_home_mode: Option<GoHomeMode>,
24    /// Indicates if dynamic home point is enabled
25    pub is_dynamic_home_point_enabled: bool,
26    /// Indicates if the drone is near its distance limit
27    pub is_near_distance_limit: bool,
28    /// Indicates if the drone is near its height limit
29    pub is_near_height_limit: bool,
30    /// Indicates if compass calibration is in progress
31    pub is_compass_calibrating: bool,
32    /// Current state of compass calibration
33    #[cfg_attr(target_arch = "wasm32", tsify(optional))]
34    pub compass_calibration_state: Option<CompassCalibrationState>,
35    /// Indicates if multiple flight modes are enabled
36    pub is_multiple_mode_enabled: bool,
37    /// Indicates if beginner mode is active
38    pub is_beginner_mode: bool,
39    /// Indicates if Intelligent Orientation Control is enabled
40    pub is_ioc_enabled: bool,
41    /// Current Intelligent Orientation Control mode
42    #[cfg_attr(target_arch = "wasm32", tsify(optional))]
43    pub ioc_mode: Option<IOCMode>,
44    /// Return-to-home height in meters
45    pub go_home_height: u16,
46    /// Intelligent Orientation Control course lock angle
47    #[cfg_attr(target_arch = "wasm32", tsify(optional))]
48    pub ioc_course_lock_angle: Option<i16>,
49    /// Maximum allowed height for the drone in meters
50    pub max_allowed_height: f32,
51    /// Index of the current flight record
52    pub current_flight_record_index: u16,
53}