Select Git revision
conftest.py
OutputHandler.cpp 5.02 KiB
/**
* \file OutputHandler.cpp
* \date Nov 20, 2010
* \version v0.6
* \copyright <2009-2014> Forschungszentrum Jülich GmbH. All rights reserved.
*
* \section License
* This file is part of JuPedSim.
*
* JuPedSim is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* JuPedSim is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with JuPedSim. If not, see <http://www.gnu.org/licenses/>.
*
* \section Description
*
*
**/
#include "OutputHandler.h"
#include <stdio.h>
#include <stdarg.h>
#include <cstdlib>
#include <cmath>
using namespace std;
void OutputHandler::incrementWarnings()
{
_nWarnings += 1;
}
int OutputHandler::GetWarnings()
{
return _nWarnings;
}
void OutputHandler::incrementErrors()
{
_nErrors += 1;
}
int OutputHandler::GetErrors()
{
return _nErrors;
}
void OutputHandler::Write(const string& str)
{
if (this != NULL)
cout << str << endl;
}
void OutputHandler::ProgressBar(double TotalPeds, double NowPeds)
{
// based on this answer:
// https://stackoverflow.com/questions/1637587/c-libcurl-console-progress-bar
// how wide you want the progress meter to be
int totaldotz=40;
double fraction = NowPeds / TotalPeds;