mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 18:33:30 +00:00
brett plis
This commit is contained in:
@@ -2,23 +2,56 @@ use serde::Serialize;
|
||||
|
||||
#[derive(Serialize)]
|
||||
pub struct Marker {
|
||||
pub longitude: f64,
|
||||
pub latitude: f64,
|
||||
pub name: String,
|
||||
pub uid: String,
|
||||
pub r#type: Option<String>,
|
||||
pub course: Option<i32>,
|
||||
pub azimuth: Option<i32>,
|
||||
pub speed: Option<i32>,
|
||||
pub battery: Option<i32>,
|
||||
pub fov: Option<i32>,
|
||||
pub ce: Option<i32>,
|
||||
pub hae: Option<i32>,
|
||||
pub le: Option<i32>,
|
||||
pub longitude: f64,
|
||||
pub latitude: f64,
|
||||
pub name: String,
|
||||
pub uid: String,
|
||||
pub r#type: String,
|
||||
pub course: i32,
|
||||
pub speed: i32,
|
||||
pub hae: i32,
|
||||
pub api_address: String,
|
||||
pub api_auth_token: String,
|
||||
}
|
||||
|
||||
pub struct MarkerPayload {
|
||||
pub api_address: String,
|
||||
pub api_auth_token: String,
|
||||
pub markers: [Marker],
|
||||
}
|
||||
use arma_rs::FromArma;
|
||||
|
||||
impl FromArma for Marker {
|
||||
fn from_arma(data: String) -> Result<Self, String> {
|
||||
let (
|
||||
uid,
|
||||
latitude,
|
||||
longitude,
|
||||
speed,
|
||||
course,
|
||||
r#type,
|
||||
name,
|
||||
hae,
|
||||
api_address,
|
||||
api_auth_token,
|
||||
) = <(
|
||||
String,
|
||||
f64,
|
||||
f64,
|
||||
i32,
|
||||
i32,
|
||||
String,
|
||||
String,
|
||||
i32,
|
||||
String,
|
||||
String,
|
||||
)>::from_arma(data)?;
|
||||
Ok(Self {
|
||||
uid,
|
||||
latitude,
|
||||
longitude,
|
||||
speed,
|
||||
course,
|
||||
r#type,
|
||||
name,
|
||||
hae,
|
||||
api_address,
|
||||
api_auth_token,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user