Print out values in degrees

feature/19
Daniel Warner 2011-05-27 01:41:56 +01:00
parent 4be78ea488
commit 9ec7e5a951
2 changed files with 8 additions and 4 deletions

View File

@ -1,5 +1,7 @@
#include "CoordGeodetic.h" #include "CoordGeodetic.h"
#include "Globals.h"
#include <sstream> #include <sstream>
#include <iomanip> #include <iomanip>
@ -46,8 +48,8 @@ bool CoordGeodetic::operator !=(const CoordGeodetic& b) const {
std::ostream& operator<< (std::ostream& stream, const CoordGeodetic& geo) { std::ostream& operator<< (std::ostream& stream, const CoordGeodetic& geo) {
std::stringstream out; std::stringstream out;
out << std::right << std::fixed << std::setprecision(2); out << std::right << std::fixed << std::setprecision(2);
out << "Lat: " << std::setw(7) << geo.latitude; out << "Lat: " << std::setw(7) << RadiansToDegrees(geo.latitude);
out << ", Lon: " << std::setw(7) << geo.longitude; out << ", Lon: " << std::setw(7) << RadiansToDegrees(geo.longitude);
out << ", Alt: " << std::setw(9) << geo.altitude; out << ", Alt: " << std::setw(9) << geo.altitude;
stream << out.str(); stream << out.str();
return stream; return stream;

View File

@ -1,5 +1,7 @@
#include "CoordTopographic.h" #include "CoordTopographic.h"
#include "Globals.h"
#include <sstream> #include <sstream>
#include <iomanip> #include <iomanip>
@ -50,8 +52,8 @@ bool CoordTopographic::operator !=(const CoordTopographic& b) const {
std::ostream& operator<< (std::ostream& stream, const CoordTopographic& topo) { std::ostream& operator<< (std::ostream& stream, const CoordTopographic& topo) {
std::stringstream out; std::stringstream out;
out << std::right << std::fixed << std::setprecision(2); out << std::right << std::fixed << std::setprecision(2);
out << "Az: " << std::setw(7) << topo.azimuth; out << "Az: " << std::setw(7) << RadiansToDegrees(topo.azimuth);
out << ", El: " << std::setw(7) << topo.elevation; out << ", El: " << std::setw(7) << RadiansToDegrees(topo.elevation);
out << ", Range: " << std::setw(9) << topo.range; out << ", Range: " << std::setw(9) << topo.range;
out << ", RangeRate: " << std::setw(6) << topo.range_rate; out << ", RangeRate: " << std::setw(6) << topo.range_rate;
stream << out.str(); stream << out.str();