first commit
This commit is contained in:
commit
47dbbb98f5
8 changed files with 2909 additions and 0 deletions
55
src/detectors.rs
Normal file
55
src/detectors.rs
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Deserialize, Clone)]
|
||||
pub struct DetectorFile {
|
||||
#[serde(rename = "type")]
|
||||
pub file_type: String, // "FeatureCollection"
|
||||
pub features: Vec<Feature>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Clone)]
|
||||
pub struct Feature {
|
||||
#[serde(rename = "type")]
|
||||
pub feature_type: String, // "Feature"
|
||||
pub geometry: Geometry,
|
||||
pub properties: Properties,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Clone)]
|
||||
pub struct Geometry {
|
||||
#[serde(rename = "type")]
|
||||
pub geometry_type: String, // "Point"
|
||||
pub coordinates: [f64; 2],
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Clone)]
|
||||
pub struct Properties {
|
||||
pub station: i32,
|
||||
pub user: i32,
|
||||
pub generation: String,
|
||||
pub status: String,
|
||||
|
||||
// Sometimes string timestamp, sometimes number 0
|
||||
pub signal_last_ctime: serde_json::Value,
|
||||
|
||||
pub region_mask: i32,
|
||||
pub comment: Option<String>,
|
||||
pub controller_board: Option<String>,
|
||||
pub firmware: Option<String>,
|
||||
pub city: Option<String>,
|
||||
pub country: Option<String>,
|
||||
pub website: Option<String>,
|
||||
pub counters: Vec<Counter>,
|
||||
pub user_stations: Vec<i32>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Clone)]
|
||||
pub struct Counter {
|
||||
pub region: i32,
|
||||
pub all: i32,
|
||||
pub valid: i32,
|
||||
pub member: i32,
|
||||
pub used: i32,
|
||||
pub min_distance: i64,
|
||||
pub max_distance: i64,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue