From: <mk...@us...> - 2003-08-18 03:47:13
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv11553/Source Modified Files: DataArchive.cpp GeoPos.cpp Key.cpp Log Message: Index: DataArchive.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/DataArchive.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** DataArchive.cpp 17 Aug 2003 10:50:21 -0000 1.14 --- DataArchive.cpp 18 Aug 2003 03:47:10 -0000 1.15 *************** *** 22,26 **** #include <SimData/DataManager.h> #include <SimData/InterfaceRegistry.h> - #include <SimData/GlibCsp.h> #include <SimData/Object.h> #include <SimData/Log.h> --- 22,25 ---- *************** *** 66,70 **** void DataArchive::writeMagic() { ! fprintf(_f, "RAWDAT-%c", (G_BYTE_ORDER == G_LITTLE_ENDIAN) ? 'L' : 'B'); } --- 65,69 ---- void DataArchive::writeMagic() { ! fprintf(_f, "RAWDAT-%c", isLittleEndian() ? 'L' : 'B'); } *************** *** 79,83 **** } bool data_little = (magic[7] == 'L'); ! bool machine_little = (G_BYTE_ORDER == G_LITTLE_ENDIAN); if (data_little != machine_little) { char msg[128]; --- 78,82 ---- } bool data_little = (magic[7] == 'L'); ! bool machine_little = isLittleEndian(); if (data_little != machine_little) { char msg[128]; Index: GeoPos.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/GeoPos.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** GeoPos.cpp 16 Aug 2003 07:56:40 -0000 1.5 --- GeoPos.cpp 18 Aug 2003 03:47:10 -0000 1.6 *************** *** 29,33 **** #include <SimData/Math.h> #include <SimData/GeoPos.h> ! #include <SimData/GlibCsp.h> #include <SimData/Pack.h> --- 29,33 ---- #include <SimData/Math.h> #include <SimData/GeoPos.h> ! #include <SimData/Math.h> #include <SimData/Pack.h> *************** *** 124,128 **** } ! double lon0 = D2R * ((utm.zone() - 1) * 6 - 180 + 3); //+3 puts origin in middle of zone M = y / k0; --- 124,128 ---- } ! double lon0 = toRadians(((utm.zone() - 1) * 6.0 - 180.0 + 3.0)); //+3 puts origin in middle of zone M = y / k0; *************** *** 174,184 **** //Make sure the longitude is between -180.00 .. 179.9 ! if (lon >= G_PI) { ! int n = (int) (0.5 * lon / G_PI + 0.5); ! lon -= n * 2.0 * G_PI; } else ! if (lon < -G_PI) { ! int n = (int) (0.5 * lon / G_PI - 0.5); ! lon -= n * 2.0 * G_PI; } --- 174,184 ---- //Make sure the longitude is between -180.00 .. 179.9 ! if (lon >= PI) { ! int n = (int) (0.5 * lon / PI + 0.5); ! lon -= n * 2.0 * PI; } else ! if (lon < -PI) { ! int n = (int) (0.5 * lon / PI - 0.5); ! lon -= n * 2.0 * PI; } *************** *** 201,205 **** break; default: ! lon0 = G_PI / 180.0 * ((int(_zone) - 1)*6 - 180 + 3); } } --- 201,205 ---- break; default: ! lon0 = toRadians((int(_zone) - 1)*6.0 - 180.0 + 3.0); } } *************** *** 234,239 **** if (_zone == -1) { ! _zone = char((lon / G_PI + 1.0) * 30.0) + 1; ! lon0 = G_PI / 180.0 * ((int(_zone) - 1)*6 - 180 + 3); } --- 234,239 ---- if (_zone == -1) { ! _zone = char((lon / PI + 1.0) * 30.0) + 1; ! lon0 = toRadians((int(_zone) - 1)*6.0 - 180.0 + 3.0); } *************** *** 581,585 **** } ! double lon0 = D2R * ((getZoneNumber() - 1) * 6 - 180 + 3); //+3 puts origin in middle of zone M = y / k0; --- 581,585 ---- } ! double lon0 = toRadians((getZoneNumber() - 1) * 6.0 - 180.0 + 3.0); //+3 puts origin in middle of zone M = y / k0; *************** *** 649,659 **** //Make sure the longitude is between -180.00 .. 179.9 ! if (lon >= G_PI) { ! int n = (int) (0.5 * lon / G_PI + 0.5); ! lon -= n * 2.0 * G_PI; } else ! if (lon < -G_PI) { ! int n = (int) (0.5 * lon / G_PI - 0.5); ! lon -= n * 2.0 * G_PI; } --- 649,659 ---- //Make sure the longitude is between -180.00 .. 179.9 ! if (lon >= PI) { ! int n = (int) (0.5 * lon / PI + 0.5); ! lon -= n * 2.0 * PI; } else ! if (lon < -PI) { ! int n = (int) (0.5 * lon / PI - 0.5); ! lon -= n * 2.0 * PI; } *************** *** 689,694 **** if (_zone == -1) { ! _zone = char((lon / G_PI + 1.0) * 30.0) + 1; ! lon0 = G_PI / 180.0 * ((int(_zone) - 1)*6 - 180 + 3); } --- 689,694 ---- if (_zone == -1) { ! _zone = char((lon / PI + 1.0) * 30.0) + 1; ! lon0 = toRadians((int(_zone) - 1) * 6.0 - 180.0 + 3.0); } *************** *** 736,740 **** { static const char designator[] = "CDEFGHJKLMNPQRSTUVWXX"; ! latitude *= 180.0 / G_PI; if (latitude < -80.0 || latitude > 84.0) return 'Z'; return designator[(int)(latitude + 80.0)>>3]; --- 736,740 ---- { static const char designator[] = "CDEFGHJKLMNPQRSTUVWXX"; ! latitude = toDegrees(latitude); if (latitude < -80.0 || latitude > 84.0) return 'Z'; return designator[(int)(latitude + 80.0)>>3]; *************** *** 863,867 **** { static const char designator[] = "CDEFGHJKLMNPQRSTUVWXX"; ! latitude *= 180.0 / G_PI; if (latitude < -80.0 || latitude > 84.0) return 'Z'; return designator[(int)(latitude + 80.0)>>3]; --- 863,867 ---- { static const char designator[] = "CDEFGHJKLMNPQRSTUVWXX"; ! latitude = toDegrees(latitude); if (latitude < -80.0 || latitude > 84.0) return 'Z'; return designator[(int)(latitude + 80.0)>>3]; *************** *** 980,986 **** std::string LLA::asString() const { ! char buff[128]; ! sprintf(buff, "[%.3f %.3f, %.3f]", toDegrees(_lat), toDegrees(_lon), _alt); ! return buff; } --- 980,990 ---- std::string LLA::asString() const { ! std::stringstream ss; ! ss << std::fixed << std::setprecision(3); ! ss << "[" << toDegrees(_lat) ! << " " << toDegrees(_lon) ! << ", " << _alt ! << "]"; ! return ss.str(); } Index: Key.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Key.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Key.cpp 15 Aug 2003 06:59:16 -0000 1.3 --- Key.cpp 18 Aug 2003 03:47:10 -0000 1.4 *************** *** 22,25 **** --- 22,28 ---- #include <SimData/Pack.h> + #include <sstream> + #include <iomanip> + NAMESPACE_SIMDATA *************** *** 46,52 **** std::string Key::asString() const { ! char buff[32]; ! sprintf(buff, "Key<%08X>", _key); ! return buff; } --- 49,55 ---- std::string Key::asString() const { ! std::stringstream ss; ! ss << "Key<0x" << std::hex << std::uppercase << std::setw(8) << std::setfill('0') << _key << ">"; ! return ss.str(); } |