[Positioning] Reindent with astyle 1.24
This commit is contained in:
parent
3b6eb55e38
commit
d35e0dd5e5
|
@ -27,22 +27,22 @@ AccessPoint::AccessPoint(const AccessPoint &ap)
|
|||
|
||||
|
||||
bool AccessPoint::operator==(const AccessPoint &ap)const
|
||||
{
|
||||
{
|
||||
if (ap_addr == ap.ap_addr)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool AccessPoint::operator!=(const AccessPoint &ap)const
|
||||
{
|
||||
{
|
||||
if (ap_addr != ap.ap_addr)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@ using std::string;
|
|||
#define AP_DEFAULT_OUTPUT_POWER 20 // Another good value, eq. to 100mW
|
||||
|
||||
class AccessPoint
|
||||
{
|
||||
protected:
|
||||
{
|
||||
protected:
|
||||
Point coordinates;
|
||||
string ap_addr;
|
||||
float friis_index;
|
||||
|
@ -25,7 +25,7 @@ class AccessPoint
|
|||
float antenna_gain;
|
||||
float output_power;
|
||||
|
||||
public:
|
||||
public:
|
||||
AccessPoint(const string &addr = AP_DEFAULT_ADDR, const float &fidx = AP_DEFAULT_FRIIS_INDEX, const Point &coords = Point(), const unsigned int &f = AP_DEFAULT_FREQ, const float &antg = AP_DEFAULT_ANTENNA_GAIN, const float &outp = AP_DEFAULT_OUTPUT_POWER);
|
||||
AccessPoint(const AccessPoint &ap);
|
||||
~AccessPoint() {};
|
||||
|
@ -89,6 +89,6 @@ class AccessPoint
|
|||
bool operator!=(const AccessPoint &ap)const;
|
||||
AccessPoint operator=(const AccessPoint &ap);
|
||||
friend ostream &operator<<(ostream &os, const AccessPoint &ap);
|
||||
};
|
||||
};
|
||||
|
||||
#endif // _ACCESSPOINT_HH_
|
||||
|
|
|
@ -70,7 +70,7 @@ Area::Area(const Area &a)
|
|||
|
||||
|
||||
bool Area::containsPoint(const Point &p)const
|
||||
{
|
||||
{
|
||||
if (p.getX() >= x_min &&
|
||||
p.getX() <= x_max &&
|
||||
p.getY() >= y_min &&
|
||||
|
@ -81,12 +81,12 @@ bool Area::containsPoint(const Point &p)const
|
|||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool Area::operator==(const Area &a)const
|
||||
{
|
||||
{
|
||||
if (area_name == a.area_name &&
|
||||
x_min == a.x_min &&
|
||||
x_max == a.x_max &&
|
||||
|
@ -98,7 +98,7 @@ bool Area::operator==(const Area &a)const
|
|||
return true ;
|
||||
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@ using namespace std;
|
|||
using std::string;
|
||||
|
||||
class Area
|
||||
{
|
||||
protected:
|
||||
{
|
||||
protected:
|
||||
string area_name;
|
||||
float x_min;
|
||||
float x_max;
|
||||
|
@ -19,7 +19,7 @@ class Area
|
|||
float z_min;
|
||||
float z_max;
|
||||
|
||||
public:
|
||||
public:
|
||||
Area(const string &_name = "No name", const float &_x1 = 0, const float &_x2 = 0, const float &_y1 = 0, const float &_y2 = 0, const float &_z1 = 0, const float &_z2 = 0) ;
|
||||
Area(const Area &a) ;
|
||||
~Area() {};
|
||||
|
@ -86,6 +86,6 @@ class Area
|
|||
|
||||
bool operator==(const Area &a)const ;
|
||||
friend ostream &operator<<(ostream &os, const Area &a) ;
|
||||
};
|
||||
};
|
||||
|
||||
#endif // _AREA_HH_
|
||||
|
|
|
@ -132,7 +132,7 @@ bool ClientInfo::operator==(const ClientInfo &c)
|
|||
|
||||
|
||||
void ClientInfo::print_viterbi_V() const
|
||||
{
|
||||
{
|
||||
#ifdef DEBUG_T
|
||||
cout << "//--> ClientInfo::print_viterbi_V()" << endl ;
|
||||
fflush(stdout) ;
|
||||
|
@ -149,4 +149,4 @@ void ClientInfo::print_viterbi_V() const
|
|||
cout << "//<-- ClientInfo::print_viterbi_V()" << endl ;
|
||||
fflush(stdout) ;
|
||||
#endif // DEBUG_T
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,12 +20,12 @@ using namespace std;
|
|||
#define VITERBI_K 8
|
||||
|
||||
class ClientInfo
|
||||
{
|
||||
public :
|
||||
{
|
||||
public :
|
||||
typedef boost::multi_array<float, 2> float_array ; // On utilise boost::multi_array pour viterbi_V.
|
||||
typedef float_array::index float_index ;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
string client_ip;
|
||||
float antenna_gain;
|
||||
int client_listen_port;
|
||||
|
@ -35,7 +35,7 @@ class ClientInfo
|
|||
float_array viterbi_V ;
|
||||
unsigned int viterbi_iteration ; // Nombre d'ensembles d'historique qu'on a déjà passés
|
||||
|
||||
public:
|
||||
public:
|
||||
ClientInfo(const string &ip = CLIENT_DEFAULT_IP, const int &port = CLIENT_DEFAULT_PORT, const float &antg = CLIENT_DEFAULT_ANTENNA_GAIN);
|
||||
ClientInfo(const ClientInfo &c) ;
|
||||
~ClientInfo();
|
||||
|
@ -65,6 +65,6 @@ class ClientInfo
|
|||
} ;
|
||||
|
||||
void print_viterbi_V() const ;
|
||||
};
|
||||
};
|
||||
|
||||
#endif // _CLIENTINFO_HH_
|
||||
|
|
|
@ -43,17 +43,17 @@
|
|||
#define MINMAX_Z_STOP 6
|
||||
|
||||
typedef struct _couple_info
|
||||
{
|
||||
{
|
||||
unsigned char ap_mac_addr_bytes[6]; // Adresse MAC de l'AP
|
||||
int antenna_signal_dbm; // Puissance du signal reçu par l'AP
|
||||
} couple_info;
|
||||
} couple_info;
|
||||
|
||||
typedef struct _request
|
||||
{
|
||||
{
|
||||
unsigned char mobile_mac_addr_bytes[6]; //Adresse MAC du mobile
|
||||
struct timeval request_time; // Date sur le client
|
||||
int nb_couples; // Nombre couples (MAC AP;Puissance)
|
||||
} request;
|
||||
} request;
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
|
|
@ -9,9 +9,9 @@ void Measurement::addSsValue(const int &ssv)
|
|||
}
|
||||
|
||||
float Measurement::getSsSquareDistance(const float &ss)const
|
||||
{
|
||||
{
|
||||
return ((ss - average_ss) * (ss - average_ss));
|
||||
}
|
||||
}
|
||||
|
||||
ostream &operator<<(ostream &os, const Measurement &m)
|
||||
{
|
||||
|
|
|
@ -10,13 +10,13 @@ using namespace std;
|
|||
using std::string;
|
||||
|
||||
class Measurement
|
||||
{
|
||||
protected:
|
||||
{
|
||||
protected:
|
||||
string mac_addr;
|
||||
float average_ss;
|
||||
vector<int> ss_list;
|
||||
|
||||
public:
|
||||
public:
|
||||
Measurement(const string &ma = "ff:ff:ff:ff:ff:ff", const float &avg = 0, const vector<int> &ssl = vector<int>())
|
||||
{
|
||||
mac_addr = ma;
|
||||
|
@ -51,6 +51,6 @@ class Measurement
|
|||
};
|
||||
float getSsSquareDistance(const float &ss)const;
|
||||
friend ostream &operator<<(ostream &os, const Measurement &m);
|
||||
};
|
||||
};
|
||||
|
||||
#endif // _MEASUREMENT_HH_
|
||||
|
|
|
@ -17,7 +17,7 @@ Point Point::operator=(const Point &p)
|
|||
|
||||
|
||||
bool Point::operator<(const Point &p) const
|
||||
{
|
||||
{
|
||||
if (x < p.x)
|
||||
return true ;
|
||||
if (x > p.x)
|
||||
|
@ -32,7 +32,7 @@ bool Point::operator<(const Point &p) const
|
|||
return true ;
|
||||
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -7,13 +7,13 @@
|
|||
using namespace std;
|
||||
|
||||
class Point
|
||||
{
|
||||
protected:
|
||||
{
|
||||
protected:
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
|
||||
public:
|
||||
public:
|
||||
Point(const float &_x = 0, const float &_y = 0, const float &_z = 0)
|
||||
{
|
||||
x = _x;
|
||||
|
@ -100,6 +100,6 @@ class Point
|
|||
return (p <= *this) ;
|
||||
} ;
|
||||
friend ostream &operator<<(ostream & os, const Point &p);
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -647,37 +647,37 @@ bool Positioning::checkTopology()
|
|||
}
|
||||
|
||||
inline bool Positioning::pointExists(const float &x, const float &y, const float &z) const
|
||||
{
|
||||
{
|
||||
return pointExists(reference_point_list, Point(x, y, z));
|
||||
}
|
||||
}
|
||||
|
||||
inline bool Positioning::pointExists(const Point &p) const
|
||||
{
|
||||
{
|
||||
return pointExists(reference_point_list, p);
|
||||
}
|
||||
}
|
||||
|
||||
inline bool Positioning::pointExists(const vector<ReferencePoint> &point_list, const float &x, const float &y, const float &z) const
|
||||
{
|
||||
{
|
||||
return pointExists(point_list, Point(x, y, z));
|
||||
}
|
||||
}
|
||||
|
||||
inline bool Positioning::pointExists(const vector<ReferencePoint> &point_list, const Point &p) const
|
||||
{
|
||||
{
|
||||
return (pointIndex(point_list, p) != -1);
|
||||
}
|
||||
}
|
||||
|
||||
inline int Positioning::pointIndex(const Point &p) const
|
||||
{
|
||||
{
|
||||
return (unsigned int) pointIndex(reference_point_list, p);
|
||||
}
|
||||
}
|
||||
|
||||
inline int Positioning::pointIndex(const vector<ReferencePoint> &point_list, const float &x, const float &y, const float &z) const
|
||||
{
|
||||
{
|
||||
return (unsigned int) pointIndex(point_list, Point(x, y, z)) ;
|
||||
}
|
||||
}
|
||||
|
||||
inline int Positioning::pointIndex(const vector<ReferencePoint> &point_list, const Point &p) const
|
||||
{
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0 ; i < point_list.size() ; i++)
|
||||
|
@ -687,21 +687,21 @@ inline int Positioning::pointIndex(const vector<ReferencePoint> &point_list, con
|
|||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Retourne la position du Point "p" dans le tableau à une dimension "point_tab" de taille "size", ou -1 en cas d'échec. */
|
||||
inline int Positioning::pointIndex(const Point *point_tab, unsigned int &size, const Point &p) const
|
||||
{
|
||||
{
|
||||
for (unsigned int i = 0 ; i < size ; i++)
|
||||
if (point_tab[i] == p)
|
||||
return i;
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Retourne la position du Point "p" dans le vector "point_list", ou -1 en cas d'échec. */
|
||||
inline int Positioning::pointIndex(const vector<Point> &point_list, const Point &p) const
|
||||
{
|
||||
{
|
||||
|
||||
for (unsigned int i = 0 ; i < point_list.size() ; i++)
|
||||
if (point_list[i] == p)
|
||||
|
@ -710,7 +710,7 @@ inline int Positioning::pointIndex(const vector<Point> &point_list, const Point
|
|||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
void Positioning::printReferencePointList()
|
||||
{
|
||||
|
@ -724,10 +724,10 @@ void Positioning::printPointList(vector<ReferencePoint> &point_list)
|
|||
}
|
||||
|
||||
void Positioning::printAccessPointList() const
|
||||
{
|
||||
{
|
||||
for (unsigned int i = 0; i < access_point_list.size(); i++)
|
||||
cout << access_point_list[i] << endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Positioning::printAreatList()
|
||||
{
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
#include "libowlps-positioning.hh"
|
||||
|
||||
class Positioning
|
||||
{
|
||||
private:
|
||||
{
|
||||
private:
|
||||
vector<ReferencePoint> reference_point_list; // Liste des points de référence (calibration).
|
||||
float** reference_point_matrix; // Matrice des distances entre les points de référence.
|
||||
vector<AccessPoint> access_point_list; // Liste des AP connus.
|
||||
|
@ -18,7 +18,7 @@ class Positioning
|
|||
float** waypoint_matrix; // Matrice des distances entre les points de passage.
|
||||
map<string, Area> area_list ; // Liste des zones homogènes (pièces).
|
||||
|
||||
public :
|
||||
public :
|
||||
Positioning() {};
|
||||
~Positioning() {};
|
||||
|
||||
|
@ -68,6 +68,6 @@ class Positioning
|
|||
void printPointList(vector<ReferencePoint> &point_list);
|
||||
void printAccessPointList() const;
|
||||
void printAreatList();
|
||||
};
|
||||
};
|
||||
|
||||
#endif // _POSITIONING_HH_
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
|
||||
float ReferencePoint::getSsSquareDistance(const vector<Measurement> &m)const
|
||||
{
|
||||
{
|
||||
unsigned int i, j;
|
||||
float ret = 0;
|
||||
bool found;
|
||||
|
@ -61,7 +61,7 @@ float ReferencePoint::getSsSquareDistance(const vector<Measurement> &m)const
|
|||
test_m.clear();
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -89,7 +89,7 @@ void ReferencePoint::addMeasurement(const string &mac_a, const int &value)
|
|||
|
||||
|
||||
bool ReferencePoint::getPowerForAp(const string &ap_mac, float *p)const
|
||||
{
|
||||
{
|
||||
unsigned int i;
|
||||
string str = ap_mac;
|
||||
string macLowerCase;
|
||||
|
@ -107,7 +107,7 @@ bool ReferencePoint::getPowerForAp(const string &ap_mac, float *p)const
|
|||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -141,6 +141,6 @@ ostream &operator<<(ostream &os, ReferencePoint &rp)
|
|||
|
||||
/* Opérateur de cast en Point */
|
||||
ReferencePoint::operator Point() const
|
||||
{
|
||||
{
|
||||
return coordinates ;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,12 +10,12 @@
|
|||
using namespace std;
|
||||
|
||||
class ReferencePoint
|
||||
{
|
||||
protected:
|
||||
{
|
||||
protected:
|
||||
Point coordinates;
|
||||
vector<Measurement> measurement_list;
|
||||
|
||||
public:
|
||||
public:
|
||||
ReferencePoint(const float &x = 0, const float &y = 0, const float &z = 0)
|
||||
{
|
||||
coordinates.setX(x);
|
||||
|
@ -56,6 +56,6 @@ class ReferencePoint
|
|||
ReferencePoint operator=(const ReferencePoint &rp);
|
||||
operator Point() const ;
|
||||
friend ostream &operator<<(ostream &os, ReferencePoint &rp);
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
#include "libowlps-positioning.hh"
|
||||
|
||||
class Server
|
||||
{
|
||||
{
|
||||
|
||||
private:
|
||||
private:
|
||||
request att_request;
|
||||
vector<couple_info> recv_info;
|
||||
|
||||
|
@ -31,7 +31,7 @@ class Server
|
|||
|
||||
Positioning pos;
|
||||
|
||||
public:
|
||||
public:
|
||||
Server(int port, int mport)
|
||||
{
|
||||
listen_port = port;
|
||||
|
@ -48,6 +48,6 @@ class Server
|
|||
void treatment();
|
||||
void createResult(Point, int, string);
|
||||
void sendToClient(Point, char *);
|
||||
};
|
||||
};
|
||||
|
||||
#endif // _SERVER_HH_
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include "treatment.hh"
|
||||
|
||||
bool Treatment::apExists(const string &ap_addr)const
|
||||
{
|
||||
{
|
||||
|
||||
string str;
|
||||
|
||||
|
@ -18,10 +18,10 @@ bool Treatment::apExists(const string &ap_addr)const
|
|||
}
|
||||
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int Treatment::apIndex(const string &ap_addr)const
|
||||
{
|
||||
{
|
||||
unsigned int i;
|
||||
string str;
|
||||
|
||||
|
@ -38,7 +38,7 @@ unsigned int Treatment::apIndex(const string &ap_addr)const
|
|||
}
|
||||
|
||||
return 0; // Should never happen
|
||||
}
|
||||
}
|
||||
|
||||
void Treatment::makeMeasurementList(vector<couple_info> recv_info)
|
||||
{
|
||||
|
@ -76,7 +76,7 @@ void Treatment::makeMeasurementList(vector<couple_info> recv_info)
|
|||
}
|
||||
|
||||
vector<Point> Treatment::getkClosestInSs(const unsigned int &k, const Point *point_ignored)const
|
||||
{
|
||||
{
|
||||
|
||||
unsigned int i, j, min_idx;
|
||||
vector<float> distances_vector;
|
||||
|
@ -145,10 +145,10 @@ vector<Point> Treatment::getkClosestInSs(const unsigned int &k, const Point *poi
|
|||
}
|
||||
|
||||
return points_vector;
|
||||
}
|
||||
}
|
||||
|
||||
Point Treatment::fbcm(const int &client_idx)const
|
||||
{
|
||||
{
|
||||
|
||||
Point ret(0, 0, 0);
|
||||
vector<string> addr;
|
||||
|
@ -202,10 +202,10 @@ Point Treatment::fbcm(const int &client_idx)const
|
|||
|
||||
/* Return position */
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
Point Treatment::fbcm_friis(const vector<float> friis_idx_list, const float &z)const
|
||||
{
|
||||
{
|
||||
|
||||
Point ret(0, 0, 0);
|
||||
vector<float> dist_vect;
|
||||
|
@ -257,10 +257,10 @@ Point Treatment::fbcm_friis(const vector<float> friis_idx_list, const float &z)c
|
|||
|
||||
/* Return position */
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
Point Treatment::interlink(const int &client_idx) const
|
||||
{
|
||||
{
|
||||
|
||||
Point ret(0, 0, 0);
|
||||
vector<string> addr;
|
||||
|
@ -309,7 +309,7 @@ Point Treatment::interlink(const int &client_idx) const
|
|||
|
||||
/* Return position */
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
vector<float> Treatment::computeFriisFromRefList(const Point &p)
|
||||
{
|
||||
|
@ -358,7 +358,7 @@ vector<float> Treatment::computeFriisFromRefList(const Point &p)
|
|||
}
|
||||
|
||||
Point Treatment::getkWeightedInSs(const unsigned int &k, const Point *point_ignored)const
|
||||
{
|
||||
{
|
||||
|
||||
unsigned int i, j;
|
||||
vector<float> distances_vector;
|
||||
|
@ -413,4 +413,4 @@ Point Treatment::getkWeightedInSs(const unsigned int &k, const Point *point_igno
|
|||
ret.setZ(z);
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
#include "libowlps-positioning.hh"
|
||||
|
||||
class Treatment
|
||||
{
|
||||
private:
|
||||
{
|
||||
private:
|
||||
vector<AccessPoint> access_point_list;
|
||||
vector<ReferencePoint> reference_point_list;
|
||||
vector<Measurement> m;
|
||||
|
||||
public:
|
||||
public:
|
||||
Treatment(vector<AccessPoint> access_point, vector<ReferencePoint> reference_point)
|
||||
{
|
||||
access_point_list = access_point;
|
||||
|
@ -40,6 +40,6 @@ class Treatment
|
|||
|
||||
vector<float> computeFriisFromRefList(const Point &p);
|
||||
Point getkWeightedInSs(const unsigned int &k, const Point *point_ignored)const ;
|
||||
};
|
||||
};
|
||||
|
||||
#endif // _TREATMENT_HH_
|
||||
|
|
Loading…
Reference in New Issue