all under models/
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
// pub mod multiple_measures;
|
||||
mod beacon_measure;
|
||||
mod device_status;
|
||||
// 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 DeviceStatus = device_status::DeviceStatus;
|
||||
@@ -1,18 +1,17 @@
|
||||
#![allow(confusable_idents)]
|
||||
#![allow(mixed_script_confusables)]
|
||||
#![allow(non_upper_case_globals)]
|
||||
|
||||
pub mod helper;
|
||||
pub mod influxdb_models;
|
||||
pub mod unit_conversion;
|
||||
|
||||
mod types;
|
||||
pub type Point = types::point::Point;
|
||||
pub type MAC = types::mac::MAC;
|
||||
|
||||
|
||||
mod models;
|
||||
pub type Antenna = models::antenna::Antenna;
|
||||
pub type DeviceReport = models::DeviceReport;
|
||||
pub type DeviceReport = models::DeviceReport;
|
||||
pub type KnownPosition = models::known_position::KnownPosition;
|
||||
|
||||
|
||||
pub type DeviceStatus = models::device_status::DeviceStatus;
|
||||
pub type BeaconMeasure = models::beacon_measure::BeaconMeasure;
|
||||
|
||||
@@ -12,7 +12,6 @@ pub struct Antenna {
|
||||
impl Antenna {
|
||||
const C: f64 = 2.99e8;
|
||||
const F: f64 = 2.4e9;
|
||||
#[allow(non_upper_case_globals)]
|
||||
const λ: f64 = Self::C / Self::F;
|
||||
|
||||
pub fn new(id: &str, tssi: f64, coord: Point) -> Antenna {
|
||||
|
||||
@@ -3,7 +3,7 @@ use influxdb::{InfluxDbWriteable, ReadQuery};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::helper::for_async::get_influx_cli;
|
||||
use crate::influxdb_models::BEACONMEASURE_TIME_WINDOW;
|
||||
use crate::models::BEACONMEASURE_TIME_WINDOW;
|
||||
use crate::MAC;
|
||||
|
||||
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, InfluxDbWriteable)]
|
||||
@@ -3,7 +3,7 @@ use influxdb::{InfluxDbWriteable, ReadQuery};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::helper::for_async::get_influx_cli;
|
||||
use crate::{Point,MAC};
|
||||
use crate::{Point, MAC};
|
||||
|
||||
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, InfluxDbWriteable)]
|
||||
pub struct KnownPosition {
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
pub mod antenna;
|
||||
pub mod beacon_measure;
|
||||
pub mod device_status;
|
||||
pub mod known_position;
|
||||
|
||||
pub const BEACONMEASURE_TIME_WINDOW: u64 = 4;
|
||||
|
||||
#[derive(Debug, serde::Serialize, serde::Deserialize)]
|
||||
pub struct DeviceReport {
|
||||
pub data: Vec<crate::influxdb_models::BeaconMeasure>,
|
||||
pub data: Vec<crate::models::beacon_measure::BeaconMeasure>,
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
pub mod mac;
|
||||
pub mod point;
|
||||
pub mod point;
|
||||
|
||||
@@ -4,7 +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, Antenna, DeviceReport, KnownPosition, Point};
|
||||
use kairo_common::{Antenna, BeaconMeasure, DeviceReport, KnownPosition, Point};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Config {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
pub mod device {
|
||||
use kairo_common::influxdb_models::BeaconMeasure;
|
||||
use kairo_common::BeaconMeasure;
|
||||
use kairo_common::{unit_conversion::UnitsConversion, DeviceReport, MAC};
|
||||
|
||||
use crate::position_solver::solve_for;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use itertools::Itertools;
|
||||
use std::collections::HashMap;
|
||||
|
||||
use kairo_common::{influxdb_models::BeaconMeasure, Antenna, KnownPosition, Point, MAC};
|
||||
use kairo_common::{Antenna, BeaconMeasure, KnownPosition, Point, MAC};
|
||||
struct KnownDistance {
|
||||
point: Point,
|
||||
dist: f64,
|
||||
|
||||
Reference in New Issue
Block a user