From c0a179e34e04b578240e64f695bfb7e6a775849d Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Sat, 30 Jul 2011 19:35:47 +0200 Subject: [PATCH] [Positioning] Result::to_csv(): include area Add the area in which is the result's coordinate, after the error. This changes the behaviour of OutputUDP and OutputCSV. --- owlps-positioning/TODO | 1 - owlps-positioning/src/outputtcpsocketevaal.cc | 2 +- owlps-positioning/src/result.cc | 7 ++++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/owlps-positioning/TODO b/owlps-positioning/TODO index 63fdceb..c7b9bfb 100644 --- a/owlps-positioning/TODO +++ b/owlps-positioning/TODO @@ -35,7 +35,6 @@ . Area: p_min et p_max −> coord_min et coord_max - User interface - ° Add the area to the result in OutputCSV. ° When reading the APs, add them to the mobiles' list (or another way to be able to have a single entry for an AP). ° Review the option names & descriptions. diff --git a/owlps-positioning/src/outputtcpsocketevaal.cc b/owlps-positioning/src/outputtcpsocketevaal.cc index fedc35e..68b0d24 100644 --- a/owlps-positioning/src/outputtcpsocketevaal.cc +++ b/owlps-positioning/src/outputtcpsocketevaal.cc @@ -97,7 +97,7 @@ void OutputTCPSocketEvAAL::write(const Result &result) int OutputTCPSocketEvAAL:: area_of_interest_number(const Point3D &position) const { - const Area *area = Stock::in_which_area_is(position) ; + const Area *const area = Stock::in_which_area_is(position) ; if (area == NULL) return 0 ; diff --git a/owlps-positioning/src/result.cc b/owlps-positioning/src/result.cc index 8a74ec4..1ece518 100644 --- a/owlps-positioning/src/result.cc +++ b/owlps-positioning/src/result.cc @@ -88,7 +88,12 @@ const string Result::to_csv() const << ';' << position.get_y() << ';' << position.get_z() << ';' << "Error" - << ';' << error ; + << ';' << error + << ';' ; + + const Area *const area = Stock::in_which_area_is(position) ; + if (area != NULL) + csv_line << area->get_name() ; return csv_line.str() ; }