From 7cedcfae2d9c9b1df39627e582a24c86a7406dbe Mon Sep 17 00:00:00 2001
From: Daniel Knorreck <daniel.knorreck@telecom-paristech.fr>
Date: Wed, 31 Mar 2010 12:03:59 +0000
Subject: [PATCH]

---
 simulators/c++2/src_simulator/sim/Simulator.cpp | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/simulators/c++2/src_simulator/sim/Simulator.cpp b/simulators/c++2/src_simulator/sim/Simulator.cpp
index f4dfbecaed..22d05f67ca 100644
--- a/simulators/c++2/src_simulator/sim/Simulator.cpp
+++ b/simulators/c++2/src_simulator/sim/Simulator.cpp
@@ -1199,9 +1199,17 @@ void Simulator::printCommandsOfTask(TMLTask* iTask, std::ostream& ioMessage){
 		ioMessage << 0 << "\">"; 
 	}else{
 		ioMessage << currCommand->getID() << "\">" << TAG_PROGRESSo << currCommand->getProgressInPercent() << TAG_PROGRESSc;
-		if (currCommand->getCurrTransaction()!=0){
-			ioMessage << TAG_STARTTIMEo << currCommand->getCurrTransaction()->getStartTime() << TAG_STARTTIMEc;
-			ioMessage << TAG_FINISHTIMEo << currCommand->getCurrTransaction()->getEndTime() << TAG_FINISHTIMEc;
+		TMLTransaction* currTrans = currCommand->getCurrTransaction();
+		if (currTrans!=0){
+			if (currTrans->getStartTime()==0)
+				ioMessage << TAG_STARTTIMEo << currTrans->getRunnableTime() << TAG_STARTTIMEc;
+			else
+				ioMessage << TAG_STARTTIMEo << currTrans->getStartTime() << TAG_STARTTIMEc;
+			if (currTrans->getEndTime()==0)
+				ioMessage << TAG_FINISHTIMEo << "-1" << TAG_FINISHTIMEc;
+			else
+				ioMessage << TAG_FINISHTIMEo << currTrans->getEndTime() << TAG_FINISHTIMEc;
+			
 		}
 		unsigned int aNbNextCmds;
 		TMLCommand** aNextCmds = currCommand->getNextCommands(aNbNextCmds);
-- 
GitLab