From ef60aec81e80ba7c7af4b079b334e0d008569a5b Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Fri, 10 Jan 2014 21:32:44 -0800 Subject: [PATCH] removed persit file load time to help windows build --- libraries/octree-server/src/OctreeServer.cpp | 17 ++--------------- libraries/octree-server/src/OctreeServer.h | 18 +++++++++--------- libraries/octree/src/OctreePersistThread.cpp | 1 - libraries/octree/src/OctreePersistThread.h | 2 -- 4 files changed, 11 insertions(+), 27 deletions(-) diff --git a/libraries/octree-server/src/OctreeServer.cpp b/libraries/octree-server/src/OctreeServer.cpp index 09bc66bdc4..69bcce5115 100644 --- a/libraries/octree-server/src/OctreeServer.cpp +++ b/libraries/octree-server/src/OctreeServer.cpp @@ -202,26 +202,13 @@ int OctreeServer::civetwebRequestHandler(struct mg_connection* connection) { // display voxel file load time if (theServer->isInitialLoadComplete()) { - time_t* loadCompleted = theServer->getLoadCompleted(); - if (loadCompleted) { - tm* voxelsLoadedAtLocal = localtime(loadCompleted); - const int MAX_TIME_LENGTH = 128; - char buffer[MAX_TIME_LENGTH]; - strftime(buffer, MAX_TIME_LENGTH, "%m/%d/%Y %X", voxelsLoadedAtLocal); - mg_printf(connection, "%s File Loaded At: %s", theServer->getMyServerName(), buffer); - - // Convert now to tm struct for UTC - tm* voxelsLoadedAtUTM = gmtime(theServer->getLoadCompleted()); - if (gmtm != NULL) { - strftime(buffer, MAX_TIME_LENGTH, "%m/%d/%Y %X", voxelsLoadedAtUTM); - mg_printf(connection, " [%s UTM] ", buffer); - } + if (theServer->isPersistEnabled()) { + mg_printf(connection, "%s File Persist Enabled...\r\n", theServer->getMyServerName()); } else { mg_printf(connection, "%s File Persist Disabled...\r\n", theServer->getMyServerName()); } mg_printf(connection, "%s", "\r\n"); - uint64_t msecsElapsed = theServer->getLoadElapsedTime() / USECS_PER_MSEC;; float seconds = (msecsElapsed % MSECS_PER_MIN)/(float)MSECS_PER_SEC; int minutes = (msecsElapsed/(MSECS_PER_MIN)) % MIN_PER_HOUR; diff --git a/libraries/octree-server/src/OctreeServer.h b/libraries/octree-server/src/OctreeServer.h index 39fb9ee990..4de602aecb 100644 --- a/libraries/octree-server/src/OctreeServer.h +++ b/libraries/octree-server/src/OctreeServer.h @@ -24,10 +24,10 @@ /// Handles assignments of type OctreeServer - sending octrees to various clients. class OctreeServer : public ThreadedAssignment, public NodeListHook { -public: +public: OctreeServer(const unsigned char* dataBuffer, int numBytes); ~OctreeServer(); - + /// allows setting of run arguments void setArguments(int argc, char** argv); @@ -37,15 +37,15 @@ public: Octree* getOctree() { return _tree; } JurisdictionMap* getJurisdiction() { return _jurisdiction; } - + int getPacketsPerClientPerInterval() const { return _packetsPerClientPerInterval; } static OctreeServer* GetInstance() { return _theInstance; } - + bool isInitialLoadComplete() const { return (_persistThread) ? _persistThread->isInitialLoadComplete() : true; } - time_t* getLoadCompleted() { return (_persistThread) ? _persistThread->getLoadCompleted() : NULL; } + bool isPersistEnabled() const { return (_persistThread) ? true : false; } uint64_t getLoadElapsedTime() const { return (_persistThread) ? _persistThread->getLoadElapsedTime() : 0; } - // Subclasses must implement these methods + // Subclasses must implement these methods virtual OctreeQueryNode* createOctreeQueryNode(Node* newNode) = 0; virtual Octree* createTree() = 0; virtual unsigned char getMyNodeType() const = 0; @@ -53,7 +53,7 @@ public: virtual const char* getMyServerName() const = 0; virtual const char* getMyLoggingServerTargetName() const = 0; virtual const char* getMyDefaultPersistFilename() const = 0; - + // subclass may implement these method virtual void beforeRun() { }; virtual bool hasSpecialPacketToSend() { return false; } @@ -61,7 +61,7 @@ public: static void attachQueryNodeToNode(Node* newNode); - // NodeListHook + // NodeListHook virtual void nodeAdded(Node* node); virtual void nodeKilled(Node* node); @@ -77,7 +77,7 @@ protected: char _persistFilename[MAX_FILENAME_LENGTH]; int _packetsPerClientPerInterval; - Octree* _tree; // this IS a reaveraging tree + Octree* _tree; // this IS a reaveraging tree bool _wantPersist; bool _debugSending; bool _debugReceiving; diff --git a/libraries/octree/src/OctreePersistThread.cpp b/libraries/octree/src/OctreePersistThread.cpp index b986f457bc..5564abc1df 100644 --- a/libraries/octree/src/OctreePersistThread.cpp +++ b/libraries/octree/src/OctreePersistThread.cpp @@ -37,7 +37,6 @@ bool OctreePersistThread::process() { } _tree->unlock(); - _loadCompleted = time(0); uint64_t loadDone = usecTimestampNow(); _loadTimeUSecs = loadDone - loadStarted; diff --git a/libraries/octree/src/OctreePersistThread.h b/libraries/octree/src/OctreePersistThread.h index 297387c2fa..5bc2f9c64c 100644 --- a/libraries/octree/src/OctreePersistThread.h +++ b/libraries/octree/src/OctreePersistThread.h @@ -24,8 +24,6 @@ public: OctreePersistThread(Octree* tree, const QString& filename, int persistInterval = DEFAULT_PERSIST_INTERVAL); bool isInitialLoadComplete() const { return _initialLoadComplete; } - - time_t* getLoadCompleted() { return &_loadCompleted; } uint64_t getLoadElapsedTime() const { return _loadTimeUSecs; } signals: