|
From: <den...@us...> - 2010-01-20 17:24:20
|
Revision: 50
http://dsim.svn.sourceforge.net/dsim/?rev=50&view=rev
Author: denis_arnaud
Date: 2010-01-20 17:24:13 +0000 (Wed, 20 Jan 2010)
Log Message:
-----------
[Dev] Removed the BasChronometer class, as it is now given by the StdAir library.
Modified Paths:
--------------
trunk/dsim/dsim/basic/sources.mk
trunk/dsim/dsim/service/DSIM_Service.cpp
Removed Paths:
-------------
trunk/dsim/dsim/basic/BasChronometer.cpp
trunk/dsim/dsim/basic/BasChronometer.hpp
Deleted: trunk/dsim/dsim/basic/BasChronometer.cpp
===================================================================
--- trunk/dsim/dsim/basic/BasChronometer.cpp 2010-01-19 18:41:41 UTC (rev 49)
+++ trunk/dsim/dsim/basic/BasChronometer.cpp 2010-01-20 17:24:13 UTC (rev 50)
@@ -1,50 +0,0 @@
-// //////////////////////////////////////////////////////////////////////
-// Import section
-// //////////////////////////////////////////////////////////////////////
-// STL
-#include <cassert>
-// Dsim
-#include <dsim/basic/BasChronometer.hpp>
-#include <dsim/service/Logger.hpp>
-
-namespace DSIM {
-
- // //////////////////////////////////////////////////////////////////////
- BasChronometer::BasChronometer () : _startTimeLaunched (false) {
- }
-
- // //////////////////////////////////////////////////////////////////////
- void BasChronometer::start () {
- // Get the time-stamp of now, and store it for later use
- _startTime = boost::posix_time::microsec_clock::local_time();
-
- // Update the boolean which states whether the chronometer
- // is launched
- _startTimeLaunched = true;
- }
-
- // //////////////////////////////////////////////////////////////////////
- double BasChronometer::elapsed () const {
- assert (_startTimeLaunched == true);
-
- // Get the time-stamp of now
- const boost::posix_time::ptime lStopTime =
- boost::posix_time::microsec_clock::local_time();
-
- // Calculate the time elapsed since the last time-stamp
- const boost::posix_time::time_duration lElapsedTime =
- lStopTime - _startTime;
-
- // Derived the corresponding number of milliseconds
- const double lElapsedTimeInMicroSeconds =
- static_cast<const double> (lElapsedTime.total_microseconds());
-
- /*DSIM_LOG_DEBUG ("Elapsed: " << lElapsedTime
- << "; (micros): "
- << lElapsedTimeInMicroSeconds / 1e6);*/
-
- // The elapsed time given in return is expressed in seconds
- return (lElapsedTimeInMicroSeconds / 1e6);
- }
-
-}
Deleted: trunk/dsim/dsim/basic/BasChronometer.hpp
===================================================================
--- trunk/dsim/dsim/basic/BasChronometer.hpp 2010-01-19 18:41:41 UTC (rev 49)
+++ trunk/dsim/dsim/basic/BasChronometer.hpp 2010-01-20 17:24:13 UTC (rev 50)
@@ -1,40 +0,0 @@
-#ifndef __DSIM_COM_BAS_BASCHRONOMETER_HPP
-#define __DSIM_COM_BAS_BASCHRONOMETER_HPP
-
-// //////////////////////////////////////////////////////////////////////
-// Import section
-// //////////////////////////////////////////////////////////////////////
-// Boost Date-Time (http://boost.org/doc/html/date_time/posix_time.html)
-#include <boost/date_time/posix_time/posix_time.hpp>
-
-namespace DSIM {
-
- /** Structure allowing measuring the time elapsed between two events. */
- struct BasChronometer {
- /** Constructor. */
- BasChronometer();
-
- /** Start the chronometer from the local time
- <br>The elapsed time given is the one elapsed since the start
- is launched. */
- void start ();
-
- /** Get the start time. */
- std::string getStart () const {
- return boost::posix_time::to_simple_string (_startTime);
- }
-
- /** Return the time elapsed since the structure has been instanciated.
- <br>That elapsed time is expressed in seconds. */
- double elapsed () const;
-
- private:
- /** Start time. */
- boost::posix_time::ptime _startTime;
-
- /** Boolean which states whether the chronometer is started or not.*/
- bool _startTimeLaunched;
- };
-
-}
-#endif // __DSIM_COM_BAS_BASCHRONOMETER_HPP
Modified: trunk/dsim/dsim/basic/sources.mk
===================================================================
--- trunk/dsim/dsim/basic/sources.mk 2010-01-19 18:41:41 UTC (rev 49)
+++ trunk/dsim/dsim/basic/sources.mk 2010-01-20 17:24:13 UTC (rev 50)
@@ -1,5 +1,3 @@
bas_h_sources = $(top_srcdir)/dsim/basic/BasConst_General.hpp \
- $(top_srcdir)/dsim/basic/BasConst_DSIM_Service.hpp \
- $(top_srcdir)/dsim/basic/BasChronometer.hpp
-bas_cc_sources = $(top_srcdir)/dsim/basic/BasConst.cpp \
- $(top_srcdir)/dsim/basic/BasChronometer.cpp
+ $(top_srcdir)/dsim/basic/BasConst_DSIM_Service.hpp
+bas_cc_sources = $(top_srcdir)/dsim/basic/BasConst.cpp
Modified: trunk/dsim/dsim/service/DSIM_Service.cpp
===================================================================
--- trunk/dsim/dsim/service/DSIM_Service.cpp 2010-01-19 18:41:41 UTC (rev 49)
+++ trunk/dsim/dsim/service/DSIM_Service.cpp 2010-01-20 17:24:13 UTC (rev 50)
@@ -7,11 +7,12 @@
// Boost
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/date_time/posix_time/ptime.hpp>
+// StdAir
+#include <stdair/basic/BasChronometer.hpp>
// Distribution
#include <simcrs/SIMCRS_Service.hpp>
// Dsim
#include <dsim/basic/BasConst_DSIM_Service.hpp>
-#include <dsim/basic/BasChronometer.hpp>
#include <dsim/command/Simulator.hpp>
#include <dsim/factory/FacDsimServiceContext.hpp>
#include <dsim/service/DSIM_ServiceContext.hpp>
@@ -96,14 +97,14 @@
lDSIM_ServiceContext.getSIMCRS_Service();
// Delegate the booking to the dedicated command
- BasChronometer lSimulationChronometer;
+ stdair::BasChronometer lSimulationChronometer;
lSimulationChronometer.start();
Simulator::simulate (lSIMCRS_Service);
const double lSimulationMeasure = lSimulationChronometer.elapsed();
// DEBUG
DSIM_LOG_DEBUG ("Simulation: " << lSimulationMeasure << " - "
- << lDSIM_ServiceContext.display());
+ << lDSIM_ServiceContext.display());
} catch (const std::exception& error) {
DSIM_LOG_ERROR ("Exception: " << error.what());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|