2008-04-11 10:11:29 +02:00
|
|
|
#ifndef _REFERENCEPOINT_HH_
|
|
|
|
#define _REFERENCEPOINT_HH_
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
#include <vector>
|
Incorporation de la dernière version de Julien
Extrait de son courriel :
« Par rapport à la précédente j'ai surtout corrigé des bugs. »
Note : la version du listener portable sur Fonera, envoyée en même temps
par Julien, viendra plus tard (le temps que je l'incorpore).
Détail des changements après analyse du code :
aggregator : correction de bogues.
positioning :
* Ajout d'un fichier de config format boost (cfg/config.cfg).
* Makefile : implantation des cibles "install" et "uninstall" ; la cible
"astyle" devient "style".
* accesspoint.{hh,cc}, area.cc, measurement.hh, point.{hh,cc},
referencepoint.{hh,cc} : cosmétique.
* owlps-positioning.c : correction de la lecture du fichier de config
(ajout d'une option permettant de spécifier un fichier alternatif).
* server.cc : essentiellement correction des requêtes.
* libowlps-positioning.{hh,cc} : passage de "unsigned long long" à
"uint64_t" comme type de retour de timeval_to_ms().
writeInDb :
* Ajout de la gestion d'un fichier de config.
* Ajout de deux scripts pour la BDD.
git-svn-id: https://pif.pu-pm.univ-fcomte.fr/svn/loc@96 785a6c6c-259e-4ff1-8b91-dc31627914f0
2009-07-01 15:39:58 +02:00
|
|
|
|
2008-04-11 10:11:29 +02:00
|
|
|
#include "point.hh"
|
|
|
|
#include "measurement.hh"
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
class ReferencePoint
|
2010-05-21 10:35:15 +02:00
|
|
|
{
|
|
|
|
protected:
|
|
|
|
Point coordinates;
|
|
|
|
vector<Measurement> measurement_list;
|
|
|
|
|
|
|
|
public:
|
|
|
|
ReferencePoint(const float &x = 0, const float &y = 0, const float &z = 0)
|
|
|
|
{
|
|
|
|
coordinates.setX(x);
|
|
|
|
coordinates.setY(y);
|
|
|
|
coordinates.setZ(z);
|
|
|
|
};
|
|
|
|
ReferencePoint(const ReferencePoint &rp)
|
|
|
|
{
|
|
|
|
coordinates = rp.coordinates;
|
|
|
|
measurement_list = rp.measurement_list;
|
|
|
|
};
|
|
|
|
ReferencePoint(const Point &c)
|
|
|
|
{
|
|
|
|
coordinates = c;
|
|
|
|
};
|
|
|
|
~ReferencePoint()
|
2009-05-29 13:46:49 +02:00
|
|
|
{
|
2010-05-21 10:35:15 +02:00
|
|
|
measurement_list.clear();
|
2009-05-29 13:46:49 +02:00
|
|
|
};
|
2008-04-11 10:11:29 +02:00
|
|
|
|
2010-05-21 10:35:15 +02:00
|
|
|
float getSsSquareDistance(const vector<Measurement> &m)const;
|
|
|
|
Point getCoordinates()const
|
|
|
|
{
|
|
|
|
return coordinates;
|
|
|
|
};
|
|
|
|
void addMeasurement(const string &mac_a, const int &value);
|
|
|
|
|
|
|
|
void setCoordinates(const Point &p)
|
|
|
|
{
|
|
|
|
coordinates = p;
|
|
|
|
};
|
|
|
|
vector<Measurement> getMeasurementList() const
|
|
|
|
{
|
|
|
|
return measurement_list;
|
|
|
|
} ;
|
|
|
|
bool getPowerForAp(const string &ap_mac, float *p) const ;
|
|
|
|
|
|
|
|
ReferencePoint operator=(const ReferencePoint &rp);
|
|
|
|
operator Point() const ;
|
|
|
|
friend ostream &operator<<(ostream &os, ReferencePoint &rp);
|
|
|
|
};
|
|
|
|
|
2008-04-11 10:11:29 +02:00
|
|
|
#endif
|