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