known position
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
// pub mod multiple_measures;
|
||||
mod beacon_measure;
|
||||
mod device_status;
|
||||
mod known_position;
|
||||
// mod known_position;
|
||||
|
||||
// Renaming types for ease of use outside the scope of this module
|
||||
pub const BEACONMEASURE_TIME_WINDOW: u64 = 4;
|
||||
pub type BeaconMeasure = beacon_measure::BeaconMeasure;
|
||||
pub type KnownPosition = known_position::KnownPosition;
|
||||
// pub type KnownPosition = known_position::KnownPosition;
|
||||
pub type DeviceStatus = device_status::DeviceStatus;
|
||||
|
||||
@@ -13,5 +13,6 @@ pub type MAC = types::mac::MAC;
|
||||
mod models;
|
||||
pub type Antenna = models::antenna::Antenna;
|
||||
pub type DeviceReport = models::DeviceReport;
|
||||
pub type KnownPosition = models::known_position::KnownPosition;
|
||||
|
||||
|
||||
|
||||
@@ -3,12 +3,14 @@ use influxdb::{InfluxDbWriteable, ReadQuery};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::helper::for_async::get_influx_cli;
|
||||
use crate::Point;
|
||||
use crate::{Point,MAC};
|
||||
|
||||
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, InfluxDbWriteable)]
|
||||
pub struct KnownPosition {
|
||||
// pub id: MAC,
|
||||
pub x: f64,
|
||||
pub y: f64,
|
||||
pub z: f64,
|
||||
pub time: DateTime<Utc>,
|
||||
}
|
||||
|
||||
@@ -17,6 +19,7 @@ impl KnownPosition {
|
||||
KnownPosition {
|
||||
x: pos.x,
|
||||
y: pos.y,
|
||||
z: 0.0,
|
||||
time: chrono::Utc::now(),
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
pub mod antenna;
|
||||
pub mod known_position;
|
||||
|
||||
|
||||
#[derive(Debug, serde::Serialize, serde::Deserialize)]
|
||||
pub struct DeviceReport {
|
||||
|
||||
@@ -4,7 +4,7 @@ use kairo_common::helper::for_async::get_influx_cli;
|
||||
use serde::Serialize;
|
||||
use tokio::time;
|
||||
|
||||
use kairo_common::{influxdb_models::KnownPosition, Point};
|
||||
use kairo_common::{KnownPosition, Point};
|
||||
|
||||
use crate::Config;
|
||||
|
||||
|
||||
@@ -4,10 +4,7 @@ use std::{thread, time};
|
||||
mod error_report;
|
||||
|
||||
use kairo_common::helper::for_sync::{get_mqtt_cli, mqtt_pub};
|
||||
use kairo_common::{
|
||||
influxdb_models::{BeaconMeasure, KnownPosition},
|
||||
Antenna, DeviceReport, Point,
|
||||
};
|
||||
use kairo_common::{influxdb_models::BeaconMeasure, Antenna, DeviceReport, KnownPosition, Point};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Config {
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
use itertools::Itertools;
|
||||
use std::collections::HashMap;
|
||||
|
||||
use kairo_common::{
|
||||
influxdb_models::{BeaconMeasure, KnownPosition},
|
||||
Antenna, Point, MAC,
|
||||
};
|
||||
use kairo_common::{influxdb_models::BeaconMeasure, Antenna, KnownPosition, Point, MAC};
|
||||
struct KnownDistance {
|
||||
point: Point,
|
||||
dist: f64,
|
||||
|
||||
Reference in New Issue
Block a user