You can subscribe to this list here.
| 2008 |
Jan
|
Feb
(58) |
Mar
(15) |
Apr
(23) |
May
(8) |
Jun
(92) |
Jul
(66) |
Aug
(6) |
Sep
(9) |
Oct
(44) |
Nov
(8) |
Dec
(1) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
(10) |
Feb
(8) |
Mar
(2) |
Apr
(8) |
May
(19) |
Jun
(11) |
Jul
(8) |
Aug
(6) |
Sep
(5) |
Oct
(4) |
Nov
(26) |
Dec
(4) |
| 2010 |
Jan
(5) |
Feb
(3) |
Mar
(4) |
Apr
(3) |
May
(4) |
Jun
|
Jul
(1) |
Aug
(16) |
Sep
(7) |
Oct
(3) |
Nov
(7) |
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <rus...@us...> - 2009-05-06 20:39:43
|
Revision: 407
http://gearbox.svn.sourceforge.net/gearbox/?rev=407&view=rev
Author: russo2503v
Date: 2009-05-06 20:39:25 +0000 (Wed, 06 May 2009)
Log Message:
-----------
fixed bug which did not report disabled modules
Modified Paths:
--------------
gearbox/trunk/cmake/DependencyUtils.cmake
Modified: gearbox/trunk/cmake/DependencyUtils.cmake
===================================================================
--- gearbox/trunk/cmake/DependencyUtils.cmake 2009-05-06 18:02:18 UTC (rev 406)
+++ gearbox/trunk/cmake/DependencyUtils.cmake 2009-05-06 20:39:25 UTC (rev 407)
@@ -217,6 +217,8 @@
set( ${cumulative_var} FALSE )
# force ENABLE_* variables to off in ccmake UI if dependencies aren't met.
GBX_UTIL_MAKE_OPTION_NAME( option_name ${module_type} ${module_name} )
+ string( COMPARE EQUAL ${type} "EXE" is_exe )
+ string( COMPARE EQUAL ${type} "LIB" is_lib )
if( is_exe )
GBX_NOT_ADD_EXECUTABLE( ${module_name} ${reason} )
set( ${option_name} OFF CACHE BOOL "Try to build ${module_name}" FORCE )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2009-05-06 18:02:25
|
Revision: 406
http://gearbox.svn.sourceforge.net/gearbox/?rev=406&view=rev
Author: russo2503v
Date: 2009-05-06 18:02:18 +0000 (Wed, 06 May 2009)
Log Message:
-----------
added comment
Modified Paths:
--------------
gearbox/trunk/cmake/DependencyUtils.cmake
Modified: gearbox/trunk/cmake/DependencyUtils.cmake
===================================================================
--- gearbox/trunk/cmake/DependencyUtils.cmake 2009-05-02 03:16:36 UTC (rev 405)
+++ gearbox/trunk/cmake/DependencyUtils.cmake 2009-05-06 18:02:18 UTC (rev 406)
@@ -215,6 +215,7 @@
# must dereference both var and option names once (!) and IF will evaluate their values
if( NOT target_location )
set( ${cumulative_var} FALSE )
+ # force ENABLE_* variables to off in ccmake UI if dependencies aren't met.
GBX_UTIL_MAKE_OPTION_NAME( option_name ${module_type} ${module_name} )
if( is_exe )
GBX_NOT_ADD_EXECUTABLE( ${module_name} ${reason} )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <to...@us...> - 2009-05-02 03:16:44
|
Revision: 405
http://gearbox.svn.sourceforge.net/gearbox/?rev=405&view=rev
Author: tobasco
Date: 2009-05-02 03:16:36 +0000 (Sat, 02 May 2009)
Log Message:
-----------
docco
Modified Paths:
--------------
gearbox/trunk/src/gbxsmartbatteryacfr/smartbatteryacfr.dox
gearbox/trunk/src/gbxsmartbatteryacfr/test/longtest.cpp
Modified: gearbox/trunk/src/gbxsmartbatteryacfr/smartbatteryacfr.dox
===================================================================
--- gearbox/trunk/src/gbxsmartbatteryacfr/smartbatteryacfr.dox 2009-05-02 01:00:28 UTC (rev 404)
+++ gearbox/trunk/src/gbxsmartbatteryacfr/smartbatteryacfr.dox 2009-05-02 03:16:36 UTC (rev 405)
@@ -28,6 +28,7 @@
@par Examples
- See 'test/shorttest.cpp' for a simple example of how to use the library. The test makes use of the 'oceanserver' class to read a few records from the oceanserver system and prints the results on the screen.
+- See 'test/longtest.cpp' for an example which continuously reads from an oceanserver system and conducts health checks according to hard-coded health thresholds.
@par Style
See http://orca-robotics.sourceforge.net/orca/orca_doc_style.html
Modified: gearbox/trunk/src/gbxsmartbatteryacfr/test/longtest.cpp
===================================================================
--- gearbox/trunk/src/gbxsmartbatteryacfr/test/longtest.cpp 2009-05-02 01:00:28 UTC (rev 404)
+++ gearbox/trunk/src/gbxsmartbatteryacfr/test/longtest.cpp 2009-05-02 03:16:36 UTC (rev 405)
@@ -48,11 +48,11 @@
{
gbxsmartbatteryacfr::BatteryHealthWarningConfig config;
config.expectedNumBatteries = 2;
- config.numCyclesThreshhold = 0; //300
- config.chargeTempThreshhold = 10.0; // 54.0
- config.dischargeTempThreshhold = 10.0; // 70.0
- config.chargeWarnThreshhold = 60; // 10
- config.chargeDeviationThreshold = 1; // 10
+ config.numCyclesThreshhold = 300;
+ config.chargeTempThreshhold = 54.0;
+ config.dischargeTempThreshhold = 70.0;
+ config.chargeWarnThreshhold = 10;
+ config.chargeDeviationThreshold = 10;
gbxsmartbatteryacfr::OceanServer oceanserver( port, tracer );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bo...@us...> - 2009-05-02 01:00:30
|
Revision: 404
http://gearbox.svn.sourceforge.net/gearbox/?rev=404&view=rev
Author: borax00
Date: 2009-05-02 01:00:28 +0000 (Sat, 02 May 2009)
Log Message:
-----------
MR changes.
Modified Paths:
--------------
gearbox/trunk/CMakeLists.txt
Modified: gearbox/trunk/CMakeLists.txt
===================================================================
--- gearbox/trunk/CMakeLists.txt 2009-05-02 00:30:20 UTC (rev 403)
+++ gearbox/trunk/CMakeLists.txt 2009-05-02 01:00:28 UTC (rev 404)
@@ -1,7 +1,7 @@
#
# Test CMake version
#
-CMAKE_MINIMUM_REQUIRED( VERSION 2.4 FATAL_ERROR )
+cmake_minimum_required( VERSION 2.4 FATAL_ERROR )
#
# project name
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bo...@us...> - 2009-05-02 00:30:21
|
Revision: 403
http://gearbox.svn.sourceforge.net/gearbox/?rev=403&view=rev
Author: borax00
Date: 2009-05-02 00:30:20 +0000 (Sat, 02 May 2009)
Log Message:
-----------
Removed 'mutable' flag from isNewData_
Modified Paths:
--------------
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/store.h
Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/store.h
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/store.h 2009-05-02 00:18:29 UTC (rev 402)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/store.h 2009-05-02 00:30:20 UTC (rev 403)
@@ -98,11 +98,11 @@
bool isEmpty_;
- // flag to keep track of new data. Make it mutable so that get() functions can be const.
- mutable bool isNewData_;
+ // flag to keep track of new data.
+ bool isNewData_;
// internal implementation of front( obj, -1 ); returns 0.
- int getNextNoWait( Type & obj ) const;
+ int getNextNoWait( Type & obj );
};
@@ -208,7 +208,7 @@
}
template<class Type>
-int Store<Type>::getNextNoWait( Type & obj ) const
+int Store<Type>::getNextNoWait( Type & obj )
{
IceUtil::Monitor<IceUtil::Mutex>::Lock lock(*this);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bo...@us...> - 2009-05-02 00:18:35
|
Revision: 402
http://gearbox.svn.sourceforge.net/gearbox/?rev=402&view=rev
Author: borax00
Date: 2009-05-02 00:18:29 +0000 (Sat, 02 May 2009)
Log Message:
-----------
Made get(Next) non-const.
Modified Paths:
--------------
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/store.h
Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/store.h
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/store.h 2009-05-02 00:17:14 UTC (rev 401)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/store.h 2009-05-02 00:18:29 UTC (rev 402)
@@ -60,7 +60,7 @@
//! Returns the contents of the Store. This operation makes the data in the Store
//! "not new", i.e. @ref isNewData returns FALSE. Calls to get() when the Store is empty
//! raises an gbxutilacfr::Exception exception.
- void get( Type & obj ) const;
+ void get( Type & obj );
//! Returns the contents of the Store. This operation does not modify anything, i.e. the
//! contents of the store remain "new" (unlike get()). Calls to peek() when the Store is empty
@@ -76,7 +76,7 @@
and the object argument itself is not touched. In the rare event of spurious wakeup,
the return value is 1.
*/
- int getNext( Type & obj, int timeoutMs=-1 ) const;
+ int getNext( Type & obj, int timeoutMs=-1 );
//! Makes the Store empty.
//! @see isEmpty
@@ -136,7 +136,7 @@
}
template<class Type>
-void Store<Type>::get( Type & obj ) const
+void Store<Type>::get( Type & obj )
{
IceUtil::Monitor<IceUtil::Mutex>::Lock lock(*this);
if ( !isEmpty_ )
@@ -166,7 +166,7 @@
}
template<class Type>
-int Store<Type>::getNext( Type & obj, int timeoutMs ) const
+int Store<Type>::getNext( Type & obj, int timeoutMs )
{
// special case: infinite wait time
if ( timeoutMs == -1 ) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bo...@us...> - 2009-05-02 00:17:54
|
Revision: 400
http://gearbox.svn.sourceforge.net/gearbox/?rev=400&view=rev
Author: borax00
Date: 2009-05-02 00:16:14 +0000 (Sat, 02 May 2009)
Log Message:
-----------
Implemented peek()
Modified Paths:
--------------
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/store.h
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/storetest.cpp
Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/store.h
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/store.h 2009-05-01 21:42:20 UTC (rev 399)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/store.h 2009-05-02 00:16:14 UTC (rev 400)
@@ -62,6 +62,11 @@
//! raises an gbxutilacfr::Exception exception.
void get( Type & obj ) const;
+ //! Returns the contents of the Store. This operation does not modify anything, i.e. the
+ //! contents of the store remain "new" (unlike get()). Calls to peek() when the Store is empty
+ //! raises an gbxutilacfr::Exception exception.
+ void peek( Type & obj ) const;
+
/*!
@brief Waits until the next update and returns the new value.
If the Store is empty, @ref getNext blocks until the Store is set and returns the new value.
@@ -146,6 +151,21 @@
}
template<class Type>
+void Store<Type>::peek( Type & obj ) const
+{
+ IceUtil::Monitor<IceUtil::Mutex>::Lock lock(*this);
+ if ( !isEmpty_ )
+ {
+ internalGet( obj );
+ // do NOT set isNewData_ to false
+ }
+ else
+ {
+ throw gbxutilacfr::Exception( ERROR_INFO, "trying to read from an empty Store." );
+ }
+}
+
+template<class Type>
int Store<Type>::getNext( Type & obj, int timeoutMs ) const
{
// special case: infinite wait time
Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/storetest.cpp
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/storetest.cpp 2009-05-01 21:42:20 UTC (rev 399)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/storetest.cpp 2009-05-02 00:16:14 UTC (rev 400)
@@ -34,6 +34,20 @@
}
cout<<"ok"<<endl;
+ cout<<"testing peek() ... ";
+ // call peek on an empty stomach
+ try
+ {
+ store.peek( data );
+ cout<<"failed. empty store, should've caught exception"<<endl;
+ return EXIT_FAILURE;
+ }
+ catch ( const gbxutilacfr::Exception & )
+ {
+ ; // ok
+ }
+ cout<<"ok"<<endl;
+
cout<<"testing getNext() ... ";
if ( store.getNext( data, 50 )==0 ) {
cout<<"failed. not expecting anybody setting the store"<<endl;
@@ -58,6 +72,28 @@
}
cout<<"ok"<<endl;
+ cout<<"testing peek() ... ";
+ try
+ {
+ store.peek( copy );
+ }
+ catch ( const gbxutilacfr::Exception & )
+ {
+ cout<<"failed. should be a non-empty store."<<endl;
+ return EXIT_FAILURE;
+ }
+ if ( data!=copy )
+ {
+ cout<<"failed. expecting an exact copy of the data."<<endl;
+ cout<<"\tin="<<data<<" out="<<copy<<endl;
+ return EXIT_FAILURE;
+ }
+ if ( store.isEmpty() || !store.isNewData() ) {
+ cout<<"failed. expecting a non-empty new store."<<endl;
+ return EXIT_FAILURE;
+ }
+ cout<<"ok"<<endl;
+
cout<<"testing get() ... ";
try
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bo...@us...> - 2009-05-02 00:17:49
|
Revision: 401
http://gearbox.svn.sourceforge.net/gearbox/?rev=401&view=rev
Author: borax00
Date: 2009-05-02 00:17:14 +0000 (Sat, 02 May 2009)
Log Message:
-----------
Modified Paths:
--------------
gearbox/trunk/doc/history.dox
Modified: gearbox/trunk/doc/history.dox
===================================================================
--- gearbox/trunk/doc/history.dox 2009-05-02 00:16:14 UTC (rev 400)
+++ gearbox/trunk/doc/history.dox 2009-05-02 00:17:14 UTC (rev 401)
@@ -55,6 +55,7 @@
- Thread class: now derives from gbxutilacfr::Stoppable. No changes in user code are requried. (alexm)
- Function checkedSleep() is defined in terms of the new light interface class gbxutilacfr::Stoppable.
No changes in user code are required. (alexm)
+ - Implemented store::peek() (AlexB)
@section gbx_doc_history_902 Changes in Release 9.02
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2009-05-01 21:42:23
|
Revision: 399
http://gearbox.svn.sourceforge.net/gearbox/?rev=399&view=rev
Author: russo2503v
Date: 2009-05-01 21:42:20 +0000 (Fri, 01 May 2009)
Log Message:
-----------
added missing files 3
Added Paths:
-----------
gearbox/trunk/cmake/gearbox-use-file.cmake
Added: gearbox/trunk/cmake/gearbox-use-file.cmake
===================================================================
--- gearbox/trunk/cmake/gearbox-use-file.cmake (rev 0)
+++ gearbox/trunk/cmake/gearbox-use-file.cmake 2009-05-01 21:42:20 UTC (rev 399)
@@ -0,0 +1,10 @@
+# This script is indended for Gearbox users (not for internal use)
+# Assumes that a variable GEARBOX_INCLUDE_DIR is defined.
+
+include_directories( ${GEARBOX_INCLUDE_DIR} )
+
+# Variable GEARBOX_LINK_DIR only needs to be defined if you're using a gearbox
+# installation (as opposed to a local gearbox repository)
+link_directories( ${GEARBOX_LINK_DIR} )
+
+# Not linking to specific libraries, it's up to the user which ones to link to.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2009-05-01 21:25:24
|
Revision: 398
http://gearbox.svn.sourceforge.net/gearbox/?rev=398&view=rev
Author: russo2503v
Date: 2009-05-01 21:25:23 +0000 (Fri, 01 May 2009)
Log Message:
-----------
added missing files 2
Added Paths:
-----------
gearbox/trunk/src/gbxutilacfr/subhealth.h
Added: gearbox/trunk/src/gbxutilacfr/subhealth.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/subhealth.h (rev 0)
+++ gearbox/trunk/src/gbxutilacfr/subhealth.h 2009-05-01 21:25:23 UTC (rev 398)
@@ -0,0 +1,67 @@
+/*
+ * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
+ * http://gearbox.sf.net/
+ * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp
+ *
+ * This distribution is licensed to you under the terms described in
+ * the LICENSE file included in this distribution.
+ *
+ */
+
+#ifndef GBXUTILACFR_SUBSYSTEM_HEALTH_H
+#define GBXUTILACFR_SUBSYSTEM_HEALTH_H
+
+#include <gbxutilacfr/status.h>
+
+namespace gbxutilacfr {
+
+//!
+//! @brief Convenience class which allows feedback on the health of a subsystem.
+//!
+//! @par Overview
+//!
+//! Provides a convenient interface for setting health information for one subsystem.
+//!
+//! @sa Status, SubsystemStatus
+//!
+class SubHealth
+{
+
+public:
+ //! Sets a reference to the system Status and this subsystem's name.
+ //! Adds this subsystem to the system.
+ SubHealth( Status& sysStatus, const std::string& subsysName ) :
+ status_(sysStatus),
+ subsysName_(subsysName)
+ {};
+
+ //! Passes this information to the system Status.
+ void heartbeat() { status_.heartbeat( subsysName_ ); };
+
+ //! Passes this information to the system Status.
+ void message( const std::string& message ) { status_.message( subsysName_, message ); };
+
+ //! Passes this information to the system Status.
+ void ok( const std::string& message="" ) { status_.ok( subsysName_, message ); };
+
+ //! Passes this information to the system Status.
+ void warning( const std::string& message ) { status_.warning( subsysName_, message ); };
+
+ //! Passes this information to the system Status.
+ void fault( const std::string& message ) { status_.fault( subsysName_, message ); };
+
+ //! Returns subsystem's name
+ std::string name() const { return subsysName_; };
+
+ // Returns system Status object
+// Status& status() { return status_; };
+
+private:
+
+ Status& status_;
+ std::string subsysName_;
+};
+
+} // namespace
+
+#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2009-05-01 21:24:11
|
Revision: 397
http://gearbox.svn.sourceforge.net/gearbox/?rev=397&view=rev
Author: russo2503v
Date: 2009-05-01 21:23:59 +0000 (Fri, 01 May 2009)
Log Message:
-----------
added missing files
Added Paths:
-----------
gearbox/trunk/cmake/SetupProjectName.cmake
gearbox/trunk/cmake/WritePackageConfig.cmake
gearbox/trunk/cmake/internal/gearbox-config-internal.cmake
gearbox/trunk/cmake/internal/gearbox-config-version.cmake.in
gearbox/trunk/cmake/internal/gearbox-config.cmake
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/threadutils.cpp
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/threadutils.h
gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverhealthchecks.cpp
gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverhealthchecks.h
gearbox/trunk/src/gbxutilacfr/stoppable.h
Added: gearbox/trunk/cmake/SetupProjectName.cmake
===================================================================
--- gearbox/trunk/cmake/SetupProjectName.cmake (rev 0)
+++ gearbox/trunk/cmake/SetupProjectName.cmake 2009-05-01 21:23:59 UTC (rev 397)
@@ -0,0 +1,30 @@
+# this is a copy of GBX_STRING_TO_CAPITAL in StringToCapital.cmake
+# (making a copy so that we can use this file here and in derived projects)
+macro( UTIL_STRING_TO_CAPITAL input_string OUTPUT_VAR )
+
+ # jump through the hoops to construct project name string with the first character capitalized
+ string( LENGTH ${input_string} string_length )
+
+ math( EXPR string_length_minus_one "${string_length} - 1" )
+
+ string( SUBSTRING ${input_string} 0 1 output_start )
+ string( SUBSTRING ${input_string} 1 ${string_length_minus_one} output_rest )
+
+ string( TOUPPER ${output_start} output_start_upper )
+ string( TOLOWER ${output_rest} output_rest_lower )
+
+ set( ${OUTPUT_VAR} "${output_start_upper}${output_rest_lower}" )
+
+endmacro( UTIL_STRING_TO_CAPITAL input_string OUTPUT_VAR )
+
+#
+# We often use different variants of the project name.
+# E.g. for project "gearbox" we want "GEARBOX", "gearbox", "Gearbox".
+#
+
+UTIL_STRING_TO_CAPITAL( ${PROJECT_NAME} GBX_PROJECT_NAME_CAP )
+# message( STATUS "Setting capitalized project name to ${PROJECT_NAME_CAP}" )
+
+string( TOUPPER ${PROJECT_NAME} GBX_PROJECT_NAME_UPPER )
+
+string( TOLOWER ${PROJECT_NAME} GBX_PROJECT_NAME_LOWER )
Added: gearbox/trunk/cmake/WritePackageConfig.cmake
===================================================================
--- gearbox/trunk/cmake/WritePackageConfig.cmake (rev 0)
+++ gearbox/trunk/cmake/WritePackageConfig.cmake 2009-05-01 21:23:59 UTC (rev 397)
@@ -0,0 +1,43 @@
+
+set( _input_dir ${PROJECT_SOURCE_DIR}/cmake/internal )
+set( _output_dir ${PROJECT_BINARY_DIR} )
+set( _destination lib/${PROJECT_NAME} )
+
+# set( _input_file config-internal.cmake.in )
+# set( _output_file ${PROJECT_NAME}-config-internal.cmake )
+# configure_file(
+# ${_input_dir}/${_input_file}
+# ${_output_dir}/${_output_file}
+# @ONLY )
+
+# set( _input_file config-external.cmake.in )
+set( _output_file ${PROJECT_NAME}-config.cmake )
+# configure_file(
+# ${_input_dir}/${_input_file}
+# ${_output_dir}/${_output_file}
+# @ONLY )
+install(
+ FILES ${_input_dir}/${_output_file}
+ DESTINATION ${_destination} )
+
+set( _input_file ${PROJECT_NAME}-config-version.cmake.in )
+set( _output_file ${PROJECT_NAME}-config-version.cmake )
+configure_file(
+ ${_input_dir}/${_input_file}
+ ${_output_dir}/${_output_file}
+ @ONLY )
+install(
+ FILES ${_output_dir}/${_output_file}
+ DESTINATION ${_destination} )
+
+# export targets
+install(
+ EXPORT ${PROJECT_NAME}-targets
+# NAMESPACE import_
+ DESTINATION ${_destination} )
+
+set( _input_dir )
+set( _output_dir )
+set( _input_file )
+set( _output_file )
+set( _destination )
Added: gearbox/trunk/cmake/internal/gearbox-config-internal.cmake
===================================================================
--- gearbox/trunk/cmake/internal/gearbox-config-internal.cmake (rev 0)
+++ gearbox/trunk/cmake/internal/gearbox-config-internal.cmake 2009-05-01 21:23:59 UTC (rev 397)
@@ -0,0 +1,11 @@
+set( GEARBOX_FOUND 1 )
+
+# This is potentially problematic: installed directory structure is different from in-source one.
+set( GEARBOX_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/gearbox/src" )
+
+set( GEARBOX_CMAKE_DIR "${CMAKE_SOURCE_DIR}/gearbox/cmake" )
+
+set( GEARBOX_USE_FILE "${GEARBOX_CMAKE_DIR}/gearbox-use-file.cmake" )
+
+# this is where Gearbox libs will be installed
+set( GEARBOX_LINK_DIR ${CMAKE_INSTALL_PREFIX}/lib/gearbox )
Added: gearbox/trunk/cmake/internal/gearbox-config-version.cmake.in
===================================================================
--- gearbox/trunk/cmake/internal/gearbox-config-version.cmake.in (rev 0)
+++ gearbox/trunk/cmake/internal/gearbox-config-version.cmake.in 2009-05-01 21:23:59 UTC (rev 397)
@@ -0,0 +1,8 @@
+set( PACKAGE_VERSION @GBX_PROJECT_VERSION@ )
+
+if( "${PACKAGE_FIND_VERSION_MAJOR}" EQUAL @GBX_PROJECT_VERSION_MAJOR@ )
+if( "${PACKAGE_FIND_VERSION_MINOR}" EQUAL @GBX_PROJECT_VERSION_MINOR@ )
+ set( PACKAGE_VERSION_COMPATIBLE 1 )
+ set( PACKAGE_VERSION_EXACT 1 )
+endif()
+endif()
Added: gearbox/trunk/cmake/internal/gearbox-config.cmake
===================================================================
--- gearbox/trunk/cmake/internal/gearbox-config.cmake (rev 0)
+++ gearbox/trunk/cmake/internal/gearbox-config.cmake 2009-05-01 21:23:59 UTC (rev 397)
@@ -0,0 +1,33 @@
+# Find Gearbox includes and library.
+#
+#
+
+set( GEARBOX_FOUND 1 )
+
+# this is the installed location of <package>-config.cmake file
+get_filename_component( _found_dir "${CMAKE_CURRENT_LIST_FILE}" PATH )
+include( ${_found_dir}/gearbox-targets.cmake )
+
+# assume that <package>-config.cmake was installed into
+# <install-root>/lib/<package>/
+set( _install_dir "${_found_dir}/../../" )
+
+get_filename_component(
+ GEARBOX_INCLUDE_DIR
+ "${_install_dir}/include/gearbox"
+ ABSOLUTE )
+
+get_filename_component(
+ GEARBOX_CMAKE_DIR
+ "${_install_dir}/share/gearbox/cmake"
+ ABSOLUTE )
+
+set( GEARBOX_USE_FILE "${GEARBOX_CMAKE_DIR}/gearbox-use-file.cmake" )
+
+get_filename_component(
+ GEARBOX_LINK_DIR
+ "${_install_dir}/lib/gearbox"
+ ABSOLUTE )
+
+set( _found_dir )
+set( _install_dir )
Added: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/threadutils.cpp
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/threadutils.cpp (rev 0)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/threadutils.cpp 2009-05-01 21:23:59 UTC (rev 397)
@@ -0,0 +1,35 @@
+/*
+ * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
+ * http://gearbox.sf.net/
+ * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp
+ *
+ * This distribution is licensed to you under the terms described in
+ * the LICENSE file included in this distribution.
+ *
+ */
+
+#include <assert.h>
+#include <IceUtil/Thread.h>
+#include "threadutils.h"
+
+namespace gbxiceutilacfr {
+
+void checkedSleep( gbxutilacfr::Stoppable* activity, const IceUtil::Time& duration, int checkIntervalMs )
+{
+ assert( activity && "Null activity pointer" );
+
+ IceUtil::Time wakeupTime = IceUtil::Time::now() + duration;
+ IceUtil::Time checkInterval = IceUtil::Time::milliSeconds( checkIntervalMs );
+
+ while ( !activity->isStopping() && IceUtil::Time::now() < wakeupTime )
+ {
+ IceUtil::ThreadControl::sleep( checkInterval );
+ }
+}
+
+void checkedSleep( gbxutilacfr::Stoppable* activity, int durationMs, int checkIntervalMs )
+{
+ checkedSleep( activity, IceUtil::Time::milliSeconds( durationMs ), checkIntervalMs );
+}
+
+} // namespace
Added: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/threadutils.h
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/threadutils.h (rev 0)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/threadutils.h 2009-05-01 21:23:59 UTC (rev 397)
@@ -0,0 +1,30 @@
+/*
+ * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
+ * http://gearbox.sf.net/
+ * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp
+ *
+ * This distribution is licensed to you under the terms described in
+ * the LICENSE file included in this distribution.
+ *
+ */
+
+#ifndef GBXICEUTILACFR_THREAD_UTILS_H
+#define GBXICEUTILACFR_THREAD_UTILS_H
+
+#include <IceUtil/Time.h>
+#include <gbxutilacfr/stoppable.h>
+
+namespace gbxiceutilacfr {
+
+//! Sleeps for @ref duration waking up every @ref checkIntervalMs [ms] to check if the @c activity
+//! was told to stop. This implementation is very simple so the error in total sleep duration
+//! can be as large as checkIntervalMs. In particular, if @ref duration is shorter than @ref checkIntervalMs,
+//! this function will sleep for @ref checkIntervalMs.
+void checkedSleep( gbxutilacfr::Stoppable* activity, const IceUtil::Time& duration, int checkIntervalMs=250 );
+
+//! Same as above, but sleep duration is specified in milliseconds.
+void checkedSleep( gbxutilacfr::Stoppable* activity, int durationMs, int checkIntervalMs=250 );
+
+} // end namespace
+
+#endif
Added: gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverhealthchecks.cpp
===================================================================
--- gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverhealthchecks.cpp (rev 0)
+++ gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverhealthchecks.cpp 2009-05-01 21:23:59 UTC (rev 397)
@@ -0,0 +1,293 @@
+/*
+ * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
+ * http://gearbox.sf.net/
+ * Copyright (c) 2004-2009 Tobias Kaupp
+ *
+ * This distribution is licensed to you under the terms described in
+ * the LICENSE file included in this distribution.
+ *
+ */
+
+#include <sstream>
+#include "oceanserverhealthchecks.h"
+
+
+using namespace std;
+
+namespace gbxsmartbatteryacfr
+{
+ namespace
+ {
+
+ bool haveBattery( const OceanServerSystem &batteryData,
+ vector<string> &warnShort,
+ vector<string> &warnVerbose )
+ {
+ const vector<bool> &bats = batteryData.availableBatteries;
+ bool haveBattery = false;
+ for (unsigned int i=0; i<bats.size(); i++)
+ {
+ if (bats[i] == true) {
+ haveBattery = true;
+ break;
+ }
+ }
+ if (!haveBattery)
+ {
+ warnVerbose.push_back("Driver reports that there are no batteries installed!\n");
+ warnShort.push_back("NO BATTERIES! ");
+ }
+ return haveBattery;
+ }
+
+ string toString( const vector<string> &stringList )
+ {
+ stringstream ss;
+ for (unsigned int i=0; i<stringList.size(); ++i)
+ {
+ ss << stringList[i];
+ }
+ return ss.str();
+
+ }
+
+ }
+
+bool checkNumberOfBatteries( const OceanServerSystem &batteryData,
+ std::vector<std::string> &warnShort,
+ std::vector<std::string> &warnVerbose,
+ int expectedNumBatteries )
+{
+ bool haveWarning = false;
+
+ int numBatteries = 0;
+ const vector<bool> &bats = batteryData.availableBatteries;
+
+ for (unsigned int i=0; i<bats.size(); i++)
+ {
+ if (bats[i] == true) {
+ numBatteries++;
+ }
+ }
+ if ( numBatteries!=expectedNumBatteries )
+ {
+ stringstream ssWarnShort;
+ ssWarnShort << "ONLY " << numBatteries << " BATTERIES! ";
+ warnShort.push_back(ssWarnShort.str());
+ stringstream ssWarnVerbose;
+ ssWarnVerbose << "Only found " << numBatteries << " battery modules (expected to see " << expectedNumBatteries << ")" << endl;
+ warnVerbose.push_back( ssWarnVerbose.str() );
+ haveWarning = true;
+ }
+
+ return haveWarning;
+}
+
+bool checkNumCycles( const OceanServerSystem &batteryData,
+ vector<string> &warnShort,
+ vector<string> &warnVerbose,
+ int numCyclesThreshhold,
+ bool printRawRecord )
+{
+ bool haveWarning = false;
+
+ map<int,SmartBattery>::const_iterator it;
+ for (it=batteryData.batteries().begin(); it!=batteryData.batteries().end(); it++)
+ {
+ const SmartBattery &bat = batteryData.battery( it->first );
+ if ( !bat.has(CycleCount) ) continue;
+
+ int numCycles = bat.cycleCount();
+
+ // There's a bug in the Oceanserver system which sometimes produces an FFFF record for this field.
+ // According to Kevin Ludlam (lu...@oc...), "caused by a collision on the SMBus"
+ if ( (numCycles > numCyclesThreshhold) && (numCycles!=65535) )
+ {
+ haveWarning = true;
+ stringstream ssWarnShort;
+ ssWarnShort << "BAT(" << it->first << "): HIGH CYCLES! ";
+ warnShort.push_back(ssWarnShort.str());
+ stringstream ssWarnVerbose;
+ ssWarnVerbose << "High charge cycles! Battery no " << it->first << " has had " << numCycles << " cycles (consider swapping at " << numCyclesThreshhold << " cycles)" << endl;
+ warnVerbose.push_back(ssWarnVerbose.str());
+ }
+ }
+
+ if (haveWarning && printRawRecord)
+ {
+ stringstream ssWarnVerbose;
+ ssWarnVerbose << "Latest raw record: " << endl << toString(batteryData.rawRecord) << endl;
+ warnVerbose.push_back(ssWarnVerbose.str());
+ }
+
+ return haveWarning;
+
+}
+
+bool checkTemperatures(const OceanServerSystem &batteryData,
+ vector<string> &warnShort,
+ vector<string> &warnVerbose,
+ double chargeTempThreshhold,
+ double dischargeTempThreshhold,
+ bool printRawRecord )
+{
+ bool haveWarning = false;
+
+ map<int,SmartBattery>::const_iterator it;
+
+ for (it=batteryData.batteries().begin(); it!=batteryData.batteries().end(); it++)
+ {
+ int batteryNumber = it->first;
+ const SmartBattery &bat = batteryData.battery( batteryNumber );
+ if ( !bat.has(Temperature) ) continue;
+
+ assert( (int)batteryData.chargingStates.size() >= batteryNumber-1 );
+ bool isCharging = batteryData.chargingStates[batteryNumber-1];
+
+ double tempThreshhold = 0.0;
+ if (isCharging) {
+ tempThreshhold = chargeTempThreshhold;
+ } else {
+ tempThreshhold = dischargeTempThreshhold;
+ }
+
+ double temperature = bat.temperature();
+ if ( temperature > tempThreshhold)
+ {
+ haveWarning = true;
+ stringstream ssWarnShort;
+ ssWarnShort << "BAT(" << batteryNumber << "): HOT! ";
+ warnShort.push_back(ssWarnShort.str());
+ stringstream ssWarnVerbose;
+ ssWarnVerbose << "High temperature! Battery no " << batteryNumber << " has " << temperature << "degC (threshhold: " << tempThreshhold << "degC)" << endl;
+ warnVerbose.push_back(ssWarnVerbose.str());
+ }
+ }
+
+ if (haveWarning && printRawRecord)
+ {
+ stringstream ssWarnVerbose;
+ ssWarnVerbose << "Latest raw record: " << endl << toString(batteryData.rawRecord) << endl;
+ warnVerbose.push_back(ssWarnVerbose.str());
+ }
+
+ return haveWarning;
+}
+
+bool checkCharges(const OceanServerSystem &batteryData,
+ vector<string> &warnShort,
+ vector<string> &warnVerbose,
+ int chargeWarnThreshhold,
+ int chargeDeviationThreshold )
+{
+ bool haveWarning = false;
+
+ map<int,SmartBattery>::const_iterator it;
+
+ for (it=batteryData.batteries().begin(); it!=batteryData.batteries().end(); it++)
+ {
+ int batteryNumber = it->first;
+ const SmartBattery &bat = batteryData.battery( batteryNumber );
+ if ( !bat.has(RelativeStateOfCharge) ) continue;
+
+ int charge = bat.relativeStateOfCharge();
+ const int avgCharge = batteryData.percentCharge;
+
+ // check whether battery charge is lower than the average
+ if ( charge < (avgCharge - chargeDeviationThreshold) )
+ {
+ haveWarning = true;
+ stringstream ssWarnShort;
+ ssWarnShort << "BAT(" << batteryNumber << "): INCONSISTENT CHARGE! ";
+ warnShort.push_back(ssWarnShort.str());
+ stringstream ssWarnVerbose;
+ ssWarnVerbose << "Inconsistent charge! Battery no " << batteryNumber << "'s charge is " << charge << "% (average: " << avgCharge << "%)" << endl;
+ warnVerbose.push_back(ssWarnVerbose.str());
+ }
+
+ // check whether battery charge is below a threshhold
+ if (charge < chargeWarnThreshhold)
+ {
+ haveWarning = true;
+ stringstream ssWarnShort;
+ ssWarnShort << "BAT(" << batteryNumber << "): LOW CHARGE! ";
+ warnShort.push_back(ssWarnShort.str());
+ stringstream ssWarnVerbose;
+ ssWarnVerbose << "Low charge! Battery no " << batteryNumber << "'s charge is " << charge << "% (threshhold: " << chargeWarnThreshhold << "%)" << endl;
+ warnVerbose.push_back(ssWarnVerbose.str());
+ }
+ }
+
+ return haveWarning;
+}
+
+bool checkModuleHealth( const OceanServerSystem &batteryData,
+ vector<string> &warnShort,
+ vector<string> &warnVerbose )
+{
+ bool haveWarning = false;
+
+ // check the flags
+ const vector<bool> &badPower = batteryData.powerNoGoodStates;
+ for (unsigned int i=0; i<badPower.size(); i++)
+ {
+ if (badPower[i]==true)
+ {
+ haveWarning = true;
+ stringstream ssWarnShort;
+ ssWarnShort << "BAT(" << i+1 << "): BAD POWER! ";
+ warnShort.push_back(ssWarnShort.str());
+ stringstream ssWarnVerbose;
+ ssWarnVerbose << "Power-no-good flag of battery number " << i+1 << " is set!" << endl;
+ warnVerbose.push_back(ssWarnVerbose.str());
+ }
+ }
+
+ const vector<bool> &chargeInhibit = batteryData.chargeInhibitedStates;
+ for (unsigned int i=0; i<chargeInhibit.size(); i++)
+ {
+ if (chargeInhibit[i]==true)
+ {
+ haveWarning = true;
+ stringstream ssWarnShort;
+ ssWarnShort << "BAT(" << i+1 << "): CHARGE INHIBITED! ";
+ warnShort.push_back(ssWarnShort.str());
+ stringstream ssWarnVerbose;
+ ssWarnVerbose << "Charge-inhibited flag of battery number " << i+1 << " is set!" << endl;
+ warnVerbose.push_back(ssWarnVerbose.str());
+ }
+ }
+
+ return haveWarning;
+}
+
+bool conductAllHealthChecks( const OceanServerSystem &batteryData,
+ const BatteryHealthWarningConfig &batteryConfig,
+ std::vector<std::string> &warnShort,
+ std::vector<std::string> &warnVerbose,
+ bool printRawRecord )
+{
+ if ( !haveBattery( batteryData, warnShort, warnVerbose ) ) return true;
+
+ bool warnNumBatteries = checkNumberOfBatteries( batteryData, warnShort, warnVerbose, batteryConfig.expectedNumBatteries );
+ bool warnModule = checkModuleHealth( batteryData, warnShort, warnVerbose );
+ bool warnCycle = checkNumCycles( batteryData, warnShort, warnVerbose, batteryConfig.numCyclesThreshhold, false );
+ bool warnTemp = checkTemperatures( batteryData, warnShort, warnVerbose, batteryConfig.chargeTempThreshhold, batteryConfig.dischargeTempThreshhold, false );
+ bool warnCharge = checkCharges( batteryData, warnShort, warnVerbose, batteryConfig.chargeWarnThreshhold, batteryConfig.chargeDeviationThreshold );
+
+ bool haveWarnings = warnNumBatteries || warnModule || warnCycle || warnTemp || warnCharge;
+
+ if (printRawRecord && haveWarnings )
+ {
+ stringstream ssWarnVerbose;
+ ssWarnVerbose << "Latest raw record: " << endl << toString(batteryData.rawRecord) << endl;
+ warnVerbose.push_back(ssWarnVerbose.str());
+ }
+
+ return haveWarnings;
+}
+
+
+
+}
+
Added: gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverhealthchecks.h
===================================================================
--- gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverhealthchecks.h (rev 0)
+++ gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverhealthchecks.h 2009-05-01 21:23:59 UTC (rev 397)
@@ -0,0 +1,92 @@
+/*
+ * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
+ * http://gearbox.sf.net/
+ * Copyright (c) 2004-2009 Tobias Kaupp
+ *
+ * This distribution is licensed to you under the terms described in
+ * the LICENSE file included in this distribution.
+ *
+ */
+
+#ifndef GBX_OCEANSERVER_HEALTH_CHECKS
+#define GBX_OCEANSERVER_HEALTH_CHECKS
+
+#include <gbxsmartbatteryacfr/oceanserversystem.h>
+
+namespace gbxsmartbatteryacfr
+{
+
+//! Issues a short and verbose warning if the number of recharge cycles of one or more batteries are exceeded
+//! Optionally includes the raw battery record in warnVerbose
+//! Returns true if there was a warning otherwise false
+bool checkNumCycles( const OceanServerSystem &batteryData,
+ std::vector<std::string> &warnShort,
+ std::vector<std::string> &warnVerbose,
+ int numCyclesThreshhold,
+ bool printRawRecord = false );
+
+//! Issues a short and verbose warning if the temperature threshholds are of one or more batteries are exceeded
+//! Optionally includes the raw battery record in warnVerbose
+//! Returns true if there was a warning otherwise false
+bool checkTemperatures(const OceanServerSystem &batteryData,
+ std::vector<std::string> &warnShort,
+ std::vector<std::string> &warnVerbose,
+ double chargeTempThreshhold,
+ double dischargeTempThreshhold,
+ bool printRawRecord = false );
+
+//! Issues a short and verbose warning if the charge of one or more batteries is below the threshold or if the charge of any battery deviates by chargeDeviationThreshold percent from the average of all batteries
+//! Returns true if there was a warning otherwise false
+bool checkCharges(const OceanServerSystem &batteryData,
+ std::vector<std::string> &warnShort,
+ std::vector<std::string> &warnVerbose,
+ int chargeWarnThreshhold,
+ int chargeDeviationThreshold );
+
+//! Issues a short and verbose warning if any of the individual modules have "bad power" or are "charge-inhibited"
+//! Returns true if there was a warning otherwise false
+bool checkModuleHealth( const OceanServerSystem &batteryData,
+ std::vector<std::string> &warnShort,
+ std::vector<std::string> &warnVerbose );
+
+//! Issues a short and verbose warning if the number of expected batteries are not installed
+//! Returns true if there was a warning otherwise false
+bool checkNumberOfBatteries( const OceanServerSystem &batteryData,
+ std::vector<std::string> &warnShort,
+ std::vector<std::string> &warnVerbose,
+ int expectedNumBatteries );
+
+//! Config structure for battery health checks
+//! The threshholds represent acceptable values before warnings are issued
+struct BatteryHealthWarningConfig
+{
+ //! Expected number of battery modules installed
+ int expectedNumBatteries;
+ //! Maximum number of battery recharge cycles before a warning is issued
+ int numCyclesThreshhold;
+ //! Maximum charging temperature before a warning is issued
+ double chargeTempThreshhold;
+ //! Maximum discharging temperature before a warning is issued
+ double dischargeTempThreshhold;
+ //! Minimum charge in percent before a warning is issued
+ int chargeWarnThreshhold;
+ //! Minimum deviation of a single battery from the average of all batteries before a warning is issued (in percent)
+ int chargeDeviationThreshold;
+};
+
+//! Conducts all of the health checks above given a battery health configuration
+//! Adds up short and verbose warning messages
+//! Optionally includes the raw battery record at the end of warnVerbose if any check generated a warning
+//! Returns true if there were warnings otherwise false
+bool conductAllHealthChecks( const OceanServerSystem &batteryData,
+ const BatteryHealthWarningConfig &batteryCheckConfig,
+ std::vector<std::string> &warnShort,
+ std::vector<std::string> &warnVerbose,
+ bool printRawRecord = false );
+
+
+
+
+} // namespace
+
+#endif
Added: gearbox/trunk/src/gbxutilacfr/stoppable.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/stoppable.h (rev 0)
+++ gearbox/trunk/src/gbxutilacfr/stoppable.h 2009-05-01 21:23:59 UTC (rev 397)
@@ -0,0 +1,58 @@
+/*
+ * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
+ * http://gearbox.sf.net/
+ * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp
+ *
+ * This distribution is licensed to you under the terms described in
+ * the LICENSE file included in this distribution.
+ *
+ */
+
+#ifndef GBXUTILACFR_STOPPABLE_H
+#define GBXUTILACFR_STOPPABLE_H
+
+namespace gbxutilacfr {
+
+/*!
+@brief An abstract interface class representing an stoppable activity.
+
+Inherit from this and other classes will know how to ask if your class was stopped (interrupted).
+
+@verbatim
+function doBigJob( gbxutilacfr::Stoppable* parent )
+{
+ // check periodically that the parent activity is not stopping
+ while( !parent->isStopping() )
+ {
+ // perform many steps
+ }
+}
+
+class MyActivity : public gbxutilacfr::Stoppable
+{
+public:
+ virtual bool isStopping()
+ {
+ // return TRUE if we are interrupted
+ };
+
+ void run()
+ {
+ doBigJob( this );
+ };
+};
+@endverbatim
+
+@author Alex Makarenko
+*/
+class Stoppable
+{
+public:
+ virtual ~Stoppable() {};
+
+ virtual bool isStopping()=0;
+};
+
+} // namespace
+
+#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bo...@us...> - 2009-05-01 09:44:38
|
Revision: 396
http://gearbox.svn.sourceforge.net/gearbox/?rev=396&view=rev
Author: borax00
Date: 2009-05-01 09:44:22 +0000 (Fri, 01 May 2009)
Log Message:
-----------
MR changes
Modified Paths:
--------------
gearbox/trunk/CMakeLists.txt
gearbox/trunk/cmake/DependencyUtils.cmake
gearbox/trunk/cmake/TargetUtils.cmake
gearbox/trunk/cmake/UseGearbox.cmake
gearbox/trunk/cmake/internal/Setup.cmake
gearbox/trunk/doc/buildsys.dox
gearbox/trunk/doc/getting.dox
gearbox/trunk/doc/history.dox
gearbox/trunk/doc/install_debian.dox
gearbox/trunk/src/gbxadvancedexample/CMakeLists.txt
gearbox/trunk/src/gbxgarminacfr/CMakeLists.txt
gearbox/trunk/src/gbxnovatelacfr/CMakeLists.txt
gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/CMakeLists.txt
gearbox/trunk/src/gbxserialacfr/CMakeLists.txt
gearbox/trunk/src/gbxsickacfr/CMakeLists.txt
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/CMakeLists.txt
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/buffer.h
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/threadtest.cpp
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/thread.cpp
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/thread.h
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/timer.cpp
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/timer.h
gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/CMakeLists.txt
gearbox/trunk/src/gbxsmartbatteryacfr/CMakeLists.txt
gearbox/trunk/src/gbxsmartbatteryacfr/gbxsmartbatteryacfr.h
gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverparser.cpp
gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverreader.h
gearbox/trunk/src/gbxsmartbatteryacfr/oceanserversystem.cpp
gearbox/trunk/src/gbxsmartbatteryacfr/oceanserversystem.h
gearbox/trunk/src/gbxsmartbatteryacfr/test/longtest.cpp
gearbox/trunk/src/gbxutilacfr/gbxutilacfr.h
gearbox/trunk/src/gbxutilacfr/status.cpp
gearbox/trunk/src/gbxutilacfr/status.h
gearbox/trunk/src/gbxutilacfr/substatus.h
gearbox/trunk/src/gbxutilacfr/trivialstatus.cpp
gearbox/trunk/src/hokuyo_aist/CMakeLists.txt
Modified: gearbox/trunk/CMakeLists.txt
===================================================================
--- gearbox/trunk/CMakeLists.txt 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/CMakeLists.txt 2009-05-01 09:44:22 UTC (rev 396)
@@ -6,13 +6,18 @@
#
# project name
#
-PROJECT( gearbox )
+project( gearbox )
#
-# project version string
+# project version
#
-set( GBX_PROJECT_VERSION 9.02+ )
+set( GBX_PROJECT_VERSION_MAJOR "9" )
+set( GBX_PROJECT_VERSION_MINOR "02" )
+set( GBX_PROJECT_VERSION_PATCH "+" )
+set( GBX_PROJECT_VERSION
+ ${GBX_PROJECT_VERSION_MAJOR}.${GBX_PROJECT_VERSION_MINOR}.${GBX_PROJECT_VERSION_PATCH} )
+
#
# The rest is done by a script
#
Modified: gearbox/trunk/cmake/DependencyUtils.cmake
===================================================================
--- gearbox/trunk/cmake/DependencyUtils.cmake 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/cmake/DependencyUtils.cmake 2009-05-01 09:44:22 UTC (rev 396)
@@ -1,18 +1,31 @@
#
# This is a utility macro for internal use.
+# If module_type is not equal "EXE" or "LIB", prints error message and quits.
#
-macro( GBX_MAKE_OPTION_NAME option_name module_type module_name )
-# message( STATUS "GBX_MAKE_OPTION_NAME [ option_name=${option_name}, MOT_TYPE=${module_type}, MOD_NAME=${module_name} ]" )
+macro( GBX_UTIL_CHECK_MODULE_TYPE type )
+# message( STATUS "GBX_UTIL_CHECK_MODULE_TYPE type=${type}" )
- string( COMPARE EQUAL ${module_type} "EXE" is_exe )
- string( COMPARE EQUAL ${module_type} "LIB" is_lib )
+ string( COMPARE EQUAL ${type} "EXE" is_exe )
+ string( COMPARE EQUAL ${type} "LIB" is_lib )
if( NOT is_exe AND NOT is_lib )
- message( FATAL_ERROR "In macro GBX_MAKE_OPTION_NAME, module_type must be either 'EXE' or 'LIB'" )
+ message( FATAL_ERROR "In GBX_REQUIRE_* macros, module_type must be either 'EXE' or 'LIB'" )
endif( NOT is_exe AND NOT is_lib )
if( is_exe AND is_lib )
- message( FATAL_ERROR "In macro GBX_MAKE_OPTION_NAME, module_type must be either 'EXE' or 'LIB'" )
+ message( FATAL_ERROR "In GBX_REQUIRE_* macros, module_type must be either 'EXE' or 'LIB'" )
endif( is_exe AND is_lib )
+endmacro( GBX_UTIL_CHECK_MODULE_TYPE type )
+
+#
+# This is a utility macro for internal use.
+#
+macro( GBX_UTIL_MAKE_OPTION_NAME option_name module_type module_name )
+# message( STATUS "GBX_UTIL_MAKE_OPTION_NAME [ option_name=${option_name}, MOT_TYPE=${module_type}, MOD_NAME=${module_name} ]" )
+
+ GBX_UTIL_CHECK_MODULE_TYPE( ${module_type} )
+
+ string( COMPARE EQUAL ${module_type} "EXE" is_exe )
+ string( COMPARE EQUAL ${module_type} "LIB" is_lib )
string( TOUPPER ${module_name} module_name_upper )
# dereference the variable name once, so that we are setting the variable in the calling context!
if( is_exe )
@@ -21,23 +34,24 @@
set( ${option_name} "ENABLE_LIB_${module_name_upper}" )
endif( is_exe )
-# message( STATUS "GBX_MAKE_OPTION_NAME output: option_name=${${option_name}}" )
-endmacro( GBX_MAKE_OPTION_NAME option_name module_name )
+# message( STATUS "GBX_UTIL_MAKE_OPTION_NAME output: option_name=${${option_name}}" )
+endmacro( GBX_UTIL_MAKE_OPTION_NAME option_name module_name )
#
# This is a utility macro for internal use.
# (there's another copy of this simple macro in TargetUtils.cmake)
#
-macro( GBX_MAKE_MANIFEST_NAME manifest_name module_name )
-# message( STATUS "GBX_MAKE_MANIFEST_NAME [ manifest_name=${manifest_name}, MOD_NAME=${module_name} ]" )
+# macro( GBX_UTIL_MAKE_MANIFEST_NAME manifest_name module_name )
+# # message( STATUS "GBX_UTIL_MAKE_MANIFEST_NAME [ manifest_name=${manifest_name}, MOD_NAME=${module_name} ]" )
+#
+# string( TOUPPER ${module_name} module_name_upper )
+# # dereference the variable name once, so that we are setting the variable in the calling context!
+# set( ${manifest_name} ${module_name_upper}_INSTALLED )
+#
+# # message( STATUS "GBX_UTIL_MAKE_MANIFEST_NAME output: manifest_name=${${manifest_name}}" )
+# endmacro( GBX_UTIL_MAKE_MANIFEST_NAME manifest_name module_name )
- string( TOUPPER ${module_name} module_name_upper )
- # dereference the variable name once, so that we are setting the variable in the calling context!
- set( ${manifest_name} ${module_name_upper}_INSTALLED )
-# message( STATUS "GBX_MAKE_MANIFEST_NAME output: manifest_name=${${manifest_name}}" )
-endmacro( GBX_MAKE_MANIFEST_NAME manifest_name module_name )
-
#
# GBX_REQUIRE_OPTION( cumulative_var [EXE | LIB] module_name default_option_value [option_name] [OPTION DESCRIPTION] )
#
@@ -51,19 +65,10 @@
#
macro( GBX_REQUIRE_OPTION cumulative_var module_type module_name default_option_value )
- string( COMPARE EQUAL ${module_type} "EXE" is_exe )
- string( COMPARE EQUAL ${module_type} "LIB" is_lib )
- if( NOT is_exe AND NOT is_lib )
- message( FATAL_ERROR "In macro GBX_REQUIRE_OPTION, module_type must be either 'EXE' or 'LIB'" )
- endif( NOT is_exe AND NOT is_lib )
- if( is_exe AND is_lib )
- message( FATAL_ERROR "In macro GBX_REQUIRE_OPTION, module_type must be either 'EXE' or 'LIB'" )
- endif( is_exe AND is_lib )
-
if( ${ARGC} GREATER 5 )
set( option_name ${ARGV6} )
else( ${ARGC} GREATER 5 )
- GBX_MAKE_OPTION_NAME( option_name ${module_type} ${module_name} )
+ GBX_UTIL_MAKE_OPTION_NAME( option_name ${module_type} ${module_name} )
endif( ${ARGC} GREATER 5 )
if( ${ARGC} GREATER 6 )
@@ -95,7 +100,7 @@
if( ${cumulative_var} AND NOT ${option_name} )
set( ${cumulative_var} FALSE )
if( is_exe )
- GBX_NOT_add_executable( ${module_name} ${option_descr} )
+ GBX_NOT_ADD_EXECUTABLE( ${module_name} ${option_descr} )
else( is_exe )
GBX_NOT_add_library( ${module_name} ${option_descr} )
endif( is_exe )
@@ -117,20 +122,13 @@
# debug
# message( STATUS "GBX_REQUIRE_VAR [ CUM_VAR=${cumulative_var}, MOD_TYPE=${module_type}, MOD_NAME=${module_name}, test_var=${${test_var}}, reason=${reason} ]" )
- string( COMPARE EQUAL ${module_type} "EXE" is_exe )
- string( COMPARE EQUAL ${module_type} "LIB" is_lib )
- if( NOT is_exe AND NOT is_lib )
- message( FATAL_ERROR "In macro GBX_REQUIRE_VAR, module_type must be either 'EXE' or 'LIB'" )
- endif( NOT is_exe AND NOT is_lib )
- if( is_exe AND is_lib )
- message( FATAL_ERROR "In macro GBX_REQUIRE_VAR, module_type must be either 'EXE' or 'LIB'" )
- endif( is_exe AND is_lib )
+ GBX_UTIL_CHECK_MODULE_TYPE( ${module_type} )
# must dereference both var names once (!) and IF will evaluate their values
if( ${cumulative_var} AND NOT ${test_var} )
set( ${cumulative_var} FALSE )
if( is_exe )
- GBX_NOT_add_executable( ${module_name} ${reason} )
+ GBX_NOT_ADD_EXECUTABLE( ${module_name} ${reason} )
else( is_exe )
GBX_NOT_add_library( ${module_name} ${reason} )
endif( is_exe )
@@ -138,6 +136,7 @@
endmacro( GBX_REQUIRE_VAR cumulative_var module_type module_name test_var reason )
+# OBSOLETE! CONVERTED FROM HOME-MADE MANIFESTS TO FIND_PACKAGE()
#
# GBX_REQUIRE_install( cumulative_var [EXE | LIB] module_name installed_module [reason] )
#
@@ -152,107 +151,108 @@
# This example is equivalent to
# REQUIRE_VAR( build LIB HydroStuff GBXSTUFF_INSTALLED "GbxStuff was not installed" )
#
-macro( GBX_REQUIRE_INSTALL cumulative_var module_type module_name installed_module )
+# macro( GBX_REQUIRE_INSTALL cumulative_var module_type module_name installed_module )
+#
+# # debug
+# # message( STATUS "GBX_REQUIRE_INSTALL [ CUM_VAR=${cumulative_var}, MOD_TYPE=${module_type}, MOD_NAME=${module_name}, installed_module=${installed_module} ]" )
+#
+# GBX_UTIL_MAKE_MANIFEST_NAME( test_var ${installed_module} )
+#
+# if( ${ARGC} GREATER 5 )
+# set( reason ${ARGV6} )
+# else( ${ARGC} GREATER 5 )
+# set( reason "${installed_module} was not installed" )
+# endif( ${ARGC} GREATER 5 )
+#
+# # must dereference both var names once (!)
+# GBX_REQUIRE_VAR( ${cumulative_var} ${module_type} ${module_name} ${test_var} ${reason} )
+#
+# endmacro( GBX_REQUIRE_INSTALL cumulative_var module_type module_name installed_module )
- # debug
-# message( STATUS "GBX_REQUIRE_INSTALL [ CUM_VAR=${cumulative_var}, MOD_TYPE=${module_type}, MOD_NAME=${module_name}, installed_module=${installed_module} ]" )
-
- GBX_MAKE_MANIFEST_NAME( test_var ${installed_module} )
-
- if( ${ARGC} GREATER 5 )
- set( reason ${ARGV6} )
- else( ${ARGC} GREATER 5 )
- set( reason "${installed_module} was not installed" )
- endif( ${ARGC} GREATER 5 )
-
- # must dereference both var names once (!)
- GBX_REQUIRE_VAR( ${cumulative_var} ${module_type} ${module_name} ${test_var} ${reason} )
-
-endmacro( GBX_REQUIRE_INSTALL cumulative_var module_type module_name installed_module )
-
+# OBSOLETE! CONVERTED FROM HOME-MADE MANIFESTS TO FIND_PACKAGE()
#
# GBX_REQUIRE_INSTALLS( cumulative_var [EXE | LIB] module_name target0 [targe1 target2 ...] )
#
-macro( GBX_REQUIRE_INSTALLS cumulative_var module_type module_name )
-
- if( ${ARGC} LESS 4 )
- message( FATAL_ERROR "GBX_REQUIRE_INSTALLS macro needs to at least one target name (${ARGC} params were given)." )
- endif( ${ARGC} LESS 4 )
+# macro( GBX_REQUIRE_INSTALLS cumulative_var module_type module_name )
+#
+# if( ${ARGC} LESS 4 )
+# message( FATAL_ERROR "GBX_REQUIRE_INSTALLS macro needs to at least one target name (${ARGC} params were given)." )
+# endif( ${ARGC} LESS 4 )
+#
+# foreach( trgt ${ARGN} )
+# GBX_REQUIRE_install( ${cumulative_var} ${module_type} ${module_name} ${trgt} )
+# endforeach( trgt ${ARGN} )
+#
+# endmacro( GBX_REQUIRE_INSTALLS cumulative_var module_type module_name )
- foreach( trgt ${ARGN} )
- GBX_REQUIRE_install( ${cumulative_var} ${module_type} ${module_name} ${trgt} )
- endforeach( trgt ${ARGN} )
-
-endmacro( GBX_REQUIRE_INSTALLS cumulative_var module_type module_name )
-
#
-# GBX_REQUIRE_TARGET( cumulative_var [EXE | LIB] module_name target_name [reason] )
+# GBX_REQUIRE_LIB( cumulative_var [EXE | LIB] module_name target_name [reason] )
#
+# Despite the name, this macro can enforce dependence on any target, not just a library.
+#
# E.g.
# Initialize a variable first
# set( build TRUE )
# Now set up and test option value
-# GBX_REQUIRE_TARGET ( build EXE localiser HydroStuff )
+# GBX_REQUIRE_LIB ( build EXE localiser HydroStuff )
#
-macro( GBX_REQUIRE_TARGET cumulative_var module_type module_name target_name )
-
+macro( GBX_REQUIRE_LIB cumulative_var module_type module_name target_name )
# debug
-# message( STATUS "GBX_REQUIRE_TARGET [ CUM_VAR=${${cumulative_var}}, MOD_TYPE=${module_type}, MOD_NAME=${module_name}, target_name=${target_name} ]" )
+# message( STATUS "GBX_REQUIRE_LIB [ CUM_VAR=${${cumulative_var}}, MOD_TYPE=${module_type}, MOD_NAME=${module_name}, target_name=${target_name} ]" )
- string( COMPARE EQUAL ${module_type} "EXE" is_exe )
- string( COMPARE EQUAL ${module_type} "LIB" is_lib )
- if( NOT is_exe AND NOT is_lib )
- message( FATAL_ERROR "In macro GBX_REQUIRE_TARGET, module_type must be either 'EXE' or 'LIB'" )
- endif( NOT is_exe AND NOT is_lib )
- if( is_exe AND is_lib )
- message( FATAL_ERROR "In macro GBX_REQUIRE_TARGET, module_type must be either 'EXE' or 'LIB'" )
- endif( is_exe AND is_lib )
+ if( ${cumulative_var} )
- if( ${ARGC} GREATER 5 )
- set( reason ${ARGV6} )
- else( ${ARGC} GREATER 5 )
- set( reason "${target_name} is not being built" )
- endif( ${ARGC} GREATER 5 )
+ GBX_UTIL_CHECK_MODULE_TYPE( ${module_type} )
+
+ if( ${ARGC} GREATER 5 )
+ set( reason ${ARGV6} )
+ else( ${ARGC} GREATER 5 )
+ set( reason "${target_name} is not being built" )
+ endif( ${ARGC} GREATER 5 )
+
+ GET_TARGET_PROPERTY( target_location ${target_name} LOCATION )
+
+ # must dereference both var and option names once (!) and IF will evaluate their values
+ if( NOT target_location )
+ set( ${cumulative_var} FALSE )
+ GBX_UTIL_MAKE_OPTION_NAME( option_name ${module_type} ${module_name} )
+ if( is_exe )
+ GBX_NOT_ADD_EXECUTABLE( ${module_name} ${reason} )
+ set( ${option_name} OFF CACHE BOOL "Try to build ${module_name}" FORCE )
+ else( is_exe )
+ GBX_NOT_add_library( ${module_name} ${reason} )
+ set( ${option_name} OFF CACHE BOOL "Try to build lib${module_name} library" FORCE )
+ endif( is_exe )
+ endif( NOT target_location )
- GET_TARGET_PROPERTY( target_location ${target_name} LOCATION )
+ endif( ${cumulative_var} )
- # must dereference both var and option names once (!) and IF will evaluate their values
- if( ${cumulative_var} AND NOT target_location )
- set( ${cumulative_var} FALSE )
- GBX_MAKE_OPTION_NAME( option_name ${module_type} ${module_name} )
- if( is_exe )
- GBX_NOT_add_executable( ${module_name} ${reason} )
- set( ${option_name} OFF CACHE BOOL "Try to build ${module_name}" FORCE )
- else( is_exe )
- GBX_NOT_add_library( ${module_name} ${reason} )
- set( ${option_name} OFF CACHE BOOL "Try to build lib${module_name} library" FORCE )
- endif( is_exe )
- endif( ${cumulative_var} AND NOT target_location )
+endmacro( GBX_REQUIRE_LIB cumulative_var module_type module_name target_name )
-endmacro( GBX_REQUIRE_TARGET cumulative_var module_type module_name target_name )
-
#
-# GBX_REQUIRE_TARGETS( cumulative_var [EXE | LIB] module_name TARGET0 [TARGET1 TARGET2 ...] )
+# GBX_REQUIRE_LIBS( cumulative_var [EXE | LIB] module_name TARGET0 [TARGET1 TARGET2 ...] )
#
-macro( GBX_REQUIRE_TARGETS cumulative_var module_type module_name )
-
+# Despite the name, this macro can enforce dependence on a set of target, not just a set of libraries.
+#
+macro( GBX_REQUIRE_LIBS cumulative_var module_type module_name )
# debug
-# message( STATUS "GBX_REQUIRE_TARGETS [ CUM_VAR=${${cumulative_var}}, MOD_TYPE=${module_type}, MOD_NAME=${module_name}, target_names=${ARGN} ]" )
+# message( STATUS "GBX_REQUIRE_LIBS [ CUM_VAR=${${cumulative_var}}, MOD_TYPE=${module_type}, MOD_NAME=${module_name}, target_names=${ARGN} ]" )
if( ${ARGC} LESS 4 )
- message( FATAL_ERROR "GBX_REQUIRE_TARGETS macro needs to at least one target name (${ARGC} params were given)." )
+ message( FATAL_ERROR "GBX_REQUIRE_LIBS macro needs to at least one target name (${ARGC} params were given)." )
endif( ${ARGC} LESS 4 )
foreach( trgt ${ARGN} )
- GBX_REQUIRE_TARGET( ${cumulative_var} ${module_type} ${module_name} ${trgt} )
+ GBX_REQUIRE_LIB( ${cumulative_var} ${module_type} ${module_name} ${trgt} )
endforeach( trgt ${ARGN} )
-endmacro( GBX_REQUIRE_TARGETS cumulative_var module_type module_name )
+endmacro( GBX_REQUIRE_LIBS cumulative_var module_type module_name )
+# OBSOLETE! Use GBX_REQUIRE_LIB instead.
#
# GBX_REQUIRE_LIB( cumulative_var [EXE | LIB] module_name depend_name [reason] )
#
-# This is a convenience macro which combines the functionality of GBX_REQUIRE_INSTALL and GBX_REQUIRE_TARGET.
+# This is a convenience macro which combines the functionality of GBX_REQUIRE_INSTALL and GBX_REQUIRE_LIB.
# It can be used to require executables despite the name.
#
# First checks if a target called ${depend_name} exists, i.e. a library or executable with this name
@@ -265,63 +265,57 @@
# Initialize a variable first
# set( build TRUE )
# Now set up and test option value
-# GBX_REQUIRE_TARGET ( build EXE localiser HydroStuff )
-# GBX_REQUIRE_TARGET ( build LIB MyStuff HydroStuff )
+# GBX_REQUIRE_LIB ( build EXE localiser HydroStuff )
+# GBX_REQUIRE_LIB ( build LIB MyStuff HydroStuff )
#
-macro( GBX_REQUIRE_LIB cumulative_var module_type module_name depend_name )
-# message( STATUS "GBX_REQUIRE_LIB [ CUM_VAR=${${cumulative_var}}, MOD_TYPE=${module_type}, MOD_NAME=${module_name}, depend_name=${depend_name} ]" )
+# macro( GBX_REQUIRE_LIB cumulative_var module_type module_name depend_name )
+# # message( STATUS "GBX_REQUIRE_LIB [ CUM_VAR=${${cumulative_var}}, MOD_TYPE=${module_type}, MOD_NAME=${module_name}, depend_name=${depend_name} ]" )
+#
+# if( ${cumulative_var} )
+#
+# GBX_UTIL_CHECK_MODULE_TYPE( ${module_type} )
+#
+# if( ${ARGC} GREATER 5 )
+# set( reason ${ARGV6} )
+# else( ${ARGC} GREATER 5 )
+# set( reason "${depend_name} is not being built and was not installed" )
+# endif( ${ARGC} GREATER 5 )
+#
+# # first, look for a target
+# GET_TARGET_PROPERTY( target_location ${depend_name} LOCATION )
+#
+# # must dereference both var and option names once (!) and IF will evaluate their values
+# if( NOT target_location )
+#
+# # target not found, look for an install
+# GBX_UTIL_MAKE_MANIFEST_NAME( test_var ${depend_name} )
+#
+# # must dereference both var names once (!)
+# GBX_REQUIRE_VAR( ${cumulative_var} ${module_type} ${module_name} ${test_var} ${reason} )
+#
+# endif( NOT target_location )
+#
+# endif( ${cumulative_var} )
+#
+# endmacro( GBX_REQUIRE_LIB cumulative_var module_type module_name target_name )
- if( ${cumulative_var} )
-
- string( COMPARE EQUAL ${module_type} "EXE" is_exe )
- string( COMPARE EQUAL ${module_type} "LIB" is_lib )
- if( NOT is_exe AND NOT is_lib )
- message( FATAL_ERROR "In macro GBX_REQUIRE_LIB, module_type must be either 'EXE' or 'LIB'" )
- endif( NOT is_exe AND NOT is_lib )
- if( is_exe AND is_lib )
- message( FATAL_ERROR "In macro GBX_REQUIRE_LIB, module_type must be either 'EXE' or 'LIB'" )
- endif( is_exe AND is_lib )
-
- if( ${ARGC} GREATER 5 )
- set( reason ${ARGV6} )
- else( ${ARGC} GREATER 5 )
- set( reason "${depend_name} is not being built and was not installed" )
- endif( ${ARGC} GREATER 5 )
-
- # first, look for a target
- GET_TARGET_PROPERTY( target_location ${depend_name} LOCATION )
-
- # must dereference both var and option names once (!) and IF will evaluate their values
- if( NOT target_location )
-
- # target not found, look for an install
- GBX_MAKE_MANIFEST_NAME( test_var ${depend_name} )
-
- # must dereference both var names once (!)
- GBX_REQUIRE_VAR( ${cumulative_var} ${module_type} ${module_name} ${test_var} ${reason} )
-
- endif( NOT target_location )
-
- endif( ${cumulative_var} )
-
-endmacro( GBX_REQUIRE_LIB cumulative_var module_type module_name target_name )
-
+# OBSOLETE! Use GBX_REQUIRE_LIBS instead.
#
# GBX_REQUIRE_LIBS( cumulative_var [EXE | LIB] module_name LIB0 [LIB1 LIB2 ...] )
#
-macro( GBX_REQUIRE_LIBS cumulative_var module_type module_name )
-# message( STATUS "GBX_REQUIRE_LIBS [ CUM_VAR=${${cumulative_var}}, MOD_TYPE=${module_type}, MOD_NAME=${module_name}, target_names=${ARGN} ]" )
+# macro( GBX_REQUIRE_LIBS cumulative_var module_type module_name )
+# # message( STATUS "GBX_REQUIRE_LIBS [ CUM_VAR=${${cumulative_var}}, MOD_TYPE=${module_type}, MOD_NAME=${module_name}, target_names=${ARGN} ]" )
+#
+# if( ${ARGC} LESS 4 )
+# message( FATAL_ERROR "GBX_REQUIRE_LIBS macro needs to at least one library name (${ARGC} params were given)." )
+# endif( ${ARGC} LESS 4 )
+#
+# foreach( lib ${ARGN} )
+# GBX_REQUIRE_LIB( ${cumulative_var} ${module_type} ${module_name} ${lib} )
+# endforeach( lib ${ARGN} )
+#
+# endmacro( GBX_REQUIRE_LIBS cumulative_var module_type module_name )
- if( ${ARGC} LESS 4 )
- message( FATAL_ERROR "GBX_REQUIRE_LIBS macro needs to at least one library name (${ARGC} params were given)." )
- endif( ${ARGC} LESS 4 )
-
- foreach( lib ${ARGN} )
- GBX_REQUIRE_LIB( ${cumulative_var} ${module_type} ${module_name} ${lib} )
- endforeach( lib ${ARGN} )
-
-endmacro( GBX_REQUIRE_LIBS cumulative_var module_type module_name )
-
#
# This is a utility macro for internal use.
#
Modified: gearbox/trunk/cmake/TargetUtils.cmake
===================================================================
--- gearbox/trunk/cmake/TargetUtils.cmake 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/cmake/TargetUtils.cmake 2009-05-01 09:44:22 UTC (rev 396)
@@ -5,6 +5,31 @@
mark_as_advanced( GBX_DEFAULT_LIB_TYPE )
#
+# Default preference for installing header files.
+#
+set( GBX_INSTALL_HEADERS TRUE CACHE BOOLEAN "Do you want to install header files?" )
+mark_as_advanced( GBX_INSTALL_HEADERS )
+
+#
+# Default preference for installing shared files.
+#
+set( GBX_INSTALL_SHARED_FILES TRUE CACHE BOOLEAN "Do you want to install shared files?" )
+mark_as_advanced( GBX_INSTALL_SHARED_FILES )
+
+#
+# Default preference for installing examples.
+#
+set( GBX_INSTALL_EXAMPLES TRUE CACHE BOOLEAN "Do you want to install example files?" )
+mark_as_advanced( GBX_INSTALL_EXAMPLES )
+
+#
+# Default preference for installing PKGCONFIG's.
+#
+set( GBX_INSTALL_PKGCONFIGS TRUE CACHE BOOLEAN "Do you want to install PKGCONFIG's files?" )
+mark_as_advanced( GBX_INSTALL_PKGCONFIGS )
+
+
+#
# Executables should add themselves by calling 'GBX_ADD_EXECUTABLE'
# instead of 'ADD_EXECUTABLE' in CMakeLists.txt.
# Usage is the same as ADD_EXECUTABLE, all parameters are passed to ADD_EXECUTABLE.
@@ -51,7 +76,9 @@
# SET_TARGET_PROPERTIES( ${name} PROPERTIES
# INSTALL_RPATH "${INSTALL_RPATH};${CMAKE_INSTALL_PREFIX}/lib/${PROJECT_NAME}"
# BUILD_WITH_INSTALL_RPATH TRUE )
- install( TARGETS ${name} DESTINATION lib/${PROJECT_NAME} )
+ install( TARGETS ${name}
+ DESTINATION lib/${PROJECT_NAME}
+ EXPORT ${PROJECT_NAME}-targets )
set( templist ${LIB_LIST} )
list( APPEND templist ${name} )
@@ -72,7 +99,9 @@
# All files are installed into PREFIX/include/${PROJECT_NAME}/${install_subdir}
#
macro( GBX_ADD_HEADERS install_subdir )
- install( FILES ${ARGN} DESTINATION include/${PROJECT_NAME}/${install_subdir} )
+ if( GBX_INSTALL_HEADERS )
+ install( FILES ${ARGN} DESTINATION include/${PROJECT_NAME}/${install_subdir} )
+ endif()
endmacro( GBX_ADD_HEADERS install_subdir )
#
# GBX_ADD_SHARED_FILES( install_subdir FILE0 [FILE1 FILE2 ...] )
@@ -81,7 +110,9 @@
# All files are installed into PREFIX/share/${PROJECT_NAME}/${install_subdir} directory.
#
macro( GBX_ADD_SHARED_FILES install_subdir )
- install( FILES ${ARGN} DESTINATION share/${PROJECT_NAME}/${install_subdir} )
+ if( GBX_INSTALL_SHARED_FILES )
+ install( FILES ${ARGN} DESTINATION share/${PROJECT_NAME}/${install_subdir} )
+ endif()
endmacro( GBX_ADD_SHARED_FILES install_subdir )
#
@@ -94,8 +125,10 @@
#
macro( GBX_ADD_EXAMPLE install_subdir makefile.in makefile.out )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/${makefile.in} ${CMAKE_CURRENT_BINARY_DIR}/${makefile.out} @ONLY)
- install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${makefile.out} DESTINATION share/${PROJECT_NAME}/${install_subdir} RENAME CMakeLists.txt )
- install( FILES ${ARGN} DESTINATION share/${PROJECT_NAME}/${install_subdir} )
+ if( GBX_INSTALL_EXAMPLES )
+ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${makefile.out} DESTINATION share/${PROJECT_NAME}/${install_subdir} RENAME CMakeLists.txt )
+ install( FILES ${ARGN} DESTINATION share/${PROJECT_NAME}/${install_subdir} )
+ endif()
endmacro( GBX_ADD_EXAMPLE install_subdir makefile )
#
@@ -123,7 +156,10 @@
endif( ${int_deps} )
configure_file( ${GBX_CMAKE_DIR}/pkgconfig.in ${CMAKE_CURRENT_BINARY_DIR}/${name}.pc @ONLY)
- install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}.pc DESTINATION lib/pkgconfig/ )
+
+ if( GBX_INSTALL_PKGCONFIGS )
+ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}.pc DESTINATION lib/pkgconfig/ )
+ endif()
endmacro( GBX_ADD_PKGCONFIG name desc cflags deps libflags libs )
#
Modified: gearbox/trunk/cmake/UseGearbox.cmake
===================================================================
--- gearbox/trunk/cmake/UseGearbox.cmake 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/cmake/UseGearbox.cmake 2009-05-01 09:44:22 UTC (rev 396)
@@ -1,6 +1,9 @@
# This script is indended for Gearbox users (not for internal use)
# Assumes that a variable GEARBOX_INCLUDE_DIR is defined.
-# Variable GEARBOX_LINK_DIR only needs to be defined if you're using a gearbox installation (as opposed to a local gearbox repository)
+# Variable GEARBOX_LINK_DIR only needs to be defined if you're using a gearbox
+# installation (as opposed to a local gearbox repository)
include_directories( ${GEARBOX_INCLUDE_DIR} )
link_directories( ${GEARBOX_LINK_DIR} )
+
+# Not linking to specific libraries, it's up to the user which ones to link to.
Modified: gearbox/trunk/cmake/internal/Setup.cmake
===================================================================
--- gearbox/trunk/cmake/internal/Setup.cmake 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/cmake/internal/Setup.cmake 2009-05-01 09:44:22 UTC (rev 396)
@@ -17,6 +17,11 @@
set( GBX_CMAKE_DIR ${${PROJECT_NAME}_SOURCE_DIR}/cmake CACHE INTERNAL "Location of CMake scripts" )
#
+# Process project name
+#
+include( ${GBX_CMAKE_DIR}/SetupProjectName.cmake )
+
+#
# Process version number
#
include( ${GBX_CMAKE_DIR}/SetupVersion.cmake )
@@ -86,7 +91,7 @@
# Enable testing by including the Dart module
# (must be done *before* entering source directories )
include(${CMAKE_ROOT}/Modules/Dart.cmake)
-ENABLE_TESTING()
+enable_testing()
#
# Enter the source tree
@@ -99,10 +104,15 @@
add_subdirectory( cmake )
#
+# Experimental
+#
+include( ${GBX_CMAKE_DIR}/WritePackageConfig.cmake )
+
+#
# Write results of CMake activity to file
#
-GBX_WRITE_MANIFEST()
-GBX_WRITE_OPTIONS()
+# GBX_WRITE_MANIFEST()
+# GBX_WRITE_OPTIONS()
#
# Print license information to a file
Modified: gearbox/trunk/doc/buildsys.dox
===================================================================
--- gearbox/trunk/doc/buildsys.dox 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/doc/buildsys.dox 2009-05-01 09:44:22 UTC (rev 396)
@@ -186,13 +186,24 @@
@endverbatim
Don't forget to close the IF structure. Notice that CMake is quite strict with @c IF statements: the signature of the closing @c ENDIF must be identical.
-@section gbx_doc_buildsys_varlist A list of useful CMake variables defined by GearBox
+@section gbx_doc_buildsys_varlist A comprehensive list of CMake variables defined by GearBox
Build system configuration:
@verbatim
GBX_DEFAULT_LIB_TYPE # Valid options {SHARED, STATIC}. Defaults to SHARED.
@endverbatim
+Project description:
+@verbatim
+GBX_PROJECT_VERSION_MAJOR
+GBX_PROJECT_VERSION_MINOR
+GBX_PROJECT_VERSION_PATCH
+GBX_PROJECT_VERSION (=MAJOR.MINOR.PATCH)
+GBX_PROJECT_NAME_LOWER (e.g. 'gearbox' )
+GBX_PROJECT_NAME_UPPER (e.g. 'GEARBOX' )
+GBX_PROJECT_NAME_CAP (e.g. 'Gearbox' )
+@endverbatim
+
OS variables: evaluate to TRUE when running on the corresponding OS, otherwise to FALSE. We define our own because the standard CMake ones are inconsistently named and the one for Linux is not defined.
@verbatim
GBX_OS_LINUX
@@ -201,7 +212,7 @@
GBX_OS_WIN
@endverbatim
-Path variables:
+Path variables for the current project:
@verbatim
GBX_BIN_INSTALL_DIR
GBX_LIB_INSTALL_DIR
Modified: gearbox/trunk/doc/getting.dox
===================================================================
--- gearbox/trunk/doc/getting.dox 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/doc/getting.dox 2009-05-01 09:44:22 UTC (rev 396)
@@ -38,7 +38,7 @@
The instructions below are quite general, follow them if your platform/distribution combination is not described above:
-# Download and install <a href="http://www.cmake.org/">CMake: Cross-Platform Make</a> which is used to build the GearBox distribution.
- - Minimum version required 2.4-patch 4 (latest tested: 2.4-patch 7).
+ - Minimum version required 2.4-patch 4 (latest tested: 2.6-patch 3).
- Full instructions are available from the <a href="http://www.cmake.org/HTML/Download.html">download page</a>.
-# Download and install any optional dependencies you'd like. Or just skip this step and do it later.
- You may want to take a look at our notes on @ref gbx_doc_depends.
Modified: gearbox/trunk/doc/history.dox
===================================================================
--- gearbox/trunk/doc/history.dox 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/doc/history.dox 2009-05-01 09:44:22 UTC (rev 396)
@@ -31,15 +31,31 @@
- Added a hook in the CMake setup to allow building Gearbox as part of a bigger "super-project". Default behavior is not modified. (tobie,alexm)
- Changed format style of CMake files. Standard functions are low-case. Custom macros are upper case. "Local" variables are low-case. "Global"
and cache variables are upper-case. (alexm)
+ - Added 4 advanced CMake variables to let user control what gets installed and what not. All are set to TRUE by default.
+ To disable installation, set a variable to FALSE on the command line: 'cmake -DGBX_INSTALL_HEADERS=false'. The
+ variables are:
+ - GBX_INSTALL_HEADERS
+ - GBX_INSTALL_SHARED_FILES
+ - GBX_INSTALL_EXAMPLES
+ - GBX_INSTALL_PKGCONFIGS
@par New libraries
@par Updated libraries
+- libGbxUtilAcfr:
+ - Status class: removed SubsystemStalled from the list of health types for a subsystem. The stall condition
+ now needs to be defined as part of the state of the monitor. (alexm)
+ - Added SubHealth class: a delegator which has access to health function of one subsystem. (alexm)
+ - Added Stoppable class: a light interface class representing stoppable activities. (alexm)
+
- libGbxIceUtilAcfr:
- Changed names in buffer.h to make it more intuitive, fixed comments (AlexB).
+ - Timer class: added constructor with non-zero elapsed time (alexm)
+ - Thread class: now derives from gbxutilacfr::Stoppable. No changes in user code are requried. (alexm)
+ - Function checkedSleep() is defined in terms of the new light interface class gbxutilacfr::Stoppable.
+ No changes in user code are required. (alexm)
-
@section gbx_doc_history_902 Changes in Release 9.02
@par New libraries
Modified: gearbox/trunk/doc/install_debian.dox
===================================================================
--- gearbox/trunk/doc/install_debian.dox 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/doc/install_debian.dox 2009-05-01 09:44:22 UTC (rev 396)
@@ -12,13 +12,13 @@
@page gbx_doc_installdebian Installing GearBox on Debian Linux
-@note Reviewed for release 0.0.1
+@note Reviewed for release 9.02
These are detailed instructions for installing GearBox on Debian Linux. They are known to work for a system using Debian \b Testing distribution. These instructions should also be applicable to Ubuntu/Kubuntu 6.10 (Edgy). See @ref gbx_doc_getting for general guidelines.
@section gbx_doc_installdebian_cmake CMake
-Minimum version required 2.4-patch 4 (latest tested: 2.4-patch 8).
+Minimum version required 2.4-patch 4 (latest tested: 2.6-patch 3).
@verbatim
# apt-get install cmake
Modified: gearbox/trunk/src/gbxadvancedexample/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxadvancedexample/CMakeLists.txt 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/src/gbxadvancedexample/CMakeLists.txt 2009-05-01 09:44:22 UTC (rev 396)
@@ -6,7 +6,7 @@
GBX_REQUIRE_VAR( build LIB ${lib_name} GBX_OS_LINUX "only Linux OS is supported" )
set( dep_libs basicexample )
-GBX_REQUIRE_TARGETS( build LIB ${lib_name} ${dep_libs} )
+GBX_REQUIRE_LIBS( build LIB ${lib_name} ${dep_libs} )
if( build )
Modified: gearbox/trunk/src/gbxgarminacfr/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxgarminacfr/CMakeLists.txt 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/src/gbxgarminacfr/CMakeLists.txt 2009-05-01 09:44:22 UTC (rev 396)
@@ -6,7 +6,7 @@
GBX_REQUIRE_VAR( build LIB ${lib_name} GBX_OS_LINUX "only Linux OS is supported" )
set( dep_libs GbxUtilAcfr GbxSerialAcfr )
-GBX_REQUIRE_TARGETS( build LIB ${lib_name} ${dep_libs} )
+GBX_REQUIRE_LIBS( build LIB ${lib_name} ${dep_libs} )
if( build )
Modified: gearbox/trunk/src/gbxnovatelacfr/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxnovatelacfr/CMakeLists.txt 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/src/gbxnovatelacfr/CMakeLists.txt 2009-05-01 09:44:22 UTC (rev 396)
@@ -5,7 +5,7 @@
GBX_REQUIRE_OPTION( build LIB ${lib_name} ON )
set( dep_libs GbxUtilAcfr GbxSerialAcfr )
-GBX_REQUIRE_TARGETS( build LIB ${lib_name} ${dep_libs} )
+GBX_REQUIRE_LIBS( build LIB ${lib_name} ${dep_libs} )
# built internally
set( dep_libs ${dep_libs} GbxNovatelUtilAcfr )
Modified: gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/CMakeLists.txt 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/CMakeLists.txt 2009-05-01 09:44:22 UTC (rev 396)
@@ -13,7 +13,7 @@
# GBX_REQUIRE_VAR( build LIB ${lib_name} ICEUTIL_FOUND "libIceUtil not found" )
set( dep_libs GbxUtilAcfr GbxSerialAcfr )
-GBX_REQUIRE_TARGETS( build LIB ${lib_name} ${dep_libs} )
+GBX_REQUIRE_LIBS( build LIB ${lib_name} ${dep_libs} )
if( build )
Modified: gearbox/trunk/src/gbxserialacfr/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxserialacfr/CMakeLists.txt 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/src/gbxserialacfr/CMakeLists.txt 2009-05-01 09:44:22 UTC (rev 396)
@@ -7,7 +7,7 @@
set( dep_libs GbxLockFileAcfr )
# this is currently internal, so we don't have to check it
-# GBX_REQUIRE_TARGETS( build LIB ${lib_name} ${dep_libs} )
+# GBX_REQUIRE_LIBS( build LIB ${lib_name} ${dep_libs} )
if( build )
Modified: gearbox/trunk/src/gbxsickacfr/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxsickacfr/CMakeLists.txt 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/src/gbxsickacfr/CMakeLists.txt 2009-05-01 09:44:22 UTC (rev 396)
@@ -8,7 +8,7 @@
add_subdirectory( gbxiceutilacfr )
set( dep_libs GbxUtilAcfr GbxIceUtilAcfr GbxSerialAcfr )
-GBX_REQUIRE_TARGETS( build LIB ${lib_name} ${dep_libs} )
+GBX_REQUIRE_LIBS( build LIB ${lib_name} ${dep_libs} )
# these are built internally
set( dep_libs ${dep_libs} GbxSerialDeviceAcfr )
Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/CMakeLists.txt 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/CMakeLists.txt 2009-05-01 09:44:22 UTC (rev 396)
@@ -9,7 +9,7 @@
GBX_REQUIRE_VAR( build LIB ${lib_name} ICEUTIL_FOUND "libIceUtil not found" )
set( proj_libs GbxUtilAcfr )
-GBX_REQUIRE_TARGETS( build LIB ${lib_name} ${proj_libs} )
+GBX_REQUIRE_LIBS( build LIB ${lib_name} ${proj_libs} )
if( build )
Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/buffer.h
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/buffer.h 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/buffer.h 2009-05-01 09:44:22 UTC (rev 396)
@@ -95,7 +95,7 @@
* Non-popping and non-blocking read from the front of the buffer.
*
* Calls to @ref get() on an empty buffer raises an gbxutilacfr::Exception exception.
- * You can catch these and call @ref getNext() which will block until new data arrives.
+ * You can catch these and call @ref getWithTimeout() which will block until new data arrives.
*/
void get( Type & obj ) const;
Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/threadtest.cpp
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/threadtest.cpp 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/threadtest.cpp 2009-05-01 09:44:22 UTC (rev 396)
@@ -13,6 +13,7 @@
#include <IceUtil/Time.h>
#include <gbxsickacfr/gbxiceutilacfr/thread.h>
+#include <gbxsickacfr/gbxiceutilacfr/threadutils.h>
#include <gbxutilacfr/exceptions.h>
using namespace std;
Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/thread.cpp
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/thread.cpp 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/thread.cpp 2009-05-01 09:44:22 UTC (rev 396)
@@ -80,15 +80,4 @@
}
}
-void checkedSleep( const gbxiceutilacfr::ThreadPtr& thread, IceUtil::Time duration, int checkIntervalMs )
-{
- IceUtil::Time wakeupTime = IceUtil::Time::now() + duration;
- IceUtil::Time checkInterval = IceUtil::Time::milliSeconds( checkIntervalMs );
-
- while ( !thread->isStopping() && IceUtil::Time::now() < wakeupTime )
- {
- IceUtil::ThreadControl::sleep( checkInterval );
- }
-}
-
} // namespace
Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/thread.h
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/thread.h 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/thread.h 2009-05-01 09:44:22 UTC (rev 396)
@@ -12,6 +12,10 @@
#define GBXICEUTILACFR_THREAD_H
#include <IceUtil/Thread.h>
+#include <gbxutilacfr/stoppable.h>
+// this is not needed for implementation of this class.
+// it's included for convenience of users of Thread class.
+#include <gbxsickacfr/gbxiceutilacfr/threadutils.h>
namespace gbxiceutilacfr {
@@ -65,7 +69,7 @@
@see SafeThread
*/
-class Thread : public IceUtil::Thread
+class Thread : public IceUtil::Thread, public gbxutilacfr::Stoppable
{
public:
@@ -75,12 +79,13 @@
//! from inside or outside this thread.
void stop();
+ // from gbxutilacfr::Stoppable
+ //! Returns TRUE if the thread is in Stopping state, FALSE otherwise.
+ virtual bool isStopping();
+
//! Returns TRUE if the thread is in Started state, FALSE otherwise.
bool isStarted();
- //! Returns TRUE if the thread is in Stopping state, FALSE otherwise.
- bool isStopping();
-
//! @b Depricated function! Use isStopping() instead (note that it returns the opposite).
//!
//! Returns FALSE if thread was told to stop, TRUE otherwise.
@@ -108,12 +113,6 @@
//! terminate. If the smart pointer is 0, this function quietly returns.
void stopAndJoin( const gbxiceutilacfr::ThreadPtr& thread );
-//! Sleeps for @ref duration waking up every @ref checkIntervalMs [ms] to check if the @c thread
-//! was told to stop. This implementation is very simple so the error in total sleep duration
-//! can be as large as checkIntervalMs. In particular, if @ref duration is shorter than @ref checkIntervalMs,
-//! this function will sleep for @ref checkIntervalMs.
-void checkedSleep( const gbxiceutilacfr::ThreadPtr& thread, IceUtil::Time duration, int checkIntervalMs=250 );
-
} // end namespace
#endif
Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/timer.cpp
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/timer.cpp 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/timer.cpp 2009-05-01 09:44:22 UTC (rev 396)
@@ -12,11 +12,16 @@
namespace gbxiceutilacfr {
-Timer::Timer()
+Timer::Timer() :
+ time_( IceUtil::Time::now() )
{
- restart();
}
+Timer::Timer( const IceUtil::Time& elapsedTime ) :
+ time_( IceUtil::Time::now()-elapsedTime )
+{
+}
+
void Timer::restart()
{
time_ = IceUtil::Time::now();
Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/timer.h
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/timer.h 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/timer.h 2009-05-01 09:44:22 UTC (rev 396)
@@ -32,19 +32,22 @@
{
public:
- //! Sets internal clock to current time
+ //! Sets elapsed time to zero.
Timer();
- //! Resets internal clock to current time
+ //! Sets elapased time to the specified time, which can be positive or negative.
+ Timer( const IceUtil::Time& elapsedTime );
+
+ //! Resets elapsed time to zero.
void restart();
- //! Returns time elapsed from last restart
+ //! Returns time elapsed from last restart.
IceUtil::Time elapsed() const;
- //! returns elapsed milliseconds as a double
+ //! Returns elapsed milliseconds as a double.
double elapsedMs() const;
- //! returns elapsed seconds as a double
+ //! Returns elapsed seconds as a double.
double elapsedSec() const;
private:
Modified: gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/CMakeLists.txt 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/CMakeLists.txt 2009-05-01 09:44:22 UTC (rev 396)
@@ -7,7 +7,7 @@
# this was already tested in the dir above
set( dep_libs GbxSerialAcfr GbxIceUtilAcfr )
-# GBX_REQUIRE_TARGETS( build LIB ${lib_name} ${proj_libs} )
+# GBX_REQUIRE_LIBS( build LIB ${lib_name} ${proj_libs} )
if( build )
Modified: gearbox/trunk/src/gbxsmartbatteryacfr/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxsmartbatteryacfr/CMakeLists.txt 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/src/gbxsmartbatteryacfr/CMakeLists.txt 2009-05-01 09:44:22 UTC (rev 396)
@@ -6,7 +6,7 @@
GBX_REQUIRE_VAR( build LIB ${lib_name} GBX_OS_LINUX "only Linux OS is supported" )
set( dep_libs GbxUtilAcfr GbxSerialAcfr )
-GBX_REQUIRE_TARGETS( build LIB ${lib_name} ${dep_libs} )
+GBX_REQUIRE_LIBS( build LIB ${lib_name} ${dep_libs} )
if( build )
Modified: gearbox/trunk/src/gbxsmartbatteryacfr/gbxsmartbatteryacfr.h
===================================================================
--- gearbox/trunk/src/gbxsmartbatteryacfr/gbxsmartbatteryacfr.h 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/src/gbxsmartbatteryacfr/gbxsmartbatteryacfr.h 2009-05-01 09:44:22 UTC (rev 396)
@@ -17,6 +17,7 @@
#include <gbxsmartbatteryacfr/exceptions.h>
#include <gbxsmartbatteryacfr/smartbattery.h>
#include <gbxsmartbatteryacfr/smartbatteryparsing.h>
+#include <gbxsmartbatteryacfr/oceanserverhealthchecks.h>
#endif
Modified: gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverparser.cpp
===================================================================
--- gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverparser.cpp 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverparser.cpp 2009-05-01 09:44:22 UTC (rev 396)
@@ -252,7 +252,10 @@
OceanServerParser::parse( vector<string> &stringList,
OceanServerSystem &batterySystem )
{
-
+ // put the raw record into the batterySystem representation
+ // useful for "higher-level" debugging: the caller can choose how to make use of this information
+ batterySystem.rawRecord = stringList;
+
//
// Debugging output
//
@@ -273,9 +276,8 @@
}
ss << endl;
tracer_.debug( ss.str(), debugLevel );
- }
+ }
-
//
// Parsing
//
Modified: gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverreader.h
===================================================================
--- gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverreader.h 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverreader.h 2009-05-01 09:44:22 UTC (rev 396)
@@ -37,6 +37,7 @@
OceanServerReader( const std::string &serialPort,
gbxutilacfr::Tracer &tracer );
+ //! Reads an OceanServerSystem record
//! May throw HardwareReadingExceptions and ParsingExceptions
void read( OceanServerSystem &system );
Modified: gearbox/trunk/src/gbxsmartbatteryacfr/oceanserversystem.cpp
===================================================================
--- gearbox/trunk/src/gbxsmartbatteryacfr/oceanserversystem.cpp 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/src/gbxsmartbatteryacfr/oceanserversystem.cpp 2009-05-01 09:44:22 UTC (rev 396)
@@ -97,6 +97,8 @@
void updateWithNewData( const OceanServerSystem &from,
OceanServerSystem &to )
{
+ to.rawRecord = from.rawRecord;
+
typedef map<int,SmartBattery>::const_iterator BatIt;
to.availableBatteries = from.availableBatteries;
Modified: gearbox/trunk/src/gbxsmartbatteryacfr/oceanserversystem.h
===================================================================
--- gearbox/trunk/src/gbxsmartbatteryacfr/oceanserversystem.h 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/src/gbxsmartbatteryacfr/oceanserversystem.h 2009-05-01 09:44:22 UTC (rev 396)
@@ -55,6 +55,9 @@
std::vector<bool> chargePowerPresentStates;
std::vector<bool> powerNoGoodStates;
std::vector<bool> chargeInhibitedStates;
+
+ //! the latest raw record, useful for debugging
+ std::vector<std::string> rawRecord;
private:
@@ -70,6 +73,7 @@
//! Updates all fields in 'to' with data from 'from'. Also reaps batteries in 'to' if they are not in 'from'.
//! Has persistence capabilities: if fields in 'from' are not set and corresponding fields in 'to' are set, the ones in 'to' are kept.
+//! There's one exception: the rawRecord field is always updated
//! Use case: a class stores 'to' as a member variable, receives the latest records into 'from', calls this function to update 'to'.
//! The reaping capability makes sure that battery modules which are no longer connected don't persist.
void updateWithNewData( const OceanServerSystem &from,
Modified: gearbox/trunk/src/gbxsmartbatteryacfr/test/longtest.cpp
===================================================================
--- gearbox/trunk/src/gbxsmartbatteryacfr/test/longtest.cpp 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/src/gbxsmartbatteryacfr/test/longtest.cpp 2009-05-01 09:44:22 UTC (rev 396)
@@ -1,9 +1,22 @@
#include <iostream>
+#include <sstream>
#include <gbxutilacfr/trivialtracer.h>
#include <gbxsmartbatteryacfr/gbxsmartbatteryacfr.h>
using namespace std;
+string toString( const vector<string> &stringList )
+{
+ stringstream ss;
+ for (unsigned int i=0; i<stringList.size(); ++i)
+ {
+ ss << stringList[i];
+ }
+ return ss.str();
+
+}
+
+
int main( int argc, char **argv )
{
int opt;
@@ -33,14 +46,39 @@
try
{
+ gbxsmartbatteryacfr::BatteryHealthWarningConfig config;
+ config.expectedNumBatteries = 2;
+ config.numCyclesThreshhold = 0; //300
+ config.chargeTempThreshhold = 10.0; // 54.0
+ config.dischargeTempThreshhold = 10.0; // 70.0
+ config.chargeWarnThreshhold = 60; // 10
+ config.chargeDeviationThreshold = 1; // 10
+
gbxsmartbatteryacfr::OceanServer oceanserver( port, tracer );
while (true)
- {
+ {
+ cout << "TRACE(test): Reading record " << numRecords << endl;
+ numRecords++;
+
gbxsmartbatteryacfr::OceanServerSystem data = oceanserver.getData();
+ vector<string> shortWarning;
+ vector<string> verboseWarning;
+ const bool printRawRecord = true;
+ bool haveWarnings = conductAllHealthChecks( data, config, shortWarning, verboseWarning, printRawRecord );
- cout << "TRACE(test): Reading record " << numRecords << endl;
- numRecords++;
+ if (haveWarnings)
+ {
+ cout << "Short warning messages: " << endl;
+ cout << toString(shortWarning) << endl << endl;
+ cout << "Verbose warning messages:" << endl;
+ cout << toString(verboseWarning) << endl;
+ }
+ else
+ {
+ cout << "All systems normal." << endl;
+ }
+
}
}
catch ( gbxsmartbatteryacfr::HardwareReadingException &e )
Modified: gearbox/trunk/src/gbxutilacfr/gbxutilacfr.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/gbxutilacfr.h 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/src/gbxutilacfr/gbxutilacfr.h 2009-05-01 09:44:22 UTC (rev 396)
@@ -19,7 +19,5 @@
#include <gbxutilacfr/status.h>
#include <gbxutilacfr/exceptions.h>
#include <gbxutilacfr/mathdefs.h>
-// #include <gbxutilacfr/stringutils.h>
-// #include <gbxutilacfr/sysutils.h>
#endif
Modified: gearbox/trunk/src/gbxutilacfr/status.cpp
===================================================================
--- gearbox/trunk/src/gbxutilacfr/status.cpp 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/src/gbxutilacfr/status.cpp 2009-05-01 09:44:22 UTC (rev 396)
@@ -43,8 +43,6 @@
return "Warning";
case SubsystemFault :
return "Fault";
- case SubsystemStalled :
- return "Stalled";
default:
assert( !"gbxutilacfr::toString(SubsystemHealth) should never get to default" );
}
Modified: gearbox/trunk/src/gbxutilacfr/status.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/status.h 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/src/gbxutilacfr/status.h 2009-05-01 09:44:22 UTC (rev 396)
@@ -42,9 +42,7 @@
//! Subsystem has encountered an abnormal but non-fault condition
SubsystemWarning,
//! Subsystem has declared a fault
- SubsystemFault,
- //! Subsystem has not been heard from for an abnormally long time
- SubsystemStalled
+ SubsystemFault
};
//! Returns string equivalent of health enumerator.
@@ -54,10 +52,12 @@
struct SubsystemStatus
{
//! Constructor.
- SubsystemStatus( SubsystemState s=SubsystemIdle, SubsystemHealth h=SubsystemOk, const std::string& msg="", double beat=0.0 ) :
+ SubsystemStatus( SubsystemState s=SubsystemIdle, SubsystemHealth h=SubsystemOk, const std::string& msg="",
+ bool stall=false, double beat=0.0 ) :
state(s),
health(h),
message(msg),
+ isStalled(stall),
sinceHeartbeat(beat) {};
//! Current state in the subsystem's state machine. I.e. what is the subsystem doing?
@@ -69,6 +69,10 @@
//! Human-readable status description
std::string message;
+ //! If true, the subsystem has not been heard from for an abnormally long time.
+ bool isStalled;
+
+ //! OBSOLETE !?
//! Ratio of time since last heartbeat to maximum expected time between heartbeats.
//! For example, sinceHeartbeat=0.5 means that half of normally expected interval between heartbeats
//! has elapsed.
Modified: gearbox/trunk/src/gbxutilacfr/substatus.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/substatus.h 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/src/gbxutilacfr/substatus.h 2009-05-01 09:44:22 UTC (rev 396)
@@ -16,13 +16,13 @@
namespace gbxutilacfr {
//!
-//! @brief Convenience class which represents the status of a subsystem.
+//! @brief Convenience class which maniupulates the status of a subsystem.
//!
//! @par Overview
//!
//! Provides a convenient interface for setting status information for one subsystem.
//!
-//! @sa Status
+//! @sa Status, @sa SubHealth
//!
class SubStatus
{
@@ -30,9 +30,9 @@
public:
//! Sets a reference to the system Status and this subsystem's name.
//! Adds this subsystem to the system.
- SubStatus( Status& status, const std::string& subsystem, double maxHeartbeatIntervalSec=-1.0 ) :
+ SubStatus( Status& status, const std::string& subsysName, double maxHeartbeatIntervalSec=-1.0 ) :
status_(status),
- subsysName_(subsystem)
+ subsysName_(subsysName)
{
status_.addSubsystem( subsysName_, maxHeartbeatIntervalSec );
};
@@ -43,38 +43,55 @@
status_.removeSubsystem( subsysName_ );
}
+ //
+ // set expectations about ourselves
+ //
+
//! Passes this information to the system Status.
void setMaxHeartbeatInterval( double interval ) { status_.setMaxHeartbeatInterval( subsysName_, interval ); };
//! Passes this information to the system Status.
void setSubsystemType( SubsystemType type ) { status_.setSubsystemType( subsysName_, type ); };
+ //
+ // set health
+ //
+
//! Passes this information to the system Status.
void heartbeat() { status_.heartbeat( subsysName_ ); };
//! Passes this information to the system Status.
- void initialising( const std::string& message="" ) { status_.initialising( subsysName_, message ); };
+ void message( const std::string& message ) { status_.message( subsysName_, message ); };
//! Passes this information to the system Status.
- void working( const std::string& message="" ) { status_.working( subsysName_, message ); };
+ void ok( const std::string& message="" ) { status_.ok( subsysName_, message ); };
//! Passes this information to the system Status.
- void finalising( const std::string& message="" ) { status_.finalising( subsysName_, message ); };
+ void warning( const std::string& message ) { status_.warning( subsysName_, message ); };
//! Passes this information to the system Status.
- void ok( const std::string& message="" ) { status_.ok( subsysName_, message ); };
+ void fault( const std::string& message ) { status_.fault( subsysName_, message ); };
+ //
+ // Set state machine states
+ //
+
//! Passes this information to the system Status.
- void warning( const std::string& message ) { status_.warning( subsysName_, message ); };
+ void initialising( const std::string& message="" ) { status_.initialising( subsysName_, message ); };
//! Passes this information to the system Status.
- void fault( const std::string& message ) { status_.fault( subsysName_, message ); };
+ void working( const std::string& message="" ) { status_.working( subsysName_, message ); };
+ //! Passes this information to the system Status.
+ void finalising( const std::string& message="" ) { status_.finalising( subsysName_, message ); };
+
+
//! Returns system Status object
Status& status() { return status_; };
//! Returns subsystem's name
std::string name() const { return subsysName_; };
+
private:
Status& status_;
Modified: gearbox/trunk/src/gbxutilacfr/trivialstatus.cpp
===================================================================
--- gearbox/trunk/src/gbxutilacfr/trivialstatus.cpp 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/src/gbxutilacfr/trivialstatus.cpp 2009-05-01 09:44:22 UTC (rev 396)
@@ -132,7 +132,6 @@
{
// cout<<"DEBUG: state="<<state<<" health="<<health<<" msg="<<msg<<endl;
assert( state!=gbxutilacfr::SubsystemIdle && "Idle state should not be reported from within the subsystem" );
- assert( health!=gbxutilacfr::SubsystemStalled && "Stalled health should not be reported from within the subsystem" );
// if this is a heartbeat, do nothing else
if ( state<0 && health<0 && msg.empty() )
@@ -172,7 +171,6 @@
tracer_.warning( trace );
break;
case gbxutilacfr::SubsystemFault :
- case gbxutilacfr::SubsystemStalled :
tracer_.error( trace );
break;
}
Modified: gearbox/trunk/src/hokuyo_aist/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/hokuyo_aist/CMakeLists.txt 2009-04-22 07:54:31 UTC (rev 395)
+++ gearbox/trunk/src/hokuyo_aist/CMakeLists.txt 2009-05-01 09:44:22 UTC (rev 396)
@@ -6,7 +6,7 @@
GBX_REQUIRE_OPTION (build LIB ${libName} ON)
SET (reqLibs flexiport)
-GBX_REQUIRE_TARGETS (build LIB ${libName} ${reqLibs})
+GBX_REQUIRE_LIBS (build LIB ${libName} ${reqLibs})
if(build)
INCLUDE (${GBX_CMAKE_DIR}/UseBasicRules.cmake)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2009-04-22 07:54:38
|
Revision: 395
http://gearbox.svn.sourceforge.net/gearbox/?rev=395&view=rev
Author: gbiggs
Date: 2009-04-22 07:54:31 +0000 (Wed, 22 Apr 2009)
Log Message:
-----------
Fixed mismatched and unsupported baud rates
Modified Paths:
--------------
gearbox/trunk/src/flexiport/serialport.cpp
gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp
Modified: gearbox/trunk/src/flexiport/serialport.cpp
===================================================================
--- gearbox/trunk/src/flexiport/serialport.cpp 2009-04-17 02:08:40 UTC (rev 394)
+++ gearbox/trunk/src/flexiport/serialport.cpp 2009-04-22 07:54:31 UTC (rev 395)
@@ -143,8 +143,34 @@
return B57600;
case 115200:
return B115200;
+#if defined (__linux)
case 230400:
return B230400;
+ case 460800:
+ return B460800;
+ case 500000:
+ return B500000;
+ case 576000:
+ return B576000;
+ case 921600:
+ return B921600;
+ case 1000000:
+ return B1000000;
+ case 1152000:
+ return B1152000;
+ case 1500000:
+ return B1500000;
+ case 2000000:
+ return B2000000;
+ case 2500000:
+ return B2500000;
+ case 3000000:
+ return B3000000;
+ case 3500000:
+ return B3500000;
+ case 4000000:
+ return B4000000;
+#endif // __linux
#endif
default:
stringstream ss;
@@ -221,8 +247,34 @@
return 57600;
case B115200:
return 115200;
+#if defined (__linux)
case B230400:
return 230400;
+ case B460800:
+ return 460800;
+ case B500000:
+ return 500000;
+ case B576000:
+ return 576000;
+ case B921600:
+ return 921600;
+ case B1000000:
+ return 1000000;
+ case B1152000:
+ return 1152000;
+ case B1500000:
+ return 1500000;
+ case B2000000:
+ return 2000000;
+ case B2500000:
+ return 2500000;
+ case B3000000:
+ return 3000000;
+ case B3500000:
+ return 3500000;
+ case B4000000:
+ return 4000000;
+#endif // __linux
#endif
default:
stringstream ss;
Modified: gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp 2009-04-17 02:08:40 UTC (rev 394)
+++ gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp 2009-04-22 07:54:31 UTC (rev 395)
@@ -968,7 +968,8 @@
if (_port->GetPortType () == "serial")
{
// Failed at the default baud rate, so try again at the other rates
- const unsigned int bauds[] = {750000, 500000, 250000, 115200, 57600, 38400, 19200};
+ // Note that a baud rate of 750000 or 250000 doesn't appear to be supported on any common OS
+ const unsigned int bauds[] = {500000, 115200, 57600, 38400, 19200};
const unsigned int numBauds = 7;
for (unsigned int ii = 0; ii < numBauds; ii++)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2009-04-17 02:08:52
|
Revision: 394
http://gearbox.svn.sourceforge.net/gearbox/?rev=394&view=rev
Author: gbiggs
Date: 2009-04-17 02:08:40 +0000 (Fri, 17 Apr 2009)
Log Message:
-----------
Some misc changes that (apparently) have been sitting on my hard drive for a few months
Modified Paths:
--------------
gearbox/trunk/src/flexiport/flexiport.h
gearbox/trunk/src/flexiport/logfile.cpp
gearbox/trunk/src/flexiport/logfile.h
gearbox/trunk/src/flexiport/logreaderport.cpp
gearbox/trunk/src/flexiport/logreaderport.h
gearbox/trunk/src/flexiport/logwriterport.cpp
gearbox/trunk/src/flexiport/logwriterport.h
gearbox/trunk/src/flexiport/port.cpp
gearbox/trunk/src/flexiport/port.h
gearbox/trunk/src/flexiport/serialport.cpp
gearbox/trunk/src/flexiport/serialport.h
gearbox/trunk/src/flexiport/tcpport.cpp
gearbox/trunk/src/flexiport/tcpport.h
gearbox/trunk/src/flexiport/udpport.cpp
gearbox/trunk/src/flexiport/udpport.h
Modified: gearbox/trunk/src/flexiport/flexiport.h
===================================================================
--- gearbox/trunk/src/flexiport/flexiport.h 2009-04-15 06:49:29 UTC (rev 393)
+++ gearbox/trunk/src/flexiport/flexiport.h 2009-04-17 02:08:40 UTC (rev 394)
@@ -58,9 +58,9 @@
: _errorStr (errorStr) {};
PortException (const std::string &errorStr)
: _errorStr (errorStr) {};
- ~PortException (void) throw () {};
+ ~PortException () throw () {};
- virtual const char* what (void) const throw ()
+ virtual const char* what () const throw ()
{
return _errorStr.c_str ();
}
Modified: gearbox/trunk/src/flexiport/logfile.cpp
===================================================================
--- gearbox/trunk/src/flexiport/logfile.cpp 2009-04-15 06:49:29 UTC (rev 393)
+++ gearbox/trunk/src/flexiport/logfile.cpp 2009-04-17 02:08:40 UTC (rev 394)
@@ -71,7 +71,7 @@
namespace flexiport
{
-inline int ErrNo (void)
+inline int ErrNo ()
{
#if defined (WIN32)
return WSAGetLastError ();
@@ -111,7 +111,7 @@
timerclear (&_openTime);
}
-LogFile::~LogFile (void)
+LogFile::~LogFile ()
{
Close ();
}
@@ -179,7 +179,7 @@
}
}
-void LogFile::Close (void)
+void LogFile::Close ()
{
if (_readFile != NULL)
{
@@ -221,7 +221,7 @@
cerr << "LogFile::" << __func__ << "() Closed file." << endl;
}
-bool LogFile::IsOpen (void) const
+bool LogFile::IsOpen () const
{
if (_readFile == NULL || _writeFile == NULL)
return false;
@@ -250,7 +250,7 @@
return true;
}
-void LogFile::ResetFile (void)
+void LogFile::ResetFile ()
{
// Rewind file positions
if (fseek (_readFile, 0, SEEK_SET) < 0)
@@ -817,7 +817,7 @@
return result;
}
-void LogFile::Flush (void)
+void LogFile::Flush ()
{
// Dump the read overflow buffer
DeallocateWriteBuffer();
@@ -852,7 +852,7 @@
Drain ();
}
-void LogFile::Drain (void)
+void LogFile::Drain ()
{
// Dump the write overflow buffer
DeallocateWriteBuffer();
@@ -1012,7 +1012,7 @@
}
}
-void LogFile::DeallocateReadBuffer (void)
+void LogFile::DeallocateReadBuffer ()
{
if (_readBuffer != NULL)
{
@@ -1025,7 +1025,7 @@
}
}
-void LogFile::DeallocateWriteBuffer (void)
+void LogFile::DeallocateWriteBuffer ()
{
if (_writeBuffer != NULL)
{
Modified: gearbox/trunk/src/flexiport/logfile.h
===================================================================
--- gearbox/trunk/src/flexiport/logfile.h 2009-04-15 06:49:29 UTC (rev 393)
+++ gearbox/trunk/src/flexiport/logfile.h 2009-04-17 02:08:40 UTC (rev 394)
@@ -47,20 +47,20 @@
{
public:
LogFile (unsigned int debug);
- ~LogFile (void);
+ ~LogFile ();
void Open (std::string fileName, bool read, bool ignoreTimes = false);
- void Close (void);
- bool IsOpen (void) const;
- void ResetFile (void);
+ void Close ();
+ bool IsOpen () const;
+ void ResetFile ();
// File reading
ssize_t Read (void *data, size_t count, Timeout &timeout);
ssize_t BytesAvailable (const Timeout &timeout);
bool CheckWrite (const void * const data, const size_t count, size_t * const numWritten,
const Timeout * const timeout = NULL);
- void Flush (void);
- void Drain (void);
+ void Flush ();
+ void Drain ();
// File writing
void WriteRead (const void * const data, size_t count);
@@ -81,8 +81,8 @@
void AllocateReadBuffer (unsigned int size = 0);
void AllocateWriteBuffer (unsigned int size = 0);
- void DeallocateReadBuffer (void);
- void DeallocateWriteBuffer (void);
+ void DeallocateReadBuffer ();
+ void DeallocateWriteBuffer ();
void GetCurrentFileTime (struct timeval &dest);
bool DataAvailableWithinLimit (FILE * const file, const struct timeval &limit);
Modified: gearbox/trunk/src/flexiport/logreaderport.cpp
===================================================================
--- gearbox/trunk/src/flexiport/logreaderport.cpp 2009-04-15 06:49:29 UTC (rev 393)
+++ gearbox/trunk/src/flexiport/logreaderport.cpp 2009-04-17 02:08:40 UTC (rev 394)
@@ -59,7 +59,7 @@
Open ();
}
-LogReaderPort::~LogReaderPort (void)
+LogReaderPort::~LogReaderPort ()
{
Close ();
}
@@ -68,7 +68,7 @@
// Port management
////////////////////////////////////////////////////////////////////////////////////////////////////
-void LogReaderPort::Open (void)
+void LogReaderPort::Open ()
{
if (_open)
throw PortException ("Attempt to open already-opened port.");
@@ -81,7 +81,7 @@
cerr << "LogReaderPort::" << __func__ << "() Port is open" << endl;
}
-void LogReaderPort::Close (void)
+void LogReaderPort::Close ()
{
if (_debug >= 2)
cerr << "LogReaderPort::" << __func__ << "() Closing port" << endl;
@@ -166,7 +166,7 @@
return receivedBytes;
}
-ssize_t LogReaderPort::BytesAvailable (void)
+ssize_t LogReaderPort::BytesAvailable ()
{
// Use a zero timeout.
Timeout timeout (0, 0);
@@ -179,7 +179,7 @@
return bytesAvailable;
}
-ssize_t LogReaderPort::BytesAvailableWait (void)
+ssize_t LogReaderPort::BytesAvailableWait ()
{
// The time limit is now + the timeout
ssize_t bytesAvailable = _logFile->BytesAvailable (_timeout);
@@ -239,7 +239,7 @@
return numWritten;
}
-void LogReaderPort::Flush (void)
+void LogReaderPort::Flush ()
{
// _logFile->Flush ();
// Actually shouldn't do anything here because any calls to flush on LogWriterPort didn't write
@@ -247,7 +247,7 @@
// log file, but not return that data, until there's no data left to read.
}
-void LogReaderPort::Drain (void)
+void LogReaderPort::Drain ()
{
// _logFile->Drain ();
// Actually shouldn't do anything here because any calls to drain on LogWriterPort didn't write
@@ -258,7 +258,7 @@
// Other public API functions
////////////////////////////////////////////////////////////////////////////////////////////////////
-std::string LogReaderPort::GetStatus (void) const
+std::string LogReaderPort::GetStatus () const
{
stringstream status;
@@ -286,7 +286,7 @@
_canWrite = canWrite;
}
-bool LogReaderPort::IsOpen (void) const
+bool LogReaderPort::IsOpen () const
{
return _open;
}
Modified: gearbox/trunk/src/flexiport/logreaderport.h
===================================================================
--- gearbox/trunk/src/flexiport/logreaderport.h 2009-04-15 06:49:29 UTC (rev 393)
+++ gearbox/trunk/src/flexiport/logreaderport.h 2009-04-17 02:08:40 UTC (rev 394)
@@ -76,28 +76,28 @@
{
public:
LogReaderPort (std::map<std::string, std::string> options);
- ~LogReaderPort (void);
+ ~LogReaderPort ();
/// @brief Open the port.
- void Open (void);
+ void Open ();
/// @brief Close the port.
- void Close (void);
+ void Close ();
/// @brief Read from the port.
ssize_t Read (void * const buffer, size_t count);
/// @brief Read the requested quantity of data from the port.
ssize_t ReadFull (void * const buffer, size_t count);
/// @brief Get the number of bytes waiting to be read at the port. Returns immediatly.
- ssize_t BytesAvailable (void);
+ ssize_t BytesAvailable ();
/// @brief Get the number of bytes waiting after blocking for the timeout.
- ssize_t BytesAvailableWait (void);
+ ssize_t BytesAvailableWait ();
/// @brief Write data to the port.
ssize_t Write (const void * const buffer, size_t count);
/// @brief Flush the port's input and output buffers, discarding all data.
- void Flush (void);
+ void Flush ();
/// @brief Drain the port's input and output buffers.
- void Drain (void);
+ void Drain ();
/// @brief Get the status of the port (type, device, etc).
- std::string GetStatus (void) const;
+ std::string GetStatus () const;
/// @brief Set the timeout value in milliseconds.
void SetTimeout (Timeout timeout);
/// @brief Set the read permissions of the port.
@@ -105,7 +105,7 @@
/// @brief Set the write permissions of the port.
void SetCanWrite (bool canWrite);
/// @brief Check if the port is open
- bool IsOpen (void) const;
+ bool IsOpen () const;
private:
LogFile *_logFile;
Modified: gearbox/trunk/src/flexiport/logwriterport.cpp
===================================================================
--- gearbox/trunk/src/flexiport/logwriterport.cpp 2009-04-15 06:49:29 UTC (rev 393)
+++ gearbox/trunk/src/flexiport/logwriterport.cpp 2009-04-17 02:08:40 UTC (rev 394)
@@ -75,7 +75,7 @@
_logFile->Open (_logFileName, false);
}
-LogWriterPort::~LogWriterPort (void)
+LogWriterPort::~LogWriterPort ()
{
// _logFile should never be NULL because it's allocated in the constructor and never deleted.
_logFile->Close ();
@@ -89,7 +89,7 @@
// Port management
////////////////////////////////////////////////////////////////////////////////////////////////////
-void LogWriterPort::Open (void)
+void LogWriterPort::Open ()
{
if (_port->IsOpen ())
throw PortException ("Attempt to open already-opened port.");
@@ -101,7 +101,7 @@
cerr << "LogWriterPort::" << __func__ << "() Port is open" << endl;
}
-void LogWriterPort::Close (void)
+void LogWriterPort::Close ()
{
if (_debug >= 2)
cerr << "LogWriterPort::" << __func__ << "() Closing port" << endl;
@@ -233,12 +233,12 @@
return numRead;
}
-ssize_t LogWriterPort::BytesAvailable (void)
+ssize_t LogWriterPort::BytesAvailable ()
{
return _port->BytesAvailable ();
}
-ssize_t LogWriterPort::BytesAvailableWait (void)
+ssize_t LogWriterPort::BytesAvailableWait ()
{
return _port->BytesAvailableWait ();
}
@@ -262,12 +262,12 @@
return numSent;
}
-void LogWriterPort::Flush (void)
+void LogWriterPort::Flush ()
{
_port->Flush ();
}
-void LogWriterPort::Drain (void)
+void LogWriterPort::Drain ()
{
_port->Drain ();
}
@@ -276,7 +276,7 @@
// Other public API functions
////////////////////////////////////////////////////////////////////////////////////////////////////
-std::string LogWriterPort::GetStatus (void) const
+std::string LogWriterPort::GetStatus () const
{
stringstream status;
@@ -303,7 +303,7 @@
// _logFile->WritePermissionsChunk (_port->GetCanRead (), canWrite);
}
-bool LogWriterPort::IsOpen (void) const
+bool LogWriterPort::IsOpen () const
{
if (_port == NULL)
return false;
Modified: gearbox/trunk/src/flexiport/logwriterport.h
===================================================================
--- gearbox/trunk/src/flexiport/logwriterport.h 2009-04-15 06:49:29 UTC (rev 393)
+++ gearbox/trunk/src/flexiport/logwriterport.h 2009-04-17 02:08:40 UTC (rev 394)
@@ -69,12 +69,12 @@
{
public:
LogWriterPort (std::map<std::string, std::string> options);
- ~LogWriterPort (void);
+ ~LogWriterPort ();
/// @brief Open the port.
- void Open (void);
+ void Open ();
/// @brief Close the port.
- void Close (void);
+ void Close ();
/// @brief Read from the port.
ssize_t Read (void * const buffer, size_t count);
/// @brief Read the requested quantity of data from the port.
@@ -85,17 +85,17 @@
count times. */
ssize_t SkipUntil (uint8_t terminator, unsigned int count);
/// @brief Get the number of bytes waiting to be read at the port. Returns immediatly.
- ssize_t BytesAvailable (void);
+ ssize_t BytesAvailable ();
/// @brief Get the number of bytes waiting after blocking for the timeout.
- ssize_t BytesAvailableWait (void);
+ ssize_t BytesAvailableWait ();
/// @brief Write data to the port.
ssize_t Write (const void * const buffer, size_t count);
/// @brief Flush the port's input and output buffers, discarding all data.
- void Flush (void);
+ void Flush ();
/// @brief Drain the port's input and output buffers.
- void Drain (void);
+ void Drain ();
/// @brief Get the status of the port (type, device, etc).
- std::string GetStatus (void) const;
+ std::string GetStatus () const;
/// @brief Set the timeout value in milliseconds.
void SetTimeout (Timeout timeout);
/// @brief Set the read permissions of the port.
@@ -103,7 +103,7 @@
/// @brief Set the write permissions of the port.
void SetCanWrite (bool canWrite);
/// @brief Check if the port is open
- bool IsOpen (void) const;
+ bool IsOpen () const;
private:
Port *_port;
Modified: gearbox/trunk/src/flexiport/port.cpp
===================================================================
--- gearbox/trunk/src/flexiport/port.cpp 2009-04-15 06:49:29 UTC (rev 393)
+++ gearbox/trunk/src/flexiport/port.cpp 2009-04-17 02:08:40 UTC (rev 394)
@@ -48,7 +48,7 @@
// Constructor/destructor
////////////////////////////////////////////////////////////////////////////////////////////////////
-Port::Port (void)
+Port::Port ()
: _type ("none"), _debug (0), _timeout (-1, 0), _canRead (true),
_canWrite (true), _alwaysOpen (false)
{
@@ -61,7 +61,7 @@
{
}
-Port::~Port (void)
+Port::~Port ()
{
}
@@ -349,7 +349,7 @@
// Other public API functions
////////////////////////////////////////////////////////////////////////////////////////////////////
-string Port::GetStatus (void) const
+string Port::GetStatus () const
{
stringstream status;
Modified: gearbox/trunk/src/flexiport/port.h
===================================================================
--- gearbox/trunk/src/flexiport/port.h 2009-04-15 06:49:29 UTC (rev 393)
+++ gearbox/trunk/src/flexiport/port.h 2009-04-17 02:08:40 UTC (rev 394)
@@ -78,14 +78,14 @@
class FLEXIPORT_EXPORT Port
{
public:
- virtual ~Port (void);
+ virtual ~Port ();
// API common to all ports
/// @brief Open the port.
- virtual void Open (void) = 0;
+ virtual void Open () = 0;
/// @brief Close the port.
- virtual void Close (void) = 0;
+ virtual void Close () = 0;
/** @brief Read from the port.
@@ -207,7 +207,7 @@
/** @brief Get the number of bytes waiting to be read at the port. Returns immediatly.
@return The number of bytes available. Will not return less than zero. */
- virtual ssize_t BytesAvailable (void) = 0;
+ virtual ssize_t BytesAvailable () = 0;
/** @brief Get the number of bytes waiting after blocking for the timeout.
@@ -215,7 +215,7 @@
available straight away.
@return The number of bytes waiting to be read, or -1 if a timeout occured. */
- virtual ssize_t BytesAvailableWait (void) = 0;
+ virtual ssize_t BytesAvailableWait () = 0;
/** @brief Write data to the port.
@@ -250,23 +250,23 @@
{ return WriteString (buffer.c_str ()); }
/// @brief Flush the port's input and output buffers, discarding all data.
- virtual void Flush (void) = 0;
+ virtual void Flush () = 0;
/** @brief Drain the port's output buffers.
Waits until timeout for the port to finish transmitting data in its output buffer. */
- virtual void Drain (void) = 0;
+ virtual void Drain () = 0;
/// @brief Get the status of the port (type, device, etc).
- virtual std::string GetStatus (void) const;
+ virtual std::string GetStatus () const;
// Accessor methods.
/// @brief Get the port type.
- std::string GetPortType (void) const { return _type; }
+ std::string GetPortType () const { return _type; }
/// @brief Set the debug level.
- void SetDebug (int debug) { _debug = debug; }
+ void SetDebug (int debug) { _debug = debug; }
/// @brief Get the debug level.
- int GetDebug (void) const { return _debug; }
+ int GetDebug () const { return _debug; }
/** @brief Set the timeout value. Set seconds to -1 to disable timeouts and block forever.
@note On Mac OS X, the timer is reset each time data is received, making the timeout an
@@ -275,21 +275,21 @@
slightly faster than the timeout. */
virtual void SetTimeout (Timeout timeout) = 0;
/// @brief Get the timeout.
- virtual Timeout GetTimeout (void) const { return _timeout; }
+ virtual Timeout GetTimeout () const { return _timeout; }
/// @brief Get the blocking property of the port. If the timeout is non-zero, the port will
/// block.
- virtual bool IsBlocking (void) const { return (_timeout._sec != 0 ||
- _timeout._usec != 0); }
+ virtual bool IsBlocking () const { return (_timeout._sec != 0 ||
+ _timeout._usec != 0); }
/// @brief Set the read permissions of the port.
virtual void SetCanRead (bool canRead) = 0;
/// @brief Get the read permissions of the port.
- virtual bool CanRead (void) const { return _canRead; }
+ virtual bool CanRead () const { return _canRead; }
/// @brief Set the write permissions of the port.
virtual void SetCanWrite (bool canWrite) = 0;
/// @brief Get the write permissions of the port.
- virtual bool CanWrite (void) const { return _canWrite; }
+ virtual bool CanWrite () const { return _canWrite; }
/// @brief Check if the port is open
- virtual bool IsOpen (void) const = 0;
+ virtual bool IsOpen () const = 0;
protected:
std::string _type; // Port type string (e.g. "tcp" or "serial" or "usb")
@@ -301,7 +301,7 @@
// reopening it if necessary).
// Protected constructor to prevent direct creation of this class.
- Port (void);
+ Port ();
// Constructor for more-direct creation.
Port (unsigned int debug, Timeout timeout, bool canRead, bool canWrite, bool alwaysOpen);
Modified: gearbox/trunk/src/flexiport/serialport.cpp
===================================================================
--- gearbox/trunk/src/flexiport/serialport.cpp 2009-04-15 06:49:29 UTC (rev 393)
+++ gearbox/trunk/src/flexiport/serialport.cpp 2009-04-17 02:08:40 UTC (rev 394)
@@ -48,7 +48,7 @@
namespace flexiport
{
-inline int ErrNo (void)
+inline int ErrNo ()
{
#if defined (WIN32)
return GetLastError ();
@@ -252,7 +252,7 @@
Open ();
}
-SerialPort::~SerialPort (void)
+SerialPort::~SerialPort ()
{
Close ();
}
@@ -261,7 +261,7 @@
// Port management
////////////////////////////////////////////////////////////////////////////////////////////////////
-void SerialPort::Open (void)
+void SerialPort::Open ()
{
if (_open)
throw PortException ("Attempt to open already-opened port.");
@@ -326,7 +326,7 @@
_open = true;
}
-void SerialPort::Close (void)
+void SerialPort::Close ()
{
if (_debug >= 2)
cerr << "SerialPort::" << __func__ << "() Closing port" << endl;
@@ -494,7 +494,7 @@
return receivedBytes;
}
-ssize_t SerialPort::BytesAvailable (void)
+ssize_t SerialPort::BytesAvailable ()
{
ssize_t bytesAvailable = 0;
@@ -529,7 +529,7 @@
return bytesAvailable;
}
-ssize_t SerialPort::BytesAvailableWait (void)
+ssize_t SerialPort::BytesAvailableWait ()
{
ssize_t bytesAvailable = 0;
@@ -646,7 +646,7 @@
return numWritten;
}
-void SerialPort::Flush (void)
+void SerialPort::Flush ()
{
#if defined (WIN32)
if (!PurgeComm (_fd, PURGE_RXCLEAR | PURGE_TXCLEAR))
@@ -667,7 +667,7 @@
#endif
}
-void SerialPort::Drain (void)
+void SerialPort::Drain ()
{
#if defined (WIN32)
if (!FlushFileBuffers (_fd))
@@ -692,7 +692,7 @@
// Other public API functions
////////////////////////////////////////////////////////////////////////////////////////////////////
-std::string SerialPort::GetStatus (void) const
+std::string SerialPort::GetStatus () const
{
stringstream status;
@@ -874,7 +874,7 @@
#if !defined (WIN32)
// Checks if data is available, waiting for the timeout if none is available immediately
-SerialPort::WaitStatus SerialPort::WaitForDataOrTimeout (void)
+SerialPort::WaitStatus SerialPort::WaitForDataOrTimeout ()
{
// Check if there is data available immediately before spending time on a select() call
if (BytesAvailable () > 0)
@@ -912,7 +912,7 @@
}
// Checks if the port can be written to, waiting for the timeout if it can't be written immediately
-SerialPort::WaitStatus SerialPort::WaitForWritableOrTimeout (void)
+SerialPort::WaitStatus SerialPort::WaitForWritableOrTimeout ()
{
fd_set fdSet;
struct timeval tv, *tvPtr = NULL;
@@ -959,7 +959,7 @@
throw PortException ("Cannot write to read-only port.");
}
-void SerialPort::SetPortSettings (void)
+void SerialPort::SetPortSettings ()
{
#if defined (WIN32)
DCB dcb = {0};
@@ -1111,7 +1111,7 @@
SetBaudRate (_baud);
}
-void SerialPort::SetPortTimeout (void)
+void SerialPort::SetPortTimeout ()
{
#if defined (WIN32)
COMMTIMEOUTS timeouts;
Modified: gearbox/trunk/src/flexiport/serialport.h
===================================================================
--- gearbox/trunk/src/flexiport/serialport.h 2009-04-15 06:49:29 UTC (rev 393)
+++ gearbox/trunk/src/flexiport/serialport.h 2009-04-17 02:08:40 UTC (rev 394)
@@ -73,32 +73,32 @@
{
public:
SerialPort (std::map<std::string, std::string> options);
- ~SerialPort (void);
+ ~SerialPort ();
/// @brief Open the port.
- void Open (void);
+ void Open ();
/// @brief Close the port.
- void Close (void);
+ void Close ();
/// @brief Read from the port.
ssize_t Read (void * const buffer, size_t count);
/// @brief Read the requested quantity of data from the port.
ssize_t ReadFull (void * const buffer, size_t count);
/// @brief Get the number of bytes waiting to be read at the port. Returns immediatly.
- ssize_t BytesAvailable (void);
+ ssize_t BytesAvailable ();
/** @brief Get the number of bytes waiting after blocking for the timeout.
@note Currently this function performs differently under Win32. It will block for the
entire length of the timeout if data is not immediatly available. This will be fixed in the
future. */
- ssize_t BytesAvailableWait (void);
+ ssize_t BytesAvailableWait ();
/// @brief Write data to the port.
ssize_t Write (const void * const buffer, size_t count);
/// @brief Flush the port's input and output buffers, discarding all data.
- void Flush (void);
+ void Flush ();
/// @brief Drain the port's input and output buffers.
- void Drain (void);
+ void Drain ();
/// @brief Get the status of the port (type, device, etc).
- std::string GetStatus (void) const;
+ std::string GetStatus () const;
/// @brief Set the timeout value in milliseconds.
void SetTimeout (Timeout timeout);
/// @brief Set the read permissions of the port.
@@ -106,12 +106,12 @@
/// @brief Set the write permissions of the port.
void SetCanWrite (bool canWrite);
/// @brief Check if the port is open.
- bool IsOpen (void) const { return _open; }
+ bool IsOpen () const { return _open; }
/// @brief Change the baud rate.
void SetBaudRate (unsigned int baud);
/// @brief Get the current baud rate.
- unsigned int GetBaudRate (void) const { return _baud; }
+ unsigned int GetBaudRate () const { return _baud; }
private:
#if defined (WIN32)
@@ -132,14 +132,14 @@
void CheckPort (bool read);
bool ProcessOption (const std::string &option, const std::string &value);
- bool IsDataAvailable (void);
+ bool IsDataAvailable ();
#if !defined (WIN32)
typedef enum {TIMED_OUT, DATA_AVAILABLE, CAN_WRITE} WaitStatus;
- WaitStatus WaitForDataOrTimeout (void);
- WaitStatus WaitForWritableOrTimeout (void);
+ WaitStatus WaitForDataOrTimeout ();
+ WaitStatus WaitForWritableOrTimeout ();
#endif
- void SetPortSettings (void);
- void SetPortTimeout (void);
+ void SetPortSettings ();
+ void SetPortTimeout ();
};
} // namespace flexiport
Modified: gearbox/trunk/src/flexiport/tcpport.cpp
===================================================================
--- gearbox/trunk/src/flexiport/tcpport.cpp 2009-04-15 06:49:29 UTC (rev 393)
+++ gearbox/trunk/src/flexiport/tcpport.cpp 2009-04-17 02:08:40 UTC (rev 394)
@@ -59,7 +59,7 @@
namespace flexiport
{
-inline int ErrNo (void)
+inline int ErrNo ()
{
#if defined (WIN32)
return WSAGetLastError ();
@@ -119,7 +119,7 @@
Open ();
}
-TCPPort::~TCPPort (void)
+TCPPort::~TCPPort ()
{
Close ();
@@ -138,7 +138,7 @@
// Port management
////////////////////////////////////////////////////////////////////////////////////////////////////
-void TCPPort::Open (void)
+void TCPPort::Open ()
{
if (_open)
throw PortException ("Attempt to open already-opened port.");
@@ -165,7 +165,7 @@
cerr << "TCPPort::" << __func__ << "() Port is open" << endl;
}
-void TCPPort::Close (void)
+void TCPPort::Close ()
{
if (_debug >= 2)
cerr << "TCPPort::" << __func__ << "() Closing port" << endl;
@@ -346,7 +346,7 @@
return receivedBytes;
}
-ssize_t TCPPort::BytesAvailable (void)
+ssize_t TCPPort::BytesAvailable ()
{
// TODO:
// MSG_PEEK is apparently bad on Windows so we should drain what we can into a local buffer
@@ -377,7 +377,7 @@
return bytesAvailable;
}
-ssize_t TCPPort::BytesAvailableWait (void)
+ssize_t TCPPort::BytesAvailableWait ()
{
CheckPort (true);
@@ -469,7 +469,7 @@
return numSent;
}
-void TCPPort::Flush (void)
+void TCPPort::Flush ()
{
int numRead = 0;
char dump[128];
@@ -500,7 +500,7 @@
// We can't do anything about the write buffers.
}
-void TCPPort::Drain (void)
+void TCPPort::Drain ()
{
// Since we can't force the write buffer to send, we can't do anything here.
if (_debug >= 1)
@@ -511,7 +511,7 @@
// Other public API functions
////////////////////////////////////////////////////////////////////////////////////////////////////
-std::string TCPPort::GetStatus (void) const
+std::string TCPPort::GetStatus () const
{
stringstream status;
@@ -573,7 +573,7 @@
}
// Connect to a remote server: used when not in listen mode
-void TCPPort::Connect (void)
+void TCPPort::Connect ()
{
Close (); // To make sure
@@ -668,7 +668,7 @@
}
// Wait for a connection: used in listen mode
-void TCPPort::WaitForConnection (void)
+void TCPPort::WaitForConnection ()
{
Close (); // To make sure
@@ -838,7 +838,7 @@
}
// Checks if data is available, waiting for the timeout if none is available immediatly
-TCPPort::WaitStatus TCPPort::WaitForDataOrTimeout (void)
+TCPPort::WaitStatus TCPPort::WaitForDataOrTimeout ()
{
if (IsDataAvailable ())
{
@@ -881,7 +881,7 @@
}
// Checks if data is available right now
-bool TCPPort::IsDataAvailable (void)
+bool TCPPort::IsDataAvailable ()
{
if (_debug >= 3)
cerr << "TCPPort::" << __func__ << "() Checking if data is available immediately." << endl;
@@ -933,7 +933,7 @@
}
// Checks it he port can be written to, waiting for the timeout if it can't be written immediatly
-TCPPort::WaitStatus TCPPort::WaitForWritableOrTimeout (void)
+TCPPort::WaitStatus TCPPort::WaitForWritableOrTimeout ()
{
fd_set fdSet;
struct timeval tv, *tvPtr = NULL;
@@ -979,7 +979,7 @@
throw PortException ("Cannot write to read-only port.");
}
-void TCPPort::SetSocketBlockingFlag (void)
+void TCPPort::SetSocketBlockingFlag ()
{
if (_timeout._sec == -1)
{
Modified: gearbox/trunk/src/flexiport/tcpport.h
===================================================================
--- gearbox/trunk/src/flexiport/tcpport.h 2009-04-15 06:49:29 UTC (rev 393)
+++ gearbox/trunk/src/flexiport/tcpport.h 2009-04-17 02:08:40 UTC (rev 394)
@@ -59,31 +59,31 @@
{
public:
TCPPort (std::map<std::string, std::string> options);
- ~TCPPort (void);
+ ~TCPPort ();
/** @brief Open the port.
For a listening port, this will call accept() and therefore cause the calling process to
block until an incoming connection. */
- void Open (void);
+ void Open ();
/// @brief Close the port.
- void Close (void);
+ void Close ();
/// @brief Read from the port.
ssize_t Read (void * const buffer, size_t count);
/// @brief Read the requested quantity of data from the port.
ssize_t ReadFull (void * const buffer, size_t count);
/// @brief Get the number of bytes waiting to be read at the port. Returns immediatly.
- ssize_t BytesAvailable (void);
+ ssize_t BytesAvailable ();
/// @brief Get the number of bytes waiting after blocking for the timeout.
- ssize_t BytesAvailableWait (void);
+ ssize_t BytesAvailableWait ();
/// @brief Write data to the port.
ssize_t Write (const void * const buffer, size_t count);
/// @brief Flush the port's input and output buffers, discarding all data.
- void Flush (void);
+ void Flush ();
/// @brief Drain the port's input and output buffers.
- void Drain (void);
+ void Drain ();
/// @brief Get the status of the port (type, device, etc).
- std::string GetStatus (void) const;
+ std::string GetStatus () const;
/// @brief Set the timeout value in milliseconds.
void SetTimeout (Timeout timeout);
/// @brief Set the read permissions of the port.
@@ -91,7 +91,7 @@
/// @brief Set the write permissions of the port.
void SetCanWrite (bool canWrite);
/// @brief Check if the port is open
- bool IsOpen (void) const { return _open; }
+ bool IsOpen () const { return _open; }
private:
int _sock; // Socket connected to wherever the data is coming from.
@@ -106,13 +106,13 @@
bool ProcessOption (const std::string &option, const std::string &value);
- void Connect (void);
- void WaitForConnection (void);
+ void Connect ();
+ void WaitForConnection ();
typedef enum {TIMED_OUT, DATA_AVAILABLE, CAN_WRITE} WaitStatus;
- WaitStatus WaitForDataOrTimeout (void);
- bool IsDataAvailable (void);
- WaitStatus WaitForWritableOrTimeout (void);
- void SetSocketBlockingFlag (void);
+ WaitStatus WaitForDataOrTimeout ();
+ bool IsDataAvailable ();
+ WaitStatus WaitForWritableOrTimeout ();
+ void SetSocketBlockingFlag ();
};
} // namespace flexiport
Modified: gearbox/trunk/src/flexiport/udpport.cpp
===================================================================
--- gearbox/trunk/src/flexiport/udpport.cpp 2009-04-15 06:49:29 UTC (rev 393)
+++ gearbox/trunk/src/flexiport/udpport.cpp 2009-04-17 02:08:40 UTC (rev 394)
@@ -59,7 +59,7 @@
namespace flexiport
{
-inline int ErrNo (void)
+inline int ErrNo ()
{
#if defined (WIN32)
return WSAGetLastError ();
@@ -119,7 +119,7 @@
Open ();
}
-UDPPort::~UDPPort (void)
+UDPPort::~UDPPort ()
{
Close ();
@@ -138,7 +138,7 @@
// Port management
////////////////////////////////////////////////////////////////////////////////////////////////////
-void UDPPort::Open (void)
+void UDPPort::Open ()
{
if (_open)
throw PortException ("Attempt to open already-opened port.");
@@ -152,7 +152,7 @@
cerr << "UDPPort::" << __func__ << "() Port is open" << endl;
}
-void UDPPort::Close (void)
+void UDPPort::Close ()
{
if (_debug >= 2)
cerr << "UDPPort::" << __func__ << "() Closing port" << endl;
@@ -397,7 +397,7 @@
return 0;
}
-ssize_t UDPPort::BytesAvailable (void)
+ssize_t UDPPort::BytesAvailable ()
{
// TODO:
// MSG_PEEK is apparently bad on Windows so we should drain what we can into a local buffer
@@ -427,7 +427,7 @@
return bytesAvailable;
}
-ssize_t UDPPort::BytesAvailableWait (void)
+ssize_t UDPPort::BytesAvailableWait ()
{
CheckPort (true);
@@ -518,7 +518,7 @@
return numSent;
}
-void UDPPort::Flush (void)
+void UDPPort::Flush ()
{
int numRead = 0;
char dump[128];
@@ -549,7 +549,7 @@
// We can't do anything about the write buffers.
}
-void UDPPort::Drain (void)
+void UDPPort::Drain ()
{
// Since we can't force the write buffer to send, we can't do anything here.
if (_debug >= 1)
@@ -560,7 +560,7 @@
// Other public API functions
////////////////////////////////////////////////////////////////////////////////////////////////////
-std::string UDPPort::GetStatus (void) const
+std::string UDPPort::GetStatus () const
{
stringstream status;
@@ -644,7 +644,7 @@
}
// Open the socket for sending data
-void UDPPort::OpenSender (void)
+void UDPPort::OpenSender ()
{
CloseSender (); // To make sure
@@ -742,7 +742,7 @@
}
// Close the socket for sending data
-void UDPPort::CloseSender (void)
+void UDPPort::CloseSender ()
{
#if defined (WIN32)
if (_sendSock != INVALID_SOCKET)
@@ -760,7 +760,7 @@
}
// Open the socket for receiving data
-void UDPPort::OpenReceiver (void)
+void UDPPort::OpenReceiver ()
{
CloseReceiver (); // To make sure
@@ -896,7 +896,7 @@
}
// Close the socket for receiving data
-void UDPPort::CloseReceiver (void)
+void UDPPort::CloseReceiver ()
{
#if defined (WIN32)
if (_recvSock != INVALID_SOCKET)
@@ -914,7 +914,7 @@
}
// Checks if data is available, waiting for the timeout if none is available immediatly
-UDPPort::WaitStatus UDPPort::WaitForDataOrTimeout (void)
+UDPPort::WaitStatus UDPPort::WaitForDataOrTimeout ()
{
if (IsDataAvailable ())
{
@@ -957,7 +957,7 @@
}
// Checks if data is available right now
-bool UDPPort::IsDataAvailable (void)
+bool UDPPort::IsDataAvailable ()
{
if (_debug >= 3)
cerr << "UDPPort::" << __func__ << "() Checking if data is available immediately." << endl;
@@ -1008,7 +1008,7 @@
}
// Checks it he port can be written to, waiting for the timeout if it can't be written immediatly
-UDPPort::WaitStatus UDPPort::WaitForWritableOrTimeout (void)
+UDPPort::WaitStatus UDPPort::WaitForWritableOrTimeout ()
{
fd_set fdSet;
struct timeval tv, *tvPtr = NULL;
@@ -1054,7 +1054,7 @@
throw PortException ("Cannot write to read-only port.");
}
-void UDPPort::SetSocketBlockingFlag (void)
+void UDPPort::SetSocketBlockingFlag ()
{
if (_timeout._sec == -1)
{
Modified: gearbox/trunk/src/flexiport/udpport.h
===================================================================
--- gearbox/trunk/src/flexiport/udpport.h 2009-04-15 06:49:29 UTC (rev 393)
+++ gearbox/trunk/src/flexiport/udpport.h 2009-04-17 02:08:40 UTC (rev 394)
@@ -74,14 +74,14 @@
{
public:
UDPPort (std::map<std::string, std::string> options);
- ~UDPPort (void);
+ ~UDPPort ();
/** @brief Open the port.
This will create a listening socket and a sending socket. */
- void Open (void);
+ void Open ();
/// @brief Close the port.
- void Close (void);
+ void Close ();
/// @brief Read from the port.
ssize_t Read (void * const buffer, size_t count);
/// @brief Read the requested quantity of data from the port.
@@ -96,17 +96,17 @@
count times. */
ssize_t SkipUntil (uint8_t terminator, unsigned int count);
/// @brief Get the number of bytes waiting to be read at the port. Returns immediatly.
- ssize_t BytesAvailable (void);
+ ssize_t BytesAvailable ();
/// @brief Get the number of bytes waiting after blocking for the timeout.
- ssize_t BytesAvailableWait (void);
+ ssize_t BytesAvailableWait ();
/// @brief Write data to the port.
ssize_t Write (const void * const buffer, size_t count);
/// @brief Flush the port's input and output buffers, discarding all data.
- void Flush (void);
+ void Flush ();
/// @brief Drain the port's input and output buffers.
- void Drain (void);
+ void Drain ();
/// @brief Get the status of the port (type, device, etc).
- std::string GetStatus (void) const;
+ std::string GetStatus () const;
/// @brief Set the timeout value in milliseconds.
void SetTimeout (Timeout timeout);
/// @brief Set the read permissions of the port.
@@ -114,7 +114,7 @@
/// @brief Set the write permissions of the port.
void SetCanWrite (bool canWrite);
/// @brief Check if the port is open
- bool IsOpen (void) const { return _open; }
+ bool IsOpen () const { return _open; }
private:
int _sendSock; // Socket to send data from.
@@ -130,15 +130,15 @@
bool ProcessOption (const std::string &option, const std::string &value);
- void OpenSender (void);
- void CloseSender (void);
- void OpenReceiver (void);
- void CloseReceiver (void);
+ void OpenSender ();
+ void CloseSender ();
+ void OpenReceiver ();
+ void CloseReceiver ();
typedef enum {TIMED_OUT, DATA_AVAILABLE, CAN_WRITE} WaitStatus;
- WaitStatus WaitForDataOrTimeout (void);
- bool IsDataAvailable (void);
- WaitStatus WaitForWritableOrTimeout (void);
- void SetSocketBlockingFlag (void);
+ WaitStatus WaitForDataOrTimeout ();
+ bool IsDataAvailable ();
+ WaitStatus WaitForWritableOrTimeout ();
+ void SetSocketBlockingFlag ();
};
} // namespace flexiport
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2009-04-15 06:49:32
|
Revision: 393
http://gearbox.svn.sourceforge.net/gearbox/?rev=393&view=rev
Author: gbiggs
Date: 2009-04-15 06:49:29 +0000 (Wed, 15 Apr 2009)
Log Message:
-----------
Updated docs to reflect the newly known-to-work UTM-30LX status
Modified Paths:
--------------
gearbox/trunk/src/hokuyo_aist/doc.dox
Modified: gearbox/trunk/src/hokuyo_aist/doc.dox
===================================================================
--- gearbox/trunk/src/hokuyo_aist/doc.dox 2009-04-15 06:44:13 UTC (rev 392)
+++ gearbox/trunk/src/hokuyo_aist/doc.dox 2009-04-15 06:49:29 UTC (rev 393)
@@ -7,9 +7,8 @@
@brief Hokuyo URG laser scanner driver.
This library provides a driver for Hokuyo laser scanner devices using the SCIP protocol version 1 or
-2. It has been tested with the Hokuyo URG-04LX, UBG-04LX and UHG-08LX, but it should work with any
-scanner that conforms to these protocol versions, including the URG-04LX-F01 and UTM-30LX. For a
-full list of functions and classes, see @ref hokuyo_aist.
+2. It has been tested with the Hokuyo URG-04LX, UBG-04LX, UHG-08LX and UTM-30LX but it should work
+with any scanner that conforms to these protocol versions, including the URG-04LX-F01.
For a full list of classes and functions, see @ref hokuyo_aist.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2009-04-15 06:44:14
|
Revision: 392
http://gearbox.svn.sourceforge.net/gearbox/?rev=392&view=rev
Author: gbiggs
Date: 2009-04-15 06:44:13 +0000 (Wed, 15 Apr 2009)
Log Message:
-----------
Rearranged code for reading sensor info to be more flexible
Modified Paths:
--------------
gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp
gearbox/trunk/src/hokuyo_aist/hokuyo_aist.h
Modified: gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp 2009-04-15 06:03:34 UTC (rev 391)
+++ gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp 2009-04-15 06:44:13 UTC (rev 392)
@@ -898,8 +898,8 @@
HokuyoLaser::HokuyoLaser ()
: _port (NULL), _scipVersion (2), _verbose (false), _sensorIsUTM30LX (false),
- _enableCheckSumWorkaround (false), _minAngle (0.0), _maxAngle (0.0), _resolution (0.0),
- _firstStep (0), _lastStep (0), _frontStep (0)
+ _enableCheckSumWorkaround (false), _ignoreUnknowns (false), _minAngle (0.0), _maxAngle (0.0),
+ _resolution (0.0), _firstStep (0), _lastStep (0), _frontStep (0)
{
}
@@ -1334,122 +1334,20 @@
// We need to send three commands to get all the info we want: VV, PP and II
SendCommand ("VV", NULL, 0, NULL);
- // Get the vendor info line
- ReadLineWithCheck (buffer, -1, true);
- info->vendor = &buffer[5]; // Chop off the "VEND:" tag
- // Get the product info line
- ReadLineWithCheck (buffer, -1, true);
- info->product = &buffer[5];
- // Also do a check to see if this is a UTM-30LX, because we need to work around a checksum
- // problem and the error messages for data change if this is the case
- if (strstr (buffer, "UTM-30LX") != NULL)
- {
- _sensorIsUTM30LX = true;
- _enableCheckSumWorkaround = true;
- }
- else
- _sensorIsUTM30LX = false;
- // Get the firmware line
- ReadLineWithCheck (buffer, -1, true);
- info->firmware = &buffer[5];
- // Get the protocol version line
- ReadLineWithCheck (buffer, -1, true);
- info->protocol = &buffer[5];
- // Get the serial number
- ReadLineWithCheck (buffer, -1, true);
- info->serial = &buffer[5];
- // Skip the end-of-message
- SkipLines (1);
+ while (ReadLineWithCheck (buffer, -1, true) != 0)
+ ProcessVVLine (buffer, info);
// Next up, PP
SendCommand ("PP", NULL, 0, NULL);
- // Get the model line
- ReadLineWithCheck (buffer, -1, true);
- info->model = &buffer[5];
- // On to the fun ones that require parsing
- ReadLineWithCheck (buffer, -1, true);
- info->minRange = atoi (&buffer[5]);
- ReadLineWithCheck (buffer, -1, true);
- info->maxRange = atoi (&buffer[5]);
- ReadLineWithCheck (buffer, -1, true);
- info->steps = atoi (&buffer[5]);
- ReadLineWithCheck (buffer, -1, true);
- info->firstStep = atoi (&buffer[5]);
- ReadLineWithCheck (buffer, -1, true);
- info->lastStep = atoi (&buffer[5]);
- ReadLineWithCheck (buffer, -1, true);
- info->frontStep = atoi (&buffer[5]);
- ReadLineWithCheck (buffer, -1, true);
- info->standardSpeed = atoi (&buffer[5]);
- // Skip the end-of-message
- SkipLines (1);
+ while (ReadLineWithCheck (buffer, -1, true) != 0)
+ ProcessPPLine (buffer, info);
// Command II: Revenge of the Commands.
SendCommand ("II", NULL, 0, NULL);
- // Skip the model line (we already have it from PP)
- SkipLines (1);
- // Get and parse the power state
- ReadLineWithCheck (buffer, -1, true);
- if (strncmp (&buffer[5], "OFF", 3) == 0)
- info->power = false;
- else
- info->power = true;
- // Motor speed
- ReadLineWithCheck (buffer, -1, true);
- if (strncmp (&buffer[5], "Initial", 7) == 0)
- {
- // Unchanged motor speed
- if (sscanf (buffer, "SCSP:%*7s(%d[rpm]", &info->speed) != 1)
- {
- stringstream ss;
- ss << "Motor speed line parse failed: " << buffer;
- throw HokuyoError (HOKUYO_ERR_PROTOCOL, ss.str ());
- }
- info->speedLevel = 0;
- }
- else
- {
- // Changed motor speed, format is:
- // <level>%<ignored string>(<speed>[rpm])
- if (sscanf (buffer, "SCSP:%hd%%%*4s(%d[rpm]", &info->speedLevel, &info->speed) != 2)
- {
- stringstream ss;
- ss << "Motor speed line parse failed: " << buffer;
- throw HokuyoError (HOKUYO_ERR_PROTOCOL, ss.str ());
- }
- }
- // Measuring state
- ReadLineWithCheck (buffer, -1, true);
- info->measureState = &buffer[5];
- // Baud rate
- ReadLineWithCheck (buffer, -1, true);
- if (strncmp (&buffer[5], "USB only", 8) == 0)
- {
- // No baud rate for USB-only devices such as the UHG-08LX
- info->baud = 0;
- }
- else if (sscanf (buffer, "SBPS:%d[bps]", &info->baud) != 1)
- {
- stringstream ss;
- ss << "Baud rate line parse failed: " << buffer;
- throw HokuyoError (HOKUYO_ERR_PROTOCOL, ss.str ());
- }
- // Time stamp
- ReadLineWithCheck (buffer, -1, true);
- if (sscanf (buffer, "TIME:%x", &info->time) != 1)
- {
- stringstream ss;
- ss << "Timestamp line parse failed: " << buffer;
- throw HokuyoError (HOKUYO_ERR_PROTOCOL, ss.str ());
- }
- // Diagnostic
- ReadLineWithCheck (buffer, -1, true);
- info->sensorDiagnostic = &buffer[5];
- // Skip the end-of-message
- SkipLines (1);
+ while (ReadLineWithCheck (buffer, -1, true) != 0)
+ ProcessIILine (buffer, info);
- if (_sensorIsUTM30LX)
- _enableCheckSumWorkaround = false;
+ _enableCheckSumWorkaround = false;
info->CalculateValues ();
if (_verbose)
@@ -2306,6 +2204,136 @@
}
}
+void HokuyoLaser::ProcessVVLine (const char *buffer, HokuyoSensorInfo *info)
+{
+ if (strncmp (buffer, "VEND", 4) == 0)
+ info->vendor = &buffer[5]; // Vendor info, minus the "VEND:" tag
+ else if (strncmp (buffer, "PROD", 4) == 0)
+ {
+ info->product = &buffer[5]; // Product info
+ // Also do a check to see if this is a UTM-30LX, because we need to work around a checksum
+ // problem and the error messages for data change if this is the case
+ if (strstr (buffer, "UTM-30LX") != NULL)
+ {
+ _sensorIsUTM30LX = true;
+ _enableCheckSumWorkaround = true;
+ }
+ else
+ _sensorIsUTM30LX = false;
+ }
+ else if (strncmp (buffer, "FIRM", 4) == 0)
+ info->firmware = &buffer[5]; // Firmware version
+ else if (strncmp (buffer, "PROT", 4) == 0)
+ info->protocol = &buffer[5]; // Protocol version
+ else if (strncmp (buffer, "SERI", 4) == 0)
+ info->serial = &buffer[5]; // Serial number
+ else if (!_ignoreUnknowns)
+ {
+ stringstream ss;
+ ss << "HokuyoLaser::" << __func__ << "() Unknown line: " << buffer;
+ throw HokuyoError (HOKUYO_ERR_PROTOCOL, ss.str ());
+ }
+}
+
+void HokuyoLaser::ProcessPPLine (const char *buffer, HokuyoSensorInfo *info)
+{
+ if (strncmp (buffer, "MODL", 4) == 0)
+ info->model = &buffer[5]; // Model
+ // On to the fun ones that require parsing
+ else if (strncmp (buffer, "DMIN", 4) == 0)
+ info->minRange = atoi (&buffer[5]);
+ else if (strncmp (buffer, "DMAX", 4) == 0)
+ info->maxRange = atoi (&buffer[5]);
+ else if (strncmp (buffer, "ARES", 4) == 0)
+ info->steps = atoi (&buffer[5]);
+ else if (strncmp (buffer, "AMIN", 4) == 0)
+ info->firstStep = atoi (&buffer[5]);
+ else if (strncmp (buffer, "AMAX", 4) == 0)
+ info->lastStep = atoi (&buffer[5]);
+ else if (strncmp (buffer, "AFRT", 4) == 0)
+ info->frontStep = atoi (&buffer[5]);
+ else if (strncmp (buffer, "SCAN", 4) == 0)
+ info->standardSpeed = atoi (&buffer[5]);
+ else if (!_ignoreUnknowns)
+ {
+ stringstream ss;
+ ss << "HokuyoLaser::" << __func__ << "() Unknown line: " << buffer;
+ throw HokuyoError (HOKUYO_ERR_PROTOCOL, ss.str ());
+ }
+}
+
+void HokuyoLaser::ProcessIILine (const char *buffer, HokuyoSensorInfo *info)
+{
+ if (strncmp (buffer, "MODL", 4) == 0)
+ // Do nothing here - we already know this value from PP
+ return;
+ else if (strncmp (buffer, "LASR", 4) == 0)
+ {
+ if (strncmp (&buffer[5], "OFF", 3) == 0)
+ info->power = false;
+ else
+ info->power = true;
+ }
+ else if (strncmp (buffer, "SCSP", 4) == 0)
+ {
+ if (strncmp (&buffer[5], "Initial", 7) == 0)
+ {
+ // Unchanged motor speed
+ if (sscanf (buffer, "SCSP:%*7s(%d[rpm]", &info->speed) != 1)
+ {
+ stringstream ss;
+ ss << "Motor speed line parse failed: " << buffer;
+ throw HokuyoError (HOKUYO_ERR_PROTOCOL, ss.str ());
+ }
+ info->speedLevel = 0;
+ }
+ else
+ {
+ // Changed motor speed, format is:
+ // <level>%<ignored string>(<speed>[rpm])
+ if (sscanf (buffer, "SCSP:%hd%%%*4s(%d[rpm]", &info->speedLevel, &info->speed) != 2)
+ {
+ stringstream ss;
+ ss << "Motor speed line parse failed: " << buffer;
+ throw HokuyoError (HOKUYO_ERR_PROTOCOL, ss.str ());
+ }
+ }
+ }
+ else if (strncmp (buffer, "MESM", 4) == 0)
+ info->measureState = &buffer[5];
+ else if (strncmp (buffer, "SBPS", 4) == 0)
+ {
+ if (strncmp (&buffer[5], "USB only", 8) == 0)
+ {
+ // No baud rate for USB-only devices such as the UHG-08LX
+ info->baud = 0;
+ }
+ else if (sscanf (buffer, "SBPS:%d[bps]", &info->baud) != 1)
+ {
+ stringstream ss;
+ ss << "Baud rate line parse failed: " << buffer;
+ throw HokuyoError (HOKUYO_ERR_PROTOCOL, ss.str ());
+ }
+ }
+ else if (strncmp (buffer, "TIME", 4) == 0)
+ {
+ if (sscanf (buffer, "TIME:%x", &info->time) != 1)
+ {
+ stringstream ss;
+ ss << "Timestamp line parse failed: " << buffer;
+ throw HokuyoError (HOKUYO_ERR_PROTOCOL, ss.str ());
+ }
+ }
+ else if (strncmp (buffer, "STAT", 4) == 0)
+ info->sensorDiagnostic = &buffer[5];
+ else if (!_ignoreUnknowns)
+ {
+ stringstream ss;
+ ss << "HokuyoLaser::" << __func__ << "() Unknown line: " << buffer;
+ throw HokuyoError (HOKUYO_ERR_PROTOCOL, ss.str ());
+ }
+}
+
void HokuyoLaser::Read2ByteRangeData (HokuyoData *data, unsigned int numSteps)
{
if (_verbose)
Modified: gearbox/trunk/src/hokuyo_aist/hokuyo_aist.h
===================================================================
--- gearbox/trunk/src/hokuyo_aist/hokuyo_aist.h 2009-04-15 06:03:34 UTC (rev 391)
+++ gearbox/trunk/src/hokuyo_aist/hokuyo_aist.h 2009-04-15 06:44:13 UTC (rev 392)
@@ -476,6 +476,10 @@
off. */
void SetVerbose (bool verbose) { _verbose = verbose; }
+ /** @brief Enables/disables ignoring unknown lines in sensor info messages. Default is
+ off. */
+ void IgnoreUnknowns (bool ignore) { _ignoreUnknowns = ignore; }
+
/// @brief A convenience function to convert a step index to an angle.
double StepToAngle (unsigned int step);
/// @brief A convenience function to convert an angle to a step (rounded towards the front).
@@ -485,7 +489,7 @@
flexiport::Port *_port;
uint8_t _scipVersion;
- bool _verbose, _sensorIsUTM30LX, _enableCheckSumWorkaround;
+ bool _verbose, _sensorIsUTM30LX, _enableCheckSumWorkaround, _ignoreUnknowns;
double _minAngle, _maxAngle, _resolution;
int _firstStep, _lastStep, _frontStep;
unsigned int _maxRange;
@@ -498,6 +502,9 @@
void GetAndSetSCIPVersion ();
void GetDefaults ();
+ void ProcessVVLine (const char *buffer, HokuyoSensorInfo *info);
+ void ProcessPPLine (const char *buffer, HokuyoSensorInfo *info);
+ void ProcessIILine (const char *buffer, HokuyoSensorInfo *info);
void Read2ByteRangeData (HokuyoData *data, unsigned int numSteps);
void Read3ByteRangeData (HokuyoData *data, unsigned int numSteps);
void Read3ByteRangeAndIntensityData (HokuyoData *data, unsigned int numSteps);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2009-04-15 06:03:40
|
Revision: 391
http://gearbox.svn.sourceforge.net/gearbox/?rev=391&view=rev
Author: gbiggs
Date: 2009-04-15 06:03:34 +0000 (Wed, 15 Apr 2009)
Log Message:
-----------
Fixed checksum workaround for UTM-30LX
Modified Paths:
--------------
gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp
gearbox/trunk/src/hokuyo_aist/hokuyo_aist.h
Modified: gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp 2009-04-14 09:11:54 UTC (rev 390)
+++ gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp 2009-04-15 06:03:34 UTC (rev 391)
@@ -1238,12 +1238,6 @@
// Get the product info line
ReadLine (buffer);
info->product = &buffer[5];
- // Also do a check to see if this is a UTM-30LX, because we need to work around a checksum
- // problem and the error messages for data change if this is the case
- if (strstr (buffer, "UTM-30LX") != NULL)
- _sensorIsUTM30LX = true;
- else
- _sensorIsUTM30LX = false;
// Get the firmware line
ReadLine (buffer);
info->firmware = &buffer[5];
@@ -1333,8 +1327,7 @@
"() Getting sensor information using SCIP version 2." << endl;
}
- if (_sensorIsUTM30LX)
- _enableCheckSumWorkaround = true;
+ info->SetDefaults ();
char buffer[SCIP2_LINE_LENGTH];
memset (buffer, 0, sizeof (char) * SCIP2_LINE_LENGTH);
@@ -1347,6 +1340,15 @@
// Get the product info line
ReadLineWithCheck (buffer, -1, true);
info->product = &buffer[5];
+ // Also do a check to see if this is a UTM-30LX, because we need to work around a checksum
+ // problem and the error messages for data change if this is the case
+ if (strstr (buffer, "UTM-30LX") != NULL)
+ {
+ _sensorIsUTM30LX = true;
+ _enableCheckSumWorkaround = true;
+ }
+ else
+ _sensorIsUTM30LX = false;
// Get the firmware line
ReadLineWithCheck (buffer, -1, true);
info->firmware = &buffer[5];
@@ -1971,7 +1973,7 @@
throw HokuyoError (HOKUYO_ERR_PROTOCOL, ss.str ());
}
- checkSum = ConfirmCheckSum (buffer, bytesToConsider,
+ checkSum = ConfirmCheckSum (buffer, newBytesToConsider,
static_cast<int> (buffer[checksumIndex]));
}
else
@@ -2540,7 +2542,7 @@
}
}
-int HokuyoLaser::ConfirmCheckSum (char *buffer, int length, int expectedSum)
+int HokuyoLaser::ConfirmCheckSum (const char *buffer, int length, int expectedSum)
{
int checkSum = 0;
// Start by adding the byte values
@@ -2554,8 +2556,8 @@
if (_verbose)
{
cerr << "HokuyoLaser::" << __func__ << "() Calculated checksum = " << checkSum << " (" <<
- static_cast<char> (checkSum) << "), given checksum = " <<
- static_cast<int> (expectedSum) << " (" << expectedSum << ")" << endl;
+ static_cast<char> (checkSum) << "), given checksum = " << expectedSum << " (" <<
+ static_cast<char> (expectedSum) << ")" << endl;
}
if (checkSum != expectedSum)
{
Modified: gearbox/trunk/src/hokuyo_aist/hokuyo_aist.h
===================================================================
--- gearbox/trunk/src/hokuyo_aist/hokuyo_aist.h 2009-04-14 09:11:54 UTC (rev 390)
+++ gearbox/trunk/src/hokuyo_aist/hokuyo_aist.h 2009-04-15 06:03:34 UTC (rev 391)
@@ -502,7 +502,7 @@
void Read3ByteRangeData (HokuyoData *data, unsigned int numSteps);
void Read3ByteRangeAndIntensityData (HokuyoData *data, unsigned int numSteps);
- int ConfirmCheckSum (char *buffer, int length, int expectedSum);
+ int ConfirmCheckSum (const char *buffer, int length, int expectedSum);
};
} // namespace hokuyo_aist
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2009-04-14 09:12:05
|
Revision: 390
http://gearbox.svn.sourceforge.net/gearbox/?rev=390&view=rev
Author: gbiggs
Date: 2009-04-14 09:11:54 +0000 (Tue, 14 Apr 2009)
Log Message:
-----------
Changed ordering of SCIP protocol version checks. Removed a misplaced (by an entire project) error message from some CMakeLists.txt files.
Modified Paths:
--------------
gearbox/trunk/src/flexiport/python/CMakeLists.txt
gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp
gearbox/trunk/src/hokuyo_aist/hokuyo_aist.h
gearbox/trunk/src/hokuyo_aist/python/CMakeLists.txt
Modified: gearbox/trunk/src/flexiport/python/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/flexiport/python/CMakeLists.txt 2009-04-08 03:30:00 UTC (rev 389)
+++ gearbox/trunk/src/flexiport/python/CMakeLists.txt 2009-04-14 09:11:54 UTC (rev 390)
@@ -20,8 +20,6 @@
GET_FILENAME_COMPONENT (boostPythonLib ${Boost_PYTHON_LIBRARY} NAME_WE CACHE)
# Chop off the lib at the front, too, if present
STRING (REGEX REPLACE "^lib" "" boostPythonLib ${boostPythonLib})
- MESSAGE (STATUS
- "PlayerC++ client library will be built with Boost::Thread support.")
else(Boost_PYTHON_FOUND)
MESSAGE (STATUS
"Boost::Python library was not found. Cannot build Python bindings for Flexiport.")
@@ -67,4 +65,4 @@
ADD_SUBDIRECTORY (test)
ELSEIF(NOT GBX_DEFAULT_LIB_TYPE STREQUAL SHARED)
MESSAGE (STATUS "Flexiport Python bindings will not be built - must build flexiport as a shared library.")
-endif(PYTHON_LIBRARIES AND Boost_FOUND AND GBX_DEFAULT_LIB_TYPE STREQUAL SHARED)
\ No newline at end of file
+endif(PYTHON_LIBRARIES AND Boost_FOUND AND GBX_DEFAULT_LIB_TYPE STREQUAL SHARED)
Modified: gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp 2009-04-08 03:30:00 UTC (rev 389)
+++ gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp 2009-04-14 09:11:54 UTC (rev 390)
@@ -114,6 +114,8 @@
- Data rows are broken after a maximum of 64 bytes, each one having a checksum and a line feed.
- Status codes 00 and 99 are OK, anything else is an error.
- Checksum is calculated by... well, see the code.
+ - BIG NOTE: The URG-30LX has a probable bug in its response to the II code whereby it does not
+ include anything after and including "<-" in the checksum calculation.
VV Version info
V|V|LF
@@ -447,7 +449,7 @@
// HokuyoError class
////////////////////////////////////////////////////////////////////////////////////////////////////
-string HokuyoError::AsString (void) const throw ()
+string HokuyoError::AsString () const throw ()
{
switch (_errorCode)
{
@@ -487,7 +489,7 @@
// HokuyoSensorInfo class
////////////////////////////////////////////////////////////////////////////////////////////////////
-HokuyoSensorInfo::HokuyoSensorInfo (void)
+HokuyoSensorInfo::HokuyoSensorInfo ()
: minRange (0), maxRange (0), steps (0), firstStep (0), lastStep (0), frontStep (0),
standardSpeed (0), power (false), speed (0), speedLevel (0), baud (0), time (0), minAngle (0.0),
maxAngle (0.0), resolution (0.0), scanableSteps (0)
@@ -495,7 +497,7 @@
}
// Set various known values based on what the manual says
-void HokuyoSensorInfo::SetDefaults (void)
+void HokuyoSensorInfo::SetDefaults ()
{
minRange = 20;
maxRange = 4095;
@@ -505,7 +507,7 @@
frontStep = 384;
}
-void HokuyoSensorInfo::CalculateValues (void)
+void HokuyoSensorInfo::CalculateValues ()
{
resolution = DTOR (360.0) / steps;
// If any of the steps are beyond INT_MAX, we have problems.
@@ -515,7 +517,7 @@
scanableSteps = lastStep - firstStep + 1;
}
-string HokuyoSensorInfo::AsString (void)
+string HokuyoSensorInfo::AsString ()
{
stringstream ss;
@@ -549,7 +551,7 @@
// HokuyoData class
////////////////////////////////////////////////////////////////////////////////////////////////////
-HokuyoData::HokuyoData (void)
+HokuyoData::HokuyoData ()
: _ranges (NULL), _intensities (NULL), _length (0),
_error (false), _time (0), _sensorIsUTM30LX (false)
{
@@ -637,7 +639,7 @@
_time = rhs.TimeStamp ();
}
-HokuyoData::~HokuyoData (void)
+HokuyoData::~HokuyoData ()
{
if (_ranges != NULL)
delete[] _ranges;
@@ -788,7 +790,7 @@
return _ranges[index];
}
-string HokuyoData::AsString (void)
+string HokuyoData::AsString ()
{
stringstream ss;
@@ -818,7 +820,7 @@
return ss.str ();
}
-void HokuyoData::CleanUp (void)
+void HokuyoData::CleanUp ()
{
if (_ranges != NULL)
delete[] _ranges;
@@ -894,13 +896,14 @@
// Public API
////////////////////////////////////////////////////////////////////////////////////////////////////
-HokuyoLaser::HokuyoLaser (void)
- : _port (NULL), _scipVersion (1), _verbose (false), _sensorIsUTM30LX (false),_minAngle (0.0),
- _maxAngle (0.0), _resolution (0.0), _firstStep (0), _lastStep (0), _frontStep (0)
+HokuyoLaser::HokuyoLaser ()
+ : _port (NULL), _scipVersion (2), _verbose (false), _sensorIsUTM30LX (false),
+ _enableCheckSumWorkaround (false), _minAngle (0.0), _maxAngle (0.0), _resolution (0.0),
+ _firstStep (0), _lastStep (0), _frontStep (0)
{
}
-HokuyoLaser::~HokuyoLaser (void)
+HokuyoLaser::~HokuyoLaser ()
{
if (_port != NULL)
delete _port;
@@ -1015,7 +1018,7 @@
return 0;
}
-void HokuyoLaser::Close (void)
+void HokuyoLaser::Close ()
{
if (!_port)
throw HokuyoError (HOKUYO_ERR_CLOSE_FAILED, "Port is not open.");
@@ -1025,7 +1028,7 @@
_port = NULL;
}
-bool HokuyoLaser::IsOpen (void) const
+bool HokuyoLaser::IsOpen () const
{
if (_port != NULL)
return _port->IsOpen ();
@@ -1111,7 +1114,7 @@
throw HokuyoError (HOKUYO_ERR_SCIPVERSION, "Unknown SCIP version.");
}
-void HokuyoLaser::Reset (void)
+void HokuyoLaser::Reset ()
{
if (_scipVersion == 1)
{
@@ -1235,6 +1238,12 @@
// Get the product info line
ReadLine (buffer);
info->product = &buffer[5];
+ // Also do a check to see if this is a UTM-30LX, because we need to work around a checksum
+ // problem and the error messages for data change if this is the case
+ if (strstr (buffer, "UTM-30LX") != NULL)
+ _sensorIsUTM30LX = true;
+ else
+ _sensorIsUTM30LX = false;
// Get the firmware line
ReadLine (buffer);
info->firmware = &buffer[5];
@@ -1324,6 +1333,9 @@
"() Getting sensor information using SCIP version 2." << endl;
}
+ if (_sensorIsUTM30LX)
+ _enableCheckSumWorkaround = true;
+
char buffer[SCIP2_LINE_LENGTH];
memset (buffer, 0, sizeof (char) * SCIP2_LINE_LENGTH);
@@ -1434,6 +1446,9 @@
// Skip the end-of-message
SkipLines (1);
+ if (_sensorIsUTM30LX)
+ _enableCheckSumWorkaround = false;
+
info->CalculateValues ();
if (_verbose)
{
@@ -1445,7 +1460,7 @@
throw HokuyoError (HOKUYO_ERR_SCIPVERSION, "Unknown SCIP version.");
}
-unsigned int HokuyoLaser::GetTime (void)
+unsigned int HokuyoLaser::GetTime ()
{
if (_scipVersion == 1)
{
@@ -1821,7 +1836,7 @@
// To get around this, keep flushing until the port reports there is no data left after a timeout.
// This shouldn't be called too much, as it introduces a delay as big as the timeout (which may be
// infinite).
-void HokuyoLaser::ClearReadBuffer (void)
+void HokuyoLaser::ClearReadBuffer ()
{
while (_port->BytesAvailableWait () > 0)
_port->Flush ();
@@ -1891,6 +1906,11 @@
// Empty lines (i.e. a line that is just the line feed, as at the end of the message) will result in
// a return value of zero and no checksum check will be performed. Otherwise the number of actual
// data bytes (i.e. excluding the checksum and semicolon) will be returned.
+// BIG NOTE: The URG-30LX has a probable bug in its response to the II code whereby it does not
+// include anything after and including "<-" in the checksum calculation. A workaround is enabled
+// in this function when _sensorIsUTM30LX is true. In this case, if the checksum fails normally, it
+// scans the line for "<-" and recalculates the checksum on the bytes up to that point. This only
+// happens in SCIP v2.
int HokuyoLaser::ReadLineWithCheck (char *buffer, int expectedLength, bool hasSemicolon)
{
int lineLength = ReadLine (buffer, expectedLength);
@@ -1923,27 +1943,44 @@
}
int checkSum = 0;
- // Start by adding the byte values
- for (int ii = 0; ii < bytesToConsider; ii++)
- checkSum += buffer[ii];
- // Take the lowest 6 bits
- checkSum &= 0x3F;
- // Add 0x30
- checkSum += 0x30;
-
- if (_verbose)
+ try
{
- cerr << "HokuyoLaser::" << __func__ << "() Calculated checksum = " << checkSum << " (" <<
- static_cast<char> (checkSum) << "), given checksum = " <<
- static_cast<int> (buffer[checksumIndex]) << " (" << buffer[checksumIndex] <<
- ")" << endl;
+ checkSum = ConfirmCheckSum (buffer, bytesToConsider,
+ static_cast<int> (buffer[checksumIndex]));
}
- if (checkSum != static_cast<int> (buffer[checksumIndex]))
+ catch (HokuyoError &e)
{
- stringstream ss;
- ss << "Invalid checksum - given: " << static_cast<int> (buffer[checksumIndex]) <<
- ", calculated: " << checkSum;
- throw HokuyoError (HOKUYO_ERR_PROTOCOL, ss.str ());
+ if (e.Code () == HOKUYO_ERR_PROTOCOL && _sensorIsUTM30LX && _enableCheckSumWorkaround)
+ {
+ // Here comes the UTM-30LX workaround
+ char* hasComment = strstr (buffer, "<-");
+ if (hasComment != NULL)
+ {
+ int newBytesToConsider = hasComment - buffer;
+ if (_verbose)
+ {
+ cerr << "HokuyoLaser::" << __func__ << "() Performing UTM-30LX II response "
+ "checksum workaround: trying with " << newBytesToConsider <<
+ " bytes." << endl;
+ }
+ if (newBytesToConsider < 1)
+ {
+ stringstream ss;
+ ss << "Not enough bytes to calculate checksum with: " << newBytesToConsider <<
+ " bytes (line length is " << lineLength << " bytes).";
+ throw HokuyoError (HOKUYO_ERR_PROTOCOL, ss.str ());
+ }
+
+ checkSum = ConfirmCheckSum (buffer, bytesToConsider,
+ static_cast<int> (buffer[checksumIndex]));
+ }
+ else
+ // Workaround is disabled - rethrow
+ throw;
+ }
+ else
+ // Not a workaround-compatible error - rethrow
+ throw;
}
// Null out the semi-colon (if there) and checksum
@@ -2128,94 +2165,47 @@
return statusCode;
}
-void HokuyoLaser::GetAndSetSCIPVersion (void)
+void HokuyoLaser::GetAndSetSCIPVersion ()
{
- bool scip1Failed = false;
+ bool scip2Failed = false;
if (_verbose)
cerr << "HokuyoLaser::" << __func__ << "() Testing SCIP protocol version." << endl;
- // Try SCIP version 1 first by sending an info command
+ // Try SCIP version 2 first by sending an info command
try
{
- SendCommand ("V", NULL, 0, NULL);
+ SendCommand ("VV", NULL, 0, NULL);
}
catch (HokuyoError)
{
// That didn't work too well...
if (_verbose)
- cerr << "HokuyoLaser::" << __func__ << "() Initial SCIP version 1 test failed." << endl;
- scip1Failed = true;
+ cerr << "HokuyoLaser::" << __func__ << "() Initial SCIP version 2 test failed." << endl;
+ scip2Failed = true;
}
- if (scip1Failed)
+ if (scip2Failed)
{
- // Currently using SCIP version 2
- _scipVersion = 2;
+ // Currently using SCIP version 1
+ // Get the firmware version and check if we can move to SCIP version 2
+ _scipVersion = 1;
_port->Flush ();
- // Make sure by sending a VV command
try
{
- SendCommand ("VV", NULL, 0, NULL);
+ SendCommand ("V", NULL, 0, NULL);
}
catch (HokuyoError)
{
throw HokuyoError (HOKUYO_ERR_SCIPVERSION, "SCIP versions 1 and 2 failed.");
}
-
- // Otherwise all OK, dump the rest of the result
- SkipLines (6);
- if (_verbose)
- cerr << "HokuyoLaser::" << __func__ << "() Using SCIP version 2." << endl;
- return;
- }
- else
- {
- // Currently using SCIP version 1
- // Get the firmware version and check if we can move to SCIP version 2
- _scipVersion = 1;
-
// Skip the vendor and product info
SkipLines (2);
// Get the firmware line
char buffer[SCIP1_LINE_LENGTH];
memset (buffer, 0, sizeof (char) * SCIP1_LINE_LENGTH);
- try
- {
- // If the laser is already in SCIP2 mode this has a tendency to time out (rather than
- // the laser doing what the manual says and giving us an error code to the command
- // that we sent to get the info).
- ReadLine (buffer);
- }
- catch (HokuyoError e)
- {
- if (e.Code () != HOKUYO_ERR_READ) // We're only interested in timeouts
- throw;
- if (_verbose)
- {
- cerr << "HokuyoLaser::" << __func__ <<
- "() Timed out trying SCIP version 1, trying SCIP version 2." << endl;
- }
- // Already in SCIP version 2 mode.
- _scipVersion = 2;
- _port->Flush ();
- // Make sure by sending a VV command
- try
- {
- SendCommand ("VV", NULL, 0, NULL);
- }
- catch (HokuyoError &e)
- {
- cout << "error: " << e.Code() << " " << e.what() << endl;
- throw HokuyoError (HOKUYO_ERR_SCIPVERSION, "SCIP versions 1 and 2 failed.");
- }
- // Otherwise all OK, dump the rest of the result
- SkipLines (6);
- if (_verbose)
- cerr << "HokuyoLaser::" << __func__ << "() Using SCIP version 2." << endl;
- return;
- }
+ ReadLine (buffer);
if (strncmp (buffer, "FIRM:", 5) != 0)
{
@@ -2223,6 +2213,9 @@
"'FIRM:' was not found when checking firmware version.");
}
// Pull out the major version number
+ // Note that although lasers such as the UTM-30LX appear to use a different firmware
+ // version format, that doesn't matter because they don't support SCIP v1 and so
+ // shouldn't get to this point anyway - if they do, it's an uncaught error.
int majorVer = strtol (&buffer[5], NULL, 10);
if (errno == ERANGE)
throw HokuyoError (HOKUYO_ERR_BADFIRMWARE, "Out-of-range firmware version.");
@@ -2271,12 +2264,23 @@
return;
}
}
+ else
+ {
+ // Currently using SCIP version 2
+ _scipVersion = 2;
+ // Dump the rest of the result
+ SkipLines (6);
+ if (_verbose)
+ cerr << "HokuyoLaser::" << __func__ << "() Using SCIP version 2." << endl;
+ return;
+ }
+
// Fallback case if didn't find a good SCIP version and return above
throw HokuyoError (HOKUYO_ERR_SCIPVERSION, "Unknown SCIP version.");
}
-void HokuyoLaser::GetDefaults (void)
+void HokuyoLaser::GetDefaults ()
{
if (_verbose)
cerr << "HokuyoLaser::" << __func__ << "() Getting default values." << endl;
@@ -2536,4 +2540,31 @@
}
}
+int HokuyoLaser::ConfirmCheckSum (char *buffer, int length, int expectedSum)
+{
+ int checkSum = 0;
+ // Start by adding the byte values
+ for (int ii = 0; ii < length; ii++)
+ checkSum += buffer[ii];
+ // Take the lowest 6 bits
+ checkSum &= 0x3F;
+ // Add 0x30
+ checkSum += 0x30;
+
+ if (_verbose)
+ {
+ cerr << "HokuyoLaser::" << __func__ << "() Calculated checksum = " << checkSum << " (" <<
+ static_cast<char> (checkSum) << "), given checksum = " <<
+ static_cast<int> (expectedSum) << " (" << expectedSum << ")" << endl;
+ }
+ if (checkSum != expectedSum)
+ {
+ stringstream ss;
+ ss << "Invalid checksum - given: " << expectedSum << ", calculated: " << checkSum;
+ throw HokuyoError (HOKUYO_ERR_PROTOCOL, ss.str ());
+ }
+
+ return checkSum;
+}
+
} // namespace hokuyo_aist
Modified: gearbox/trunk/src/hokuyo_aist/hokuyo_aist.h
===================================================================
--- gearbox/trunk/src/hokuyo_aist/hokuyo_aist.h 2009-04-08 03:30:00 UTC (rev 389)
+++ gearbox/trunk/src/hokuyo_aist/hokuyo_aist.h 2009-04-14 09:11:54 UTC (rev 390)
@@ -64,19 +64,19 @@
HokuyoError (unsigned int code, std::string desc)
: _errorCode (code), _errorDesc (desc)
{}
- virtual ~HokuyoError (void) throw () {};
+ virtual ~HokuyoError () throw () {};
- virtual unsigned int Code (void) const throw ()
+ virtual unsigned int Code () const throw ()
{
return _errorCode;
}
- virtual const char* what (void) const throw ()
+ virtual const char* what () const throw ()
{
return _errorDesc.c_str ();
}
- virtual std::string AsString (void) const throw();
+ virtual std::string AsString () const throw();
private:
/** Error code. */
@@ -155,14 +155,14 @@
public:
friend class HokuyoLaser;
- HokuyoSensorInfo (void);
+ HokuyoSensorInfo ();
HokuyoSensorInfo (const HokuyoSensorInfo &rhs);
/// @brief Assignment operator.
HokuyoSensorInfo& operator= (const HokuyoSensorInfo &rhs);
/// @brief Format the entire object into a string.
- std::string AsString (void);
+ std::string AsString ();
// Version details.
/// Vendor name.
@@ -223,8 +223,8 @@
unsigned int scanableSteps;
private:
- void SetDefaults (void);
- void CalculateValues (void);
+ void SetDefaults ();
+ void CalculateValues ();
};
/** @brief Structure to store data returned from the laser scanner. */
@@ -234,7 +234,7 @@
friend class HokuyoLaser;
/// This constructor creates an empty HokuyoData with no data currently allocated.
- HokuyoData (void);
+ HokuyoData ();
/// This constructor performs a deep copy of range data.
HokuyoData (uint32_t *ranges, unsigned int length, bool error, unsigned int time);
/// This constructor performs a deep copy of range and intensity data.
@@ -242,27 +242,27 @@
bool error, unsigned int time);
/// This copy constructor performs a deep copy of present data.
HokuyoData (const HokuyoData &rhs);
- ~HokuyoData (void);
+ ~HokuyoData ();
/** @brief Return a pointer to an array of range readings in millimetres.
Values less than 20mm indicate an error. Check the error value for the data to see a
probable cause for the error. Most of the time, it will just be an out-of-range reading. */
- const uint32_t* Ranges (void) const { return _ranges; }
+ const uint32_t* Ranges () const { return _ranges; }
/// @brief Return a pointer to an array of intensity readings.
- const uint32_t* Intensities (void) const { return _intensities; }
+ const uint32_t* Intensities () const { return _intensities; }
/// @brief Get the number of samples in the data.
- unsigned int Length (void) const { return _length; }
+ unsigned int Length () const { return _length; }
/** @brief Indicates if one or more steps had an error.
A step's value will be less than 20 if it had an error. Use @ref ErrorCodeToString to get
a textual representation of the error. */
- bool GetErrorStatus (void) const { return _error; }
+ bool GetErrorStatus () const { return _error; }
/// @brief Return a string representing the error for the given error code.
std::string ErrorCodeToString (uint32_t errorCode);
/** @brief Get the time stamp of the data in milliseconds (only available using SCIP
version 2). */
- unsigned int TimeStamp (void) const { return _time; }
+ unsigned int TimeStamp () const { return _time; }
/// @brief Assignment operator.
HokuyoData& operator= (const HokuyoData &rhs);
@@ -270,10 +270,10 @@
uint32_t operator[] (unsigned int index);
/// @brief Format the entire object into a string.
- std::string AsString (void);
+ std::string AsString ();
/// @brief Force the data to clean up.
- void CleanUp (void);
+ void CleanUp ();
protected:
uint32_t *_ranges;
@@ -300,8 +300,8 @@
class HOKUYO_AIST_EXPORT HokuyoLaser
{
public:
- HokuyoLaser (void);
- ~HokuyoLaser (void);
+ HokuyoLaser ();
+ ~HokuyoLaser ();
/// @brief Open the laser scanner and begin scanning.
void Open (std::string portOptions);
@@ -317,10 +317,10 @@
unsigned int OpenWithProbing (std::string portOptions);
/// @brief Close the connection to the laser scanner.
- void Close (void);
+ void Close ();
/// @brief Checks if the connection to the laser scanner is open.
- bool IsOpen (void) const;
+ bool IsOpen () const;
/// @brief Switch the laser scanner on or off.
void SetPower (bool on);
@@ -334,7 +334,7 @@
/** @brief Reset the laser scanner to its default settings.
Not available with the SCIP v1 protocol. */
- void Reset (void);
+ void Reset ();
/** @brief Set the speed at which the scanner's sensor spins.
@@ -358,7 +358,7 @@
/** @brief Get the current value of the scanner's clock in milliseconds.
Not available with the SCIP v1 protocol. */
- unsigned int GetTime (void);
+ unsigned int GetTime ();
/** @brief Get the latest scan data from the scanner.
@@ -470,11 +470,11 @@
double endAngle, unsigned int clusterCount = 1);
/// @brief Return the major version of the SCIP protocol in use.
- uint8_t SCIPVersion (void) const { return _scipVersion; }
+ uint8_t SCIPVersion () const { return _scipVersion; }
/** @brief Turns on and off printing of verbose operating information to stderr. Default is
off. */
- void SetVerbose (bool verbose) { _verbose = verbose; }
+ void SetVerbose (bool verbose) { _verbose = verbose; }
/// @brief A convenience function to convert a step index to an angle.
double StepToAngle (unsigned int step);
@@ -485,22 +485,24 @@
flexiport::Port *_port;
uint8_t _scipVersion;
- bool _verbose, _sensorIsUTM30LX;
+ bool _verbose, _sensorIsUTM30LX, _enableCheckSumWorkaround;
double _minAngle, _maxAngle, _resolution;
int _firstStep, _lastStep, _frontStep;
unsigned int _maxRange;
- void ClearReadBuffer (void);
+ void ClearReadBuffer ();
int ReadLine (char *buffer, int expectedLength = -1);
int ReadLineWithCheck (char *buffer, int expectedLength = -1, bool hasSemicolon = false);
void SkipLines (int count);
int SendCommand (const char *cmd, const char *param, int paramLength, const char *extraOK);
- void GetAndSetSCIPVersion (void);
- void GetDefaults (void);
+ void GetAndSetSCIPVersion ();
+ void GetDefaults ();
void Read2ByteRangeData (HokuyoData *data, unsigned int numSteps);
void Read3ByteRangeData (HokuyoData *data, unsigned int numSteps);
void Read3ByteRangeAndIntensityData (HokuyoData *data, unsigned int numSteps);
+
+ int ConfirmCheckSum (char *buffer, int length, int expectedSum);
};
} // namespace hokuyo_aist
Modified: gearbox/trunk/src/hokuyo_aist/python/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/hokuyo_aist/python/CMakeLists.txt 2009-04-08 03:30:00 UTC (rev 389)
+++ gearbox/trunk/src/hokuyo_aist/python/CMakeLists.txt 2009-04-14 09:11:54 UTC (rev 390)
@@ -20,8 +20,6 @@
GET_FILENAME_COMPONENT (boostPythonLib ${Boost_PYTHON_LIBRARY} NAME_WE CACHE)
# Chop off the lib at the front, too, if present
STRING (REGEX REPLACE "^lib" "" boostPythonLib ${boostPythonLib})
- MESSAGE (STATUS
- "PlayerC++ client library will be built with Boost::Thread support.")
else(Boost_PYTHON_FOUND)
MESSAGE (STATUS
"Boost::Python library was not found. Cannot build Python bindings for Hokuyo_aist.")
@@ -66,4 +64,4 @@
ADD_SUBDIRECTORY (test)
ELSEIF(NOT GBX_DEFAULT_LIB_TYPE STREQUAL SHARED)
MESSAGE (STATUS "Hokuyo_aist Python bindings will not be built - must build hokuyo_aist as a shared library.")
-endif(PYTHON_LIBRARIES AND Boost_FOUND AND GBX_DEFAULT_LIB_TYPE STREQUAL SHARED)
\ No newline at end of file
+endif(PYTHON_LIBRARIES AND Boost_FOUND AND GBX_DEFAULT_LIB_TYPE STREQUAL SHARED)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2009-04-08 03:30:07
|
Revision: 389
http://gearbox.svn.sourceforge.net/gearbox/?rev=389&view=rev
Author: russo2503v
Date: 2009-04-08 03:30:00 +0000 (Wed, 08 Apr 2009)
Log Message:
-----------
checking if policy exists
Modified Paths:
--------------
gearbox/trunk/cmake/internal/Setup.cmake
Modified: gearbox/trunk/cmake/internal/Setup.cmake
===================================================================
--- gearbox/trunk/cmake/internal/Setup.cmake 2009-04-06 02:08:34 UTC (rev 388)
+++ gearbox/trunk/cmake/internal/Setup.cmake 2009-04-08 03:30:00 UTC (rev 389)
@@ -8,9 +8,11 @@
# Set CMake policies
# For help on policy CMPxxxx: $ cmake --help-policy CMPxxxx
#
-if(COMMAND cmake_policy)
- cmake_policy(SET CMP0011 NEW)
-endif(COMMAND cmake_policy)
+if( COMMAND cmake_policy )
+ if( POLICY CMP0011 )
+ cmake_policy(SET CMP0011 NEW )
+ endif( POLICY CMP0011 )
+endif( COMMAND cmake_policy )
set( GBX_CMAKE_DIR ${${PROJECT_NAME}_SOURCE_DIR}/cmake CACHE INTERNAL "Location of CMake scripts" )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bo...@us...> - 2009-04-06 02:08:49
|
Revision: 388
http://gearbox.svn.sourceforge.net/gearbox/?rev=388&view=rev
Author: borax00
Date: 2009-04-06 02:08:34 +0000 (Mon, 06 Apr 2009)
Log Message:
-----------
allowed monolithic builds, simplified dependency checking.
Modified Paths:
--------------
gearbox/trunk/CMakeLists.txt
gearbox/trunk/cmake/Assert.cmake
gearbox/trunk/cmake/CMakeLists.txt
gearbox/trunk/cmake/CheckCompiler.cmake
gearbox/trunk/cmake/DependencyUtils.cmake
gearbox/trunk/cmake/FindGearbox.cmake
gearbox/trunk/cmake/FindIceUtil.cmake
gearbox/trunk/cmake/SetupBuildType.cmake
gearbox/trunk/cmake/SetupDirectories.cmake
gearbox/trunk/cmake/SetupOs.cmake
gearbox/trunk/cmake/SetupVersion.cmake
gearbox/trunk/cmake/TargetUtils.cmake
gearbox/trunk/cmake/UseBasicRules.cmake
gearbox/trunk/cmake/UseGearbox.cmake
gearbox/trunk/cmake/UseIceUtil.cmake
gearbox/trunk/cmake/WriteConfigH.cmake
gearbox/trunk/cmake/internal/Setup.cmake
gearbox/trunk/doc/history.dox
gearbox/trunk/retired/CMakeLists.txt
gearbox/trunk/src/CMakeLists.txt
gearbox/trunk/src/basicexample/CMakeLists.txt
gearbox/trunk/src/flexiport/CMakeLists.txt
gearbox/trunk/src/flexiport/python/CMakeLists.txt
gearbox/trunk/src/flexiport/python/test/CMakeLists.txt
gearbox/trunk/src/flexiport/test/CMakeLists.txt
gearbox/trunk/src/flexiport/utils/CMakeLists.txt
gearbox/trunk/src/gbxadvancedexample/CMakeLists.txt
gearbox/trunk/src/gbxgarminacfr/CMakeLists.txt
gearbox/trunk/src/gbxgarminacfr/test/CMakeLists.txt
gearbox/trunk/src/gbxnovatelacfr/CMakeLists.txt
gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/CMakeLists.txt
gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/test/CMakeLists.txt
gearbox/trunk/src/gbxnovatelacfr/test/CMakeLists.txt
gearbox/trunk/src/gbxserialacfr/CMakeLists.txt
gearbox/trunk/src/gbxserialacfr/lockfile/CMakeLists.txt
gearbox/trunk/src/gbxserialacfr/lockfile/test/CMakeLists.txt
gearbox/trunk/src/gbxserialacfr/test/CMakeLists.txt
gearbox/trunk/src/gbxsickacfr/CMakeLists.txt
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/CMakeLists.txt
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/CMakeLists.txt
gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/CMakeLists.txt
gearbox/trunk/src/gbxsickacfr/test/CMakeLists.txt
gearbox/trunk/src/gbxsmartbatteryacfr/CMakeLists.txt
gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverparser.cpp
gearbox/trunk/src/gbxsmartbatteryacfr/test/CMakeLists.txt
gearbox/trunk/src/gbxsmartbatteryacfr/test/darttest/CMakeLists.txt
gearbox/trunk/src/gbxutilacfr/CMakeLists.txt
gearbox/trunk/src/gbxutilacfr/test/CMakeLists.txt
gearbox/trunk/src/hokuyo_aist/CMakeLists.txt
gearbox/trunk/src/hokuyo_aist/python/CMakeLists.txt
gearbox/trunk/src/hokuyo_aist/python/test/CMakeLists.txt
gearbox/trunk/src/hokuyo_aist/test/CMakeLists.txt
gearbox/trunk/submitted/CMakeLists.txt
Modified: gearbox/trunk/CMakeLists.txt
===================================================================
--- gearbox/trunk/CMakeLists.txt 2009-03-28 01:44:55 UTC (rev 387)
+++ gearbox/trunk/CMakeLists.txt 2009-04-06 02:08:34 UTC (rev 388)
@@ -11,9 +11,9 @@
#
# project version string
#
-SET( GBX_PROJECT_VERSION 9.02+ CACHE STRING "Version of GearBox distribution" )
+set( GBX_PROJECT_VERSION 9.02+ )
#
# The rest is done by a script
#
-INCLUDE( cmake/internal/Setup.cmake )
+include( cmake/internal/Setup.cmake )
Modified: gearbox/trunk/cmake/Assert.cmake
===================================================================
--- gearbox/trunk/cmake/Assert.cmake 2009-03-28 01:44:55 UTC (rev 387)
+++ gearbox/trunk/cmake/Assert.cmake 2009-04-06 02:08:34 UTC (rev 388)
@@ -1,32 +1,32 @@
#
# GBX_ASSERT( TEST COMMENT_FAIL [COMMENT_PASS=''] [IS_FATAL=FALSE] )
#
-MACRO( GBX_ASSERT TEST COMMENT_FAIL )
+macro( GBX_ASSERT TEST COMMENT_FAIL )
- IF( ${TEST} )
-# MESSAGE( STATUS "DEBUG: assertion passed : ${TEST}" )
+ if( ${TEST} )
+# message( STATUS "DEBUG: assertion passed : ${TEST}" )
# ARG2 holds COMMENT_PASS
- IF( ${ARGC} GREATER 2 )
- MESSAGE( STATUS ${ARGV2} )
- ENDIF( ${ARGC} GREATER 2 )
+ if( ${ARGC} GREATER 2 )
+ message( STATUS ${ARGV2} )
+ endif( ${ARGC} GREATER 2 )
- ELSE ( ${TEST} )
-# MESSAGE( STATUS "DEBUG: assertion failed : ${TEST}" )
+ else( ${TEST} )
+# message( STATUS "DEBUG: assertion failed : ${TEST}" )
- SET( IS_FATAL 0 )
- IF( ${ARGC} GREATER 3 )
- SET( IS_FATAL ${ARGV3} )
- ENDIF( ${ARGC} GREATER 3 )
+ set( IS_FATAL 0 )
+ if( ${ARGC} GREATER 3 )
+ set( IS_FATAL ${ARGV3} )
+ endif( ${ARGC} GREATER 3 )
- IF( ${IS_FATAL} )
-# MESSAGE( STATUS "DEBUG: failure is fatal : ${IS_FATAL}" )
- MESSAGE( FATAL_ERROR ${COMMENT_FAIL} )
- ELSE ( ${IS_FATAL} )
-# MESSAGE( STATUS "DEBUG: failure is NOT fatal : ${IS_FATAL}" )
- MESSAGE( STATUS ${COMMENT_FAIL} )
- ENDIF( ${IS_FATAL} )
+ if( ${IS_FATAL} )
+# message( STATUS "DEBUG: failure is fatal : ${IS_FATAL}" )
+ message( FATAL_ERROR ${COMMENT_FAIL} )
+ else( ${IS_FATAL} )
+# message( STATUS "DEBUG: failure is NOT fatal : ${IS_FATAL}" )
+ message( STATUS ${COMMENT_FAIL} )
+ endif( ${IS_FATAL} )
- ENDIF( ${TEST} )
+ endif( ${TEST} )
-ENDMACRO( GBX_ASSERT )
+endmacro( GBX_ASSERT )
Modified: gearbox/trunk/cmake/CMakeLists.txt
===================================================================
--- gearbox/trunk/cmake/CMakeLists.txt 2009-03-28 01:44:55 UTC (rev 387)
+++ gearbox/trunk/cmake/CMakeLists.txt 2009-04-06 02:08:34 UTC (rev 388)
@@ -1,5 +1,5 @@
#
# Install all .cmake files, so other projects can use them.
#
-FILE( GLOB scripts *.cmake )
+file( GLOB scripts *.cmake )
GBX_ADD_SHARED_FILES( cmake ${scripts} )
Modified: gearbox/trunk/cmake/CheckCompiler.cmake
===================================================================
--- gearbox/trunk/cmake/CheckCompiler.cmake 2009-03-28 01:44:55 UTC (rev 387)
+++ gearbox/trunk/cmake/CheckCompiler.cmake 2009-04-06 02:08:34 UTC (rev 388)
@@ -1,28 +1,28 @@
#
# If we're using gcc, make sure the version is OK.
#
-IF( ${CMAKE_C_COMPILER} MATCHES gcc )
+if( ${CMAKE_C_COMPILER} MATCHES gcc )
- EXEC_PROGRAM ( ${CMAKE_C_COMPILER} ARGS --version OUTPUT_VARIABLE gcc_version )
- MESSAGE( STATUS "gcc version: ${gcc_version}")
+ exec_program ( ${CMAKE_C_COMPILER} ARGS --version OUTPUT_VARIABLE gcc_version )
+ message( STATUS "gcc version: ${gcc_version}")
# Why doesn't this work?
- #STRING( REGEX MATCHALL "gcc\.*" VERSION_STRING ${CMAKE_C_COMPILER} )
+ #string( REGEX MATCHALL "gcc\.*" VERSION_STRING ${CMAKE_C_COMPILER} )
- IF( gcc_version MATCHES ".*4\\.[0-9]\\.[0-9]" )
- SET( GCC_VERSION_OK 1 )
- ENDIF( gcc_version MATCHES ".*4\\.[0-9]\\.[0-9]")
+ if( gcc_version MATCHES ".*4\\.[0-9]\\.[0-9]" )
+ set( GCC_VERSION_OK 1 )
+ endif( gcc_version MATCHES ".*4\\.[0-9]\\.[0-9]")
GBX_ASSERT ( GCC_VERSION_OK
"Checking gcc version - failed. ${PROJECT_NAME} requires gcc v. 4.x"
"Checking gcc version - ok"
1 )
- IF( gcc_version MATCHES ".*4\\.0.*" )
+ if( gcc_version MATCHES ".*4\\.0.*" )
# gcc 4.0.x
- ENDIF( gcc_version MATCHES ".*4\\.0.*" )
+ endif( gcc_version MATCHES ".*4\\.0.*" )
- IF( gcc_version MATCHES ".*4\\.1.*" )
+ if( gcc_version MATCHES ".*4\\.1.*" )
# gcc 4.1.x
# gcc-4.1 adds stack protection, which makes code robust to buffer-overrun attacks
# (see: http://www.trl.ibm.com/projects/security/ssp/)
@@ -30,8 +30,8 @@
# So turn it off.
# Tobi: it looks like stack protection is off by default from version gcc 4.1.2, so we don't need this any more.
# Will keep it for now, it doesn't hurt.
- ADD_DEFINITIONS( -fno-stack-protector )
- ENDIF( gcc_version MATCHES ".*4\\.1.*" )
+ add_definitions( -fno-stack-protector )
+ endif( gcc_version MATCHES ".*4\\.1.*" )
-ENDIF( ${CMAKE_C_COMPILER} MATCHES gcc )
+endif( ${CMAKE_C_COMPILER} MATCHES gcc )
Modified: gearbox/trunk/cmake/DependencyUtils.cmake
===================================================================
--- gearbox/trunk/cmake/DependencyUtils.cmake 2009-03-28 01:44:55 UTC (rev 387)
+++ gearbox/trunk/cmake/DependencyUtils.cmake 2009-04-06 02:08:34 UTC (rev 388)
@@ -1,261 +1,344 @@
#
-# utility macro
+# This is a utility macro for internal use.
#
-MACRO( GBX_MAKE_OPTION_NAME option_name module_type module_name )
+macro( GBX_MAKE_OPTION_NAME option_name module_type module_name )
+# message( STATUS "GBX_MAKE_OPTION_NAME [ option_name=${option_name}, MOT_TYPE=${module_type}, MOD_NAME=${module_name} ]" )
- STRING( COMPARE EQUAL ${module_type} "EXE" is_exe )
- STRING( COMPARE EQUAL ${module_type} "LIB" is_lib )
- IF( NOT is_exe AND NOT is_lib )
- MESSAGE( FATAL_ERROR "In macro GBX_MAKE_OPTION_NAME, module_type must be either 'EXE' or 'LIB'" )
- ENDIF( NOT is_exe AND NOT is_lib )
- IF( is_exe AND is_lib )
- MESSAGE( FATAL_ERROR "In macro GBX_MAKE_OPTION_NAME, module_type must be either 'EXE' or 'LIB'" )
- ENDIF( is_exe AND is_lib )
+ string( COMPARE EQUAL ${module_type} "EXE" is_exe )
+ string( COMPARE EQUAL ${module_type} "LIB" is_lib )
+ if( NOT is_exe AND NOT is_lib )
+ message( FATAL_ERROR "In macro GBX_MAKE_OPTION_NAME, module_type must be either 'EXE' or 'LIB'" )
+ endif( NOT is_exe AND NOT is_lib )
+ if( is_exe AND is_lib )
+ message( FATAL_ERROR "In macro GBX_MAKE_OPTION_NAME, module_type must be either 'EXE' or 'LIB'" )
+ endif( is_exe AND is_lib )
- STRING( TOUPPER ${module_name} module_name_upper )
- IF( is_exe )
- SET( option_name "ENABLE_${module_name_upper}" )
- ELSE ( is_exe )
- SET( option_name "ENABLE_LIB_${module_name_upper}" )
- ENDIF( is_exe )
+ string( TOUPPER ${module_name} module_name_upper )
+ # dereference the variable name once, so that we are setting the variable in the calling context!
+ if( is_exe )
+ set( ${option_name} "ENABLE_${module_name_upper}" )
+ else( is_exe )
+ set( ${option_name} "ENABLE_LIB_${module_name_upper}" )
+ endif( is_exe )
-ENDMACRO( GBX_MAKE_OPTION_NAME option_name module_name )
+# message( STATUS "GBX_MAKE_OPTION_NAME output: option_name=${${option_name}}" )
+endmacro( GBX_MAKE_OPTION_NAME option_name module_name )
#
+# This is a utility macro for internal use.
+# (there's another copy of this simple macro in TargetUtils.cmake)
+#
+macro( GBX_MAKE_MANIFEST_NAME manifest_name module_name )
+# message( STATUS "GBX_MAKE_MANIFEST_NAME [ manifest_name=${manifest_name}, MOD_NAME=${module_name} ]" )
+
+ string( TOUPPER ${module_name} module_name_upper )
+ # dereference the variable name once, so that we are setting the variable in the calling context!
+ set( ${manifest_name} ${module_name_upper}_INSTALLED )
+
+# message( STATUS "GBX_MAKE_MANIFEST_NAME output: manifest_name=${${manifest_name}}" )
+endmacro( GBX_MAKE_MANIFEST_NAME manifest_name module_name )
+
+#
# GBX_REQUIRE_OPTION( cumulative_var [EXE | LIB] module_name default_option_value [option_name] [OPTION DESCRIPTION] )
#
# E.g.
# Initialize a variable first
-# SET( BUILD TRUE )
+# set( build TRUE )
# Now set up and test option value
-# GBX_REQUIRE_OPTION ( BUILD EXE localiser ON )
+# GBX_REQUIRE_OPTION ( build EXE localiser ON )
# This does the same thing
-# GBX_REQUIRE_OPTION ( BUILD EXE localiser ON BUILD_LOCALISER )
+# GBX_REQUIRE_OPTION ( build EXE localiser ON BUILD_LOCALISER )
#
-MACRO( GBX_REQUIRE_OPTION cumulative_var module_type module_name default_option_value )
+macro( GBX_REQUIRE_OPTION cumulative_var module_type module_name default_option_value )
- STRING( COMPARE EQUAL ${module_type} "EXE" is_exe )
- STRING( COMPARE EQUAL ${module_type} "LIB" is_lib )
- IF( NOT is_exe AND NOT is_lib )
- MESSAGE( FATAL_ERROR "In macro GBX_REQUIRE_OPTION, module_type must be either 'EXE' or 'LIB'" )
- ENDIF( NOT is_exe AND NOT is_lib )
- IF( is_exe AND is_lib )
- MESSAGE( FATAL_ERROR "In macro GBX_REQUIRE_OPTION, module_type must be either 'EXE' or 'LIB'" )
- ENDIF( is_exe AND is_lib )
+ string( COMPARE EQUAL ${module_type} "EXE" is_exe )
+ string( COMPARE EQUAL ${module_type} "LIB" is_lib )
+ if( NOT is_exe AND NOT is_lib )
+ message( FATAL_ERROR "In macro GBX_REQUIRE_OPTION, module_type must be either 'EXE' or 'LIB'" )
+ endif( NOT is_exe AND NOT is_lib )
+ if( is_exe AND is_lib )
+ message( FATAL_ERROR "In macro GBX_REQUIRE_OPTION, module_type must be either 'EXE' or 'LIB'" )
+ endif( is_exe AND is_lib )
- IF( ${ARGC} GREATER 5 )
- SET( option_name ${ARGV6} )
- ELSE ( ${ARGC} GREATER 5 )
- STRING( TOUPPER ${module_name} module_name_upper )
- IF( is_exe )
- SET( option_name "ENABLE_${module_name_upper}" )
- ELSE ( is_exe )
- SET( option_name "ENABLE_LIB_${module_name_upper}" )
- ENDIF( is_exe )
- ENDIF( ${ARGC} GREATER 5 )
+ if( ${ARGC} GREATER 5 )
+ set( option_name ${ARGV6} )
+ else( ${ARGC} GREATER 5 )
+ GBX_MAKE_OPTION_NAME( option_name ${module_type} ${module_name} )
+ endif( ${ARGC} GREATER 5 )
- IF( ${ARGC} GREATER 6 )
- SET( option_descr ${ARGV7} )
- ELSE ( ${ARGC} GREATER 6 )
- SET( option_descr "disabled by user, use ccmake to enable" )
- ENDIF( ${ARGC} GREATER 6 )
+ if( ${ARGC} GREATER 6 )
+ set( option_descr ${ARGV7} )
+ else( ${ARGC} GREATER 6 )
+ set( option_descr "disabled by user, use ccmake to enable" )
+ endif( ${ARGC} GREATER 6 )
# debug
-# MESSAGE( STATUS
+# message( STATUS
# "GBX_REQUIRE_OPTION (CUM_VAR=${cumulative_var}, MOD_TYPE=${module_type}, MOD_NAME=${module_name}, default_option_value=${default_option_value}, OPT_NAME=${option_name}, OPT_DESC=${option_descr})" )
# set up the option
- IF( is_exe )
- OPTION( ${option_name} "Try to build ${module_name}" ${default_option_value} )
- ELSE ( is_exe )
- OPTION( ${option_name} "Try to build lib${module_name} library" ${default_option_value} )
- ENDIF( is_exe )
+ if( is_exe )
+ option( ${option_name} "Try to build ${module_name}" ${default_option_value} )
+ else( is_exe )
+ option( ${option_name} "Try to build lib${module_name} library" ${default_option_value} )
+ endif( is_exe )
# add option to the list: this has nothing to do with the build system.
# it is useful to have a text list of all options if you want to build a particular
# configuration from the command line.
- SET( templist ${OPTION_LIST} )
+ set( templist ${OPTION_LIST} )
# (escaping \)
- LIST( APPEND templist "${option_name}=${default_option_value}" )
- SET( OPTION_LIST ${templist} CACHE INTERNAL "Global list of cmake options" FORCE )
+ list( APPEND templist "${option_name}=${default_option_value}" )
+ set( OPTION_LIST ${templist} CACHE INTERNAL "Global list of cmake options" FORCE )
# must dereference both var and option names once (!) and IF will evaluate their values
- IF( ${cumulative_var} AND NOT ${option_name} )
- SET( ${cumulative_var} FALSE )
- IF( is_exe )
- GBX_NOT_ADD_EXECUTABLE( ${module_name} ${option_descr} )
- ELSE ( is_exe )
- GBX_NOT_ADD_LIBRARY( ${module_name} ${option_descr} )
- ENDIF( is_exe )
- ENDIF( ${cumulative_var} AND NOT ${option_name} )
+ if( ${cumulative_var} AND NOT ${option_name} )
+ set( ${cumulative_var} FALSE )
+ if( is_exe )
+ GBX_NOT_add_executable( ${module_name} ${option_descr} )
+ else( is_exe )
+ GBX_NOT_add_library( ${module_name} ${option_descr} )
+ endif( is_exe )
+ endif( ${cumulative_var} AND NOT ${option_name} )
-ENDMACRO( GBX_REQUIRE_OPTION cumulative_var module_type module_name default_option_value )
+endmacro( GBX_REQUIRE_OPTION cumulative_var module_type module_name default_option_value )
#
# GBX_REQUIRE_VAR ( cumulative_var [EXE | LIB] module_name test_var reason )
#
# E.g.
# Initialize a variable first
-# SET( BUILD TRUE )
+# set( build TRUE )
# Now test the variable value
-# GBX_REQUIRE_VAR ( BUILD LIB HydroStuff GOOD_TO_GO "good-to-go is no good" )
+# GBX_REQUIRE_VAR ( build LIB HydroStuff GOOD_TO_GO "good-to-go is no good" )
#
-MACRO( GBX_REQUIRE_VAR cumulative_var module_type module_name test_var reason )
+macro( GBX_REQUIRE_VAR cumulative_var module_type module_name test_var reason )
# debug
-# MESSAGE( STATUS "GBX_REQUIRE_VAR [ CUM_VAR=${cumulative_var}, MOD_TYPE=${module_type}, MOD_NAME=${module_name}, test_var=${${test_var}}, reason=${reason} ]" )
+# message( STATUS "GBX_REQUIRE_VAR [ CUM_VAR=${cumulative_var}, MOD_TYPE=${module_type}, MOD_NAME=${module_name}, test_var=${${test_var}}, reason=${reason} ]" )
- STRING( COMPARE EQUAL ${module_type} "EXE" is_exe )
- STRING( COMPARE EQUAL ${module_type} "LIB" is_lib )
- IF( NOT is_exe AND NOT is_lib )
- MESSAGE( FATAL_ERROR "In macro GBX_REQUIRE_VAR, module_type must be either 'EXE' or 'LIB'" )
- ENDIF( NOT is_exe AND NOT is_lib )
- IF( is_exe AND is_lib )
- MESSAGE( FATAL_ERROR "In macro GBX_REQUIRE_VAR, module_type must be either 'EXE' or 'LIB'" )
- ENDIF( is_exe AND is_lib )
+ string( COMPARE EQUAL ${module_type} "EXE" is_exe )
+ string( COMPARE EQUAL ${module_type} "LIB" is_lib )
+ if( NOT is_exe AND NOT is_lib )
+ message( FATAL_ERROR "In macro GBX_REQUIRE_VAR, module_type must be either 'EXE' or 'LIB'" )
+ endif( NOT is_exe AND NOT is_lib )
+ if( is_exe AND is_lib )
+ message( FATAL_ERROR "In macro GBX_REQUIRE_VAR, module_type must be either 'EXE' or 'LIB'" )
+ endif( is_exe AND is_lib )
# must dereference both var names once (!) and IF will evaluate their values
- IF( ${cumulative_var} AND NOT ${test_var} )
- SET( ${cumulative_var} FALSE )
- IF( is_exe )
- GBX_NOT_ADD_EXECUTABLE( ${module_name} ${reason} )
- ELSE ( is_exe )
- GBX_NOT_ADD_LIBRARY( ${module_name} ${reason} )
- ENDIF( is_exe )
- ENDIF( ${cumulative_var} AND NOT ${test_var} )
+ if( ${cumulative_var} AND NOT ${test_var} )
+ set( ${cumulative_var} FALSE )
+ if( is_exe )
+ GBX_NOT_add_executable( ${module_name} ${reason} )
+ else( is_exe )
+ GBX_NOT_add_library( ${module_name} ${reason} )
+ endif( is_exe )
+ endif( ${cumulative_var} AND NOT ${test_var} )
-ENDMACRO( GBX_REQUIRE_VAR cumulative_var module_type module_name test_var reason )
+endmacro( GBX_REQUIRE_VAR cumulative_var module_type module_name test_var reason )
#
-# GBX_REQUIRE_INSTALL ( cumulative_var [EXE | LIB] module_name installed_module [reason] )
+# GBX_REQUIRE_install( cumulative_var [EXE | LIB] module_name installed_module [reason] )
#
# A special case of REQUIRE_VAR. Checks whether a manifest variable is defined
# for the module with a name "installed_module".
# E.g.
# Initialize a variable first
-# SET( BUILD TRUE )
+# set( build TRUE )
# Now test the variable value
-# REQUIRE_INSTALL ( build LIB HydroStuff GbxStuff )
+# REQUIRE_install( build LIB HydroStuff GbxStuff )
# will check if GBXSTUFF_INSTALLED is defined.
# This example is equivalent to
# REQUIRE_VAR( build LIB HydroStuff GBXSTUFF_INSTALLED "GbxStuff was not installed" )
#
-MACRO( GBX_REQUIRE_INSTALL cumulative_var module_type module_name installed_module )
+macro( GBX_REQUIRE_INSTALL cumulative_var module_type module_name installed_module )
# debug
-# MESSAGE( STATUS "REQUIRE_INSTALL [ CUM_VAR=${cumulative_var}, MOD_TYPE=${module_type}, MOD_NAME=${module_name}, installed_module=${installed_module} ]" )
+# message( STATUS "GBX_REQUIRE_INSTALL [ CUM_VAR=${cumulative_var}, MOD_TYPE=${module_type}, MOD_NAME=${module_name}, installed_module=${installed_module} ]" )
- STRING( TOUPPER ${installed_module} upper_installed_module )
- SET( test_var ${upper_installed_module}_INSTALLED )
+ GBX_MAKE_MANIFEST_NAME( test_var ${installed_module} )
- IF( ${ARGC} GREATER 5 )
- SET( reason ${ARGV6} )
- ELSE ( ${ARGC} GREATER 5 )
- SET( reason "${installed_module} was not installed" )
- ENDIF( ${ARGC} GREATER 5 )
+ if( ${ARGC} GREATER 5 )
+ set( reason ${ARGV6} )
+ else( ${ARGC} GREATER 5 )
+ set( reason "${installed_module} was not installed" )
+ endif( ${ARGC} GREATER 5 )
# must dereference both var names once (!)
GBX_REQUIRE_VAR( ${cumulative_var} ${module_type} ${module_name} ${test_var} ${reason} )
-ENDMACRO( GBX_REQUIRE_INSTALL cumulative_var module_type module_name installed_module )
+endmacro( GBX_REQUIRE_INSTALL cumulative_var module_type module_name installed_module )
#
# GBX_REQUIRE_INSTALLS( cumulative_var [EXE | LIB] module_name target0 [targe1 target2 ...] )
#
-MACRO( GBX_REQUIRE_INSTALLS cumulative_var module_type module_name )
+macro( GBX_REQUIRE_INSTALLS cumulative_var module_type module_name )
- IF( ${ARGC} LESS 4 )
- MESSAGE( FATAL_ERROR "GBX_REQUIRE_INSTALLS macro needs to at least one target name (${ARGC} params were given)." )
- ENDIF( ${ARGC} LESS 4 )
+ if( ${ARGC} LESS 4 )
+ message( FATAL_ERROR "GBX_REQUIRE_INSTALLS macro needs to at least one target name (${ARGC} params were given)." )
+ endif( ${ARGC} LESS 4 )
- FOREACH( TRGT ${ARGN} )
- GBX_REQUIRE_INSTALL( ${cumulative_var} ${module_type} ${module_name} ${TRGT} )
- ENDFOREACH( TRGT ${ARGN} )
+ foreach( trgt ${ARGN} )
+ GBX_REQUIRE_install( ${cumulative_var} ${module_type} ${module_name} ${trgt} )
+ endforeach( trgt ${ARGN} )
-ENDMACRO( GBX_REQUIRE_INSTALLS cumulative_var module_type module_name )
+endmacro( GBX_REQUIRE_INSTALLS cumulative_var module_type module_name )
#
# GBX_REQUIRE_TARGET( cumulative_var [EXE | LIB] module_name target_name [reason] )
-#DEPS
+#
# E.g.
# Initialize a variable first
-# SET( BUILD TRUE )
+# set( build TRUE )
# Now set up and test option value
-# GBX_REQUIRE_TARGET ( BUILD EXE localiser HydroStuff )
+# GBX_REQUIRE_TARGET ( build EXE localiser HydroStuff )
#
-MACRO( GBX_REQUIRE_TARGET cumulative_var module_type module_name target_name )
+macro( GBX_REQUIRE_TARGET cumulative_var module_type module_name target_name )
# debug
-# MESSAGE( STATUS "GBX_REQUIRE_TARGET [ CUM_VAR=${${cumulative_var}}, MOD_TYPE=${module_type}, MOD_NAME=${module_name}, target_name=${target_name} ]" )
+# message( STATUS "GBX_REQUIRE_TARGET [ CUM_VAR=${${cumulative_var}}, MOD_TYPE=${module_type}, MOD_NAME=${module_name}, target_name=${target_name} ]" )
- STRING( COMPARE EQUAL ${module_type} "EXE" is_exe )
- STRING( COMPARE EQUAL ${module_type} "LIB" is_lib )
- IF( NOT is_exe AND NOT is_lib )
- MESSAGE( FATAL_ERROR "In macro GBX_REQUIRE_TARGET, module_type must be either 'EXE' or 'LIB'" )
- ENDIF( NOT is_exe AND NOT is_lib )
- IF( is_exe AND is_lib )
- MESSAGE( FATAL_ERROR "In macro GBX_REQUIRE_TARGET, module_type must be either 'EXE' or 'LIB'" )
- ENDIF( is_exe AND is_lib )
+ string( COMPARE EQUAL ${module_type} "EXE" is_exe )
+ string( COMPARE EQUAL ${module_type} "LIB" is_lib )
+ if( NOT is_exe AND NOT is_lib )
+ message( FATAL_ERROR "In macro GBX_REQUIRE_TARGET, module_type must be either 'EXE' or 'LIB'" )
+ endif( NOT is_exe AND NOT is_lib )
+ if( is_exe AND is_lib )
+ message( FATAL_ERROR "In macro GBX_REQUIRE_TARGET, module_type must be either 'EXE' or 'LIB'" )
+ endif( is_exe AND is_lib )
- IF( ${ARGC} GREATER 5 )
- SET( reason ${ARGV6} )
- ELSE ( ${ARGC} GREATER 5 )
- SET( reason "lib${target_name} is not being built" )
- ENDIF( ${ARGC} GREATER 5 )
+ if( ${ARGC} GREATER 5 )
+ set( reason ${ARGV6} )
+ else( ${ARGC} GREATER 5 )
+ set( reason "${target_name} is not being built" )
+ endif( ${ARGC} GREATER 5 )
GET_TARGET_PROPERTY( target_location ${target_name} LOCATION )
# must dereference both var and option names once (!) and IF will evaluate their values
- IF( ${cumulative_var} AND NOT target_location )
- SET( ${cumulative_var} FALSE )
+ if( ${cumulative_var} AND NOT target_location )
+ set( ${cumulative_var} FALSE )
GBX_MAKE_OPTION_NAME( option_name ${module_type} ${module_name} )
- IF( is_exe )
- GBX_NOT_ADD_EXECUTABLE( ${module_name} ${reason} )
- SET( ${option_name} OFF CACHE BOOL "Try to build ${module_name}" FORCE )
- ELSE ( is_exe )
- GBX_NOT_ADD_LIBRARY( ${module_name} ${reason} )
- SET( ${option_name} OFF CACHE BOOL "Try to build lib${module_name} library" FORCE )
- ENDIF( is_exe )
- ENDIF( ${cumulative_var} AND NOT target_location )
+ if( is_exe )
+ GBX_NOT_add_executable( ${module_name} ${reason} )
+ set( ${option_name} OFF CACHE BOOL "Try to build ${module_name}" FORCE )
+ else( is_exe )
+ GBX_NOT_add_library( ${module_name} ${reason} )
+ set( ${option_name} OFF CACHE BOOL "Try to build lib${module_name} library" FORCE )
+ endif( is_exe )
+ endif( ${cumulative_var} AND NOT target_location )
-ENDMACRO( GBX_REQUIRE_TARGET cumulative_var module_type module_name target_name )
+endmacro( GBX_REQUIRE_TARGET cumulative_var module_type module_name target_name )
-
#
# GBX_REQUIRE_TARGETS( cumulative_var [EXE | LIB] module_name TARGET0 [TARGET1 TARGET2 ...] )
#
-MACRO( GBX_REQUIRE_TARGETS cumulative_var module_type module_name )
+macro( GBX_REQUIRE_TARGETS cumulative_var module_type module_name )
# debug
-# MESSAGE( STATUS "GBX_REQUIRE_TARGETS [ CUM_VAR=${${cumulative_var}}, MOD_TYPE=${module_type}, MOD_NAME=${module_name}, target_names=${ARGN} ]" )
+# message( STATUS "GBX_REQUIRE_TARGETS [ CUM_VAR=${${cumulative_var}}, MOD_TYPE=${module_type}, MOD_NAME=${module_name}, target_names=${ARGN} ]" )
- IF( ${ARGC} LESS 4 )
- MESSAGE( FATAL_ERROR "GBX_REQUIRE_TARGETS macro needs to at least one target name (${ARGC} params were given)." )
- ENDIF( ${ARGC} LESS 4 )
+ if( ${ARGC} LESS 4 )
+ message( FATAL_ERROR "GBX_REQUIRE_TARGETS macro needs to at least one target name (${ARGC} params were given)." )
+ endif( ${ARGC} LESS 4 )
- FOREACH( trgt ${ARGN} )
+ foreach( trgt ${ARGN} )
GBX_REQUIRE_TARGET( ${cumulative_var} ${module_type} ${module_name} ${trgt} )
- ENDFOREACH( trgt ${ARGN} )
+ endforeach( trgt ${ARGN} )
-ENDMACRO( GBX_REQUIRE_TARGETS cumulative_var module_type module_name )
+endmacro( GBX_REQUIRE_TARGETS cumulative_var module_type module_name )
#
+# GBX_REQUIRE_LIB( cumulative_var [EXE | LIB] module_name depend_name [reason] )
+#
+# This is a convenience macro which combines the functionality of GBX_REQUIRE_INSTALL and GBX_REQUIRE_TARGET.
+# It can be used to require executables despite the name.
+#
+# First checks if a target called ${depend_name} exists, i.e. a library or executable with this name
+# is part of the same project and is enabled. If it exists, sets ${cumulative_var} to TRUE and exits.
+#
+# Otherwise, checks if a library or executable called ${depend_name} is installed, i.e. a manifest
+# variable is defined.
+#
+# E.g.
+# Initialize a variable first
+# set( build TRUE )
+# Now set up and test option value
+# GBX_REQUIRE_TARGET ( build EXE localiser HydroStuff )
+# GBX_REQUIRE_TARGET ( build LIB MyStuff HydroStuff )
+#
+macro( GBX_REQUIRE_LIB cumulative_var module_type module_name depend_name )
+# message( STATUS "GBX_REQUIRE_LIB [ CUM_VAR=${${cumulative_var}}, MOD_TYPE=${module_type}, MOD_NAME=${module_name}, depend_name=${depend_name} ]" )
+
+ if( ${cumulative_var} )
+
+ string( COMPARE EQUAL ${module_type} "EXE" is_exe )
+ string( COMPARE EQUAL ${module_type} "LIB" is_lib )
+ if( NOT is_exe AND NOT is_lib )
+ message( FATAL_ERROR "In macro GBX_REQUIRE_LIB, module_type must be either 'EXE' or 'LIB'" )
+ endif( NOT is_exe AND NOT is_lib )
+ if( is_exe AND is_lib )
+ message( FATAL_ERROR "In macro GBX_REQUIRE_LIB, module_type must be either 'EXE' or 'LIB'" )
+ endif( is_exe AND is_lib )
+
+ if( ${ARGC} GREATER 5 )
+ set( reason ${ARGV6} )
+ else( ${ARGC} GREATER 5 )
+ set( reason "${depend_name} is not being built and was not installed" )
+ endif( ${ARGC} GREATER 5 )
+
+ # first, look for a target
+ GET_TARGET_PROPERTY( target_location ${depend_name} LOCATION )
+
+ # must dereference both var and option names once (!) and IF will evaluate their values
+ if( NOT target_location )
+
+ # target not found, look for an install
+ GBX_MAKE_MANIFEST_NAME( test_var ${depend_name} )
+
+ # must dereference both var names once (!)
+ GBX_REQUIRE_VAR( ${cumulative_var} ${module_type} ${module_name} ${test_var} ${reason} )
+
+ endif( NOT target_location )
+
+ endif( ${cumulative_var} )
+
+endmacro( GBX_REQUIRE_LIB cumulative_var module_type module_name target_name )
+
+#
+# GBX_REQUIRE_LIBS( cumulative_var [EXE | LIB] module_name LIB0 [LIB1 LIB2 ...] )
+#
+macro( GBX_REQUIRE_LIBS cumulative_var module_type module_name )
+# message( STATUS "GBX_REQUIRE_LIBS [ CUM_VAR=${${cumulative_var}}, MOD_TYPE=${module_type}, MOD_NAME=${module_name}, target_names=${ARGN} ]" )
+
+ if( ${ARGC} LESS 4 )
+ message( FATAL_ERROR "GBX_REQUIRE_LIBS macro needs to at least one library name (${ARGC} params were given)." )
+ endif( ${ARGC} LESS 4 )
+
+ foreach( lib ${ARGN} )
+ GBX_REQUIRE_LIB( ${cumulative_var} ${module_type} ${module_name} ${lib} )
+ endforeach( lib ${ARGN} )
+
+endmacro( GBX_REQUIRE_LIBS cumulative_var module_type module_name )
+
+#
# This is a utility macro for internal use.
#
-MACRO( GBX_WRITE_OPTIONS )
- SET( output_file ${GBX_PROJECT_BINARY_DIR}/${PROJECT_NAME}_options.cmake )
- WRITE_FILE( ${output_file} "\# Autogenerated by CMake for ${PROJECT_NAME} project" )
+macro( GBX_WRITE_OPTIONS )
+ set( output_file ${GBX_PROJECT_BINARY_DIR}/${PROJECT_NAME}_options.cmake )
+ write_file( ${output_file} "\# Autogenerated by CMake for ${PROJECT_NAME} project" )
- FOREACH( a ${OPTION_LIST} )
- WRITE_FILE( ${output_file} "-D${a} \\" APPEND )
- ENDFOREACH( a ${LIB_LIST} )
-ENDMACRO( GBX_WRITE_OPTIONS )
+ foreach( a ${OPTION_LIST} )
+ write_file( ${output_file} "-D${a} \\" APPEND )
+ endforeach( a ${LIB_LIST} )
+endmacro( GBX_WRITE_OPTIONS )
#
# This is a utility macro for internal use.
# Reset global lists of components, libraries, etc.
#
-MACRO( GBX_RESET_ALL_DEPENDENCY_LISTS )
- # MESSAGE( STATUS "DEBUG: Resetting global dependency lists" )
- SET( OPTION_LIST "" CACHE INTERNAL "Global list of cmake options" FORCE )
-ENDMACRO( GBX_RESET_ALL_DEPENDENCY_LISTS )
+macro( GBX_RESET_ALL_DEPENDENCY_LISTS )
+ # message( STATUS "DEBUG: Resetting global dependency lists" )
+ set( OPTION_LIST "" CACHE INTERNAL "Global list of cmake options" FORCE )
+endmacro( GBX_RESET_ALL_DEPENDENCY_LISTS )
Modified: gearbox/trunk/cmake/FindGearbox.cmake
===================================================================
--- gearbox/trunk/cmake/FindGearbox.cmake 2009-03-28 01:44:55 UTC (rev 387)
+++ gearbox/trunk/cmake/FindGearbox.cmake 2009-04-06 02:08:34 UTC (rev 388)
@@ -7,18 +7,21 @@
# We look for the cmake manifest file generated by Gearbox.
# start with 'not found'
-SET( GEARBOX_FOUND 0 CACHE BOOL "Do we have Gearbox?" )
+set( GEARBOX_FOUND 0 CACHE BOOL "Do we have Gearbox?" )
-FIND_PATH( GEARBOX_HOME gearbox_manifest.cmake
- $ENV{GEARBOX_HOME}
- # Test standard installation points
- /usr/local
- /opt/gearbox
- C:/gearbox
- )
-# MESSAGE( STATUS "DEBUG: manifest.cmake is apparently found in : ${GEARBOX_HOME}" )
+find_path( GEARBOX_HOME gearbox_manifest.cmake
+ # Test user-specified installation point (first look in the dir specified
+ # with command line CMake variable, then with environment variable)
+ ${GEARBOX_HOME}
+ $ENV{GEARBOX_HOME}
+ # Test standard installation points
+ /usr/local
+ /opt/gearbox
+ C:/gearbox
+)
+# message( STATUS "DEBUG: manifest.cmake is apparently found in : ${GEARBOX_HOME}" )
# NOTE: if GEARBOX_HOME is set to *-NOTFOUND it will evaluate to FALSE
-IF( GEARBOX_HOME )
- SET( GEARBOX_FOUND 1 CACHE BOOL "Do we have Gearbox?" FORCE )
-ENDIF( GEARBOX_HOME )
+if( GEARBOX_HOME )
+ set( GEARBOX_FOUND 1 CACHE BOOL "Do we have Gearbox?" FORCE )
+endif( GEARBOX_HOME )
Modified: gearbox/trunk/cmake/FindIceUtil.cmake
===================================================================
--- gearbox/trunk/cmake/FindIceUtil.cmake 2009-03-28 01:44:55 UTC (rev 387)
+++ gearbox/trunk/cmake/FindIceUtil.cmake 2009-04-06 02:08:34 UTC (rev 388)
@@ -5,9 +5,9 @@
# ICEUTIL_HOME : path where to find include, lib, bin, etc.
# start with 'not found'
-SET( ICEUTIL_FOUND 0 CACHE BOOL "Do we have libIceUtil?" )
+set( ICEUTIL_FOUND 0 CACHE BOOL "Do we have libIceUtil?" )
-FIND_PATH( ICEUTIL_HOME_INCLUDE_ICEUTIL IceUtil.h
+find_path( iceutil_home_include_iceutil_dir IceUtil.h
# rational for this search order:
# source install w/env.var -> source install
# package -> package
@@ -37,25 +37,24 @@
C:/Ice-3.2.1/include/IceUtil
C:/Ice-3.2.0-VC80/include/IceUtil
C:/Ice-3.2.0/include/IceUtil
- )
-# MESSAGE( STATUS "DEBUG: Ice.h is apparently found in : ${ICEUTIL_HOME_INCLUDE_ICE}" )
+)
# NOTE: if ICEUTIL_HOME_INCLUDE_ICE is set to *-NOTFOUND it will evaluate to FALSE
-IF( ICEUTIL_HOME_INCLUDE_ICEUTIL )
+if( iceutil_home_include_iceutil_dir )
- SET( ICEUTIL_FOUND 1 CACHE BOOL "Do we have Ice?" FORCE )
+ set( ICEUTIL_FOUND 1 CACHE BOOL "Do we have Ice?" FORCE )
# strip 'file' twice to get rid off 'include/IceUtil'
-# MESSAGE( STATUS "DEBUG: ICEUTIL_HOME_INCLUDE_ICE=" ${ICEUTIL_HOME_INCLUDE_ICE} )
- GET_FILENAME_COMPONENT( ICEUTIL_HOME_INCLUDE ${ICEUTIL_HOME_INCLUDE_ICEUTIL} PATH )
-# MESSAGE( STATUS "DEBUG: ICEUTIL_HOME_INCLUDE=" ${ICEUTIL_HOME_INCLUDE} )
- GET_FILENAME_COMPONENT( ICEUTIL_HOME ${ICEUTIL_HOME_INCLUDE} PATH CACHE )
-# MESSAGE( STATUS "Setting ICEUTIL_HOME to ${ICEUTIL_HOME}" )
+# message( STATUS "DEBUG: ICEUTIL_HOME_INCLUDE_ICE=" ${ICEUTIL_HOME_INCLUDE_ICE} )
+ get_filename_component( iceutil_home_include_dir ${iceutil_home_include_iceutil_dir} PATH )
+# message( STATUS "DEBUG: iceutil_home_include_dir=" ${iceutil_home_include_dir} )
+ get_filename_component( ICEUTIL_HOME ${iceutil_home_include_dir} PATH CACHE )
+# message( STATUS "Setting ICEUTIL_HOME to ${ICEUTIL_HOME}" )
-ENDIF( ICEUTIL_HOME_INCLUDE_ICEUTIL )
+endif( iceutil_home_include_iceutil_dir )
-IF( ICEUTIL_FOUND )
- MESSAGE( STATUS "Looking for libIceUtil - found in ${ICEUTIL_HOME}")
-ELSE ( ICEUTIL_FOUND )
- MESSAGE( STATUS "Looking for libIceUtil - not found")
-ENDIF( ICEUTIL_FOUND )
+if( ICEUTIL_FOUND )
+ message( STATUS "Looking for libIceUtil - found in ${ICEUTIL_HOME}")
+else( ICEUTIL_FOUND )
+ message( STATUS "Looking for libIceUtil - not found")
+endif( ICEUTIL_FOUND )
Modified: gearbox/trunk/cmake/SetupBuildType.cmake
===================================================================
--- gearbox/trunk/cmake/SetupBuildType.cmake 2009-03-28 01:44:55 UTC (rev 387)
+++ gearbox/trunk/cmake/SetupBuildType.cmake 2009-04-06 02:08:34 UTC (rev 388)
@@ -1,18 +1,18 @@
-IF( NOT CMAKE_BUILD_TYPE )
+if( NOT CMAKE_BUILD_TYPE )
- IF( NOT GBX_OS_WIN )
+ if( NOT GBX_OS_WIN )
# For gcc, RelWithDebInfo gives '-O2 -g'
- SET( CMAKE_BUILD_TYPE RelWithDebInfo )
- ELSE ( NOT GBX_OS_WIN )
+ set( CMAKE_BUILD_TYPE RelWithDebInfo )
+ else( NOT GBX_OS_WIN )
# windows... a temp hack: VCC does not seem to respect the cmake
# setting and always defaults to debug, we have to match it here.
- SET( CMAKE_BUILD_TYPE Debug )
- ENDIF( NOT GBX_OS_WIN )
+ set( CMAKE_BUILD_TYPE Debug )
+ endif( NOT GBX_OS_WIN )
- MESSAGE( STATUS "Setting build type to '${CMAKE_BUILD_TYPE}'" )
+ message( STATUS "Setting build type to '${CMAKE_BUILD_TYPE}'" )
-ELSE ( NOT CMAKE_BUILD_TYPE )
+else( NOT CMAKE_BUILD_TYPE )
- MESSAGE( STATUS "Build type set to '${CMAKE_BUILD_TYPE}' by user." )
+ message( STATUS "Build type set to '${CMAKE_BUILD_TYPE}' by user." )
-ENDIF( NOT CMAKE_BUILD_TYPE )
+endif( NOT CMAKE_BUILD_TYPE )
Modified: gearbox/trunk/cmake/SetupDirectories.cmake
===================================================================
--- gearbox/trunk/cmake/SetupDirectories.cmake 2009-03-28 01:44:55 UTC (rev 387)
+++ gearbox/trunk/cmake/SetupDirectories.cmake 2009-04-06 02:08:34 UTC (rev 388)
@@ -3,7 +3,7 @@
# later sources overwrite earlier ones:
# 1. OS-dependent defaults (effective only the first time CMake runs or after CMakeCache is deleted)
# 2. Enviroment variable whose name is determined as <PROJECT_NAME>_INSTALL
-# 3. CMake variable whose name is determined as <PROJECT_NAME>_INSTALL (same as the environment variable)
+# 3. CMake variable whose name is determined as <PROJECT_NAME>_install(same as the environment variable)
#
# E.g. in Linux, for a project called 'fruitcake'
# $ rm CMakeCache.txt; cmake .
@@ -18,53 +18,65 @@
# A manually set installation dir (e.i. with ccmake) is not touched until an environment variable or
# a command line variable is introduced.
-# 1. using custom defaults (effective only the very first time CMake runs, or after CMakeCache is deleted)
-IF( CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
- MESSAGE( STATUS "Setting default installation directory..." )
- IF( NOT GBX_OS_WIN )
- SET( CMAKE_INSTALL_PREFIX /usr/local CACHE PATH "Installation directory" FORCE )
- ELSE ( NOT GBX_OS_WIN )
- SET( CMAKE_INSTALL_PREFIX "C:\\Program Files\\${PROJECT_NAME}" CACHE PATH "Installation directory" FORCE )
- ENDIF( NOT GBX_OS_WIN )
-ENDIF( CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT )
+#
+# IS_SUPER_PROJECT is a flag which is defined if Gearbox is built as part of CMake "ueber-project".
+# If it's set don't overwrite CMAKE_INSTALL_PREFIX because the ueber-project has already set it.
+#
+if( DEFINED IS_SUPER_PROJECT )
-# the name of the variable controlling install directory for this project
-STRING( TOUPPER ${PROJECT_NAME} project_name_upper )
-SET( project_install_var "${project_name_upper}_INSTALL" )
+ message( STATUS "(This is a super-project, not changing install directory)." )
-# 2. check if environment variable is set
-SET( install_dir $ENV{${project_install_var}} )
-STRING( LENGTH "A${install_dir}" is_env_var_defined_plus_one )
-MATH( EXPR is_env_var_defined "${is_env_var_defined_plus_one}-1" )
-IF( is_env_var_defined )
- # debug
- MESSAGE( STATUS "Overwriting install dir with enviroment variable ${project_install_var}=${install_dir}" )
+else( DEFINED IS_SUPER_PROJECT )
- SET( CMAKE_INSTALL_PREFIX ${install_dir} CACHE PATH "Installation directory" FORCE )
-ENDIF( is_env_var_defined )
+ # 1. using custom defaults (effective only the very first time CMake runs, or after CMakeCache is deleted)
+ if( CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+ message( STATUS "Setting default installation directory..." )
+ if( NOT GBX_OS_WIN )
+ set( CMAKE_INSTALL_PREFIX /usr/local CACHE PATH "Installation directory" FORCE )
+ else( NOT GBX_OS_WIN )
+ set( CMAKE_INSTALL_PREFIX "C:\\Program Files\\${PROJECT_NAME}" CACHE PATH "Installation directory" FORCE )
+ endif( NOT GBX_OS_WIN )
+ endif( CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT )
+
+ # the name of the variable controlling install directory for this project
+ string( TOUPPER ${PROJECT_NAME} project_name_upper )
+ set( project_install_var "${project_name_upper}_INSTALL" )
+
+ # 2. check if environment variable is set
+ set( install_dir $ENV{${project_install_var}} )
+ string( LENGTH "A${install_dir}" is_env_var_defined_plus_one )
+ math( EXPR is_env_var_defined "${is_env_var_defined_plus_one}-1" )
+ if( is_env_var_defined )
+ # debug
+ message( STATUS "(Overwriting install dir with enviroment variable ${project_install_var}=${install_dir})" )
+
+ set( CMAKE_INSTALL_PREFIX ${install_dir} CACHE PATH "Installation directory" FORCE )
+ endif( is_env_var_defined )
+
+ # 3. check if CMake variable is set on the command line
+ if( DEFINED ${project_install_var} )
+ set( install_dir ${${project_install_var}} )
+ # debug
+ message( STATUS "(Overwriting install dir with command line variable ${project_install_var}=${install_dir})" )
+
+ # using user-supplied installation directory
+ set( CMAKE_INSTALL_PREFIX ${install_dir} CACHE PATH "Installation directory" FORCE )
+ endif( DEFINED ${project_install_var} )
-# 3. check if CMake variable is set on the command line
-IF( DEFINED ${project_install_var} )
- SET( install_dir ${${project_install_var}} )
- # debug
- MESSAGE( STATUS "Overwriting install dir with command line variable ${project_install_var}=${install_dir}" )
-
- # using user-supplied installation directory
- SET( CMAKE_INSTALL_PREFIX ${install_dir} CACHE PATH "Installation directory" FORCE )
-ENDIF( DEFINED ${project_install_var} )
+endif( DEFINED IS_SUPER_PROJECT )
# final result
-MESSAGE( STATUS "Setting installation directory to ${CMAKE_INSTALL_PREFIX}" )
+message( STATUS "Installation directory was set to ${CMAKE_INSTALL_PREFIX}" )
# special installation directories
-SET( GBX_BIN_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/bin )
-SET( GBX_LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib/${PROJECT_NAME} )
-SET( GBX_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/install/${PROJECT_NAME} )
-SET( GBX_SHARE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME} )
+set( GBX_BIN_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/bin )
+set( GBX_LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib/${PROJECT_NAME} )
+set( GBX_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/install/${PROJECT_NAME} )
+set( GBX_SHARE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME} )
#
# It's sometimes useful to refer to the top level of the project.
# CMake does not make it very easy.
#
-SET( GBX_PROJECT_SOURCE_DIR ${${PROJECT_NAME}_SOURCE_DIR} )
-SET( GBX_PROJECT_BINARY_DIR ${${PROJECT_NAME}_BINARY_DIR} )
+set( GBX_PROJECT_SOURCE_DIR ${${PROJECT_NAME}_SOURCE_DIR} )
+set( GBX_PROJECT_BINARY_DIR ${${PROJECT_NAME}_BINARY_DIR} )
Modified: gearbox/trunk/cmake/SetupOs.cmake
===================================================================
--- gearbox/trunk/cmake/SetupOs.cmake 2009-03-28 01:44:55 UTC (rev 387)
+++ gearbox/trunk/cmake/SetupOs.cmake 2009-04-06 02:08:34 UTC (rev 388)
@@ -5,41 +5,41 @@
# CMake does not distinguish Linux from other Unices.
-STRING( REGEX MATCH Linux GBX_OS_LINUX ${CMAKE_SYSTEM_NAME})
+string( REGEX MATCH Linux GBX_OS_LINUX ${CMAKE_SYSTEM_NAME})
# Rename CMake's variable to something which makes more sense.
-IF( QNXNTO )
- SET( GBX_OS_QNX TRUE BOOL INTERNAL )
-ENDIF( QNXNTO )
+if( QNXNTO )
+ set( GBX_OS_QNX TRUE BOOL INTERNAL )
+endif( QNXNTO )
# In windows we just mirror CMake's own variable
-IF( WIN32 )
- SET( GBX_OS_WIN TRUE BOOL INTERNAL )
-ENDIF( WIN32 )
+if( WIN32 )
+ set( GBX_OS_WIN TRUE BOOL INTERNAL )
+endif( WIN32 )
# In MacOS X we just mirror CMake's own variable
-IF( APPLE )
- SET( GBX_OS_MAC TRUE BOOL INTERNAL )
-ENDIF( APPLE )
+if( APPLE )
+ set( GBX_OS_MAC TRUE BOOL INTERNAL )
+endif( APPLE )
# From now on, use our own OS flags
-IF( GBX_OS_LINUX )
- MESSAGE( STATUS "Running on Linux" )
-ENDIF( GBX_OS_LINUX )
+if( GBX_OS_LINUX )
+ message( STATUS "Running on Linux" )
+endif( GBX_OS_LINUX )
-IF( GBX_OS_QNX )
- MESSAGE( STATUS "Running on QNX" )
- ADD_DEFINITIONS( -shared -fexceptions )
-ENDIF( GBX_OS_QNX )
+if( GBX_OS_QNX )
+ message( STATUS "Running on QNX" )
+ add_definitions( -shared -fexceptions )
+endif( GBX_OS_QNX )
-IF( GBX_OS_WIN )
+if( GBX_OS_WIN )
# CMake seems not to set this property correctly for some reason
- SET( GBX_EXE_EXTENSION ".exe" )
- MESSAGE( STATUS "Running on Windows" )
-ENDIF( GBX_OS_WIN )
+ set( GBX_EXE_EXTENSION ".exe" )
+ message( STATUS "Running on Windows" )
+endif( GBX_OS_WIN )
-IF( GBX_OS_MAC )
- MESSAGE( STATUS "Running on OS-X" )
-ENDIF( GBX_OS_MAC )
+if( GBX_OS_MAC )
+ message( STATUS "Running on OS-X" )
+endif( GBX_OS_MAC )
Modified: gearbox/trunk/cmake/SetupVersion.cmake
===================================================================
--- gearbox/trunk/cmake/SetupVersion.cmake 2009-03-28 01:44:55 UTC (rev 387)
+++ gearbox/trunk/cmake/SetupVersion.cmake 2009-04-06 02:08:34 UTC (rev 388)
@@ -9,4 +9,4 @@
# alexm: for gcc need to produce this in the Makefile: -DGEARBOX_VERSION=\"X.Y.Z\",
# without escaping the quotes the compiler will strip them off.
# alexb: it seems that you also need to escape the quotes for windoze??
-ADD_DEFINITIONS( "-DGEARBOX_VERSION=\\\"${GBX_PROJECT_VERSION}\\\"" )
+add_definitions( "-DGEARBOX_VERSION=\\\"${GBX_PROJECT_VERSION}\\\"" )
Modified: gearbox/trunk/cmake/TargetUtils.cmake
===================================================================
--- gearbox/trunk/cmake/TargetUtils.cmake 2009-03-28 01:44:55 UTC (rev 387)
+++ gearbox/trunk/cmake/TargetUtils.cmake 2009-04-06 02:08:34 UTC (rev 388)
@@ -1,30 +1,30 @@
#
# Default library type (shared or static).
#
-SET( GBX_DEFAULT_LIB_TYPE "SHARED" CACHE STRING "Default library type (SHARED or STATIC)" )
-MARK_AS_ADVANCED( GBX_DEFAULT_LIB_TYPE )
+set( GBX_DEFAULT_LIB_TYPE "SHARED" CACHE STRING "Default library type (SHARED or STATIC)" )
+mark_as_advanced( GBX_DEFAULT_LIB_TYPE )
#
# Executables should add themselves by calling 'GBX_ADD_EXECUTABLE'
# instead of 'ADD_EXECUTABLE' in CMakeLists.txt.
# Usage is the same as ADD_EXECUTABLE, all parameters are passed to ADD_EXECUTABLE.
#
-MACRO( GBX_ADD_EXECUTABLE name )
- IF( COMMAND cmake_policy )
- CMAKE_POLICY( SET CMP0003 NEW )
- ENDIF( COMMAND cmake_policy )
+macro( GBX_ADD_EXECUTABLE name )
+ if( COMMAND cmake_policy )
+ cmake_policy( SET CMP0003 NEW )
+ endif( COMMAND cmake_policy )
- ADD_EXECUTABLE( ${name} ${ARGN} )
-# SET_TARGET_PROPERTIES( ${name} PROPERTIES
+ add_executable( ${name} ${ARGN} )
+# set_target_properties( ${name} PROPERTIES
# INSTALL_RPATH "${INSTALL_RPATH};${CMAKE_INSTALL_PREFIX}/lib/${PROJECT_NAME}"
# BUILD_WITH_INSTALL_RPATH TRUE )
- INSTALL( TARGETS ${name} RUNTIME DESTINATION bin )
- SET( templist ${EXE_LIST} )
- LIST( APPEND templist ${name} )
-# MESSAGE( STATUS "DEBUG: ${templist}" )
- SET( EXE_LIST ${templist} CACHE INTERNAL "Global list of executables to build" FORCE )
- MESSAGE( STATUS "Planning to build executable: ${name}" )
-ENDMACRO( GBX_ADD_EXECUTABLE name )
+ install( TARGETS ${name} RUNTIME DESTINATION bin )
+ set( templist ${EXE_LIST} )
+ list( APPEND templist ${name} )
+# message( STATUS "DEBUG: ${templist}" )
+ set( EXE_LIST ${templist} CACHE INTERNAL "Global list of executables to build" FORCE )
+ message( STATUS "Planning to build executable: ${name}" )
+endmacro( GBX_ADD_EXECUTABLE name )
#
# Libraries should add themselves by calling 'GBX_ADD_LIBRARY'
@@ -34,69 +34,69 @@
# by the user (or SHARED if the user hasn't changed it from the original setting).
# All extra parameters are passed to ADD_LIBRARY as source files.
#
-MACRO( GBX_ADD_LIBRARY name type )
- IF( COMMAND cmake_policy )
- CMAKE_POLICY( SET CMP0003 NEW )
- ENDIF( COMMAND cmake_policy )
+macro( GBX_ADD_LIBRARY name type )
+ if( COMMAND cmake_policy )
+ cmake_policy( SET CMP0003 NEW )
+ endif( COMMAND cmake_policy )
- IF( ${type} STREQUAL SHARED )
- SET( libType SHARED )
+ if( ${type} STREQUAL SHARED )
+ set( libType SHARED )
ELSEIF( ${type} STREQUAL STATIC )
- SET( libType STATIC )
- ELSE( ${type} STREQUAL SHARED )
- SET( libType ${GBX_DEFAULT_LIB_TYPE} )
- ENDIF( ${type} STREQUAL SHARED )
+ set( libType STATIC )
+ else( ${type} STREQUAL SHARED )
+ set( libType ${GBX_DEFAULT_LIB_TYPE} )
+ endif( ${type} STREQUAL SHARED )
- ADD_LIBRARY( ${name} ${libType} ${ARGN} )
+ add_library( ${name} ${libType} ${ARGN} )
# SET_TARGET_PROPERTIES( ${name} PROPERTIES
# INSTALL_RPATH "${INSTALL_RPATH};${CMAKE_INSTALL_PREFIX}/lib/${PROJECT_NAME}"
# BUILD_WITH_INSTALL_RPATH TRUE )
- INSTALL( TARGETS ${name} DESTINATION lib/${PROJECT_NAME} )
+ install( TARGETS ${name} DESTINATION lib/${PROJECT_NAME} )
- SET( templist ${LIB_LIST} )
- LIST( APPEND templist ${name} )
- SET( LIB_LIST ${templist} CACHE INTERNAL "Global list of libraries to build" FORCE )
+ set( templist ${LIB_LIST} )
+ list( APPEND templist ${name} )
+ set( LIB_LIST ${templist} CACHE INTERNAL "Global list of libraries to build" FORCE )
- IF( libType STREQUAL SHARED )
- SET( libTypeDesc "shared" )
- ELSE( libType STREQUAL SHARED )
- SET( libTypeDesc "static" )
- ENDIF( libType STREQUAL SHARED )
- MESSAGE( STATUS "Planning to build ${libTypeDesc} library: ${name}" )
-ENDMACRO( GBX_ADD_LIBRARY name )
+ if( libType STREQUAL SHARED )
+ set( libTypeDesc "shared" )
+ else( libType STREQUAL SHARED )
+ set( libTypeDesc "static" )
+ endif( libType STREQUAL SHARED )
+ message( STATUS "Planning to build ${libTypeDesc} library: ${name}" )
+endmacro( GBX_ADD_LIBRARY name )
#
# GBX_ADD_HEADERS( install_subdir FILE0 [FILE1 FILE2 ...] )
#
-# Specialization of INSTALL(FILES ...) to install header files.
+# Specialization of install(FILES ...) to install header files.
# All files are installed into PREFIX/include/${PROJECT_NAME}/${install_subdir}
#
-MACRO( GBX_ADD_HEADERS install_subdir )
- INSTALL( FILES ${ARGN} DESTINATION include/${PROJECT_NAME}/${install_subdir} )
-ENDMACRO( GBX_ADD_HEADERS install_subdir )
+macro( GBX_ADD_HEADERS install_subdir )
+ install( FILES ${ARGN} DESTINATION include/${PROJECT_NAME}/${install_subdir} )
+endmacro( GBX_ADD_HEADERS install_subdir )
#
# GBX_ADD_SHARED_FILES( install_subdir FILE0 [FILE1 FILE2 ...] )
#
-# Specialization of INSTALL(FILES ...) to install shared files.
+# Specialization of install(FILES ...) to install shared files.
# All files are installed into PREFIX/share/${PROJECT_NAME}/${install_subdir} directory.
#
-MACRO( GBX_ADD_SHARED_FILES install_subdir )
- INSTALL( FILES ${ARGN} DESTINATION share/${PROJECT_NAME}/${install_subdir} )
-ENDMACRO( GBX_ADD_SHARED_FILES install_subdir )
+macro( GBX_ADD_SHARED_FILES install_subdir )
+ install( FILES ${ARGN} DESTINATION share/${PROJECT_NAME}/${install_subdir} )
+endmacro( GBX_ADD_SHARED_FILES install_subdir )
#
# GBX_ADD_EXAMPLE( install_subdir makefile.in makefile.out [FILE0 FILE1 FILE2 ...] )
#
-# Specialisation of INSTALL(FILES ...) to install examples.
+# Specialisation of install(FILES ...) to install examples.
# All files are installed into PREFIX/share/${PROJECT_NAME}/${install_subdir}.
# makefile is passed through CONFIGURE_FILE to add in correct include and library
# paths based on the install prefix.
#
-MACRO( GBX_ADD_EXAMPLE install_subdir makefile.in makefile.out )
- CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/${makefile.in} ${CMAKE_CURRENT_BINARY_DIR}/${makefile.out} @ONLY)
- INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/${makefile.out} DESTINATION share/${PROJECT_NAME}/${install_subdir} RENAME CMakeLists.txt )
- INSTALL( FILES ${ARGN} DESTINATION share/${PROJECT_NAME}/${install_subdir} )
-ENDMACRO( GBX_ADD_EXAMPLE install_subdir makefile )
+macro( GBX_ADD_EXAMPLE install_subdir makefile.in makefile.out )
+ configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/${makefile.in} ${CMAKE_CURRENT_BINARY_DIR}/${makefile.out} @ONLY)
+ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${makefile.out} DESTINATION share/${PROJECT_NAME}/${install_subdir} RENAME CMakeLists.txt )
+ install( FILES ${ARGN} DESTINATION share/${PROJECT_NAME}/${install_subdir} )
+endmacro( GBX_ADD_EXAMPLE install_subdir makefile )
#
# GBX_ADD_PKGCONFIG( name cflags libflags [DEPENDENCY0 DEPENDENCY1 ...] )
@@ -109,22 +109,22 @@
# libflags is appended to the "Libs" value.
# that should be linked with at the same time as linking to this library.
#
-MACRO( GBX_ADD_PKGCONFIG name desc ext_deps int_deps cflags libflags )
- SET( PKG_NAME ${name} )
- SET( PKG_DESC ${desc} )
- SET( PKG_CFLAGS ${cflags} )
- SET( PKG_LIBFLAGS ${libflags} )
- SET( PKG_EXTERNAL_DEPS ${${ext_deps}} )
- SET( PKG_INTERNAL_DEPS "" )
- IF( ${int_deps} )
- FOREACH( A ${${int_deps}} )
- SET( PKG_INTERNAL_DEPS "${PKG_INTERNAL_DEPS} -l${A}" )
- ENDFOREACH( A ${${int_deps}} )
- ENDIF( ${int_deps} )
+macro( GBX_ADD_PKGCONFIG name desc ext_deps int_deps cflags libflags )
+ set( PKG_NAME ${name} )
+ set( PKG_DESC ${desc} )
+ set( PKG_CFLAGS ${cflags} )
+ set( PKG_LIBFLAGS ${libflags} )
+ set( PKG_EXTERNAL_DEPS ${${ext_deps}} )
+ set( PKG_INTERNAL_DEPS "" )
+ if( ${int_deps} )
+ foreach( item ${${int_deps}} )
+ set( PKG_INTERNAL_DEPS "${PKG_INTERNAL_DEPS} -l${item}" )
+ endforeach( item ${${int_deps}} )
+ endif( ${int_deps} )
- CONFIGURE_FILE( ${GBX_CMAKE_DIR}/pkgconfig.in ${CMAKE_CURRENT_BINARY_DIR}/${name}.pc @ONLY)
- INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}.pc DESTINATION lib/pkgconfig/ )
-ENDMACRO( GBX_ADD_PKGCONFIG name desc cflags deps libflags libs )
+ configure_file( ${GBX_CMAKE_DIR}/pkgconfig.in ${CMAKE_CURRENT_BINARY_DIR}/${name}.pc @ONLY)
+ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}.pc DESTINATION lib/pkgconfig/ )
+endmacro( GBX_ADD_PKGCONFIG name desc cflags deps libflags libs )
#
# This is a mechanism to register special items which are not
@@ -133,73 +133,73 @@
# to the Dashboard.
# Usage: GBX_ADD_ITEM( name )
#
-MACRO( GBX_ADD_ITEM name )
- SET( templist ${ITEM_LIST} )
- LIST( APPEND templist ${name} )
- SET( ITEM_LIST ${templist} CACHE INTERNAL "Global list of special items to build" FORCE )
- MESSAGE( STATUS "Planning to build item: ${name}" )
-ENDMACRO( GBX_ADD_ITEM name )
+macro( GBX_ADD_ITEM name )
+ set( templist ${ITEM_LIST} )
+ list( APPEND templist ${name} )
+ set( ITEM_LIST ${templist} CACHE INTERNAL "Global list of special items to build" FORCE )
+ message( STATUS "Planning to build item: ${name}" )
+endmacro( GBX_ADD_ITEM name )
#
# This is a mechanism to specify a license for the current source directory.
# Usage: GBX_ADD_LICENSE( license )
#
-MACRO( GBX_ADD_LICENSE license )
- SET( templist ${LICENSE_LIST} )
+macro( GBX_ADD_LICENSE license )
+ set( templist ${LICENSE_LIST} )
# get relative path to the current source dir
- STRING( LENGTH ${GBX_PROJECT_SOURCE_DIR} proj_src_dir_length )
- STRING( LENGTH ${CMAKE_CURRENT_SOURCE_DIR} current_src_dir_length )
- MATH( EXPR relative_path_length "${current_src_dir_length} - ${proj_src_dir_length} - 1" )
- MATH( EXPR relative_path_start "${proj_src_dir_length} + 1" )
- STRING( SUBSTRING ${CMAKE_CURRENT_SOURCE_DIR}
+ string( LENGTH ${GBX_PROJECT_SOURCE_DIR} proj_src_dir_length )
+ string( LENGTH ${CMAKE_CURRENT_SOURCE_DIR} current_src_dir_length )
+ math( EXPR relative_path_length "${current_src_dir_length} - ${proj_src_dir_length} - 1" )
+ math( EXPR relative_path_start "${proj_src_dir_length} + 1" )
+ string( SUBSTRING ${CMAKE_CURRENT_SOURCE_DIR}
${relative_path_start} ${relative_path_length} current_src_dir_relative )
# format the string to line up properly
- SET( spaces "A Z" )
- STRING( LENGTH ${current_src_dir_relative} current_src_dir_relative_length )
- MATH( EXPR white_space_length "60 - ${current_src_dir_relative_length}" )
- STRING( SUBSTRING ${spaces} 1 ${white_space_length} white_space )
+ set( spaces "A Z" )
+ string( LENGTH ${current_src_dir_relative} current_src_dir_relative_length )
+ math( EXPR white_space_length "60 - ${current_src_dir_relative_length}" )
+ string( SUBSTRING ${spaces} 1 ${white_space_length} white_space )
- SET( line_item "${current_src_dir_relative}${white_space}${license}" )
- LIST( APPEND templist ${line_item} )
- SET( LICENSE_LIST ${templist} CACHE INTERNAL "Global list of directories and their licenses" FORCE )
-# MESSAGE( STATUS ${line_item} )
-ENDMACRO( GBX_ADD_LICENSE license )
+ set( line_item "${current_src_dir_relative}${white_space}${license}" )
+ list( APPEND templist ${line_item} )
+ set( LICENSE_LIST ${templist} CACHE INTERNAL "Global list of directories and their licenses" FORCE )
+# message( STATUS ${line_item} )
+endmacro( GBX_ADD_LICENSE license )
#
# Usage: GBX_ADD_TEST( testname exename [arg1 arg2 ...] )
# Example: GBX_ADD_TEST( IntegerTest inttest --verbose )
#
-MACRO( GBX_ADD_TEST name executable )
- ADD_TEST( ${name} ${executable} ${ARGN} )
- SET( templist ${TEST_LIST} )
- LIST( APPEND templist ${name} )
- SET( TEST_LIST ${templist} CACHE INTERNAL "Global list of (CTest) tests to build" FORCE )
-# MESSAGE( STATUS "Planning to build test: ${name}" )
-ENDMACRO( GBX_ADD_TEST name executable )
+macro( GBX_ADD_TEST name executable )
+ add_test( ${name} ${executable} ${ARGN} )
+ set( templist ${TEST_LIST} )
+ list( APPEND templist ${name} )
+ set( TEST_LIST ${templist} CACHE INTERNAL "Global list of (CTest) tests to build" FORCE )
+# message( STATUS "Planning to build test: ${name}" )
+endmacro( GBX_ADD_TEST name executable )
#
-# Usage: GBX_NOT_ADD_EXECUTABLE( name reason )
+# Usage: GBX_NOT_add_executable( name reason )
#
-MACRO( GBX_NOT_ADD_EXECUTABLE name reason )
- SET( templist ${EXE_NOT_LIST} )
- LIST( APPEND templist ${name} )
-# MESSAGE( STATUS "DEBUG: ${templist}" )
- SET( EXE_NOT_LIST ${templist} CACHE INTERNAL "Global list of executables NOT to build" FORCE )
- MESSAGE( STATUS "Not planning to build executable: ${name} because ${reason}" )
-ENDMACRO( GBX_NOT_ADD_EXECUTABLE name reason )
+macro( GBX_NOT_ADD_EXECUTABLE name reason )
+ set( templist ${EXE_NOT_LIST} )
+ list( APPEND templist ${name} )
+# message( STATUS "DEBUG: ${templist}" )
+ set( EXE_NOT_LIST ${templist} CACHE INTERNAL "Global list of executables NOT to build" FORCE )
+ message( STATUS "Not planning to build executable: ${name} because ${reason}" )
+endmacro( GBX_NOT_ADD_EXECUTABLE name reason )
#
-# Usage: GBX_NOT_ADD_LIBRARY( name reason )
+# Usage: GBX_NOT_add_library( name reason )
#
-MACRO( GBX_NOT_ADD_LIBRARY name reason )
- SET( templist ${LIB_NOT_LIST} )
- LIST( APPEND templist ${name} )
-# MESSAGE( STATUS "DEBUG: ${templist}" )
- SET( LIB_NOT_LIST ${templist} CACHE INTERNAL "Global list of libraries NOT to build" FORCE )
- MESSAGE( STATUS "Not planning to build library: ${name} because ${reason}" )
-ENDMACRO( GBX_NOT_ADD_LIBRARY name reason )
+macro( GBX_NOT_ADD_LIBRARY name reason )
+ set( templist ${LIB_NOT_LIST} )
+ list( APPEND templist ${name} )
+# message( STATUS "DEBUG: ${templist}" )
+ set( LIB_NOT_LIST ${templist} CACHE INTERNAL "Global list of libraries NOT to build" FORCE )
+ message( STATUS "Not planning to build library: ${name} because ${reason}" )
+endmacro( GBX_NOT_ADD_LIBRARY name reason )
#
# This is a utility macro for internal use.
@@ -210,115 +210,125 @@
# Tricky list stuff.
# see http://www.cmake.org/Wiki/CMakeMacroMerge for an example
#
-MACRO( LIST_REPORT action item_name note L )
- SET( templist ${L} )
- LIST( LENGTH templist templist_length )
- SET( report_file ${GBX_PROJECT_BINARY_DIR}/cmake_config_report.txt )
+macro( LIST_REPORT action item_name note L )
+ set( templist ${L} )
+ list( LENGTH templist templist_length...
[truncated message content] |
|
From: <bo...@us...> - 2009-03-28 01:48:43
|
Revision: 387
http://gearbox.svn.sourceforge.net/gearbox/?rev=387&view=rev
Author: borax00
Date: 2009-03-28 01:44:55 +0000 (Sat, 28 Mar 2009)
Log Message:
-----------
made naming of buffer functions more intuitive
Modified Paths:
--------------
gearbox/trunk/doc/history.dox
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/buffer.h
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/buffertest.cpp
gearbox/trunk/src/gbxsickacfr/serialhandler.h
Modified: gearbox/trunk/doc/history.dox
===================================================================
--- gearbox/trunk/doc/history.dox 2009-03-02 08:11:52 UTC (rev 386)
+++ gearbox/trunk/doc/history.dox 2009-03-28 01:44:55 UTC (rev 387)
@@ -29,7 +29,10 @@
@par Updated libraries
+- libGbxIceUtilAcfr:
+ - Changed names in buffer.h to make it more intuitive, fixed comments (AlexB).
+
@section gbx_doc_history_902 Changes in Release 9.02
@par New libraries
Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/buffer.h
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/buffer.h 2009-03-02 08:11:52 UTC (rev 386)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/buffer.h 2009-03-28 01:44:55 UTC (rev 387)
@@ -38,26 +38,6 @@
this container for storing smart pointers (e.g. IceUtil smart pointers). In this case the container will
only store the pointers and will not perform a deep copy.
-You should always try to @ref get() data before blocking with @ref getNext() because closely spaced push events may be lost. For example:
-@verbatim
-gbxiceutilacfr::Buffer<double> buffer( 10, gbxiceutilacfr::BufferTypeCircular );
-double data;
-while (1)
-{
- int ret = 0;
- try {
- buffer.getAndPop( data );
- }
- catch ( const gbxutilacfr::Exception & e ) {
- ret = buffer.getAndPopNext( data, TIMEOUT_MS );
- }
- if ( ret == 0 )
- {
- // do something with data
- }
-}
-@endverbatim
-
@note This implementation uses IceUtil threading classes. See example in sec. 28.9.2 of the Ice manual.
@see Notify, Proxy
*/
@@ -133,20 +113,20 @@
/*!
* If there is an object in the buffer, sets the object and returns 0;
*
- * If the buffer is empty, @ref getNext() blocks until a new object is pushed in
- * and returns the new value. By default, there is no timeout (negative value).
+ * If the buffer is empty, @ref getWithTimeout() blocks until a new object is pushed in
+ * and returns the new value. By default, there is an infinite timeout (negative value).
* Returns 0 if successful.
*
* If timeout is set to a positive value and the wait times out, this function returns -1
* and the object argument itself is not touched. In the rare event of spurious wakeup,
* the return value is 1.
*/
- int getNext( Type & obj, int timeoutMs=-1 );
+ int getWithTimeout( Type & obj, int timeoutMs=-1 );
/*!
- * Same as @ref getNext but calls @ref pop afterwards.
+ * Same as @ref getWithTimeout but calls @ref pop afterwards.
*/
- int getAndPopNext( Type & obj, int timeoutMs=-1 );
+ int getAndPopWithTimeout( Type & obj, int timeoutMs=-1 );
protected:
@@ -173,8 +153,8 @@
// buffer type (see type definitions in BufferType enum)
BufferType type_;
- // internal implementation of front( obj, -1 ); returns 0.
- int getNextNoWait( Type & obj );
+ // internal implementation of getWithTimeout( obj, -1 );
+ void getWithInfiniteWait( Type & obj );
};
@@ -298,12 +278,13 @@
}
template<class Type>
-int Buffer<Type>::getNext( Type &obj, int timeoutMs )
+int Buffer<Type>::getWithTimeout( Type &obj, int timeoutMs )
{
// special case: infinite wait time
if ( timeoutMs == -1 )
{
- return getNextNoWait( obj );
+ getWithInfiniteWait( obj );
+ return 0;
}
// finite wait time
@@ -339,9 +320,9 @@
}
template<class Type>
-int Buffer<Type>::getAndPopNext( Type &obj, int timeoutMs )
+int Buffer<Type>::getAndPopWithTimeout( Type &obj, int timeoutMs )
{
- int ret = getNext( obj, timeoutMs );
+ int ret = getWithTimeout( obj, timeoutMs );
if ( ret==0 ) {
pop();
}
@@ -350,7 +331,7 @@
// internal utility function (waits for update infinitely)
template<class Type>
-int Buffer<Type>::getNextNoWait( Type &obj )
+void Buffer<Type>::getWithInfiniteWait( Type &obj )
{
IceUtil::Monitor<IceUtil::Mutex>::Lock lock(*this);
@@ -362,7 +343,6 @@
}
internalGet( obj );
- return 0;
}
// NOTE: see notes on efficient notification in Ice sec. 28.9.3
Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/buffertest.cpp
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/buffertest.cpp 2009-03-02 08:11:52 UTC (rev 386)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/test/buffertest.cpp 2009-03-28 01:44:55 UTC (rev 387)
@@ -54,15 +54,15 @@
}
cout<<"ok"<<endl;
- cout<<"testing getNext() with empty buffer ... ";
- if ( buffer.getNext( data, 50 )==0 ) {
+ cout<<"testing getWithTimeout() with empty buffer ... ";
+ if ( buffer.getWithTimeout( data, 50 )==0 ) {
cout<<"failed. not expecting anybody setting the buffer"<<endl;
return EXIT_FAILURE;
}
cout<<"ok"<<endl;
- cout<<"testing getAndPopNext() with empty buffer ... ";
- if ( buffer.getAndPopNext( data, 50 )==0 ) {
+ cout<<"testing getAndPopWithTimeout() with empty buffer ... ";
+ if ( buffer.getAndPopWithTimeout( data, 50 )==0 ) {
cout<<"failed. not expecting anybody setting the proxy"<<endl;
return EXIT_FAILURE;
}
@@ -188,15 +188,15 @@
// todo: test where the last data actually went.
cout<<"ok"<<endl;
- cout<<"testing getNext() ... ";
- if ( buffer.getNext( data, 50 )!=0 ) {
+ cout<<"testing getWithTimeout() ... ";
+ if ( buffer.getWithTimeout( data, 50 )!=0 ) {
cout<<"failed. expected to get data"<<endl;
return EXIT_FAILURE;
}
cout<<"ok"<<endl;
- cout<<"testing getAndPopNext() ... ";
- if ( buffer.getAndPopNext( data, 50 )!=0 ) {
+ cout<<"testing getAndPopWithTimeout() ... ";
+ if ( buffer.getAndPopWithTimeout( data, 50 )!=0 ) {
cout<<"failed. expected to get data"<<endl;
return EXIT_FAILURE;
}
Modified: gearbox/trunk/src/gbxsickacfr/serialhandler.h
===================================================================
--- gearbox/trunk/src/gbxsickacfr/serialhandler.h 2009-03-02 08:11:52 UTC (rev 386)
+++ gearbox/trunk/src/gbxsickacfr/serialhandler.h 2009-03-28 01:44:55 UTC (rev 387)
@@ -83,7 +83,7 @@
int getNextResponse( TimedLmsResponse &timedResponse, int maxWaitMs )
{
gbxserialdeviceacfr::TimedResponse genericTimedResponse;
- int ret = serialDeviceHandler_->responseBuffer().getAndPopNext( genericTimedResponse, maxWaitMs );
+ int ret = serialDeviceHandler_->responseBuffer().getAndPopWithTimeout( genericTimedResponse, maxWaitMs );
if ( ret == 0 )
{
timedResponse.timeStampSec = genericTimedResponse.timeStampSec;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2009-03-02 08:12:01
|
Revision: 386
http://gearbox.svn.sourceforge.net/gearbox/?rev=386&view=rev
Author: russo2503v
Date: 2009-03-02 08:11:52 +0000 (Mon, 02 Mar 2009)
Log Message:
-----------
adapted to new SF access procedures
Modified Paths:
--------------
gearbox/trunk/doc/rebuild_docco.sh
Modified: gearbox/trunk/doc/rebuild_docco.sh
===================================================================
--- gearbox/trunk/doc/rebuild_docco.sh 2009-02-18 02:11:54 UTC (rev 385)
+++ gearbox/trunk/doc/rebuild_docco.sh 2009-03-02 08:11:52 UTC (rev 386)
@@ -14,15 +14,33 @@
fi
}
-# doxygen
+if [ $# -ne 1 ]; then
+ echo "Usage: $0 <user-name>"
+ exit 1
+fi
+
DOXYGENCMD=/usr/bin/doxygen
DOXYFILE=doxyfile
TARBALL=gearbox-release-doc.tar.gz
+SFUSER=$1
+SFSCPHOST=web.sf.net
+SFSHELLHOST=shell.sf.net
+SFPROJECT=gearbox
+SFDIR=/home/groups/g/ge/gearbox/htdocs/gearbox
force ls
force $DOXYGENCMD $DOXYFILE
+
+# direct file copy, works but is very slow
+#scp -r html/* $SFUSER@$SFSCPHOST:$SFDIR/.
+
+# with tarball
force cd html
force tar --exclude=$TARBALL -zcvf $TARBALL *
-force scp $TARBALL shell.sourceforge.net:
+force scp $TARBALL $SFUSER@$SFSCPHOST:
-ssh shell.sourceforge.net "cd /home/groups/g/ge/gearbox/htdocs/; mv ~/$TARBALL .; tar -zxvf $TARBALL"
+# don't know how to combine this login with commands, do it manually
+echo "when connected execute this:"
+echo "cd $SFDIR; mv ~/$TARBALL .; tar -zxvf $TARBALL"
+echo "to quit, type 'shutdown'"
+force ssh -t $SFUSER,$SFPROJECT@$SFSHELLHOST create #"cd $SFDIR; mv ~/$TARBALL .; tar -zxvf $TARBALL"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2009-02-18 03:23:02
|
Revision: 384
http://gearbox.svn.sourceforge.net/gearbox/?rev=384&view=rev
Author: russo2503v
Date: 2009-02-18 02:11:07 +0000 (Wed, 18 Feb 2009)
Log Message:
-----------
ver++
Modified Paths:
--------------
gearbox/trunk/CMakeLists.txt
gearbox/trunk/doc/release_instructions.dox
Modified: gearbox/trunk/CMakeLists.txt
===================================================================
--- gearbox/trunk/CMakeLists.txt 2009-02-18 01:42:52 UTC (rev 383)
+++ gearbox/trunk/CMakeLists.txt 2009-02-18 02:11:07 UTC (rev 384)
@@ -11,7 +11,7 @@
#
# project version string
#
-SET( GBX_PROJECT_VERSION 9.02 CACHE STRING "Version of GearBox distribution" )
+SET( GBX_PROJECT_VERSION 9.02+ CACHE STRING "Version of GearBox distribution" )
#
# The rest is done by a script
Modified: gearbox/trunk/doc/release_instructions.dox
===================================================================
--- gearbox/trunk/doc/release_instructions.dox 2009-02-18 01:42:52 UTC (rev 383)
+++ gearbox/trunk/doc/release_instructions.dox 2009-02-18 02:11:07 UTC (rev 384)
@@ -33,6 +33,7 @@
$ svn copy https://gearbox.svn.sf.net/svnroot/gearbox/gearbox/trunk https://gearbox.svn.sf.net/svnroot/gearbox/gearbox/tags/RELEASE_9.02 -m 'Tagging release 9.02'
@endverbatim
-# Delete all .svn directories (eg with 'find . -name .svn | xargs rm -rf')
+ -# Delete @c build directory, if exists.
-# Create tar-ball, named eg. 'gearbox-9.02.tar.gz'
-# Now the tar-ball is ready to roll. But first test that the original untars and builds cleanly.
-# Copy the tar-ball to a machine with external access.
@@ -44,6 +45,7 @@
- Login a project administrator
- (Go through "'Admin' -> 'File Releases'" from the GearBox project page)
-# Update the web page
+ - change temporatily the last line of the script to say [USERNAME],ge...@sh...
- Use the script: <distro>/doc/rebuild_docco.sh
-# Increment the version numbers (eg '9.02' -> '9.02+') in the top-level CMakeLists.txt files.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2009-02-18 03:22:25
|
Revision: 385
http://gearbox.svn.sourceforge.net/gearbox/?rev=385&view=rev
Author: russo2503v
Date: 2009-02-18 02:11:54 +0000 (Wed, 18 Feb 2009)
Log Message:
-----------
Modified Paths:
--------------
gearbox/trunk/doc/history.dox
Modified: gearbox/trunk/doc/history.dox
===================================================================
--- gearbox/trunk/doc/history.dox 2009-02-18 02:11:07 UTC (rev 384)
+++ gearbox/trunk/doc/history.dox 2009-02-18 02:11:54 UTC (rev 385)
@@ -25,11 +25,16 @@
@section gbx_doc_history_head Changes in SVN since Last Release
+@par New libraries
+
+@par Updated libraries
+
+
@section gbx_doc_history_902 Changes in Release 9.02
@par New libraries
--libGbxNovatelAcfr
+- libGbxNovatelAcfr
- ACFR driver for a Novatel(SPAN) system. This is the implementation used by Sydney-Berkeley DGC'07 team.
(Michael M)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2009-02-18 02:55:32
|
Revision: 382
http://gearbox.svn.sourceforge.net/gearbox/?rev=382&view=rev
Author: russo2503v
Date: 2009-02-18 01:41:55 +0000 (Wed, 18 Feb 2009)
Log Message:
-----------
version++
Modified Paths:
--------------
gearbox/trunk/CMakeLists.txt
gearbox/trunk/LICENSE
gearbox/trunk/doc/history.dox
gearbox/trunk/doc/index.dox
Removed Paths:
-------------
gearbox/trunk/retired/urg_nz/
Modified: gearbox/trunk/CMakeLists.txt
===================================================================
--- gearbox/trunk/CMakeLists.txt 2009-02-13 07:58:24 UTC (rev 381)
+++ gearbox/trunk/CMakeLists.txt 2009-02-18 01:41:55 UTC (rev 382)
@@ -11,7 +11,7 @@
#
# project version string
#
-SET( GBX_PROJECT_VERSION 8.07+ CACHE STRING "Version of GearBox distribution" )
+SET( GBX_PROJECT_VERSION 9.02 CACHE STRING "Version of GearBox distribution" )
#
# The rest is done by a script
Modified: gearbox/trunk/LICENSE
===================================================================
--- gearbox/trunk/LICENSE 2009-02-13 07:58:24 UTC (rev 381)
+++ gearbox/trunk/LICENSE 2009-02-18 01:41:55 UTC (rev 382)
@@ -9,6 +9,8 @@
src/gbxserialacfr/lockfile LGPL
src/gbxutilacfr LGPL
src/gbxgarminacfr LGPL
+src/gbxnovatelacfr LGPL
+src/gbxnovatelacfr/gbxnovatelutilacfr LGPL
src/gbxsickacfr LGPL
src/gbxsickacfr/gbxiceutilacfr LGPL
src/gbxsickacfr/gbxserialdeviceacfr LGPL
Modified: gearbox/trunk/doc/history.dox
===================================================================
--- gearbox/trunk/doc/history.dox 2009-02-13 07:58:24 UTC (rev 381)
+++ gearbox/trunk/doc/history.dox 2009-02-18 01:41:55 UTC (rev 382)
@@ -13,7 +13,7 @@
@par Project wide
@par New libraries
@par Updated libraries
-@par Removed libraries
+@par Retired libraries
/*!
@@ -25,6 +25,14 @@
@section gbx_doc_history_head Changes in SVN since Last Release
+@section gbx_doc_history_902 Changes in Release 9.02
+
+@par New libraries
+
+-libGbxNovatelAcfr
+ - ACFR driver for a Novatel(SPAN) system. This is the implementation used by Sydney-Berkeley DGC'07 team.
+ (Michael M)
+
@par Updated libraries
- libGbxSickAcfr
@@ -67,9 +75,9 @@
- libGbxSickAcfr
- using 'size_t' instead of 'uint' to improve compatibility.
-@par Removed libraries
+@par Retired libraries
-- hokuyo_nz
+- urg_nz
@section gbx_doc_history_100 Changes in Release 1.0.0
Modified: gearbox/trunk/doc/index.dox
===================================================================
--- gearbox/trunk/doc/index.dox 2009-02-13 07:58:24 UTC (rev 381)
+++ gearbox/trunk/doc/index.dox 2009-02-18 01:41:55 UTC (rev 382)
@@ -45,6 +45,7 @@
@section gbx_doc_index_news News
+- 18-Feb-09 Release 9.02. One new driver and a few updates in other libraries. (@ref gbx_doc_history_902)
- 25-Jul-08 Release 8.07. Includes 5 new libraries and a re-write of the Hokuyo driver. (@ref gbx_doc_history_807)
- 21-Apr-08 First release, version 1.0 (@ref gbx_doc_history_100)
- 18-Mar-08 Accepted ACFR's implementation of SICK laser driver and the serial library used by it.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|