Renamed Time to Timing

because Time.h would clash with standard lib time.h
on case insensitive file systems
This commit is contained in:
Michaël Lemaire 2015-12-30 20:20:27 +01:00
parent 958fd0121b
commit e5372c61e4
6 changed files with 18 additions and 15 deletions

View file

@ -7,7 +7,7 @@
#include "AtmosphereDefinition.h" #include "AtmosphereDefinition.h"
#include "FloatNode.h" #include "FloatNode.h"
#include "AtmosphereRenderer.h" #include "AtmosphereRenderer.h"
#include "Time.h" #include "Timing.h"
ModelerCameras::ModelerCameras(MainModelerWindow *parent) : QObject(parent), parent(parent) { ModelerCameras::ModelerCameras(MainModelerWindow *parent) : QObject(parent), parent(parent) {
render = new CameraDefinition(); render = new CameraDefinition();
@ -69,7 +69,7 @@ void ModelerCameras::startSunTool(unsigned long duration) {
active = tool; active = tool;
} }
tool_auto_end = duration ? (Time::getRelativeTimeMs() + duration) : 0; tool_auto_end = duration ? (Timing::getRelativeTimeMs() + duration) : 0;
} }
void ModelerCameras::endTool() { void ModelerCameras::endTool() {
@ -84,7 +84,7 @@ void ModelerCameras::timerEvent(QTimerEvent *) {
parent->getScenery()->keepCameraAboveGround(current); parent->getScenery()->keepCameraAboveGround(current);
parent->getRenderer()->setCamera(current); parent->getRenderer()->setCamera(current);
} }
if (tool_auto_end > 0 and Time::getRelativeTimeMs() >= tool_auto_end) { if (tool_auto_end > 0 and Timing::getRelativeTimeMs() >= tool_auto_end) {
endTool(); endTool();
} }
} }

View file

@ -1,7 +1,7 @@
#include "RenderProgress.h" #include "RenderProgress.h"
#include "Mutex.h" #include "Mutex.h"
#include "Time.h" #include "Timing.h"
#include "Logs.h" #include "Logs.h"
RenderProgress::RenderProgress(int count) { RenderProgress::RenderProgress(int count) {
@ -25,7 +25,7 @@ void RenderProgress::reset() {
subs.pop(); subs.pop();
} }
start_time = Time::getRelativeTimeMs(); start_time = Timing::getRelativeTimeMs();
prev_est_spent = 0; prev_est_spent = 0;
prev_est_done = 0.0; prev_est_done = 0.0;
@ -75,14 +75,14 @@ void RenderProgress::end() {
Logs::error("Software") << subs.size() << " progress subs remaining at the end of render" << endl; Logs::error("Software") << subs.size() << " progress subs remaining at the end of render" << endl;
} }
end_time = Time::getRelativeTimeMs(); end_time = Timing::getRelativeTimeMs();
} }
unsigned long RenderProgress::getDuration() const { unsigned long RenderProgress::getDuration() const {
if (end_time) { if (end_time) {
return end_time - start_time; return end_time - start_time;
} else { } else {
return Time::getRelativeTimeMs() - start_time; return Timing::getRelativeTimeMs() - start_time;
} }
} }

View file

@ -1,6 +1,6 @@
#include "Logs.h" #include "Logs.h"
#include "Time.h" #include "Timing.h"
#include <streambuf> #include <streambuf>
#include <ostream> #include <ostream>
@ -59,7 +59,7 @@ ostream &Logs::error(const string &logger) {
} }
void Logs::debugTimestamp(const string &logger, const string &message) { void Logs::debugTimestamp(const string &logger, const string &message) {
debug(logger) << Time::getRelativeTimeMs() << " - " << message << endl; debug(logger) << Timing::getRelativeTimeMs() << " - " << message << endl;
} }
void Logs::disable() { void Logs::disable() {

View file

@ -1,9 +1,9 @@
#include "Time.h" #include "Timing.h"
#include <QTime> #include <QTime>
static QTime EPOCH = QTime::currentTime(); static QTime EPOCH = QTime::currentTime();
unsigned long Time::getRelativeTimeMs() { unsigned long Timing::getRelativeTimeMs() {
return EPOCH.msecsTo(QTime::currentTime()); return EPOCH.msecsTo(QTime::currentTime());
} }

View file

@ -1,12 +1,15 @@
#ifndef TIME_H #ifndef TIMING_H
#define TIME_H #define TIMING_H
#include "system_global.h" #include "system_global.h"
namespace paysages { namespace paysages {
namespace system { namespace system {
class SYSTEMSHARED_EXPORT Time { /**
* Timing tools.
*/
class SYSTEMSHARED_EXPORT Timing {
public: public:
/** /**
* Get a timestamp in milliseconds. * Get a timestamp in milliseconds.

View file

@ -26,7 +26,7 @@ class Thread;
class Mutex; class Mutex;
class Semaphore; class Semaphore;
class PictureWriter; class PictureWriter;
class Time; class Timing;
class RandomGenerator; class RandomGenerator;
extern SYSTEMSHARED_EXPORT RandomGenerator &RandomGeneratorDefault; extern SYSTEMSHARED_EXPORT RandomGenerator &RandomGeneratorDefault;