//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
#include <iomanip>
#include <sstream>
+#include <iostream>
#include <string.h>
+#include <time.h>
#include <simgear/debug/logstream.hxx>
#include <simgear/environment/metar.hxx>
using namespace std;
// text color
-#if defined(__linux__) || defined( __sun__ ) || defined(__CYGWIN__) \
+#if defined(__linux__) || defined(__sun) || defined(__CYGWIN__) \
|| defined( __FreeBSD__ ) || defined ( sgi )
# define R "\033[31;1m" // red
# define G "\033[32;1m" // green
double rnd(double r, int g = 0)
{
double f = pow(10.0, g);
- return f * rint(r / f);
+ return f * floor(r / f + 0.5);
}
-ostream& operator<<(ostream& s, SGMetarVisibility& v)
+ostream& operator<<(ostream& s, const SGMetarVisibility& v)
{
ostringstream buf;
int m = v.getModifier();
// directed visibility
- SGMetarVisibility *dirvis = m->getDirVisibility();
+ const SGMetarVisibility *dirvis = m->getDirVisibility();
for (i = 0; i < 8; i++, dirvis++)
if (dirvis->getVisibility_m() != NaN)
cout << "\t\t\t" << *dirvis << endl;
if ((s = rwy.getExtentString()) && strlen(s))
surface.push_back(s);
if ((d = rwy.getDepth()) != NaN) {
- sprintf(buf, "%.0lf mm", d * 1000.0);
+ sprintf(buf, "%.1lf mm", d * 1000.0);
surface.push_back(buf);
}
if ((s = rwy.getFrictionString()) && strlen(s))
);
}
-
int main(int argc, char *argv[])
{
bool report = true;