[Jderobot-admin] jderobot-r1181 - trunk/src/stable/libs/parallelIce

frivas en jderobot.org frivas en jderobot.org
Lun Mar 3 21:37:28 CET 2014


Author: frivas
Date: 2014-03-03 21:37:28 +0100 (Mon, 03 Mar 2014)
New Revision: 1181

Modified:
   trunk/src/stable/libs/parallelIce/CMakeLists.txt
   trunk/src/stable/libs/parallelIce/cameraClient.cpp
   trunk/src/stable/libs/parallelIce/cameraClient.h
   trunk/src/stable/libs/parallelIce/laserClient.cpp
   trunk/src/stable/libs/parallelIce/laserClient.h
   trunk/src/stable/libs/parallelIce/pointcloudClient.cpp
   trunk/src/stable/libs/parallelIce/pointcloudClient.h
Log:
#181 logger integrated into parallelIce


Modified: trunk/src/stable/libs/parallelIce/CMakeLists.txt
===================================================================
--- trunk/src/stable/libs/parallelIce/CMakeLists.txt	2014-03-03 20:25:12 UTC (rev 1180)
+++ trunk/src/stable/libs/parallelIce/CMakeLists.txt	2014-03-03 20:37:28 UTC (rev 1181)
@@ -6,10 +6,10 @@
 include_directories( ${LIBS_DIR}/)
 
 add_library (parallelIce STATIC cameraClient.cpp  cameraClient.h  pointcloudClient.cpp  pointcloudClient.h laserClient.cpp laserClient.h)
-TARGET_LINK_LIBRARIES(parallelIce colorspacesmm ${Boost_LIBRARIES})
+TARGET_LINK_LIBRARIES(parallelIce colorspacesmm logger ${Boost_LIBRARIES})
 
 add_library (parallelIceshare SHARED cameraClient.cpp  cameraClient.h  pointcloudClient.cpp  pointcloudClient.h laserClient.cpp laserClient.h)
-TARGET_LINK_LIBRARIES(parallelIceshare colorspacesmmshare ${Boost_LIBRARIES})
+TARGET_LINK_LIBRARIES(parallelIceshare colorspacesmmshare logger ${Boost_LIBRARIES})
 
 
 set_target_properties(parallelIceshare PROPERTIES OUTPUT_NAME parallelIce)

Modified: trunk/src/stable/libs/parallelIce/cameraClient.cpp
===================================================================
--- trunk/src/stable/libs/parallelIce/cameraClient.cpp	2014-03-03 20:25:12 UTC (rev 1180)
+++ trunk/src/stable/libs/parallelIce/cameraClient.cpp	2014-03-03 20:37:28 UTC (rev 1181)
@@ -31,6 +31,7 @@
 	Ice::PropertiesPtr prop;
 	prop = ic->getProperties();
 	Ice::ObjectPrx baseCamera;
+	this->refreshRate=0;
 
 
 	int fps=prop->getPropertyAsIntWithDefault(prefix+"Fps",10);
@@ -50,7 +51,7 @@
 	}
 	catch (const char* msg) {
 		std::cerr << msg << std::endl;
-		std::cout << prefix + " Not camera provided" << std::endl;
+		jderobot::Logger::getInstance()->error(prefix + " Not camera provided");
 	}
 
 	jderobot::ImageDataPtr data = this->prx->getImageData();
@@ -116,8 +117,7 @@
 		int process = this->cycle - (IceUtil::Time::now().toMicroSeconds() - last.toMicroSeconds());
 
 		if (process > (int)cycle ){
-			if (debug==3)
-				std::cout<<"--------" << prefix << " adquisition timeout-" << std::endl;
+			jderobot::Logger::getInstance()->warning("--------" + prefix + " adquisition timeout-");
 		}
 		else{
 			int delay = (int)cycle - process;
@@ -136,7 +136,7 @@
 		if (iterIndex == INT_MAX) 
 		{
 			iterIndex = 0;
-			std::cout << "*** Reinicio contador" << std::endl;
+			jderobot::Logger::getInstance()->info( "*** Counter reset");
 		}
 
 	}

Modified: trunk/src/stable/libs/parallelIce/cameraClient.h
===================================================================
--- trunk/src/stable/libs/parallelIce/cameraClient.h	2014-03-03 20:25:12 UTC (rev 1180)
+++ trunk/src/stable/libs/parallelIce/cameraClient.h	2014-03-03 20:37:28 UTC (rev 1181)
@@ -31,6 +31,7 @@
 #include <sstream>
 #include <fstream>
 #include <climits>
+#include <log/Logger.h>
 
 namespace jderobot {
 

Modified: trunk/src/stable/libs/parallelIce/laserClient.cpp
===================================================================
--- trunk/src/stable/libs/parallelIce/laserClient.cpp	2014-03-03 20:25:12 UTC (rev 1180)
+++ trunk/src/stable/libs/parallelIce/laserClient.cpp	2014-03-03 20:37:28 UTC (rev 1181)
@@ -28,6 +28,7 @@
 	this->debug= debug;
 	Ice::PropertiesPtr prop;
 	prop = ic->getProperties();
+	this->refreshRate=0;
 
 	int fps=prop->getPropertyAsIntWithDefault(prefix+"Fps",10);
 	this->cycle=(float)(1/(float)fps)*1000000;
@@ -47,9 +48,10 @@
 	}
 	catch (const char* msg) {
 		std::cerr << msg << std::endl;
-		std::cout <<  prefix + " Not laser provided" << std::endl;
+		jderobot::Logger::getInstance()->error(prefix + " Not laser provided");
 	}
 	_done=false;
+	this->pauseStatus=false;
 
 }
 
@@ -90,8 +92,7 @@
 		this->controlMutex.unlock();
 
 		if ((IceUtil::Time::now().toMicroSeconds() - last.toMicroSeconds()) > this->cycle ){
-			if (this->debug)
-				std::cout<< prefix << ": pointCloud adquisition timeout-" << std::endl;
+			jderobot::Logger::getInstance()->warning(prefix + ": pointCloud adquisition timeout-");
 		}
 		else{
 			usleep(this->cycle - (IceUtil::Time::now().toMicroSeconds() - last.toMicroSeconds()));

Modified: trunk/src/stable/libs/parallelIce/laserClient.h
===================================================================
--- trunk/src/stable/libs/parallelIce/laserClient.h	2014-03-03 20:25:12 UTC (rev 1180)
+++ trunk/src/stable/libs/parallelIce/laserClient.h	2014-03-03 20:37:28 UTC (rev 1181)
@@ -29,6 +29,7 @@
 #include <cv.h>
 #include <sstream>
 #include <fstream>
+#include <log/Logger.h>
 
 namespace jderobot {
 

Modified: trunk/src/stable/libs/parallelIce/pointcloudClient.cpp
===================================================================
--- trunk/src/stable/libs/parallelIce/pointcloudClient.cpp	2014-03-03 20:25:12 UTC (rev 1180)
+++ trunk/src/stable/libs/parallelIce/pointcloudClient.cpp	2014-03-03 20:37:28 UTC (rev 1181)
@@ -28,6 +28,7 @@
 	this->debug= debug;
 	Ice::PropertiesPtr prop;
 	prop = ic->getProperties();
+	this->refreshRate=0;
 
 	int fps=prop->getPropertyAsIntWithDefault(prefix+"Fps",10);
 	this->cycle=(float)(1/(float)fps)*1000000;
@@ -47,7 +48,7 @@
 	}
 	catch (const char* msg) {
 		std::cerr << msg << std::endl;
-		std::cout <<  prefix + " Not camera provided" << std::endl;
+		jderobot::Logger::getInstance()->error(prefix + " Not camera provided");
 	}
 	_done=false;
 	this->pauseStatus=false;
@@ -95,8 +96,7 @@
 		int process = this->cycle - (IceUtil::Time::now().toMicroSeconds() - last.toMicroSeconds());
 
 		if (process > (int)cycle ){
-			if (debug==3)
-				std::cout<<"--------" << prefix << ": pointCloud adquisition timeout-" << std::endl;
+			jderobot::Logger::getInstance()->warning(prefix + ": pointCloud adquisition timeout-");
 		}
 		else{
 			int delay = (int)cycle - process;

Modified: trunk/src/stable/libs/parallelIce/pointcloudClient.h
===================================================================
--- trunk/src/stable/libs/parallelIce/pointcloudClient.h	2014-03-03 20:25:12 UTC (rev 1180)
+++ trunk/src/stable/libs/parallelIce/pointcloudClient.h	2014-03-03 20:37:28 UTC (rev 1181)
@@ -30,6 +30,7 @@
 #include <cv.h>
 #include <sstream>
 #include <fstream>
+#include <log/Logger.h>
 
 namespace jderobot {
 



More information about the Jderobot-admin mailing list