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: <bo...@us...> - 2009-11-08 11:51:38
|
Revision: 457
http://gearbox.svn.sourceforge.net/gearbox/?rev=457&view=rev
Author: borax00
Date: 2009-11-08 11:51:23 +0000 (Sun, 08 Nov 2009)
Log Message:
-----------
MR Changes
Modified Paths:
--------------
gearbox/trunk/doc/history.dox
gearbox/trunk/src/gbxgarminacfr/driver.cpp
gearbox/trunk/src/gbxgarminacfr/driver.h
gearbox/trunk/src/gbxgarminacfr/nmea.cpp
gearbox/trunk/src/gbxgarminacfr/nmea.h
gearbox/trunk/src/gbxgarminacfr/test/test.cpp
gearbox/trunk/src/gbxsickacfr/messages.cpp
gearbox/trunk/src/gbxsickacfr/test/test.cpp
gearbox/trunk/src/gbxsmartbatteryacfr/oceanserver.cpp
gearbox/trunk/src/gbxsmartbatteryacfr/oceanserver.h
gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverhealthchecks.cpp
gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverparser.cpp
gearbox/trunk/src/gbxsmartbatteryacfr/oceanserversystem.cpp
gearbox/trunk/src/gbxsmartbatteryacfr/oceanserversystem.h
gearbox/trunk/src/gbxsmartbatteryacfr/test/darttest/checksumtest.cpp
gearbox/trunk/src/gbxsmartbatteryacfr/test/longtest.cpp
gearbox/trunk/src/gbxutilacfr/exceptions.cpp
gearbox/trunk/src/gbxutilacfr/exceptions.h
Modified: gearbox/trunk/doc/history.dox
===================================================================
--- gearbox/trunk/doc/history.dox 2009-11-07 04:25:00 UTC (rev 456)
+++ gearbox/trunk/doc/history.dox 2009-11-08 11:51:23 UTC (rev 457)
@@ -46,6 +46,13 @@
@par Updated libraries
+-libGbxSmartBatteryAcfr (tobi)
+ - improved robustness by encapsulating data of the oceanserversystem class and implementing access/set and check-for-empty functions
+ - improved healthcheck functions
+ - bug fix related to initialisation
+ - improved exception and error handling
+ - added a raw data record to the oceanserversystem data record useful for debugging
+
- libflexiport
- The UDP port type now properly supports sending and receiving broadcast packets on all operating systems.
(GeoffB)
@@ -56,7 +63,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)
+ - Implemented store::peek() (AlexB)
- libGbxUtilAcfr:
- Status class: removed SubsystemStalled from the list of health types for a subsystem. The stall condition
Modified: gearbox/trunk/src/gbxgarminacfr/driver.cpp
===================================================================
--- gearbox/trunk/src/gbxgarminacfr/driver.cpp 2009-11-07 04:25:00 UTC (rev 456)
+++ gearbox/trunk/src/gbxgarminacfr/driver.cpp 2009-11-08 11:51:23 UTC (rev 457)
@@ -23,16 +23,17 @@
#include "driver.h"
using namespace std;
-using namespace gbxgarminacfr;
///////////////////////////////////////
+namespace gbxgarminacfr {
+
namespace {
// Get the useful bits from a GGA message
-GenericData* extractGgaData( gbxgpsutilacfr::NmeaMessage& msg, int timeSec, int timeUsec )
+GenericData* extractGgaData( const gbxgpsutilacfr::NmeaMessage& msg, int timeSec, int timeUsec )
{
- GgaData* data = new GgaData;
+ std::auto_ptr<GgaData> data( new GgaData );
data->timeStampSec = timeSec;
data->timeStampUsec = timeUsec;
@@ -58,7 +59,7 @@
data->longitude = 0.0;
data->altitude = 0.0;
data->geoidalSeparation = 0.0;
- return data;
+ return data.release();
case '1':
data->fixType = Autonomous;
break;
@@ -84,18 +85,20 @@
data->longitude=dir*(deg+(min/60.0));
//altitude
- data->altitude=atof(msg.getDataToken(Hgt).c_str());
+ data->isAltitudeKnown = !msg.isDataTokenEmpty(Hgt);
+ if ( data->isAltitudeKnown )
+ data->altitude=atof(msg.getDataToken(Hgt).c_str());
//geoidal Separation
data->geoidalSeparation=atof(msg.getDataToken(GeoidHgt).c_str());
- return data;
+ return data.release();
}
// VTG provides velocity and heading information
-GenericData* extractVtgData( gbxgpsutilacfr::NmeaMessage& msg, int timeSec, int timeUsec )
+GenericData* extractVtgData( const gbxgpsutilacfr::NmeaMessage& msg, int timeSec, int timeUsec )
{
- VtgData* data = new VtgData;
+ std::auto_ptr<VtgData> data( new VtgData );
data->timeStampSec = timeSec;
data->timeStampUsec = timeUsec;
@@ -104,15 +107,16 @@
enum VtgTokens{MsgType=0,HeadingTrue,T,HeadingMag,M,SpeedKnots,
N,SpeedKPH,K,ModeInd};
- //Check for an empty string. Means that we are not moving
- //When the message has empty fields tokeniser skips so we get the next field inline.
- if( msg.getDataToken(HeadingTrue)[0] == 'T' ) {
- data->headingTrue=0.0;
- data->headingMagnetic=0.0;
- data->speed=0.0;
- // NOTE: not processing the rest!
- return data;
+ //Check for an empty string. Means that we can't tell anything useful.
+ if ( msg.isDataTokenEmpty(HeadingTrue) )
+ {
+ data->isValid = false;
+ data->headingTrue = 0.0;
+ data->headingMagnetic = 0.0;
+ data->speed = 0.0;
+ return data.release();
}
+ data->isValid = true;
// true heading
double headingRad = DEG2RAD(atof(msg.getDataToken(HeadingTrue).c_str()));
@@ -128,16 +132,16 @@
data->speed=atof(msg.getDataToken(SpeedKPH).c_str());
data->speed*=(1000/3600.0);
- return data;
+ return data.release();
}
// RME message. This one is garmin specific... Give position error estimates
// See doc.dox for a discussion of the position errors as reported here.
// Essentially the EPE reported by the garmin is a 1 sigma error (RMS) or a
// 68% confidence bounds.
-GenericData* extractRmeData( gbxgpsutilacfr::NmeaMessage& msg, int timeSec, int timeUsec )
+GenericData* extractRmeData( const gbxgpsutilacfr::NmeaMessage& msg, int timeSec, int timeUsec )
{
- RmeData* data = new RmeData;
+ std::auto_ptr<RmeData> data( new RmeData );
data->timeStampSec = timeSec;
data->timeStampUsec = timeUsec;
@@ -145,11 +149,33 @@
//Names for the RME message items
enum RmeTokens{MsgType=0,HError,M1,VError,M2,EPE,M3};
+ if ( msg.isDataTokenEmpty(HError) )
+ {
+ // No valid information
+ data->isValid = false;
+ data->isVerticalPositionErrorValid = false;
+ data->horizontalPositionError = 0.0;
+ data->verticalPositionError = 0.0;
+ data->estimatedPositionError = 0.0;
+ return data.release();
+ }
+ data->isValid = true;
+
data->horizontalPositionError = atof(msg.getDataToken(HError).c_str());
- data->verticalPositionError = atof(msg.getDataToken(VError).c_str());
+ if ( msg.isDataTokenEmpty(VError) )
+ {
+ data->isVerticalPositionErrorValid = false;
+ data->verticalPositionError = -1;
+ }
+ else
+ {
+ data->isVerticalPositionErrorValid = true;
+ data->verticalPositionError = atof(msg.getDataToken(VError).c_str());
+ }
+
data->estimatedPositionError = atof(msg.getDataToken(EPE).c_str());
- return data;
+ return data.release();
}
}
@@ -172,9 +198,9 @@
Config::toString() const
{
std::stringstream ss;
- ss << "Garmin driver config: " <<
- "\tdevice="<<device <<
- "\twill read sentences: GPGGA="<<readGga<<" GPVTG="<<readVtg<<" PGRME="<<readRme;
+ ss << "Garmin driver config: " << endl
+ << "\tdevice="<<device << endl
+ << "\twill read sentences: GPGGA="<<readGga<<" GPVTG="<<readVtg<<" PGRME="<<readRme;
return ss.str();
}
@@ -209,7 +235,15 @@
Driver::~Driver()
{
- disableDevice();
+ // Don't throw from destructors...
+ try {
+ disableDevice();
+ }
+ catch ( const std::exception &e )
+ {
+ cout << "Driver::~Driver: exception while disabling: " << e.what() << endl;
+ }
+ catch ( ... ) {}
}
void
@@ -240,6 +274,7 @@
gbxgpsutilacfr::NmeaMessage disableAllMsg( "$PGRMO,,2*xx\r\n",gbxgpsutilacfr::AddChecksum );
serial_->writeString( disableAllMsg.sentence() );
+ // alexb: what is this sleep for?
sleep(1);
if ( config_.readGga ) {
@@ -247,7 +282,6 @@
serial_->writeString( enableGgaMsg.sentence() );
}
-
if ( config_.readVtg ) {
gbxgpsutilacfr::NmeaMessage enableVtgMsg( "$PGRMO,GPVTG,1*xx\r\n",gbxgpsutilacfr::AddChecksum );
serial_->writeString( enableVtgMsg.sentence() );
@@ -258,6 +292,7 @@
serial_->writeString( enableRmeMsg.sentence() );
}
+ // alexb: what is this sleep for?
sleep(1);
}
@@ -273,11 +308,7 @@
Driver::read()
{
std::auto_ptr<GenericData> genericData;
-
gbxgpsutilacfr::NmeaMessage nmeaMessage;
- // Make sure that we clear our internal data structures
- // alexm: is this necessary? should NmeaMessage do it for itself?
- memset((void*)(&nmeaMessage) , 0 , sizeof(nmeaMessage));
int nmeaExceptionCount = 0;
int nmeaFailChecksumCount = 0;
@@ -330,7 +361,7 @@
//Put it into the message object and checksum the data
try {
// This throws if it cannot find the * to deliminate the checksum field
- nmeaMessage.setSentence( serialData.c_str(), gbxgpsutilacfr::TestChecksum );
+ nmeaMessage.setSentence( serialData, gbxgpsutilacfr::TestChecksum );
}
catch ( const gbxgpsutilacfr::NmeaException& e ) {
//Don't throw on isolated checksum problems
@@ -384,7 +415,10 @@
else
throw gbxutilacfr::Exception( ERROR_INFO, "got unexpected GPGGA message" );
genericData.reset( extractGgaData( nmeaMessage, now.tv_sec, now.tv_usec ) );
- break;
+ if ( genericData.get() )
+ break;
+ else
+ continue;
}
else if ( MsgType == "$GPVTG" ) {
if ( config_.readVtg )
@@ -392,7 +426,10 @@
else
throw gbxutilacfr::Exception( ERROR_INFO, "got unexpected GPVTG message" );
genericData.reset( extractVtgData( nmeaMessage, now.tv_sec, now.tv_usec ) );
- break;
+ if ( genericData.get() )
+ break;
+ else
+ continue;
}
else if ( MsgType == "$PGRME" ) {
if ( config_.readRme )
@@ -400,7 +437,10 @@
else
throw gbxutilacfr::Exception( ERROR_INFO, "got unexpected PGRME message" );
genericData.reset( extractRmeData( nmeaMessage, now.tv_sec, now.tv_usec ) );
- break;
+ if ( genericData.get() )
+ break;
+ else
+ continue;
}
else if ( MsgType == "$PGRMO" ) {
//This message is sent by us to control msg transmission and then echoed by GPS
@@ -415,8 +455,64 @@
else
throw gbxutilacfr::Exception( ERROR_INFO, ss.str() );
}
+ }
+ return genericData;
+}
+std::string toString( const FixType &f )
+{
+ switch ( f )
+ {
+ case Invalid: return "Invalid";
+ case Autonomous: return "Autonomous";
+ case Differential: return "Differential";
+ default: return "??";
}
+}
- return genericData;
+std::string toString( const GgaData &d )
+{
+ stringstream ss;
+ ss << endl;
+ ss << " timeStampSec : " << d.timeStampSec << endl
+ << " timeStampUsec : " << d.timeStampUsec << endl
+ << " utcTimeHrs : " << d.utcTimeHrs << endl
+ << " utcTimeMin : " << d.utcTimeMin << endl
+ << " utcTimeSec : " << d.utcTimeSec << endl
+ << " latitude : " << d.latitude << endl
+ << " longitude : " << d.longitude << endl
+ << " isAltitudeKnown : " << d.isAltitudeKnown << endl
+ << " altitude : " << d.altitude << endl
+ << " fixType : " << d.fixType << endl
+ << " satellites : " << d.satellites << endl
+ << " horizontalDilutionOfPosition : " << d.horizontalDilutionOfPosition << endl
+ << " geoidalSeparation : " << d.geoidalSeparation;
+ return ss.str();
}
+std::string toString( const VtgData &d )
+{
+ stringstream ss;
+ ss << endl;
+ ss << " timeStampSec : " << d.timeStampSec << endl
+ << " timeStampUsec : " << d.timeStampUsec << endl
+ << " isValid : " << d.isValid << endl
+ << " headingTrue : " << d.headingTrue << endl
+ << " headingMagnetic : " << d.headingMagnetic << endl
+ << " speed : " << d.speed;
+ return ss.str();
+}
+std::string toString( const RmeData &d )
+{
+ stringstream ss;
+ ss << endl;
+ ss << " timeStampSec : " << d.timeStampSec << endl
+ << " timeStampUsec : " << d.timeStampUsec << endl
+ << " isValid : " << d.isValid << endl
+ << " horizontalPositionError : " << d.horizontalPositionError << endl
+ << " isVerticalPositionErrorValid : " << d.isVerticalPositionErrorValid << endl
+ << " verticalPositionError : " << d.verticalPositionError << endl
+ << " estimatedPositionError : " << d.estimatedPositionError;
+ return ss.str();
+}
+
+}
Modified: gearbox/trunk/src/gbxgarminacfr/driver.h
===================================================================
--- gearbox/trunk/src/gbxgarminacfr/driver.h 2009-11-07 04:25:00 UTC (rev 456)
+++ gearbox/trunk/src/gbxgarminacfr/driver.h 2009-11-08 11:51:23 UTC (rev 457)
@@ -85,6 +85,7 @@
//! Differentially corrected
Differential
};
+std::string toString( const FixType &f );
//! Fix data structure. Note that when fixType is Invalid, all other data except the time stamps
//! are meaningless.
@@ -114,7 +115,9 @@
double latitude;
//! Longitude [degrees]
double longitude;
- //! Altitude [metres above ellipsoid]
+ //! Altitude is meaningful if and only if isAltitudeKnown
+ bool isAltitudeKnown;
+ //! Altitude [metres above ellipsoid] (only meaningful if isAltitudeKnown)
double altitude;
//! Fix type. When fixType is Invalid, all other data except the time stamps
@@ -130,6 +133,9 @@
//! Height of geoid (mean sea level) above WGS84 ellipsoid [metres]
double geoidalSeparation;
};
+std::string toString( const GgaData &d );
+inline std::ostream &operator<<( std::ostream &s, const GgaData &d )
+{ return s << toString(d); }
//! Vector track and speed over ground data structure.
class VtgData : public GenericData
@@ -143,6 +149,10 @@
//! Time (according to the computer clock) when data was measured.
//! Number of microseconds
int timeStampUsec;
+
+ //! When false, means that the GPS unit can't make a valid measurement
+ //! (so all data other than the timestamp is meaningless).
+ bool isValid;
//! Heading/track/course with respect to true North [rad]
double headingTrue;
@@ -151,6 +161,9 @@
//! Horizontal velocity [metres/second]
double speed;
};
+std::string toString( const VtgData &d );
+inline std::ostream &operator<<( std::ostream &s, const VtgData &d )
+{ return s << toString(d); }
//! Gps data structure
class RmeData : public GenericData
@@ -165,6 +178,14 @@
//! Number of microseconds
int timeStampUsec;
+ //! When false, means that the GPS unit can't make a valid measurement
+ //! (so all data other than the timestamp is meaningless).
+ bool isValid;
+
+ //! When false, means that the GPS unit can't tell us anything
+ //! about our vertical error
+ bool isVerticalPositionErrorValid;
+
//! Horizontal position error: one standard deviation [metres)]
double horizontalPositionError;
//! Vertical position error: one standard deviation [metres]
@@ -173,6 +194,9 @@
//! Estimated position error.
double estimatedPositionError;
};
+std::string toString( const RmeData &d );
+inline std::ostream &operator<<( std::ostream &s, const RmeData &d )
+{ return s << toString(d); }
/*!
Garmin GPS driver.
Modified: gearbox/trunk/src/gbxgarminacfr/nmea.cpp
===================================================================
--- gearbox/trunk/src/gbxgarminacfr/nmea.cpp 2009-11-07 04:25:00 UTC (rev 456)
+++ gearbox/trunk/src/gbxgarminacfr/nmea.cpp 2009-11-08 11:51:23 UTC (rev 457)
@@ -12,33 +12,34 @@
#include <string>
#include <iostream>
#include <assert.h>
+#include <sstream>
#include <gbxutilacfr/tokenise.h>
-//////////////////////////////
+// //////////////////////////////
-// Ensure we have strnlen
-// eg. Solaris doesn't define strnlen in string.h, so define it here.
-#if !HAVE_STRNLEN
+// // Ensure we have strnlen
+// // eg. Solaris doesn't define strnlen in string.h, so define it here.
+// #if !HAVE_STRNLEN
-#include <cstring>
+// #include <cstring>
-// inline the fucker to guard against multiple inclusion, without the
-// hassle of a special lib.
-inline size_t strnlen(const char *s, size_t maxlen)
-{
- char *p;
- if (s == NULL) {
- return maxlen;
- }
- p = (char *)memchr(s, 0, maxlen);
- if (p == NULL) {
- return maxlen;
- }
- return ((p - s) + 1);
-}
-#endif
+// // inline the fucker to guard against multiple inclusion, without the
+// // hassle of a special lib.
+// inline size_t strnlen(const char *s, size_t maxlen)
+// {
+// char *p;
+// if (s == NULL) {
+// return maxlen;
+// }
+// p = (char *)memchr(s, 0, maxlen);
+// if (p == NULL) {
+// return maxlen;
+// }
+// return ((p - s) + 1);
+// }
+// #endif
-//////////////////////////////
+// //////////////////////////////
#include "nmea.h"
@@ -57,39 +58,30 @@
void NmeaMessage::init()
{
- haveSentence_ = false;
- haveTokens_ = false;
haveCheckSum_ = false;
checkSumOK_ = false;
// Now clear the internal data store
- sentence_[0] = 0;
+ sentence_.clear();
dataTokens_.clear();
}
-
-NmeaMessage::NmeaMessage(const char *sentence, int testCheckSum)
+NmeaMessage::NmeaMessage(const std::string &sentence, NmeaMessageOptions addOrTestCheckSum)
{
init();
- setSentence(sentence,testCheckSum);
+ setSentence(sentence,addOrTestCheckSum);
}
//Load the data as requested and test the checksum if we are asked to.
void
-NmeaMessage::setSentence(const char *data, int AddOrTestCheckSum)
+NmeaMessage::setSentence(const std::string &data, NmeaMessageOptions addOrTestCheckSum)
{
init();
-
- strncpy(sentence_,data, MAX_SENTENCE_LEN);
- //terminate just in case, Note that we have a buffer which is
- //MAX_SENTENCE_LEN + 1 long!
-
- sentence_[MAX_SENTENCE_LEN] = '\0';
- haveSentence_ = true;
+ sentence_ = data;
- switch ( AddOrTestCheckSum )
+ switch ( addOrTestCheckSum )
{
case TestChecksum: {
// This is for Rx'd data that we need to test for correct reception
@@ -106,7 +98,7 @@
case DontTestOrAddChecksum:
break;
default:
- assert( true && "unrecognized message option" );
+ assert( false && "unrecognized message option" );
}
}
@@ -116,34 +108,36 @@
haveCheckSum_ = true;
checkSumOK_ = false;
- //First save the checksum chars from the existing message
- char* ptr;
- char chksum_HIB,chksum_LOB;
-
//First save the existing two checksum chars from the message
//These are straight after the '*' character
- ptr = strchr(sentence_, NMEAChecksumDelim);
- if ( !ptr ) {
-// cout<<"device: no checksum delimiter"<<endl;
+ const size_t starPos = sentence_.find( NMEAChecksumDelim );
+ if ( starPos == std::string::npos )
+ {
+ // cout<<"device: no checksum delimiter"<<endl;
return false;
}
+
+ if ( starPos+2 >= sentence_.size() )
+ {
+ // cout<<"device: no checksum after delimiter"<<endl;
+ return false;
+ }
//save the high and low bytes of the checksum
//Make sure they are in upper case!
- chksum_HIB = (char)toupper(*(++ptr));
- chksum_LOB = (char)toupper(*(ptr + 1));
-
+ const int checksumPos = starPos+1;
+ const char chksum_HIB = (char)toupper(sentence_[checksumPos]);
+ const char chksum_LOB = (char)toupper(sentence_[checksumPos+1]);
//invalidate the existing checksum
- *ptr = *(ptr+1) = 'x';
-
- //****NOTE** We leave the ptr pointing at the first chksum byte
-
+ sentence_[checksumPos] = 'x';
+ sentence_[checksumPos+1] = 'x';
+
//Re-calculate our own copy of the checksum
addCheckSum();
//Now compare our saved version with our new ones
- if( (chksum_HIB == *ptr) && (chksum_LOB == *(ptr+1)) ) {
+ if( (chksum_HIB == sentence_[checksumPos]) && (chksum_LOB == sentence_[checksumPos+1]) ) {
//all looked good!
checkSumOK_ = true;
return true;
@@ -160,9 +154,9 @@
// the checksum, and that the checksum delimiter is there
void
NmeaMessage::addCheckSum()
-{
- assert( haveSentence_ && "calling addCheckSum() without a sentence" );
-
+{
+ assert( haveSentence() && "calling addCheckSum() without a sentence" );
+
haveCheckSum_ = true;
//check that we have the '$' at the start
@@ -172,12 +166,11 @@
unsigned char chkRunning = 0;
+ // we start from 1 to skip the leading '$'
int loopCount;
- unsigned char nextChar;
- // we start from 1 to skip the leading '$'
- for( loopCount=1; loopCount<MAX_SENTENCE_LEN; ++loopCount )
+ for ( loopCount = 1; loopCount < (int)(sentence_.size()); loopCount++ )
{
- nextChar = static_cast<unsigned char>(sentence_[loopCount]);
+ unsigned char nextChar = static_cast<unsigned char>(sentence_[loopCount]);
// no delimiter uh oh
if( (nextChar=='\r') || (nextChar=='\n') || (nextChar=='\0') ) {
@@ -196,9 +189,14 @@
// Keep the running XOR total
chkRunning ^= nextChar;
}
+
+ if ( loopCount+2 >= (int)(sentence_.size()) )
+ {
+ throw NmeaException("addCheckSum(): no space for checksum of '*' not found.");
+ }
//Put the byte values as upper case HEX back into the message
- sprintf( sentence_ + loopCount + 1,"%02X", chkRunning );
+ sprintf( &(sentence_[loopCount + 1]),"%02X", chkRunning );
}
// Parse the data fields of our message...
@@ -218,3 +216,39 @@
//keep track of what we have done.
haveTokens_ = true;
}
+
+bool
+NmeaMessage::isDataTokenEmpty(int i) const
+{
+ if ( i >= (int)(dataTokens_.size()) )
+ {
+ stringstream ss;
+ ss << "NmeaMessage::" << __func__
+ << ": attempt to getDataToken("<<i<<") but only " << dataTokens_.size() << " exist in sentence: "
+ << sentence_;
+ throw NmeaException( ss.str() );
+ }
+ return dataTokens_[i].empty();
+}
+
+const std::string &
+NmeaMessage::getDataToken(int i) const
+{
+ if ( i >= (int)(dataTokens_.size()) )
+ {
+ stringstream ss;
+ ss << "NmeaMessage::" << __func__
+ << ": attempt to getDataToken("<<i<<") but only " << dataTokens_.size() << " exist in sentence: "
+ << sentence_;
+ throw NmeaException( ss.str() );
+ }
+ if ( dataTokens_[i].empty() )
+ {
+ stringstream ss;
+ ss << "NmeaMessage::" << __func__
+ << ": attempt to getDataToken("<<i<<") but this token is empty in sentence: "
+ << sentence_;
+ throw NmeaException( ss.str() );
+ }
+ return dataTokens_[i];
+}
Modified: gearbox/trunk/src/gbxgarminacfr/nmea.h
===================================================================
--- gearbox/trunk/src/gbxgarminacfr/nmea.h 2009-11-07 04:25:00 UTC (rev 456)
+++ gearbox/trunk/src/gbxgarminacfr/nmea.h 2009-11-08 11:51:23 UTC (rev 457)
@@ -78,14 +78,14 @@
{
public:
NmeaMessage();
- NmeaMessage(const char *sentence, int testCheckSum=DontTestOrAddChecksum );
+ NmeaMessage(const std::string &sentence, NmeaMessageOptions addOrTestCheckSum=DontTestOrAddChecksum );
// Set up the internal data for a sentence.
// May throw NmeaException if TestChecksum is specified.
- void setSentence(const char *data, int testCheckSum=DontTestOrAddChecksum );
+ void setSentence(const std::string &data, NmeaMessageOptions addOrTestCheckSum=DontTestOrAddChecksum );
- // Do we only have the raw string?
- bool haveSentence() const { return haveSentence_; };
+ // Do we have the raw string?
+ bool haveSentence() const { return !sentence_.empty(); };
// Do we have parsed fields?
bool haveTokens() const { return haveTokens_; };
@@ -101,11 +101,14 @@
bool testChecksumOk();
// Return the raw sentence string
- const char* sentence() { return sentence_; };
+ const std::string &sentence() const { return sentence_; };
- // Return a single data token as a string
- std::string& getDataToken(int i) { return dataTokens_[i]; };
+ // Return a single data token as a string.
+ // Throws an exception if that token is empty (see 'isDataTokenEmpty()')
+ const std::string &getDataToken(int i) const;
+ bool isDataTokenEmpty(int i) const;
+
// Return the number of fields
int numDataTokens() const { return dataTokens_.size(); };
@@ -116,15 +119,14 @@
void init();
// May throw NmeaException.
void addCheckSum();
- // Do we only have the raw string ?
- bool haveSentence_;
// Have we parsed data into tokens ?
bool haveTokens_;
// Have we a checksum and is it valid?
bool haveCheckSum_;
bool checkSumOK_;
// The raw sentence, allow for terminator
- char sentence_[MAX_SENTENCE_LEN+1];
+// char sentence_[MAX_SENTENCE_LEN+1];
+ std::string sentence_;
// The tokenised data
std::vector<std::string> dataTokens_;
};
Modified: gearbox/trunk/src/gbxgarminacfr/test/test.cpp
===================================================================
--- gearbox/trunk/src/gbxgarminacfr/test/test.cpp 2009-11-07 04:25:00 UTC (rev 456)
+++ gearbox/trunk/src/gbxgarminacfr/test/test.cpp 2009-11-08 11:51:23 UTC (rev 457)
@@ -32,22 +32,31 @@
// defaults
string port = "/dev/ttyS0";
bool quiet = false;
+ int numReads = 30;
+ int debugLevel = 5;
// Get some options from the command line
- while ((opt = getopt(argc, argv, "p:q")) != -1)
+ while ((opt = getopt(argc, argv, "p:n:d:q")) != -1)
{
switch ( opt )
{
case 'p':
port = optarg;
break;
+ case 'n':
+ numReads=atoi(optarg);
+ break;
+ case 'd':
+ debugLevel=atoi(optarg);
+ break;
case 'q':
quiet = true;
break;
default:
cout << "Usage: " << argv[0] << " [-p port]" << endl << endl
- << "-p port\tPort the device is connected to. E.g. /dev/ttyS0"
- << "-q \tMakes normal operation quiet, only errors are traced." << endl;
+ << "-p port \tPort the device is connected to. E.g. /dev/ttyS0" << endl
+ << "-n numReads\tNumber of times to read from the device" << endl
+ << "-q \tMakes normal operation quiet, only errors are traced." << endl;
return 1;
}
}
@@ -66,17 +75,16 @@
cout << "Using configuration: " << config.toString() << endl;
// Instantiate objects to handle messages from the driver
- bool debug = 5;
if ( quiet )
- debug = 0;
- gbxutilacfr::TrivialTracer tracer( debug );
+ debugLevel = 0;
+ gbxutilacfr::TrivialTracer tracer( debugLevel );
gbxutilacfr::TrivialStatus status( tracer );
// Instantiate the driver itself
- gbxgarminacfr::Driver* device;
+ std::auto_ptr<gbxgarminacfr::Driver> device;
try
{
- device = new gbxgarminacfr::Driver( config, tracer, status );
+ device.reset( new gbxgarminacfr::Driver( config, tracer, status ) );
}
catch ( const std::exception& e )
{
@@ -88,7 +96,6 @@
std::auto_ptr<gbxgarminacfr::GenericData> data;
// Read a few times
- const int numReads = 30 + 10000000;
for ( int i=0; i < numReads; i++ )
{
try
@@ -142,7 +149,5 @@
cout <<"Test: Failed to read data: "<<e.what()<<endl;
}
}
-
- delete device;
return 0;
}
Modified: gearbox/trunk/src/gbxsickacfr/messages.cpp
===================================================================
--- gearbox/trunk/src/gbxsickacfr/messages.cpp 2009-11-07 04:25:00 UTC (rev 456)
+++ gearbox/trunk/src/gbxsickacfr/messages.cpp 2009-11-08 11:51:23 UTC (rev 457)
@@ -893,6 +893,7 @@
if ( checksumFailed )
{
IceUtil::Time t = IceUtil::Time::now();
+ cout << "========== Checksum failed, timestamp: " << t.toDateTime() << endl;
// cout << "WARN(messages.cpp): " << t.toDateTime() << ": Checksum failed at buf pos " <<bytesParsed << endl;
// cout<<"TRACE(messages.cpp): checksum was over: " << toHexString( &(buffer[bytesParsed]), telegramLength ) << endl;
bytesParsed++;
Modified: gearbox/trunk/src/gbxsickacfr/test/test.cpp
===================================================================
--- gearbox/trunk/src/gbxsickacfr/test/test.cpp 2009-11-07 04:25:00 UTC (rev 456)
+++ gearbox/trunk/src/gbxsickacfr/test/test.cpp 2009-11-08 11:51:23 UTC (rev 457)
@@ -12,7 +12,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#include <iostream>
#include <sstream>
@@ -28,30 +27,35 @@
//
int main( int argc, char **argv )
{
- int opt;
int baud = 38400;
string port = "/dev/ttyS0";
int debug = 0;
bool showScan = false;
// Get some options from the command line
- while ((opt = getopt(argc, argv, "p:b:vs")) != -1)
+ for ( int i=1; i < argc; i++ )
{
- switch ( opt )
+ if ( !strcmp(argv[i],"-p") && i < argc-1 )
{
- case 'p':
- port = optarg;
- break;
- case 'b':
- baud = atoi( optarg );
- break;
- case 'v':
- debug = 5;
- break;
- case 's':
+ port = argv[i+1];
+ i++;
+ }
+ else if ( !strcmp(argv[i],"-b") && i < argc-1 )
+ {
+ baud = atoi(argv[i+1]);
+ i++;
+ }
+ else if ( !strcmp(argv[i],"-v") )
+ {
+ debug = true;
+ }
+ else if ( !strcmp(argv[i],"-s") )
+ {
showScan = true;
- break;
- default:
+ }
+ else
+ {
+ cout << "Unknown option: " << argv[i] << endl;
cout << "Usage: " << argv[0] << " [-p port] [-b baud] [-v(erbose)] [-s(how scan)]" << endl << endl
<< "-p port\tPort the laser scanner is connected to. E.g. /dev/ttyS0" << endl
<< "-b baud\tBaud rate to connect at (9600, 19200, 38400, or 500000)." << endl;
Modified: gearbox/trunk/src/gbxsmartbatteryacfr/oceanserver.cpp
===================================================================
--- gearbox/trunk/src/gbxsmartbatteryacfr/oceanserver.cpp 2009-11-07 04:25:00 UTC (rev 456)
+++ gearbox/trunk/src/gbxsmartbatteryacfr/oceanserver.cpp 2009-11-08 11:51:23 UTC (rev 457)
@@ -36,7 +36,7 @@
// read new data, this may throw
reader_->read(data);
- // if successful, reset counter and string
+ // successful read: reset counter and string
exceptionCounter_ = 0;
exceptionString_ = "";
@@ -54,8 +54,8 @@
exceptionCounter_++;
stringstream ssEx;
ssEx << e.what() << endl;
- for (unsigned int i=0; i<data.rawRecord.size(); i++)
- ssEx << data.rawRecord[i] << endl;
+ for (unsigned int i=0; i<data.rawRecord().size(); i++)
+ ssEx << data.rawRecord()[i] << endl;
ssEx << endl;
exceptionString_ = exceptionString_ + ssEx.str();
@@ -79,7 +79,8 @@
}
// return updated internal storage
- // if there was an exception on read, we just return the previous record
+ // if there was an exception on read which does not get re-thrown above,
+ // the internal storage will contain the previous record
return data_;
}
Modified: gearbox/trunk/src/gbxsmartbatteryacfr/oceanserver.h
===================================================================
--- gearbox/trunk/src/gbxsmartbatteryacfr/oceanserver.h 2009-11-07 04:25:00 UTC (rev 456)
+++ gearbox/trunk/src/gbxsmartbatteryacfr/oceanserver.h 2009-11-08 11:51:23 UTC (rev 457)
@@ -38,6 +38,7 @@
//! Reads data from OceanServer, incrementally updates internal storage
//! Returns a reference to the internal storage
//! May throw gbxutilacfr::Exception
+ //! May return an empty record ( check with isEmpty() )
const gbxsmartbatteryacfr::OceanServerSystem& getData();
private:
Modified: gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverhealthchecks.cpp
===================================================================
--- gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverhealthchecks.cpp 2009-11-07 04:25:00 UTC (rev 456)
+++ gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverhealthchecks.cpp 2009-11-08 11:51:23 UTC (rev 457)
@@ -18,12 +18,24 @@
{
namespace
{
-
+
+ bool isRecordEmpty( const OceanServerSystem &batteryData,
+ vector<string> &warnShort,
+ vector<string> &warnVerbose)
+ {
+ if ( !batteryData.isEmpty() )
+ return false;
+
+ warnVerbose.push_back("The OceanServerSystem data record was empty");
+ warnShort.push_back("EMPTY RECORD");
+ return true;
+ }
+
bool haveBattery( const OceanServerSystem &batteryData,
vector<string> &warnShort,
vector<string> &warnVerbose )
{
- const vector<bool> &bats = batteryData.availableBatteries;
+ const vector<bool> &bats = batteryData.availableBatteries();
bool haveBattery = false;
for (unsigned int i=0; i<bats.size(); i++)
{
@@ -58,10 +70,12 @@
std::vector<std::string> &warnVerbose,
int expectedNumBatteries )
{
+ if ( isRecordEmpty(batteryData, warnShort, warnVerbose) ) return true;
+
bool haveWarning = false;
int numBatteries = 0;
- const vector<bool> &bats = batteryData.availableBatteries;
+ const vector<bool> &bats = batteryData.availableBatteries();
for (unsigned int i=0; i<bats.size(); i++)
{
@@ -72,10 +86,10 @@
if ( numBatteries!=expectedNumBatteries )
{
stringstream ssWarnShort;
- ssWarnShort << "ONLY " << numBatteries << " BATTERIES! ";
+ ssWarnShort << "HAVE " << numBatteries << ", EXP " << expectedNumBatteries << " BAT! ";
warnShort.push_back(ssWarnShort.str());
stringstream ssWarnVerbose;
- ssWarnVerbose << "Only found " << numBatteries << " battery modules (expected to see " << expectedNumBatteries << ")" << endl;
+ ssWarnVerbose << "Found " << numBatteries << " battery modules (expected to see " << expectedNumBatteries << ")" << endl;
warnVerbose.push_back( ssWarnVerbose.str() );
haveWarning = true;
}
@@ -89,6 +103,8 @@
int numCyclesThreshhold,
bool printRawRecord )
{
+ if ( isRecordEmpty(batteryData, warnShort, warnVerbose) ) return true;
+
bool haveWarning = false;
map<int,SmartBattery>::const_iterator it;
@@ -114,7 +130,7 @@
if (haveWarning && printRawRecord)
{
stringstream ssWarnVerbose;
- ssWarnVerbose << "Latest raw record: " << endl << toString(batteryData.rawRecord) << endl;
+ ssWarnVerbose << "Latest raw record: " << endl << toString(batteryData.rawRecord()) << endl;
warnVerbose.push_back(ssWarnVerbose.str());
}
@@ -128,7 +144,9 @@
double chargeTempThreshhold,
double dischargeTempThreshhold,
bool printRawRecord )
-{
+{
+ if ( isRecordEmpty(batteryData, warnShort, warnVerbose) ) return true;
+
bool haveWarning = false;
map<int,SmartBattery>::const_iterator it;
@@ -139,8 +157,8 @@
const SmartBattery &bat = batteryData.battery( batteryNumber );
if ( !bat.has(Temperature) ) continue;
- assert( (int)batteryData.chargingStates.size() >= batteryNumber-1 );
- bool isCharging = batteryData.chargingStates[batteryNumber-1];
+ assert( (int)batteryData.chargingStates().size() >= batteryNumber-1 );
+ bool isCharging = batteryData.chargingStates()[batteryNumber-1];
double tempThreshhold = 0.0;
if (isCharging) {
@@ -165,7 +183,7 @@
if (haveWarning && printRawRecord)
{
stringstream ssWarnVerbose;
- ssWarnVerbose << "Latest raw record: " << endl << toString(batteryData.rawRecord) << endl;
+ ssWarnVerbose << "Latest raw record: " << endl << toString(batteryData.rawRecord()) << endl;
warnVerbose.push_back(ssWarnVerbose.str());
}
@@ -178,6 +196,12 @@
int chargeWarnThreshhold,
int chargeDeviationThreshold )
{
+
+ if ( isRecordEmpty(batteryData, warnShort, warnVerbose) ) return true;
+
+ // if the system is charging, don't bother issuing warnings
+ if ( isSystemOnCharge(batteryData) ) return false;
+
bool haveWarning = false;
map<int,SmartBattery>::const_iterator it;
@@ -189,7 +213,7 @@
if ( !bat.has(RelativeStateOfCharge) ) continue;
int charge = bat.relativeStateOfCharge();
- const int avgCharge = batteryData.percentCharge;
+ const int avgCharge = batteryData.percentCharge();
// check whether battery charge is lower than the average
if ( charge < (avgCharge - chargeDeviationThreshold) )
@@ -202,8 +226,7 @@
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;
@@ -219,14 +242,17 @@
return haveWarning;
}
-bool checkModuleHealth( const OceanServerSystem &batteryData,
+bool checkModuleHealth( const OceanServerSystem &batteryData,
vector<string> &warnShort,
vector<string> &warnVerbose )
{
+
+ if ( isRecordEmpty(batteryData, warnShort, warnVerbose) ) return true;
+
bool haveWarning = false;
// check the flags
- const vector<bool> &badPower = batteryData.powerNoGoodStates;
+ const vector<bool> &badPower = batteryData.powerNoGoodStates();
for (unsigned int i=0; i<badPower.size(); i++)
{
if (badPower[i]==true)
@@ -241,7 +267,7 @@
}
}
- const vector<bool> &chargeInhibit = batteryData.chargeInhibitedStates;
+ const vector<bool> &chargeInhibit = batteryData.chargeInhibitedStates();
for (unsigned int i=0; i<chargeInhibit.size(); i++)
{
if (chargeInhibit[i]==true)
@@ -265,20 +291,29 @@
std::vector<std::string> &warnVerbose,
bool printRawRecord )
{
- if ( !haveBattery( batteryData, warnShort, warnVerbose ) ) return true;
+ if ( isRecordEmpty(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 = false;
+
+ if ( haveBattery( batteryData, warnShort, warnVerbose ) )
+ {
+ 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 );
+
+ haveWarnings = warnNumBatteries || warnModule || warnCycle || warnTemp || warnCharge;
+ }
+ else
+ {
+ haveWarnings = true;
+ }
- bool haveWarnings = warnNumBatteries || warnModule || warnCycle || warnTemp || warnCharge;
-
if (printRawRecord && haveWarnings )
{
stringstream ssWarnVerbose;
- ssWarnVerbose << "Latest raw record: " << endl << toString(batteryData.rawRecord) << endl;
+ ssWarnVerbose << "Latest raw record: " << endl << toString(batteryData.rawRecord()) << endl;
warnVerbose.push_back(ssWarnVerbose.str());
}
Modified: gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverparser.cpp
===================================================================
--- gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverparser.cpp 2009-11-07 04:25:00 UTC (rev 456)
+++ gearbox/trunk/src/gbxsmartbatteryacfr/oceanserverparser.cpp 2009-11-08 11:51:23 UTC (rev 457)
@@ -34,16 +34,16 @@
for (it=keyValuePairs.begin(); it!=keyValuePairs.end(); it++)
{
if (it->first=="01") {
- batterySystem.minToEmpty = readMinutes(it->second);
+ batterySystem.setMinToEmpty( readMinutes(it->second) );
}
else if (it->first=="02") {
// reserved, do nothing
}
else if (it->first=="03") {
- batterySystem.messageToSystem = it->second;
+ batterySystem.setMessageToSystem( it->second );
}
else if (it->first=="04") {
- batterySystem.percentCharge = readPercentByte(it->second);
+ batterySystem.setPercentCharge( readPercentByte(it->second) );
}
else
{
@@ -66,30 +66,30 @@
if (it->first=="01") {
readFlags(it->second, states);
- batterySystem.availableBatteries = states;
+ batterySystem.availableBatteries() = states;
}
else if (it->first=="02") {
readFlags(it->second, states);
- batterySystem.chargingStates = states;
+ batterySystem.chargingStates() = states;
}
else if (it->first=="03") {
readFlags(it->second, states);
- batterySystem.supplyingPowerStates = states;
+ batterySystem.supplyingPowerStates() = states;
}
else if (it->first=="04") {
// reserved, do nothing
}
else if (it->first=="05") {
readFlags(it->second, states);
- batterySystem.chargePowerPresentStates = states;
+ batterySystem.chargePowerPresentStates() = states;
}
else if (it->first=="06") {
readFlags(it->second, states);
- batterySystem.powerNoGoodStates = states;
+ batterySystem.powerNoGoodStates() = states;
}
else if (it->first=="07") {
readFlags(it->second, states);
- batterySystem.chargeInhibitedStates = states;
+ batterySystem.chargeInhibitedStates() = states;
}
else
{
@@ -254,7 +254,7 @@
{
// 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;
+ batterySystem.rawRecord() = stringList;
//
// Debugging output
Modified: gearbox/trunk/src/gbxsmartbatteryacfr/oceanserversystem.cpp
===================================================================
--- gearbox/trunk/src/gbxsmartbatteryacfr/oceanserversystem.cpp 2009-11-07 04:25:00 UTC (rev 456)
+++ gearbox/trunk/src/gbxsmartbatteryacfr/oceanserversystem.cpp 2009-11-08 11:51:23 UTC (rev 457)
@@ -49,17 +49,18 @@
//
// Non-member functions
//
+
string toString( const OceanServerSystem &system )
{
stringstream ss;
- ss << "Charge: \t" << system.percentCharge << endl;
- ss << "Minutes to empty:\t" << system.minToEmpty << endl;
- ss << "Available batt.: \t" << toString( system.availableBatteries ) << endl;
- ss << "Charging: \t" << toString( system.chargingStates ) << endl;
- ss << "Supplying power: \t" << toString( system.supplyingPowerStates ) << endl;
- ss << "Charge power: \t" << toString( system.chargePowerPresentStates ) << endl;
- ss << "Power no good: \t" << toString( system.powerNoGoodStates ) << endl;
- ss << "Charge inhibited:\t" << toString( system.chargeInhibitedStates ) << endl;
+ ss << "Charge: \t" << system.percentCharge() << endl;
+ ss << "Minutes to empty:\t" << system.minToEmpty() << endl;
+ ss << "Available batt.: \t" << toString( system.availableBatteries() ) << endl;
+ ss << "Charging: \t" << toString( system.chargingStates() ) << endl;
+ ss << "Supplying power: \t" << toString( system.supplyingPowerStates() ) << endl;
+ ss << "Charge power: \t" << toString( system.chargePowerPresentStates() ) << endl;
+ ss << "Power no good: \t" << toString( system.powerNoGoodStates() ) << endl;
+ ss << "Charge inhibited:\t" << toString( system.chargeInhibitedStates() ) << endl;
map<int,SmartBattery>::const_iterator it;
for (it=system.batteries().begin(); it!=system.batteries().end(); it++)
@@ -74,14 +75,14 @@
string toLogString( const OceanServerSystem &system )
{
stringstream ss;
- ss << system.percentCharge << " ";
- ss << system.minToEmpty << " ";
- ss << toLogString( system.availableBatteries ) << " ";
- ss << toLogString( system.chargingStates ) << " ";
- ss << toLogString( system.supplyingPowerStates ) << " ";
- ss << toLogString( system.chargePowerPresentStates ) << " ";
- ss << toLogString( system.powerNoGoodStates ) << " ";
- ss << toLogString( system.chargeInhibitedStates ) << endl;
+ ss << system.percentCharge() << " ";
+ ss << system.minToEmpty() << " ";
+ ss << toLogString( system.availableBatteries() ) << " ";
+ ss << toLogString( system.chargingStates() ) << " ";
+ ss << toLogString( system.supplyingPowerStates() ) << " ";
+ ss << toLogString( system.chargePowerPresentStates() ) << " ";
+ ss << toLogString( system.powerNoGoodStates() ) << " ";
+ ss << toLogString( system.chargeInhibitedStates() ) << endl;
ss << system.batteries().size();
@@ -97,19 +98,19 @@
void updateWithNewData( const OceanServerSystem &from,
OceanServerSystem &to )
{
- to.rawRecord = from.rawRecord;
+ to.rawRecord() = from.rawRecord();
typedef map<int,SmartBattery>::const_iterator BatIt;
- to.availableBatteries = from.availableBatteries;
- to.percentCharge = from.percentCharge;
- to.minToEmpty = from.minToEmpty;
- to.messageToSystem = from.messageToSystem;
- to.chargingStates = from.chargingStates;
- to.supplyingPowerStates = from.supplyingPowerStates;
- to.chargePowerPresentStates = from.chargePowerPresentStates;
- to.powerNoGoodStates = from.powerNoGoodStates;
- to.chargeInhibitedStates = from.chargeInhibitedStates;
+ to.setPercentCharge( from.percentCharge() );
+ to.setMinToEmpty( from.minToEmpty() );
+ to.setMessageToSystem( from.messageToSystem() );
+ to.availableBatteries() = from.availableBatteries();
+ to.chargingStates() = from.chargingStates();
+ to.supplyingPowerStates() = from.supplyingPowerStates();
+ to.chargePowerPresentStates() = from.chargePowerPresentStates();
+ to.powerNoGoodStates() = from.powerNoGoodStates();
+ to.chargeInhibitedStates() = from.chargeInhibitedStates();
for (BatIt it=from.batteries().begin(); it!=from.batteries().end(); it++)
{
@@ -177,23 +178,35 @@
}
+bool isSystemOnCharge( const gbxsmartbatteryacfr::OceanServerSystem &batterySystem )
+{
+ for (unsigned int i=0; i<batterySystem.chargingStates().size(); ++i)
+ {
+ if (batterySystem.chargingStates()[i]==true)
+ return true;
+ }
+ return false;
+}
+
+
//
// Member functions
//
OceanServerSystem::OceanServerSystem()
- : percentCharge(0),
- minToEmpty(0),
- messageToSystem("")
+ : isEmpty_(true),
+ percentCharge_(0),
+ minToEmpty_(0),
+ messageToSystem_("")
{
// fixed number of slots for oceanserver system
const int NUM_BATTERY_SLOTS = 8;
- availableBatteries.resize(NUM_BATTERY_SLOTS);
- chargingStates.resize(NUM_BATTERY_SLOTS);
- supplyingPowerStates.resize(NUM_BATTERY_SLOTS);
- chargePowerPresentStates.resize(NUM_BATTERY_SLOTS);
- powerNoGoodStates.resize(NUM_BATTERY_SLOTS);
- chargeInhibitedStates.resize(NUM_BATTERY_SLOTS);
+ availableBatteries_.resize(NUM_BATTERY_SLOTS);
+ chargingStates_.resize(NUM_BATTERY_SLOTS);
+ supplyingPowerStates_.resize(NUM_BATTERY_SLOTS);
+ chargePowerPresentStates_.resize(NUM_BATTERY_SLOTS);
+ powerNoGoodStates_.resize(NUM_BATTERY_SLOTS);
+ chargeInhibitedStates_.resize(NUM_BATTERY_SLOTS);
}
// read access to all batteries
@@ -207,6 +220,8 @@
SmartBattery&
OceanServerSystem::battery( unsigned int batteryNumber )
{
+ isEmpty_=false;
+
map<int,SmartBattery>::iterator it = batteries_.find(batteryNumber);
if ( it==batteries_.end() )
{
Modified: gearbox/trunk/src/gbxsmartbatteryacfr/oceanserversystem.h
===================================================================
--- gearbox/trunk/src/gbxsmartbatteryacfr/oceanserversystem.h 2009-11-07 04:25:00 UTC (rev 456)
+++ gearbox/trunk/src/gbxsmartbatteryacfr/oceanserversystem.h 2009-11-08 11:51:23 UTC (rev 457)
@@ -26,9 +26,12 @@
class OceanServerSystem
{
public:
-
+
+ //! Initialises all data in OceanServerSystem class
OceanServerSystem();
- ~OceanServerSystem() {};
+
+ //! Returns true if no valid data has been set
+ bool isEmpty() const { return isEmpty_; };
//! Read access to all batteries
const std::map<int,SmartBattery>& batteries() const;
@@ -42,24 +45,69 @@
//! Erase a battery
void eraseBattery( unsigned int batteryNumber );
- //! Average battery values
- int percentCharge;
- int minToEmpty;
- std::string messageToSystem;
+ //! Set charge in %
+ void setPercentCharge(int percentCharge) { isEmpty_=false; percentCharge_ = percentCharge; };
+ //! Access charget in %
+ int percentCharge() const { return percentCharge_; };
+ //! Set minutes to empty
+ void setMinToEmpty(int minToEmpty) { isEmpty_=false; minToEmpty_ = minToEmpty; };
+ //! Access minutes-to-empty
+ int minToEmpty() const { return minToEmpty_; };
+ //! Set message-to-system string
+ void setMessageToSystem(const std::string &messageToSystem) { isEmpty_=false; messageToSystem_ = messageToSystem; };
+ //! Access message-to-system string
+ std::string messageToSystem() const { return messageToSystem_; };
- //! Battery module states. Each vector is always of size 8 because OceanServer's Battery
- //! Management Modules have a maximum of 8 slots (either 2, 4, or 8 dependent on the model)
- std::vector<bool> availableBatteries;
- std::vector<bool> chargingStates;
- std::vector<bool> supplyingPowerStates;
- std::vector<bool> chargePowerPresentStates;
- std::vector<bool> powerNoGoodStates;
- std::vector<bool> chargeInhibitedStates;
+ //! Access availableBatteries flags
+ const std::vector<bool> &availableBatteries() const { return availableBatteries_; };
+ //! Set availableBatteries flags
+ std::vector<bool> &availableBatteries() { isEmpty_=false; return availableBatteries_; };
+ //! Access chargingStates flags
+ const std::vector<bool> &chargingStates() const { return chargingStates_; };
+ //! Set chargingStates flags
+ std::vector<bool> &chargingStates() { isEmpty_=false; return chargingStates_; };
+ //! Access supplyingPowerStates flags
+ const std::vector<bool> &supplyingPowerStates() const { return supplyingPowerStates_; };
+ //! Set supplyingPowerStates flags
+ std::vector<bool> &supplyingPowerStates() { isEmpty_=false; return supplyingPowerStates_; };
+ //! Access chargePowerPresentStates flags
+ const std::vector<bool> &chargePowerPresentStates() const { return chargePowerPresentStates_; };
+ //! Set chargePowerPresentStates flags
+ std::vector<bool> &chargePowerPresentStates() { isEmpty_=false; return chargePowerPresentStates_; };
+ //! Access powerNoGoodStates flags
+ const std::vector<bool> &powerNoGoodStates() const { return powerNoGoodStates_; };
+ //! Set powerNoGoodStates flags
+ std::vector<bool> &powerNoGoodStates() { isEmpty_=false; return powerNoGoodStates_; };
+ //! Access chargeInhibitedStates flags
+ const std::vector<bool> &chargeInhibitedStates() const { return chargeInhibitedStates_; }
+ //! Set chargeInhibitedStates flags
+ std::vector<bool> &chargeInhibitedStates() { isEmpty_=false; return chargeInhibitedStates_; }
- //! the latest raw record, useful for debugging
- std::vector<std::string> rawRecord;
+ //! Access the latest raw record, useful for debugging
+ const std::vector<std::string> &rawRecord() const { return rawRecord_; };
+ //! Set the latest raw record
+ std::vector<std::string> &rawRecord() { isEmpty_=false; return rawRecord_; };
private:
+
+ bool isEmpty_;
+
+ // Average battery values
+ int percentCharge_;
+ int minToEmpty_;
+ std::string messageToSystem_;
+
+ // Battery module states. Each vector is always of size 8 because OceanServer's Battery
+ // Management Modules have a maximum of 8 slots (either 2, 4, or 8 dependent on the model)
+ std::vector<bool> availableBatteries_;
+ std::vector<bool> chargingStates_;
+ std::vector<bool> supplyingPowerStates_;
+ std::vector<bool> chargePowerPresentStates_;
+ std::vector<bool> powerNoGoodStates_;
+ std::vector<bool> chargeInhibitedStates_;
+
+ // the latest raw record, useful for debugging
+ std::vector<std::string> rawRecord_;
// key: slot number, data: a single smart battery module
std::map<int,SmartBattery> batteries_;
@@ -78,6 +126,9 @@
//! The reaping capability makes sure that battery modules which are no longer connected don't persist.
void updateWithNewData( const OceanServerSystem &from,
OceanServerSystem &to );
+
+//! Returns true if at least one of the battery modules is on charge otherwise false
+bool isSystemOnCharge( const OceanServerSystem &batterySystem );
} // namespace
Modified: gearbox/trunk/src/gbxsmartbatteryacfr/test/darttest/checksumtest.cpp
===================================================================
--- gearbox/trunk/src/gbxsmartbatteryacfr/test/darttest/checksumtest.cpp 2009-11-07 04:25:00 UTC (rev 456)
+++ gearbox/trunk/src/gbxsmartbatteryacfr/test/darttest/checksumtest.cpp 2009-11-08 11:51:23 UTC (rev 457)
@@ -76,7 +76,7 @@
string checksumStr = ss.str();
for (unsigned int i=0; i<checksumStr.size(); i++)
- checksumStr[i] = toupper( checksumStr[i] );
+ checksumStr[i] = (char)(toupper( checksumStr[i] ));
cout << "Expected checksum result is:\t" << resultHex << endl;
cout << "Computed checksum result is:\t" << checksumStr << endl << endl;
Modified: gearbox/trunk/src/gbxsmartbatteryacfr/test/longtest.cpp
===================================================================
--- gearbox/trunk/src/gbxsmartbatteryacfr/test/longtest.cpp 2009-11-07 04:25:00 UTC (rev 456)
+++ gearbox/trunk/src/gbxsmartbatteryacfr/test/longtest.cpp 2009-11-08 11:51:23 UTC (rev 457)
@@ -58,10 +58,15 @@
while (true)
{
- cout << "TRACE(test): Reading record " << numRecords << endl;
+ cout << "Reading record " << numRecords << endl;
numRecords++;
gbxsmartbatteryacfr::OceanServerSystem data = oceanserver.getData();
+ if ( data.isEmpty() )
+ {
+ cout << "Data was empty. No worries, keep trying to read." << endl;
+ continue;
+ }
vector<string> shortWarning;
vector<string> verboseWarning;
const bool printRawRecord = true;
Modified: gearbox/trunk/src/gbxutilacfr/exceptions.cpp
===================================================================
--- gearbox/trunk/src/gbxutilacfr/exceptions.cpp 2009-11-07 04:25:00 UTC (rev 456)
+++ gearbox/trunk/src/gbxutilacfr/exceptions.cpp 2009-11-08 11:51:23 UTC (rev 457)
@@ -25,7 +25,7 @@
}
const char *
-Exception::basename( const char *s )
+Exception::basename( const char *s ) const
{
#ifndef WIN32
return strrchr( s, '/' )+1;
@@ -35,7 +35,7 @@
};
std::string
-Exception::toMessageString( const char *file, const char *line, const std::string &message )
+Exception::toMessageString( const char *file, const char *line, const std::string &message ) const
{
std::string msg = "\n *** ERROR(";
// not to confuse our local basename() with gbxutilacfr::basename()
Modified: gearbox/trunk/src/gbxutilacfr/exceptions.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/exceptions.h 2009-11-07 04:25:00 UTC (rev 456)
+++ gearbox/trunk/src/gbxutilacfr/exceptions.h 2009-11-08 11:51:23 UTC (rev 457)
@@ -72,12 +72,12 @@
virtual const char* what() const throw() { return message_.c_str(); }
protected:
- std::string toMessageString( const char *file, const char *line, const std::string &message );
+ std::string toMessageString( const char *file, const char *line, const std::string &message ) const;
std::string message_;
private:
- const char *basename( const char *s );
+ const char *basename( const char *s ) const;
};
//! This exception is raised when something is wrong with the hardware.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2009-11-07 04:25:10
|
Revision: 456
http://gearbox.svn.sourceforge.net/gearbox/?rev=456&view=rev
Author: russo2503v
Date: 2009-11-07 04:25:00 +0000 (Sat, 07 Nov 2009)
Log Message:
-----------
Modified Paths:
--------------
gearbox/trunk/doc/contributors.dox
Modified: gearbox/trunk/doc/contributors.dox
===================================================================
--- gearbox/trunk/doc/contributors.dox 2009-11-07 04:13:03 UTC (rev 455)
+++ gearbox/trunk/doc/contributors.dox 2009-11-07 04:25:00 UTC (rev 456)
@@ -1,5 +1,5 @@
/*
- * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
+ * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
* Copyright (c) 2008 GearBox Team
*
@@ -21,9 +21,10 @@
- <a href="http://www.cas.edu.au/content.php/232.html?personid=9">Alex Brooks</a>
- <a href="http://www.cas.edu.au/content.php/232.html?personid=45">Tobias Kaupp</a>
+- <a href="http://www.cas.edu.au/content.php/232.html?personid=65">Ian Mahon</a>
+- Richard Mattes
- <a href="http://www.cas.edu.au/content.php/232.html?personid=69">Michael Moser</a>
- John Yamokoski
-- <a href="http://www.cas.edu.au/content.php/232.html?personid=65">Ian Mahon</a>
@par Past contributors
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2009-11-07 04:13:09
|
Revision: 455
http://gearbox.svn.sourceforge.net/gearbox/?rev=455&view=rev
Author: russo2503v
Date: 2009-11-07 04:13:03 +0000 (Sat, 07 Nov 2009)
Log Message:
-----------
version++
Modified Paths:
--------------
gearbox/trunk/CMakeLists.txt
Modified: gearbox/trunk/CMakeLists.txt
===================================================================
--- gearbox/trunk/CMakeLists.txt 2009-11-07 03:39:30 UTC (rev 454)
+++ gearbox/trunk/CMakeLists.txt 2009-11-07 04:13:03 UTC (rev 455)
@@ -12,10 +12,10 @@
# project version
#
set( GBX_PROJECT_VERSION_MAJOR "9" )
-set( GBX_PROJECT_VERSION_MINOR "07" )
+set( GBX_PROJECT_VERSION_MINOR "11" )
set( GBX_PROJECT_VERSION_PATCH "0" )
-set( GBX_PROJECT_VERSION
+set( GBX_PROJECT_VERSION
${GBX_PROJECT_VERSION_MAJOR}.${GBX_PROJECT_VERSION_MINOR}.${GBX_PROJECT_VERSION_PATCH} )
#
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2009-11-07 03:39:50
|
Revision: 454
http://gearbox.svn.sourceforge.net/gearbox/?rev=454&view=rev
Author: russo2503v
Date: 2009-11-07 03:39:30 +0000 (Sat, 07 Nov 2009)
Log Message:
-----------
revised directory setup and package-congif
Modified Paths:
--------------
gearbox/trunk/cmake/SetupDirectories.cmake
gearbox/trunk/cmake/TargetUtils.cmake
gearbox/trunk/cmake/WritePackageConfig.cmake
gearbox/trunk/cmake/internal/gearbox-config-internal.cmake
gearbox/trunk/doc/buildsys.dox
Added Paths:
-----------
gearbox/trunk/cmake/internal/config-external.cmake.in
gearbox/trunk/cmake/internal/config-version.cmake.in
Removed Paths:
-------------
gearbox/trunk/cmake/internal/gearbox-config-version.cmake.in
gearbox/trunk/cmake/internal/gearbox-config.cmake
Modified: gearbox/trunk/cmake/SetupDirectories.cmake
===================================================================
--- gearbox/trunk/cmake/SetupDirectories.cmake 2009-11-06 07:11:29 UTC (rev 453)
+++ gearbox/trunk/cmake/SetupDirectories.cmake 2009-11-07 03:39:30 UTC (rev 454)
@@ -69,19 +69,35 @@
message( STATUS "Installation directory was set to ${CMAKE_INSTALL_PREFIX}" )
# special installation directories
-set( GBX_BIN_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/bin )
-set( GBX_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME} )
-set( GBX_SHARE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME} )
+set( GBX_BIN_INSTALL_SUFFIX bin )
+set( GBX_INCLUDE_INSTALL_SUFFIX include/${PROJECT_NAME} )
+set( GBX_SHARE_INSTALL_SUFFIX share/${PROJECT_NAME} )
+set( GBX_CMAKE_INSTALL_SUFFIX ${GBX_SHARE_INSTALL_SUFFIX}/cmake )
-IF (GBX_PROC_64BIT)
- set( GBX_LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib64/${PROJECT_NAME} )
-ELSE (GBX_PROC_64BIT)
- set( GBX_LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib/${PROJECT_NAME} )
-ENDIF(GBX_PROC_64BIT)
+if( GBX_PROC_64BIT )
+ set( GBX_LIB_INSTALL_SUFFIX lib64/${PROJECT_NAME} )
+ set( GBX_PKGCONFIG_INSTALL_SUFFIX lib64/pkgconfig )
+else()
+ set( GBX_LIB_INSTALL_SUFFIX lib/${PROJECT_NAME} )
+ set( GBX_PKGCONFIG_INSTALL_SUFFIX lib/pkgconfig )
+endif()
+# by convention, we install cmake package-config files with the libraries
+set( GBX_CMAKE_PKGCONFIG_INSTALL_SUFFIX ${GBX_LIB_INSTALL_SUFFIX} )
+
+# now the acutal install directories
+set( GBX_BIN_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${GBX_BIN_INSTALL_SUFFIX} )
+set( GBX_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${GBX_INCLUDE_INSTALL_SUFFIX} )
+set( GBX_SHARE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${GBX_SHARE_INSTALL_SUFFIX} )
+set( GBX_CMAKE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${GBX_CMAKE_INSTALL_SUFFIX} )
+set( GBX_CMAKE_PKGCONFIG_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${GBX_CMAKE_PKGCONFIG_INSTALL_SUFFIX} )
+set( GBX_LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${GBX_LIB_INSTALL_SUFFIX} )
+set( GBX_PKGCONFIG_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${GBX_PKGCONFIG_INSTALL_SUFFIX} )
+
+
#
# It's sometimes useful to refer to the top level of the project.
-# CMake does not make it very easy.
+# CMake provides the right variables but, as all variables, they are poorly documented.
#
-set( GBX_PROJECT_SOURCE_DIR ${${PROJECT_NAME}_SOURCE_DIR} )
-set( GBX_PROJECT_BINARY_DIR ${${PROJECT_NAME}_BINARY_DIR} )
+set( GBX_PROJECT_SOURCE_DIR ${PROJECT_SOURCE_DIR} )
+set( GBX_PROJECT_BINARY_DIR ${PROJECT_BINARY_DIR} )
Modified: gearbox/trunk/cmake/TargetUtils.cmake
===================================================================
--- gearbox/trunk/cmake/TargetUtils.cmake 2009-11-06 07:11:29 UTC (rev 453)
+++ gearbox/trunk/cmake/TargetUtils.cmake 2009-11-07 03:39:30 UTC (rev 454)
@@ -39,6 +39,7 @@
# 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.
+# See SetupDirectories.cmake for definition of the install directory.
#
macro( GBX_ADD_EXECUTABLE name )
if( COMMAND cmake_policy )
@@ -49,7 +50,8 @@
# 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 )
+ install( TARGETS ${name} RUNTIME
+ DESTINATION ${GBX_BIN_INSTALL_SUFFIX} )
set( templist ${EXE_LIST} )
list( APPEND templist ${name} )
# message( STATUS "DEBUG: ${templist}" )
@@ -67,6 +69,7 @@
# distinct from the Gearbox distribution version, as each library will change its
# API independently.
# All extra parameters are passed to ADD_LIBRARY as source files.
+# See SetupDirectories.cmake for definition of the install directory.
#
macro( GBX_ADD_LIBRARY name type soversion )
if( COMMAND cmake_policy )
@@ -90,16 +93,10 @@
SOVERSION ${soversion} )
# INSTALL_RPATH "${INSTALL_RPATH};${CMAKE_INSTALL_PREFIX}/lib/${PROJECT_NAME}"
# BUILD_WITH_INSTALL_RPATH TRUE )
-
- if (GBX_PROC_64BIT)
+
install( TARGETS ${name}
- DESTINATION lib64/${PROJECT_NAME}
+ DESTINATION ${GBX_LIB_INSTALL_SUFFIX}
EXPORT ${PROJECT_NAME}-targets )
- else (GBX_PROC_64BIT)
- install( TARGETS ${name}
- DESTINATION lib/${PROJECT_NAME}
- EXPORT ${PROJECT_NAME}-targets )
- ENDIF (GBX_PROC_64BIT)
set( templist ${LIB_LIST} )
list( APPEND templist ${name}-${soversion} )
@@ -117,11 +114,12 @@
# GBX_ADD_HEADERS( install_subdir FILE0 [FILE1 FILE2 ...] )
#
# Specialization of install(FILES ...) to install header files.
-# All files are installed into PREFIX/include/${PROJECT_NAME}/${install_subdir}
+# See SetupDirectories.cmake for definition of the install directory.
#
macro( GBX_ADD_HEADERS install_subdir )
if( GBX_INSTALL_HEADERS )
- install( FILES ${ARGN} DESTINATION include/${PROJECT_NAME}/${install_subdir} )
+ install( FILES ${ARGN}
+ DESTINATION ${GBX_INCLUDE_INSTALL_SUFFIX}/${install_subdir} )
endif()
endmacro( GBX_ADD_HEADERS install_subdir )
@@ -129,11 +127,12 @@
# GBX_ADD_SHARED_FILES( install_subdir FILE0 [FILE1 FILE2 ...] )
#
# Specialization of install(FILES ...) to install shared files.
-# All files are installed into PREFIX/share/${PROJECT_NAME}/${install_subdir} directory.
+# See SetupDirectories.cmake for definition of the install directory.
#
macro( GBX_ADD_SHARED_FILES install_subdir )
if( GBX_INSTALL_SHARED_FILES )
- install( FILES ${ARGN} DESTINATION share/${PROJECT_NAME}/${install_subdir} )
+ install( FILES ${ARGN}
+ DESTINATION ${GBX_SHARE_INSTALL_SUFFIX}/${install_subdir} )
endif()
endmacro( GBX_ADD_SHARED_FILES install_subdir )
@@ -141,11 +140,12 @@
# GBX_ADD_CMAKE_SCRIPTS( FILE0 [FILE1 FILE2 ...] )
#
# Specialization of install(FILES ...) to install CMake scripts.
-# All files are installed into PREFIX/share/cmake/Modules directory.
+# See SetupDirectories.cmake for definition of the install directory.
#
macro( GBX_ADD_CMAKE_SCRIPTS )
if( GBX_INSTALL_CMAKE_SCRIPTS )
- install( FILES ${ARGN} DESTINATION share/cmake/Modules )
+ install( FILES ${ARGN}
+ DESTINATION ${GBX_CMAKE_INSTALL_SUFFIX} )
endif()
endmacro( GBX_ADD_CMAKE_SCRIPTS )
@@ -160,8 +160,11 @@
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)
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} )
+ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${makefile.out}
+ DESTINATION ${GBX_SHARE_INSTALL_SUFFIX}/${install_subdir}
+ RENAME CMakeLists.txt )
+ install( FILES ${ARGN}
+ DESTINATION ${GBX_SHARE_INSTALL_SUFFIX}/${install_subdir} )
endif()
endmacro( GBX_ADD_EXAMPLE install_subdir makefile )
@@ -176,6 +179,7 @@
# libflags is appended to the "Libs" value.
# version is the soversion of the library.
# that should be linked with at the same time as linking to this library.
+# See SetupDirectories.cmake for definition of the install directory.
#
macro( GBX_ADD_PKGCONFIG name desc ext_deps int_deps cflags libflags version )
set( PKG_NAME ${name} )
@@ -191,14 +195,13 @@
endforeach( item ${${int_deps}} )
endif( ${int_deps} )
- configure_file( ${GBX_CMAKE_DIR}/pkgconfig.in ${CMAKE_CURRENT_BINARY_DIR}/${name}.pc @ONLY)
+ configure_file( ${GBX_CMAKE_DIR}/pkgconfig.in
+ ${CMAKE_CURRENT_BINARY_DIR}/${name}.pc
+ @ONLY)
if( GBX_INSTALL_PKGCONFIGS )
- IF (GBX_PROC_64BIT)
- install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}.pc DESTINATION lib64/pkgconfig/ )
- ELSE (GBX_PROC_64BIT)
- install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}.pc DESTINATION lib/pkgconfig/ )
- ENDIF(GBX_PROC_64BIT)
+ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}.pc
+ DESTINATION ${GBX_PKGCONFIG_INSTALL_SUFFIX} )
endif()
endmacro( GBX_ADD_PKGCONFIG name desc cflags deps libflags libs )
@@ -376,7 +379,8 @@
string( TOUPPER ${PROJECT_NAME} upper_project_name )
write_file( ${output_file} "set( ${upper_project_name}_MANIFEST_LOADED 1)" APPEND )
- install( FILES ${output_file} DESTINATION . )
+ install( FILES ${output_file}
+ DESTINATION . )
endmacro( GBX_WRITE_MANIFEST )
macro( GBX_WRITE_LICENSE )
Modified: gearbox/trunk/cmake/WritePackageConfig.cmake
===================================================================
--- gearbox/trunk/cmake/WritePackageConfig.cmake 2009-11-06 07:11:29 UTC (rev 453)
+++ gearbox/trunk/cmake/WritePackageConfig.cmake 2009-11-07 03:39:30 UTC (rev 454)
@@ -1,39 +1,36 @@
+#
+# Generate and install files to be used with CMake's PackageConfig system.
+# (This is different from Linux's PkgConfig)
+#
set( _input_dir ${PROJECT_SOURCE_DIR}/cmake/internal )
set( _output_dir ${PROJECT_BINARY_DIR} )
-set( _destination lib/${PROJECT_NAME} )
+set( _destination ${GBX_CMAKE_PKGCONFIG_INSTALL_SUFFIX} )
-# 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( _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}
+configure_file(
+ ${_input_dir}/${_input_file}
+ ${_output_dir}/${_output_file}
+ @ONLY )
+install(
+ FILES ${_output_dir}/${_output_file}
DESTINATION ${_destination} )
-set( _input_file ${PROJECT_NAME}-config-version.cmake.in )
+set( _input_file config-version.cmake.in )
set( _output_file ${PROJECT_NAME}-config-version.cmake )
-configure_file(
+configure_file(
${_input_dir}/${_input_file}
${_output_dir}/${_output_file}
@ONLY )
-install(
+install(
FILES ${_output_dir}/${_output_file}
DESTINATION ${_destination} )
# export targets
-install(
- EXPORT ${PROJECT_NAME}-targets
-# NAMESPACE import_
+install(
+ EXPORT ${PROJECT_NAME}-targets
+# NAMESPACE import_
DESTINATION ${_destination} )
set( _input_dir )
Copied: gearbox/trunk/cmake/internal/config-external.cmake.in (from rev 453, gearbox/trunk/cmake/internal/gearbox-config.cmake)
===================================================================
--- gearbox/trunk/cmake/internal/config-external.cmake.in (rev 0)
+++ gearbox/trunk/cmake/internal/config-external.cmake.in 2009-11-07 03:39:30 UTC (rev 454)
@@ -0,0 +1,35 @@
+# Find resources installed by Gearbox.
+# To be used by external CMake projects.
+#
+
+set( GEARBOX_FOUND 1 )
+
+# this is the installed location of <package>-config.cmake file
+get_filename_component( _found_dir "${CMAKE_CURRENT_LIST_FILE}" PATH )
+
+# load all exported Gearbox targets
+include( ${_found_dir}/gearbox-targets.cmake )
+
+# assume that gearbox-config.cmake was installed into
+# <install-root>/lib/gearbox/
+set( _install_dir "${_found_dir}/../../" )
+
+get_filename_component(
+ GEARBOX_INCLUDE_DIR
+ "${_install_dir}/@GBX_INCLUDE_INSTALL_SUFFIX@"
+ ABSOLUTE )
+
+get_filename_component(
+ GEARBOX_CMAKE_DIR
+ "${_install_dir}/@GBX_CMAKE_INSTALL_SUFFIX@"
+ ABSOLUTE )
+# this is where the use-file can be found
+set( GEARBOX_USE_FILE "${GEARBOX_CMAKE_DIR}/gearbox-use-file.cmake" )
+
+get_filename_component(
+ GEARBOX_LINK_DIR
+ "${_install_dir}/@GBX_LIB_INSTALL_SUFFIX@"
+ ABSOLUTE )
+
+set( _found_dir )
+set( _install_dir )
Copied: gearbox/trunk/cmake/internal/config-version.cmake.in (from rev 453, gearbox/trunk/cmake/internal/gearbox-config-version.cmake.in)
===================================================================
--- gearbox/trunk/cmake/internal/config-version.cmake.in (rev 0)
+++ gearbox/trunk/cmake/internal/config-version.cmake.in 2009-11-07 03:39:30 UTC (rev 454)
@@ -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()
Modified: gearbox/trunk/cmake/internal/gearbox-config-internal.cmake
===================================================================
--- gearbox/trunk/cmake/internal/gearbox-config-internal.cmake 2009-11-06 07:11:29 UTC (rev 453)
+++ gearbox/trunk/cmake/internal/gearbox-config-internal.cmake 2009-11-07 03:39:30 UTC (rev 454)
@@ -1,5 +1,9 @@
-set( GEARBOX_FOUND 1 )
+# Find resources contained within Gearbox.
+# To be used by CMake projects co-located with Gearbox within one "super-project".
+#
+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" )
@@ -7,5 +11,5 @@
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 )
+# this is where Gearbox libs will be installed
+set( GEARBOX_LINK_DIR ${CMAKE_INSTALL_PREFIX}/${GBX_LIB_INSTALL_DIR} )
Deleted: gearbox/trunk/cmake/internal/gearbox-config-version.cmake.in
===================================================================
--- gearbox/trunk/cmake/internal/gearbox-config-version.cmake.in 2009-11-06 07:11:29 UTC (rev 453)
+++ gearbox/trunk/cmake/internal/gearbox-config-version.cmake.in 2009-11-07 03:39:30 UTC (rev 454)
@@ -1,8 +0,0 @@
-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()
Deleted: gearbox/trunk/cmake/internal/gearbox-config.cmake
===================================================================
--- gearbox/trunk/cmake/internal/gearbox-config.cmake 2009-11-06 07:11:29 UTC (rev 453)
+++ gearbox/trunk/cmake/internal/gearbox-config.cmake 2009-11-07 03:39:30 UTC (rev 454)
@@ -1,35 +0,0 @@
-# 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 )
-
-# load all exported Gearbox targets
-include( ${_found_dir}/gearbox-targets.cmake )
-
-# assume that gearbox-config.cmake was installed into
-# <install-root>/lib/gearbox/
-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/cmake/Modules"
- 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 )
Modified: gearbox/trunk/doc/buildsys.dox
===================================================================
--- gearbox/trunk/doc/buildsys.dox 2009-11-06 07:11:29 UTC (rev 453)
+++ gearbox/trunk/doc/buildsys.dox 2009-11-07 03:39:30 UTC (rev 454)
@@ -217,14 +217,31 @@
GBX_PROC_64BIT
@endverbatim
-Path variables for the current project:
+Source and binary directories can be distinguished as so
@verbatim
+GBX_PROJECT_BINARY_DIR
+GBX_PROJECT_SOURCE_DIR
+@endverbatim
+
+Install directories can be referenced with absolute paths
+@verbatim
GBX_BIN_INSTALL_DIR
+GBX_CMAKE_INSTALL_DIR
+GBX_CMAKE_PKGCONFIG_INSTALL_DIR
+GBX_INCLUDE_INSTALL_DIR
GBX_LIB_INSTALL_DIR
-GBX_INCLUDE_INSTALL_DIR
-GBX_PROJECT_BINARY_DIR
-GBX_PROJECT_SOURCE_DIR
+GBX_PKGCONFIG_INSTALL_DIR
GBX_SHARE_INSTALL_DIR
@endverbatim
+.. or path relative to the install directory
+@verbatim
+GBX_BIN_INSTALL_SUFFIX
+GBX_CMAKE_INSTALL_SUFFIX
+GBX_CMAKEPKGCONFIG_INSTALL_SUFFIX
+GBX_INCLUDE_INSTALL_SUFFIX
+GBX_LIB_INSTALL_SUFFIX
+GBX_PKGCONFIG_INSTALL_SUFFIX
+GBX_SHARE_INSTALL_SUFFIX
+@endverbatim
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2009-11-06 07:11:35
|
Revision: 453
http://gearbox.svn.sourceforge.net/gearbox/?rev=453&view=rev
Author: russo2503v
Date: 2009-11-06 07:11:29 +0000 (Fri, 06 Nov 2009)
Log Message:
-----------
fixed dir bug
Modified Paths:
--------------
gearbox/trunk/cmake/SetupDirectories.cmake
Modified: gearbox/trunk/cmake/SetupDirectories.cmake
===================================================================
--- gearbox/trunk/cmake/SetupDirectories.cmake 2009-11-06 07:05:54 UTC (rev 452)
+++ gearbox/trunk/cmake/SetupDirectories.cmake 2009-11-06 07:11:29 UTC (rev 453)
@@ -18,7 +18,7 @@
# A manually set installation dir (e.i. with ccmake) is not touched until an environment variable or
# a command line variable is introduced.
-#
+#
# 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.
#
@@ -37,11 +37,11 @@
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 )
@@ -49,22 +49,22 @@
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} )
endif( DEFINED IS_SUPER_PROJECT )
-
+
# final result
message( STATUS "Installation directory was set to ${CMAKE_INSTALL_PREFIX}" )
@@ -76,7 +76,7 @@
IF (GBX_PROC_64BIT)
set( GBX_LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib64/${PROJECT_NAME} )
ELSE (GBX_PROC_64BIT)
- set( GBX_LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib${PROJECT_NAME} )
+ set( GBX_LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib/${PROJECT_NAME} )
ENDIF(GBX_PROC_64BIT)
#
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2009-11-06 07:06:06
|
Revision: 452
http://gearbox.svn.sourceforge.net/gearbox/?rev=452&view=rev
Author: russo2503v
Date: 2009-11-06 07:05:54 +0000 (Fri, 06 Nov 2009)
Log Message:
-----------
fixed bug with include dir variable; correct install for 64 bit systems
Modified Paths:
--------------
gearbox/trunk/cmake/SetupDirectories.cmake
Modified: gearbox/trunk/cmake/SetupDirectories.cmake
===================================================================
--- gearbox/trunk/cmake/SetupDirectories.cmake 2009-11-06 07:04:22 UTC (rev 451)
+++ gearbox/trunk/cmake/SetupDirectories.cmake 2009-11-06 07:05:54 UTC (rev 452)
@@ -70,10 +70,15 @@
# 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_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME} )
set( GBX_SHARE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME} )
+IF (GBX_PROC_64BIT)
+ set( GBX_LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib64/${PROJECT_NAME} )
+ELSE (GBX_PROC_64BIT)
+ set( GBX_LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib${PROJECT_NAME} )
+ENDIF(GBX_PROC_64BIT)
+
#
# It's sometimes useful to refer to the top level of the project.
# CMake does not make it very easy.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2009-11-06 07:04:32
|
Revision: 451
http://gearbox.svn.sourceforge.net/gearbox/?rev=451&view=rev
Author: russo2503v
Date: 2009-11-06 07:04:22 +0000 (Fri, 06 Nov 2009)
Log Message:
-----------
correct installs for 64bit systems
Modified Paths:
--------------
gearbox/trunk/cmake/TargetUtils.cmake
Modified: gearbox/trunk/cmake/TargetUtils.cmake
===================================================================
--- gearbox/trunk/cmake/TargetUtils.cmake 2009-11-06 06:58:26 UTC (rev 450)
+++ gearbox/trunk/cmake/TargetUtils.cmake 2009-11-06 07:04:22 UTC (rev 451)
@@ -90,9 +90,16 @@
SOVERSION ${soversion} )
# INSTALL_RPATH "${INSTALL_RPATH};${CMAKE_INSTALL_PREFIX}/lib/${PROJECT_NAME}"
# BUILD_WITH_INSTALL_RPATH TRUE )
+
+ if (GBX_PROC_64BIT)
install( TARGETS ${name}
+ DESTINATION lib64/${PROJECT_NAME}
+ EXPORT ${PROJECT_NAME}-targets )
+ else (GBX_PROC_64BIT)
+ install( TARGETS ${name}
DESTINATION lib/${PROJECT_NAME}
EXPORT ${PROJECT_NAME}-targets )
+ ENDIF (GBX_PROC_64BIT)
set( templist ${LIB_LIST} )
list( APPEND templist ${name}-${soversion} )
@@ -187,7 +194,11 @@
configure_file( ${GBX_CMAKE_DIR}/pkgconfig.in ${CMAKE_CURRENT_BINARY_DIR}/${name}.pc @ONLY)
if( GBX_INSTALL_PKGCONFIGS )
- install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}.pc DESTINATION lib/pkgconfig/ )
+ IF (GBX_PROC_64BIT)
+ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}.pc DESTINATION lib64/pkgconfig/ )
+ ELSE (GBX_PROC_64BIT)
+ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}.pc DESTINATION lib/pkgconfig/ )
+ ENDIF(GBX_PROC_64BIT)
endif()
endmacro( GBX_ADD_PKGCONFIG name desc cflags deps libflags libs )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2009-11-06 06:58:36
|
Revision: 450
http://gearbox.svn.sourceforge.net/gearbox/?rev=450&view=rev
Author: russo2503v
Date: 2009-11-06 06:58:26 +0000 (Fri, 06 Nov 2009)
Log Message:
-----------
detect 64bitness
Modified Paths:
--------------
gearbox/trunk/cmake/SetupOs.cmake
gearbox/trunk/doc/buildsys.dox
Modified: gearbox/trunk/cmake/SetupOs.cmake
===================================================================
--- gearbox/trunk/cmake/SetupOs.cmake 2009-11-01 12:05:08 UTC (rev 449)
+++ gearbox/trunk/cmake/SetupOs.cmake 2009-11-06 06:58:26 UTC (rev 450)
@@ -27,6 +27,16 @@
if( GBX_OS_LINUX )
message( STATUS "Running on Linux" )
+
+ # 32 or 64 bit Linux
+ # Set the library directory suffix accordingly
+ IF (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
+ SET (GBX_PROC_64BIT TRUE BOOL INTERNAL)
+ MESSAGE (STATUS "Linux x86_64 Target Detected")
+ ELSEIF (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "ppc64")
+ MESSAGE (STATUS "Linux ppc64 Target Detected")
+ SET (GBX_PROC_64BIT TRUE BOOL INTERNAL)
+ ENDIF (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
endif( GBX_OS_LINUX )
if( GBX_OS_QNX )
Modified: gearbox/trunk/doc/buildsys.dox
===================================================================
--- gearbox/trunk/doc/buildsys.dox 2009-11-01 12:05:08 UTC (rev 449)
+++ gearbox/trunk/doc/buildsys.dox 2009-11-06 06:58:26 UTC (rev 450)
@@ -1,5 +1,5 @@
/*
- * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
+ * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
* Copyright (c) 2008 GearBox Team
*
@@ -26,7 +26,7 @@
Builds are controlled by a set of files called 'CMakeLists.txt'. There
is approximately one in each directory, and builds descend recursively through the source tree.
-An individual developer only needs to be concerned with writing CMakeLists.txt files in the directory containing his or her library code and below.
+An individual developer only needs to be concerned with writing CMakeLists.txt files in the directory containing his or her library code and below.
@section gbx_doc_buildsys_example Example
@@ -49,7 +49,7 @@
GBX_REQUIRE_TARGETS( build LIB ${lib_name} ${dep_libs} )
IF ( build )
-
+
INCLUDE( ${GBX_CMAKE_DIR}/UseBasicRules.cmake )
FILE( GLOB hdrs *.h )
@@ -68,7 +68,7 @@
@verbatim
SET ( lib_name GbxAdvanced )
@endverbatim
-All variables in CMake contain text. Assignment is done with SET function. (The C++ equivalent of this line: <code>string lib_name = "GbxAdvanced"</code>).
+All variables in CMake contain text. Assignment is done with SET function. (The C++ equivalent of this line: <code>string lib_name = "GbxAdvanced"</code>).
- You can get more information on this and all other CMake commands.
@verbatim
$ cmake --help-command SET
@@ -76,8 +76,8 @@
Notice the GearBox convention for naming CMake variables:
- All "local" variables created in this CMakeLists.txt are in low case, e.g. @c lib_name.
-- All "global" variables created somewhere else are in upper case.
-- All custom "global" variables created by GearBox start with "GBX_", e.g. @c GBX_CMAKE_DIR.
+- All "global" variables created somewhere else are in upper case.
+- All custom "global" variables created by GearBox start with "GBX_", e.g. @c GBX_CMAKE_DIR.
- Note that the standard CMake variables are also in upper case and some start with "CMAKE_", e.g. @c CMAKE_INSTALL_PREFIX and some don't, e.g. @c PROJECT_NAME.
@verbatim
@@ -97,14 +97,14 @@
Any text following "#" is a comment. Use them to explain uncommon usage.
This GearBox macro checks for user input into the build process. It is actually a shortcut which does several things:
-- Defines a CMake cache variable called @c BUILD_LIB_GBXADVANCED which can be used a user-controlled switch for turning compilation of this library ON and OFF. You will see this option when you run the @c ccmake tool. The option variable is defined the very first time CMake is run, and it is assigned the specified default value (ON).
+- Defines a CMake cache variable called @c BUILD_LIB_GBXADVANCED which can be used a user-controlled switch for turning compilation of this library ON and OFF. You will see this option when you run the @c ccmake tool. The option variable is defined the very first time CMake is run, and it is assigned the specified default value (ON).
- Every time CMake runs, it checks the current value of the @c BUILD_LIB_GBXADVANCED variable. If the user configured it FALSE, then the value of @c build variable will also become FALSE.
- If it is decided that the library will not be built due to user input a corresponding entry will be added to a global list and the name of the library will be printed out at the end of the CMake process under the "Will NOT build..." heading.
Notice that to evaluate the variable you have to inclose it in braces and add a dollar sign, i.e. @c ${lib_name}. Without this, CMake would just treat it as text. (Similar to the UNIX shells).
This macro is quite flexible. You can specify custom names for the option variables and provide a custom description.
- - Here's the complete signature.
+ - Here's the complete signature.
@verbatim
GBX_REQUIRE_OPTION( cumulative_var [EXE | LIB] module_name default_option_value [option_name] [option_description] )
@endverbatim
@@ -153,7 +153,7 @@
FILE( GLOB hdrs *.h )
FILE( GLOB srcs *.cpp )
@endverbatim
-Search for file in the current directory which fit the specified pattern and assign the list to the variables @c hdrs and @c srcs.
+Search for file in the current directory which fit the specified pattern and assign the list to the variables @c hdrs and @c srcs.
- Instead of searching you can just list the files you need.
@verbatim
SET( srcs util.cpp )
@@ -167,7 +167,7 @@
@c GBX_ADD_LIBRARY is a custom GearBox macro. It does several things:
- Actually defines a library target (with a standard command @c ADD_LIBRARY ). In Linux, this will produce @c libGbxAdvanced.so or @c libGbxAdvanced.a
-- Specifies library type. Valid options are SHARED, STATIC, or DEFAULT (the prefered option). DEFAULT is resolved to the user-specified variable GBX_DEFAULT_LIB_TYPE (which initially is set to SHARED).
+- Specifies library type. Valid options are SHARED, STATIC, or DEFAULT (the prefered option). DEFAULT is resolved to the user-specified variable GBX_DEFAULT_LIB_TYPE (which initially is set to SHARED).
- Specifies standard installation directory: @c [PREFIX]/lib/gearbox/
- Adds the name of the library to the global list of libraries which will be built (for feedback).
@@ -212,6 +212,11 @@
GBX_OS_WIN
@endverbatim
+Under Linux, an additional variable if defined
+@verbatim
+GBX_PROC_64BIT
+@endverbatim
+
Path variables for the current project:
@verbatim
GBX_BIN_INSTALL_DIR
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bo...@us...> - 2009-11-01 12:05:19
|
Revision: 449
http://gearbox.svn.sourceforge.net/gearbox/?rev=449&view=rev
Author: borax00
Date: 2009-11-01 12:05:08 +0000 (Sun, 01 Nov 2009)
Log Message:
-----------
Fix for problem noticed by Anup.
Modified Paths:
--------------
gearbox/trunk/src/gbxserialacfr/lockfile/lockfile.cpp
Modified: gearbox/trunk/src/gbxserialacfr/lockfile/lockfile.cpp
===================================================================
--- gearbox/trunk/src/gbxserialacfr/lockfile/lockfile.cpp 2009-10-28 13:16:07 UTC (rev 448)
+++ gearbox/trunk/src/gbxserialacfr/lockfile/lockfile.cpp 2009-11-01 12:05:08 UTC (rev 449)
@@ -154,10 +154,10 @@
FILE *fd;
char lbuf[260];
int pidOfLocker = 0;
- char *p;
- if ((p = strrchr(dev, '/')))
- dev = p + 1;
+ const char *lastSlashPos = strrchr(dev, '/');
+ if ( lastSlashPos )
+ dev = lastSlashPos + 1;
sprintf(lbuf, "%s/LCK..%s", LOCK_DIR, dev);
fd = fopen(lbuf, "r");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2009-10-28 13:16:22
|
Revision: 448
http://gearbox.svn.sourceforge.net/gearbox/?rev=448&view=rev
Author: russo2503v
Date: 2009-10-28 13:16:07 +0000 (Wed, 28 Oct 2009)
Log Message:
-----------
added version to license
Modified Paths:
--------------
gearbox/trunk/LICENSE
gearbox/trunk/src/basicexample/CMakeLists.txt
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/gbxserialacfr/lockfile/CMakeLists.txt
gearbox/trunk/src/gbxsickacfr/CMakeLists.txt
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/CMakeLists.txt
gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/CMakeLists.txt
gearbox/trunk/src/gbxsmartbatteryacfr/CMakeLists.txt
gearbox/trunk/src/gbxutilacfr/CMakeLists.txt
Modified: gearbox/trunk/LICENSE
===================================================================
--- gearbox/trunk/LICENSE 2009-10-27 03:02:57 UTC (rev 447)
+++ gearbox/trunk/LICENSE 2009-10-28 13:16:07 UTC (rev 448)
@@ -2,17 +2,17 @@
----------------------------------------------------------------------
DIRECTORY license
----------------------------------------------------------------------
-src/basicexample LGPL
+src/basicexample LGPL2+
src/flexiport LGPL3
-src/gbxadvancedexample GPL
-src/gbxserialacfr LGPL
-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
-src/gbxsmartbatteryacfr LGPL
+src/gbxadvancedexample GPL2+
+src/gbxserialacfr LGPL2+
+src/gbxserialacfr/lockfile LGPL2+
+src/gbxutilacfr LGPL2+
+src/gbxgarminacfr LGPL2+
+src/gbxnovatelacfr LGPL2+
+src/gbxnovatelacfr/gbxnovatelutilacfr LGPL2+
+src/gbxsickacfr LGPL2+
+src/gbxsickacfr/gbxiceutilacfr LGPL2+
+src/gbxsickacfr/gbxserialdeviceacfr LGPL2+
+src/gbxsmartbatteryacfr LGPL2+
src/hokuyo_aist LGPL3
Modified: gearbox/trunk/src/basicexample/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/basicexample/CMakeLists.txt 2009-10-27 03:02:57 UTC (rev 447)
+++ gearbox/trunk/src/basicexample/CMakeLists.txt 2009-10-28 13:16:07 UTC (rev 448)
@@ -1,12 +1,12 @@
set( lib_name basicexample )
set( libVersion 1.0.0 )
-GBX_ADD_LICENSE( LGPL )
+GBX_ADD_LICENSE( LGPL2+ )
set( build TRUE )
GBX_REQUIRE_OPTION( build LIB ${lib_name} OFF )
if( build )
-
+
include( ${GBX_CMAKE_DIR}/UseBasicRules.cmake )
file( GLOB hdrs *.h )
Modified: gearbox/trunk/src/gbxadvancedexample/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxadvancedexample/CMakeLists.txt 2009-10-27 03:02:57 UTC (rev 447)
+++ gearbox/trunk/src/gbxadvancedexample/CMakeLists.txt 2009-10-28 13:16:07 UTC (rev 448)
@@ -1,6 +1,6 @@
set( lib_name GbxAdvancedExample )
set( libVersion 1.0.0 )
-GBX_ADD_LICENSE( GPL )
+GBX_ADD_LICENSE( GPL2+ )
set( build TRUE )
GBX_REQUIRE_OPTION( build LIB ${lib_name} OFF )
@@ -10,7 +10,7 @@
GBX_REQUIRE_LIBS( build LIB ${lib_name} ${dep_libs} )
if( build )
-
+
include( ${GBX_CMAKE_DIR}/UseBasicRules.cmake )
file( GLOB hdrs *.h )
Modified: gearbox/trunk/src/gbxgarminacfr/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxgarminacfr/CMakeLists.txt 2009-10-27 03:02:57 UTC (rev 447)
+++ gearbox/trunk/src/gbxgarminacfr/CMakeLists.txt 2009-10-28 13:16:07 UTC (rev 448)
@@ -1,21 +1,21 @@
set( lib_name GbxGarminAcfr )
set( lib_version 1.0.0 )
-GBX_ADD_LICENSE( LGPL )
+GBX_ADD_LICENSE( LGPL2+ )
set( build TRUE )
GBX_REQUIRE_OPTION( build LIB ${lib_name} ON )
GBX_REQUIRE_VAR( build LIB ${lib_name} GBX_OS_LINUX "only Linux OS is supported" )
-set( dep_libs GbxUtilAcfr GbxSerialAcfr )
+set( dep_libs GbxUtilAcfr GbxSerialAcfr )
GBX_REQUIRE_LIBS( build LIB ${lib_name} ${dep_libs} )
if( build )
include( ${GBX_CMAKE_DIR}/UseBasicRules.cmake )
-
+
file( GLOB hdrs *.h )
file( GLOB srcs *.cpp )
-
+
GBX_ADD_LIBRARY( ${lib_name} DEFAULT ${lib_version} ${srcs} )
target_link_libraries( ${lib_name} ${dep_libs} )
GBX_ADD_PKGCONFIG( ${lib_name} "Garmin GPS driver" "" dep_libs "" "" ${lib_version} )
Modified: gearbox/trunk/src/gbxnovatelacfr/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxnovatelacfr/CMakeLists.txt 2009-10-27 03:02:57 UTC (rev 447)
+++ gearbox/trunk/src/gbxnovatelacfr/CMakeLists.txt 2009-10-28 13:16:07 UTC (rev 448)
@@ -1,6 +1,6 @@
set( lib_name GbxNovatelAcfr )
set( lib_version 1.0.0 )
-GBX_ADD_LICENSE( LGPL )
+GBX_ADD_LICENSE( LGPL2+ )
set( build TRUE )
GBX_REQUIRE_OPTION( build LIB ${lib_name} ON )
Modified: gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/CMakeLists.txt 2009-10-27 03:02:57 UTC (rev 447)
+++ gearbox/trunk/src/gbxnovatelacfr/gbxnovatelutilacfr/CMakeLists.txt 2009-10-28 13:16:07 UTC (rev 448)
@@ -1,6 +1,6 @@
set( lib_name GbxNovatelUtilAcfr )
set( lib_version 1.0.0 )
-GBX_ADD_LICENSE( LGPL )
+GBX_ADD_LICENSE( LGPL2+ )
set( build TRUE )
# don't give user an option
@@ -17,7 +17,7 @@
GBX_REQUIRE_LIBS( build LIB ${lib_name} ${dep_libs} )
if( build )
-
+
include( ${GBX_CMAKE_DIR}/UseBasicRules.cmake )
file( GLOB hdrs *.h )
Modified: gearbox/trunk/src/gbxserialacfr/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxserialacfr/CMakeLists.txt 2009-10-27 03:02:57 UTC (rev 447)
+++ gearbox/trunk/src/gbxserialacfr/CMakeLists.txt 2009-10-28 13:16:07 UTC (rev 448)
@@ -1,6 +1,6 @@
set( lib_name GbxSerialAcfr )
set( lib_version 1.0.0 )
-GBX_ADD_LICENSE( LGPL )
+GBX_ADD_LICENSE( LGPL2+ )
set( build TRUE )
GBX_REQUIRE_OPTION( build LIB ${lib_name} ON )
@@ -13,7 +13,7 @@
if( build )
add_subdirectory( lockfile )
-
+
include( ${GBX_CMAKE_DIR}/UseBasicRules.cmake )
# for config.h
Modified: gearbox/trunk/src/gbxserialacfr/lockfile/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxserialacfr/lockfile/CMakeLists.txt 2009-10-27 03:02:57 UTC (rev 447)
+++ gearbox/trunk/src/gbxserialacfr/lockfile/CMakeLists.txt 2009-10-28 13:16:07 UTC (rev 448)
@@ -1,6 +1,6 @@
set( lib_name GbxLockFileAcfr )
set( lib_version 1.0.0 )
-GBX_ADD_LICENSE( LGPL )
+GBX_ADD_LICENSE( LGPL2+ )
set( build TRUE )
# don't give user an option
@@ -9,7 +9,7 @@
# GBX_REQUIRE_VAR( build LIB ${lib_name} GBX_OS_LINUX "only Linux OS is supported" )
if( build )
-
+
include( ${GBX_CMAKE_DIR}/UseBasicRules.cmake )
file( GLOB hdrs *.h )
Modified: gearbox/trunk/src/gbxsickacfr/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxsickacfr/CMakeLists.txt 2009-10-27 03:02:57 UTC (rev 447)
+++ gearbox/trunk/src/gbxsickacfr/CMakeLists.txt 2009-10-28 13:16:07 UTC (rev 448)
@@ -1,6 +1,6 @@
set( lib_name GbxSickAcfr )
set( lib_version 1.0.0 )
-GBX_ADD_LICENSE( LGPL )
+GBX_ADD_LICENSE( LGPL2+ )
set( build TRUE )
GBX_REQUIRE_OPTION( build LIB ${lib_name} ON )
@@ -17,7 +17,7 @@
if( build )
add_subdirectory( gbxserialdeviceacfr )
-
+
include( ${GBX_CMAKE_DIR}/UseBasicRules.cmake )
include( ${GBX_CMAKE_DIR}/UseIceUtil.cmake )
Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/CMakeLists.txt 2009-10-27 03:02:57 UTC (rev 447)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/CMakeLists.txt 2009-10-28 13:16:07 UTC (rev 448)
@@ -1,6 +1,6 @@
set( lib_name GbxIceUtilAcfr )
set( lib_version 1.0.0 )
-GBX_ADD_LICENSE( LGPL )
+GBX_ADD_LICENSE( LGPL2+ )
set( build TRUE )
@@ -13,7 +13,7 @@
GBX_REQUIRE_LIBS( build LIB ${lib_name} ${proj_libs} )
if( build )
-
+
include( ${GBX_CMAKE_DIR}/UseBasicRules.cmake )
include( ${GBX_CMAKE_DIR}/UseIceUtil.cmake )
Modified: gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/CMakeLists.txt 2009-10-27 03:02:57 UTC (rev 447)
+++ gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/CMakeLists.txt 2009-10-28 13:16:07 UTC (rev 448)
@@ -1,6 +1,6 @@
set( lib_name GbxSerialDeviceAcfr )
set( lib_version 1.0.0 )
-GBX_ADD_LICENSE( LGPL )
+GBX_ADD_LICENSE( LGPL2+ )
set( build TRUE )
# don't give user an option
@@ -11,7 +11,7 @@
# GBX_REQUIRE_LIBS( build LIB ${lib_name} ${proj_libs} )
if( build )
-
+
include( ${GBX_CMAKE_DIR}/UseBasicRules.cmake )
include( ${GBX_CMAKE_DIR}/UseIceUtil.cmake )
Modified: gearbox/trunk/src/gbxsmartbatteryacfr/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxsmartbatteryacfr/CMakeLists.txt 2009-10-27 03:02:57 UTC (rev 447)
+++ gearbox/trunk/src/gbxsmartbatteryacfr/CMakeLists.txt 2009-10-28 13:16:07 UTC (rev 448)
@@ -1,6 +1,6 @@
set( lib_name GbxSmartBatteryAcfr )
set( lib_version 1.0.0 )
-GBX_ADD_LICENSE( LGPL )
+GBX_ADD_LICENSE( LGPL2+ )
set( build TRUE )
GBX_REQUIRE_OPTION( build LIB ${lib_name} ON )
@@ -12,16 +12,16 @@
if( build )
include( ${GBX_CMAKE_DIR}/UseBasicRules.cmake )
-
+
file( GLOB hdrs *.h )
file( GLOB srcs *.cpp )
-
+
GBX_ADD_LIBRARY( ${lib_name} DEFAULT ${lib_version} ${srcs} )
target_link_libraries( ${lib_name} ${dep_libs} )
GBX_ADD_PKGCONFIG( ${lib_name} "Interface library for Ocean Server battery systems" proj_libs dep_libs "" "" ${lib_version} )
-
+
GBX_ADD_HEADERS( gbxsmartbatteryacfr ${hdrs} )
-
+
if( GBX_BUILD_TESTS )
add_subdirectory( test )
endif( GBX_BUILD_TESTS )
Modified: gearbox/trunk/src/gbxutilacfr/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxutilacfr/CMakeLists.txt 2009-10-27 03:02:57 UTC (rev 447)
+++ gearbox/trunk/src/gbxutilacfr/CMakeLists.txt 2009-10-28 13:16:07 UTC (rev 448)
@@ -1,6 +1,6 @@
set( lib_name GbxUtilAcfr )
set( lib_version 1.0.0 )
-GBX_ADD_LICENSE( LGPL )
+GBX_ADD_LICENSE( LGPL2+ )
set( build TRUE )
GBX_REQUIRE_OPTION( build LIB ${lib_name} ON )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2009-10-27 03:03:04
|
Revision: 447
http://gearbox.svn.sourceforge.net/gearbox/?rev=447&view=rev
Author: russo2503v
Date: 2009-10-27 03:02:57 +0000 (Tue, 27 Oct 2009)
Log Message:
-----------
gearbox-config.cmake now reflects the actual install dir
Modified Paths:
--------------
gearbox/trunk/cmake/internal/gearbox-config.cmake
Modified: gearbox/trunk/cmake/internal/gearbox-config.cmake
===================================================================
--- gearbox/trunk/cmake/internal/gearbox-config.cmake 2009-10-20 23:52:58 UTC (rev 446)
+++ gearbox/trunk/cmake/internal/gearbox-config.cmake 2009-10-27 03:02:57 UTC (rev 447)
@@ -11,24 +11,24 @@
include( ${_found_dir}/gearbox-targets.cmake )
# assume that gearbox-config.cmake was installed into
-# <install-root>/lib/gearbox/
+# <install-root>/lib/gearbox/
set( _install_dir "${_found_dir}/../../" )
-get_filename_component(
- GEARBOX_INCLUDE_DIR
- "${_install_dir}/include/gearbox"
+get_filename_component(
+ GEARBOX_INCLUDE_DIR
+ "${_install_dir}/include/gearbox"
ABSOLUTE )
-get_filename_component(
- GEARBOX_CMAKE_DIR
- "${_install_dir}/share/gearbox/cmake"
+get_filename_component(
+ GEARBOX_CMAKE_DIR
+ "${_install_dir}/share/cmake/Modules"
ABSOLUTE )
set( GEARBOX_USE_FILE "${GEARBOX_CMAKE_DIR}/gearbox-use-file.cmake" )
-get_filename_component(
- GEARBOX_LINK_DIR
- "${_install_dir}/lib/gearbox"
+get_filename_component(
+ GEARBOX_LINK_DIR
+ "${_install_dir}/lib/gearbox"
ABSOLUTE )
set( _found_dir )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2009-10-20 23:53:05
|
Revision: 446
http://gearbox.svn.sourceforge.net/gearbox/?rev=446&view=rev
Author: gbiggs
Date: 2009-10-20 23:52:58 +0000 (Tue, 20 Oct 2009)
Log Message:
-----------
Moved CMake scripts to ${PREFIX}/share/cmake/Modules
Modified Paths:
--------------
gearbox/trunk/cmake/CMakeLists.txt
gearbox/trunk/cmake/TargetUtils.cmake
Modified: gearbox/trunk/cmake/CMakeLists.txt
===================================================================
--- gearbox/trunk/cmake/CMakeLists.txt 2009-10-20 23:06:11 UTC (rev 445)
+++ gearbox/trunk/cmake/CMakeLists.txt 2009-10-20 23:52:58 UTC (rev 446)
@@ -2,4 +2,4 @@
# Install all .cmake files, so other projects can use them.
#
file( GLOB scripts *.cmake )
-GBX_ADD_SHARED_FILES( cmake ${scripts} )
+GBX_ADD_CMAKE_SCRIPTS( ${scripts} )
Modified: gearbox/trunk/cmake/TargetUtils.cmake
===================================================================
--- gearbox/trunk/cmake/TargetUtils.cmake 2009-10-20 23:06:11 UTC (rev 445)
+++ gearbox/trunk/cmake/TargetUtils.cmake 2009-10-20 23:52:58 UTC (rev 446)
@@ -17,6 +17,12 @@
mark_as_advanced( GBX_INSTALL_SHARED_FILES )
#
+# Default preference for installing CMake scripts.
+#
+set( GBX_INSTALL_CMAKE_SCRIPTS TRUE CACHE BOOLEAN "Do you want to install CMake scripts?" )
+mark_as_advanced( GBX_INSTALL_CMAKE_SCRIPTS )
+
+#
# Default preference for installing examples.
#
set( GBX_INSTALL_EXAMPLES TRUE CACHE BOOLEAN "Do you want to install example files?" )
@@ -111,6 +117,7 @@
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 ...] )
#
@@ -124,6 +131,18 @@
endmacro( GBX_ADD_SHARED_FILES install_subdir )
#
+# GBX_ADD_CMAKE_SCRIPTS( FILE0 [FILE1 FILE2 ...] )
+#
+# Specialization of install(FILES ...) to install CMake scripts.
+# All files are installed into PREFIX/share/cmake/Modules directory.
+#
+macro( GBX_ADD_CMAKE_SCRIPTS )
+ if( GBX_INSTALL_CMAKE_SCRIPTS )
+ install( FILES ${ARGN} DESTINATION share/cmake/Modules )
+ endif()
+endmacro( GBX_ADD_CMAKE_SCRIPTS )
+
+#
# GBX_ADD_EXAMPLE( install_subdir makefile.in makefile.out [FILE0 FILE1 FILE2 ...] )
#
# Specialisation of install(FILES ...) to install examples.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2009-10-20 23:06:21
|
Revision: 445
http://gearbox.svn.sourceforge.net/gearbox/?rev=445&view=rev
Author: gbiggs
Date: 2009-10-20 23:06:11 +0000 (Tue, 20 Oct 2009)
Log Message:
-----------
Clarified licenses in LICENSE file
Modified Paths:
--------------
gearbox/trunk/LICENSE
gearbox/trunk/src/flexiport/CMakeLists.txt
gearbox/trunk/src/hokuyo_aist/CMakeLists.txt
Modified: gearbox/trunk/LICENSE
===================================================================
--- gearbox/trunk/LICENSE 2009-09-30 02:25:28 UTC (rev 444)
+++ gearbox/trunk/LICENSE 2009-10-20 23:06:11 UTC (rev 445)
@@ -3,7 +3,7 @@
DIRECTORY license
----------------------------------------------------------------------
src/basicexample LGPL
-src/flexiport LGPL
+src/flexiport LGPL3
src/gbxadvancedexample GPL
src/gbxserialacfr LGPL
src/gbxserialacfr/lockfile LGPL
@@ -15,4 +15,4 @@
src/gbxsickacfr/gbxiceutilacfr LGPL
src/gbxsickacfr/gbxserialdeviceacfr LGPL
src/gbxsmartbatteryacfr LGPL
-src/hokuyo_aist LGPL
+src/hokuyo_aist LGPL3
Modified: gearbox/trunk/src/flexiport/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/flexiport/CMakeLists.txt 2009-09-30 02:25:28 UTC (rev 444)
+++ gearbox/trunk/src/flexiport/CMakeLists.txt 2009-10-20 23:06:11 UTC (rev 445)
@@ -1,7 +1,7 @@
set (libName flexiport)
set (libDesc "FlexiPort generic comms library")
set (libVersion 1.0.0)
-GBX_ADD_LICENSE (LGPL)
+GBX_ADD_LICENSE (LGPL3)
set (build TRUE)
GBX_REQUIRE_OPTION (build LIB ${libName} ON)
Modified: gearbox/trunk/src/hokuyo_aist/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/hokuyo_aist/CMakeLists.txt 2009-09-30 02:25:28 UTC (rev 444)
+++ gearbox/trunk/src/hokuyo_aist/CMakeLists.txt 2009-10-20 23:06:11 UTC (rev 445)
@@ -1,7 +1,7 @@
set (libName hokuyo_aist)
set (libDesc "Hokuyo laser scanner driver")
set (libVersion 1.0.0)
-GBX_ADD_LICENSE (LGPL)
+GBX_ADD_LICENSE (LGPL3)
set (build TRUE)
GBX_REQUIRE_OPTION (build LIB ${libName} ON)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2009-09-30 02:25:44
|
Revision: 444
http://gearbox.svn.sourceforge.net/gearbox/?rev=444&view=rev
Author: gbiggs
Date: 2009-09-30 02:25:28 +0000 (Wed, 30 Sep 2009)
Log Message:
-----------
Adding OpenRTM components for Gearbox libraries
Added Paths:
-----------
openrtm/
openrtm/branches/
openrtm/tags/
openrtm/trunk/
openrtm/trunk/flexiport/
openrtm/trunk/flexiport/Flexiport.cpp
openrtm/trunk/flexiport/Flexiport.h
openrtm/trunk/flexiport/Flexiport.yaml
openrtm/trunk/flexiport/FlexiportComp.cpp
openrtm/trunk/flexiport/FlexiportComp_vc8.vcproj
openrtm/trunk/flexiport/FlexiportComp_vc9.vcproj
openrtm/trunk/flexiport/Flexiport_vc8.sln
openrtm/trunk/flexiport/Flexiport_vc8.vcproj
openrtm/trunk/flexiport/Flexiport_vc9.sln
openrtm/trunk/flexiport/Flexiport_vc9.vcproj
openrtm/trunk/flexiport/Makefile.Flexiport
openrtm/trunk/flexiport/README.Flexiport
openrtm/trunk/flexiport/copyprops.bat
openrtm/trunk/flexiport/flexiport.hh
openrtm/trunk/flexiport/flexiport.idl
openrtm/trunk/flexiport/flexiportDynSK.cc
openrtm/trunk/flexiport/flexiportSK.cc
openrtm/trunk/flexiport/flexiportSVC_impl.cpp
openrtm/trunk/flexiport/flexiportSVC_impl.h
openrtm/trunk/flexiport/gen.sh
openrtm/trunk/flexiport/user_config.vsprops
openrtm/trunk/gbxgarminacfr/
openrtm/trunk/gbxgarminacfr/.project
openrtm/trunk/gbxgarminacfr/GbxGarminAcfr.cpp
openrtm/trunk/gbxgarminacfr/GbxGarminAcfr.h
openrtm/trunk/gbxgarminacfr/GbxGarminAcfrComp.cpp
openrtm/trunk/gbxgarminacfr/GbxGarminAcfrComp_vc8.vcproj
openrtm/trunk/gbxgarminacfr/GbxGarminAcfrComp_vc9.vcproj
openrtm/trunk/gbxgarminacfr/GbxGarminAcfr_vc8.sln
openrtm/trunk/gbxgarminacfr/GbxGarminAcfr_vc8.vcproj
openrtm/trunk/gbxgarminacfr/GbxGarminAcfr_vc9.sln
openrtm/trunk/gbxgarminacfr/GbxGarminAcfr_vc9.vcproj
openrtm/trunk/gbxgarminacfr/Makefile.GbxGarminAcfr
openrtm/trunk/gbxgarminacfr/README.GbxGarminAcfr
openrtm/trunk/gbxgarminacfr/copyprops.bat
openrtm/trunk/gbxgarminacfr/user_config.vsprops
openrtm/trunk/gbxnovatelacfr/
openrtm/trunk/gbxnovatelacfr/.project
openrtm/trunk/gbxnovatelacfr/GbxNovatelAcfr.cpp
openrtm/trunk/gbxnovatelacfr/GbxNovatelAcfr.h
openrtm/trunk/gbxnovatelacfr/GbxNovatelAcfrComp.cpp
openrtm/trunk/gbxnovatelacfr/GbxNovatelAcfrComp_vc8.vcproj
openrtm/trunk/gbxnovatelacfr/GbxNovatelAcfrComp_vc9.vcproj
openrtm/trunk/gbxnovatelacfr/GbxNovatelAcfr_vc8.sln
openrtm/trunk/gbxnovatelacfr/GbxNovatelAcfr_vc8.vcproj
openrtm/trunk/gbxnovatelacfr/GbxNovatelAcfr_vc9.sln
openrtm/trunk/gbxnovatelacfr/GbxNovatelAcfr_vc9.vcproj
openrtm/trunk/gbxnovatelacfr/Makefile.GbxNovatelAcfr
openrtm/trunk/gbxnovatelacfr/README.GbxNovatelAcfr
openrtm/trunk/gbxnovatelacfr/copyprops.bat
openrtm/trunk/gbxnovatelacfr/user_config.vsprops
openrtm/trunk/gbxsickacfr/
openrtm/trunk/gbxsickacfr/.project
openrtm/trunk/gbxsickacfr/Makefile.gbxsickacfr
openrtm/trunk/gbxsickacfr/README.gbxsickacfr
openrtm/trunk/gbxsickacfr/copyprops.bat
openrtm/trunk/gbxsickacfr/gbxsickacfr.cpp
openrtm/trunk/gbxsickacfr/gbxsickacfr.h
openrtm/trunk/gbxsickacfr/gbxsickacfrComp.cpp
openrtm/trunk/gbxsickacfr/gbxsickacfrComp_vc8.vcproj
openrtm/trunk/gbxsickacfr/gbxsickacfrComp_vc9.vcproj
openrtm/trunk/gbxsickacfr/gbxsickacfr_vc8.sln
openrtm/trunk/gbxsickacfr/gbxsickacfr_vc8.vcproj
openrtm/trunk/gbxsickacfr/gbxsickacfr_vc9.sln
openrtm/trunk/gbxsickacfr/gbxsickacfr_vc9.vcproj
openrtm/trunk/gbxsickacfr/user_config.vsprops
openrtm/trunk/gbxsmartbatteryacfr/
openrtm/trunk/gbxsmartbatteryacfr/.project
openrtm/trunk/gbxsmartbatteryacfr/GbxSmartBatteryAcfr.cpp
openrtm/trunk/gbxsmartbatteryacfr/GbxSmartBatteryAcfr.h
openrtm/trunk/gbxsmartbatteryacfr/GbxSmartBatteryAcfrComp.cpp
openrtm/trunk/gbxsmartbatteryacfr/GbxSmartBatteryAcfrComp_vc8.vcproj
openrtm/trunk/gbxsmartbatteryacfr/GbxSmartBatteryAcfrComp_vc9.vcproj
openrtm/trunk/gbxsmartbatteryacfr/GbxSmartBatteryAcfr_vc8.sln
openrtm/trunk/gbxsmartbatteryacfr/GbxSmartBatteryAcfr_vc8.vcproj
openrtm/trunk/gbxsmartbatteryacfr/GbxSmartBatteryAcfr_vc9.sln
openrtm/trunk/gbxsmartbatteryacfr/GbxSmartBatteryAcfr_vc9.vcproj
openrtm/trunk/gbxsmartbatteryacfr/Makefile.GbxSmartBatteryAcfr
openrtm/trunk/gbxsmartbatteryacfr/README.GbxSmartBatteryAcfr
openrtm/trunk/gbxsmartbatteryacfr/copyprops.bat
openrtm/trunk/gbxsmartbatteryacfr/gbxsmartbatteryacfr.hh
openrtm/trunk/gbxsmartbatteryacfr/gbxsmartbatteryacfr.idl
openrtm/trunk/gbxsmartbatteryacfr/gbxsmartbatteryacfrDynSK.cc
openrtm/trunk/gbxsmartbatteryacfr/gbxsmartbatteryacfrSK.cc
openrtm/trunk/gbxsmartbatteryacfr/gbxsmartbatteryacfrSVC_impl.cpp
openrtm/trunk/gbxsmartbatteryacfr/gbxsmartbatteryacfrSVC_impl.h
openrtm/trunk/gbxsmartbatteryacfr/user_config.vsprops
openrtm/trunk/hokuyo_aist/
openrtm/trunk/hokuyo_aist/.project
openrtm/trunk/hokuyo_aist/Makefile.hokuyo_aist
openrtm/trunk/hokuyo_aist/README.hokuyo_aist
openrtm/trunk/hokuyo_aist/copyprops.bat
openrtm/trunk/hokuyo_aist/hokuyo_aist.cpp
openrtm/trunk/hokuyo_aist/hokuyo_aist.h
openrtm/trunk/hokuyo_aist/hokuyo_aist.hh
openrtm/trunk/hokuyo_aist/hokuyo_aist.idl
openrtm/trunk/hokuyo_aist/hokuyo_aistComp.cpp
openrtm/trunk/hokuyo_aist/hokuyo_aistComp_vc8.vcproj
openrtm/trunk/hokuyo_aist/hokuyo_aistComp_vc9.vcproj
openrtm/trunk/hokuyo_aist/hokuyo_aistDynSK.cc
openrtm/trunk/hokuyo_aist/hokuyo_aistSK.cc
openrtm/trunk/hokuyo_aist/hokuyo_aistSVC_impl.cpp
openrtm/trunk/hokuyo_aist/hokuyo_aistSVC_impl.h
openrtm/trunk/hokuyo_aist/hokuyo_aist_vc8.sln
openrtm/trunk/hokuyo_aist/hokuyo_aist_vc8.vcproj
openrtm/trunk/hokuyo_aist/hokuyo_aist_vc9.sln
openrtm/trunk/hokuyo_aist/hokuyo_aist_vc9.vcproj
openrtm/trunk/hokuyo_aist/user_config.vsprops
Added: openrtm/trunk/flexiport/Flexiport.cpp
===================================================================
--- openrtm/trunk/flexiport/Flexiport.cpp (rev 0)
+++ openrtm/trunk/flexiport/Flexiport.cpp 2009-09-30 02:25:28 UTC (rev 444)
@@ -0,0 +1,300 @@
+// -*- C++ -*-
+/*!
+ * @file Flexiport.cpp * @brief Flexiport hardware data communications component * $Date$
+ *
+ * $Id$
+ */
+#include "Flexiport.h"
+
+#include <flexiport/flexiport.h>
+
+// Module specification
+// <rtc-template block="module_spec">
+static const char* flexiport_spec[] =
+ {
+ "implementation_id", "Flexiport",
+ "type_name", "Flexiport",
+ "description", "Flexiport hardware data communications component",
+ "version", "0.0.1",
+ "vendor", "Geoffrey Biggs, AIST",
+ "category", "DataProvider",
+ "activity_type", "SPORADIC",
+ "kind", "DataFlowComponent",
+ "max_instance", "10",
+ "language", "C++",
+ "lang_type", "compile",
+ // Configuration variables
+ "conf.default.portOpts", "type=serial,device=/dev/ttyACM0,timeout=1",
+ "conf.default.debug", "0",
+ "conf.default.timeout_sec", "1",
+ "conf.default.timeout_usec", "0",
+ "conf.default.readable", "1",
+ "conf.default.writable", "1",
+ "conf.default.sleepTime", "10",
+ "conf.default.bufferSize", "0",
+ ""
+ };
+// </rtc-template>
+
+Flexiport::Flexiport(RTC::Manager* manager)
+ // <rtc-template block="initializer">
+ : RTC::DataFlowComponentBase(manager),
+ m_sendDataIn("sendData", m_sendData),
+ m_recvDataOut("recvData", m_recvData),
+ m_apiPortPort("apiPort"),
+
+ // </rtc-template>
+ _port (NULL), _buffer (NULL)
+{
+ // Registration: InPort/OutPort/Service
+ // <rtc-template block="registration">
+ // Set InPort buffers
+ registerInPort("sendData", m_sendDataIn);
+
+ // Set OutPort buffer
+ registerOutPort("recvData", m_recvDataOut);
+
+ // Set service provider to Ports
+ m_apiPortPort.registerProvider("flexiport", "flexiport", m_flexiport);
+
+ // Set service consumers to Ports
+
+ // Set CORBA Service Ports
+ registerPort(m_apiPortPort);
+
+ // </rtc-template>
+
+}
+
+Flexiport::~Flexiport()
+{
+ if (_buffer != NULL)
+ {
+ free (_buffer);
+ _buffer = NULL;
+ }
+ if (_port != NULL)
+ {
+ delete _port;
+ _port = NULL;
+ }
+}
+
+
+RTC::ReturnCode_t Flexiport::onInitialize()
+{
+ // <rtc-template block="bind_config">
+ // Bind variables and configuration variable
+ bindParameter("portOpts", m_portOpts, "type=serial,device=/dev/ttyACM0,timeout=1");
+ bindParameter("debug", m_debug, "0");
+ bindParameter("timeout_sec", m_timeout_sec, "1");
+ bindParameter("timeout_usec", m_timeout_usec, "0");
+ bindParameter("readable", m_readable, "1");
+ bindParameter("writable", m_writable, "1");
+ bindParameter("sleepTime", m_sleepTime, "0");
+ bindParameter("bufferSize", m_bufferSize, "0");
+
+ // </rtc-template>
+ return RTC::RTC_OK;
+}
+
+
+/*
+RTC::ReturnCode_t Flexiport::onFinalize()
+{
+ return RTC::RTC_OK;
+}
+*/
+/*
+RTC::ReturnCode_t Flexiport::onStartup(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+/*
+RTC::ReturnCode_t Flexiport::onShutdown(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+
+RTC::ReturnCode_t Flexiport::onActivated(RTC::UniqueId ec_id)
+{
+ try
+ {
+ _port = flexiport::CreatePort (m_portOpts);
+ if (!_port->IsOpen ())
+ _port->Open ();
+ }
+ catch (flexiport::PortException e)
+ {
+ std::cout << "Failed to create and open port: " << e.what () << std::endl;
+ return RTC::RTC_ERROR;
+ }
+ m_flexiport.SetPort (_port);
+
+ if (m_bufferSize > 0)
+ {
+ if ((_buffer = reinterpret_cast<uint8_t*> (malloc (sizeof (uint8_t) * m_bufferSize))) == NULL)
+ {
+ std::cout << "Failed to allocate memory for buffer." << std::endl;
+ return RTC::RTC_ERROR;
+ }
+ }
+ else
+ {
+ if ((_buffer = reinterpret_cast<uint8_t*> (malloc (1))) == NULL)
+ {
+ std::cout << "Failed to allocate memory for buffer." << std::endl;
+ return RTC::RTC_ERROR;
+ }
+ }
+
+ return RTC::RTC_OK;
+}
+
+
+RTC::ReturnCode_t Flexiport::onDeactivated(RTC::UniqueId ec_id)
+{
+ if (_buffer != NULL)
+ {
+ free (_buffer);
+ _buffer = NULL;
+ }
+ if (_port != NULL)
+ {
+ delete _port;
+ _port = NULL;
+ }
+
+ return RTC::RTC_OK;
+}
+
+
+RTC::ReturnCode_t Flexiport::onExecute(RTC::UniqueId ec_id)
+{
+ int bytesWaiting = 0, bytesToRead = 0, bytesRead = 0, bytesWritten = 0;
+
+ // Check the left port for waiting data
+ std::cout << "Checking port for data." << std::endl;
+ bytesWaiting = _port->BytesAvailableWait ();
+ if (bytesWaiting > 0)
+ {
+ std::cout << "There are " << bytesWaiting << " bytes waiting at the port." << std::endl;
+ if (m_bufferSize == 0)
+ {
+ // Allocate space
+ if ((_buffer = reinterpret_cast<uint8_t*> (realloc (_buffer,
+ sizeof (uint8_t) * bytesWaiting + 1))) == NULL)
+ {
+ std::cout << "Failed to reallocate memory for buffer." << std::endl;
+ return RTC::RTC_ERROR;
+ }
+ bytesToRead = bytesWaiting;
+ }
+ else
+ bytesToRead = m_bufferSize; // Read up to as much as we can fit
+ // Read data from the left
+ bytesRead = _port->Read (_buffer, bytesToRead);
+ _buffer[bytesRead] = '\0';
+ std::cout << "Read " << bytesRead << " bytes from the port: |" << _buffer <<
+ "|." << std::endl;
+ if (bytesRead <= 0)
+ {
+ std::cout << "Expected " << bytesToRead <<
+ " bytes from the port, didn't get any." << std::endl;
+ }
+ else
+ {
+ // Pump the data out the data out port
+ m_recvData.data.length (bytesRead);
+ for (int ii = 0; ii < bytesRead; ii++)
+ m_recvData.data[ii] = _buffer[ii];
+ m_recvDataOut.write ();
+ }
+ }
+
+ // Do the same thing for the data in port
+ std::cout << "Checking data in port for data." << std::endl;
+ if (m_sendDataIn.isNew())
+ {
+ m_sendDataIn.read();
+ bytesWaiting = m_sendData.data.length ();
+ std::cout << "There are " << bytesWaiting << " bytes waiting at the data in port." << std::endl;
+ if (m_bufferSize == 0)
+ {
+ // Allocate space
+ if ((_buffer = reinterpret_cast<uint8_t*> (realloc (_buffer,
+ sizeof (uint8_t) * bytesWaiting + 1))) == NULL)
+ {
+ std::cout << "Failed to reallocate memory for buffer." << std::endl;
+ return RTC::RTC_ERROR;
+ }
+ // bytesWaiting = bytesWaiting
+ }
+ else
+ bytesWaiting = m_bufferSize; // Read up to as much as we can fit
+ // Write the data to the left port
+ for (int ii = 0; ii < bytesWaiting; ii++)
+ _buffer[ii]= m_sendData.data[ii];
+ bytesWritten = _port->WriteFull (_buffer, bytesWaiting);
+ std::cout << "Wrote " << bytesWritten << " bytes to the port." << std::endl;
+ }
+
+ // Sleep if set to do so
+ if (m_sleepTime > 0)
+ {
+ std::cout << "Sleeping for " << m_sleepTime << " microseconds." << std::endl;
+ usleep (m_sleepTime);
+ }
+
+ return RTC::RTC_OK;
+}
+
+/*
+RTC::ReturnCode_t Flexiport::onAborting(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+/*
+RTC::ReturnCode_t Flexiport::onError(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+/*
+RTC::ReturnCode_t Flexiport::onReset(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+/*
+RTC::ReturnCode_t Flexiport::onStateUpdate(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+/*
+RTC::ReturnCode_t Flexiport::onRateChanged(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+
+
+extern "C"
+{
+
+ void FlexiportInit(RTC::Manager* manager)
+ {
+ RTC::Properties profile(flexiport_spec);
+ manager->registerFactory(profile,
+ RTC::Create<Flexiport>,
+ RTC::Delete<Flexiport>);
+ }
+
+};
+
+
+
Added: openrtm/trunk/flexiport/Flexiport.h
===================================================================
--- openrtm/trunk/flexiport/Flexiport.h (rev 0)
+++ openrtm/trunk/flexiport/Flexiport.h 2009-09-30 02:25:28 UTC (rev 444)
@@ -0,0 +1,206 @@
+// -*- C++ -*-
+/*!
+ * @file Flexiport.h * @brief Flexiport hardware data communications component * @date $Date$
+ *
+ * $Id$
+ */
+#ifndef FLEXIPORT_H
+#define FLEXIPORT_H
+
+#include <rtm/idl/BasicDataTypeSkel.h>
+#include <rtm/Manager.h>
+#include <rtm/DataFlowComponentBase.h>
+#include <rtm/CorbaPort.h>
+#include <rtm/DataInPort.h>
+#include <rtm/DataOutPort.h>
+#include <flexiport/port.h>
+
+// Service implementation headers
+// <rtc-template block="service_impl_h">
+#include "flexiportSVC_impl.h"
+
+// </rtc-template>
+
+// Service Consumer stub headers
+// <rtc-template block="consumer_stub_h">
+
+// </rtc-template>
+
+using namespace RTC;
+
+class Flexiport : public RTC::DataFlowComponentBase
+{
+ public:
+ Flexiport(RTC::Manager* manager);
+ ~Flexiport();
+
+ // The initialize action (on CREATED->ALIVE transition)
+ // formaer rtc_init_entry()
+ virtual RTC::ReturnCode_t onInitialize();
+
+ // The finalize action (on ALIVE->END transition)
+ // formaer rtc_exiting_entry()
+ // virtual RTC::ReturnCode_t onFinalize();
+
+ // The startup action when ExecutionContext startup
+ // former rtc_starting_entry()
+ // virtual RTC::ReturnCode_t onStartup(RTC::UniqueId ec_id);
+
+ // The shutdown action when ExecutionContext stop
+ // former rtc_stopping_entry()
+ // virtual RTC::ReturnCode_t onShutdown(RTC::UniqueId ec_id);
+
+ // The activated action (Active state entry action)
+ // former rtc_active_entry()
+ virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id);
+
+ // The deactivated action (Active state exit action)
+ // former rtc_active_exit()
+ virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id);
+
+ // The execution action that is invoked periodically
+ // former rtc_active_do()
+ virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id);
+
+ // The aborting action when main logic error occurred.
+ // former rtc_aborting_entry()
+ // virtual RTC::ReturnCode_t onAborting(RTC::UniqueId ec_id);
+
+ // The error action in ERROR state
+ // former rtc_error_do()
+ // virtual RTC::ReturnCode_t onError(RTC::UniqueId ec_id);
+
+ // The reset action that is invoked resetting
+ // This is same but different the former rtc_init_entry()
+ // virtual RTC::ReturnCode_t onReset(RTC::UniqueId ec_id);
+
+ // The state update action that is invoked after onExecute() action
+ // no corresponding operation exists in OpenRTm-aist-0.2.0
+ // virtual RTC::ReturnCode_t onStateUpdate(RTC::UniqueId ec_id);
+
+ // The action that is invoked when execution context's rate is changed
+ // no corresponding operation exists in OpenRTm-aist-0.2.0
+ // virtual RTC::ReturnCode_t onRateChanged(RTC::UniqueId ec_id);
+
+
+ protected:
+ // Configuration variable declaration
+ // <rtc-template block="config_declare">
+ /*!
+ * Options for the serial port connected to the laser. See GearBox library flexiport
+ * documentation for details.
+ * - Name: portOptions
+ * - DefaultValue: type=serial,device=/dev/ttyACM0,timeout=1
+ */
+ std::string m_portOpts;
+ /*!
+ * Debug level.
+ * - Name: debug debug
+ * - DefaultValue: 0
+ */
+ int m_debug;
+ /*!
+ * Timeout for the port, seconds value.
+ * - Name: timeout_sec timeout_sec
+ * - DefaultValue: 1
+ * - Unit: seconds
+ */
+ int m_timeout_sec;
+ /*!
+ * Timeout for the port, microseconds value.
+ * - Name: timeout_usec timeout_usec
+ * - DefaultValue: 0
+ * - Unit: microseconds
+ */
+ int m_timeout_usec;
+ /*!
+ * Port read permissions.
+ * - Name: readable readable
+ * - DefaultValue: 1
+ */
+ bool m_readable;
+ /*!
+ * Port write permissions.
+ * - Name: writable writable
+ * - DefaultValue: 1
+ */
+ bool m_writable;
+ /*!
+ * Time to sleep between peeks for data waiting to be read or written.
+ * - Name: sleepTime sleepTime
+ * - DefaultValue: 10
+ * - Unit: microseconds
+ */
+ int m_sleepTime;
+ /*!
+ * Amount of data to move at a time. Set to zero to move as much as possible.
+ * - Name: bufferSize bufferSize
+ * - DefaultValue: 0
+ * - Unit: bytes
+ */
+ int m_bufferSize;
+
+ // </rtc-template>
+
+ // DataInPort declaration
+ // <rtc-template block="inport_declare">
+ TimedOctetSeq m_sendData;
+ /*!
+ * Data to write to the port.
+ * - Type: TimedOctetSeq
+ * - Number: Variable.
+ * - Semantics: Raw bytes.
+ * - Frequency: Irregularly.
+ */
+ InPort<TimedOctetSeq> m_sendDataIn;
+
+ // </rtc-template>
+
+ // DataOutPort declaration
+ // <rtc-template block="outport_declare">
+ TimedOctetSeq m_recvData;
+ /*!
+ * Data read from the port.
+ * - Type: TimedOctetSeq
+ * - Number: Variable.
+ * - Semantics: Raw bytes.
+ * - Frequency: Irregularly.
+ */
+ OutPort<TimedOctetSeq> m_recvDataOut;
+
+ // </rtc-template>
+
+ // CORBA Port declaration
+ // <rtc-template block="corbaport_declare">
+ /*!
+ * Control interface; provides programmatical access to the port's settings.
+ */
+ RTC::CorbaPort m_apiPortPort;
+
+ // </rtc-template>
+
+ // Service declaration
+ // <rtc-template block="service_declare">
+ flexiport_intfSVC_impl m_flexiport;
+
+ // </rtc-template>
+
+ // Consumer declaration
+ // <rtc-template block="consumer_declare">
+
+ // </rtc-template>
+ flexiport::Port *_port;
+ uint8_t *_buffer;
+
+ private:
+
+};
+
+
+extern "C"
+{
+ void FlexiportInit(RTC::Manager* manager);
+};
+
+#endif // FLEXIPORT_H
+
Added: openrtm/trunk/flexiport/Flexiport.yaml
===================================================================
--- openrtm/trunk/flexiport/Flexiport.yaml (rev 0)
+++ openrtm/trunk/flexiport/Flexiport.yaml 2009-09-30 02:25:28 UTC (rev 444)
@@ -0,0 +1,272 @@
+rtcProfile:
+ version: "1.0"
+ id: RTC:Geoffrey Biggs, AIST.DataProvider.Flexiport:0.0.1
+ basicInfo:
+ name: Flexiport
+ description: Flexiport hardware data communications component
+ version: 0.0.1
+ vendor: Geoffrey Biggs, AIST
+ category: DataProvider
+ componentType: STATIC
+ activityType: SPORADIC
+ componentKind: DataFlowComponent
+ maxInstances: 10
+ abstract:
+ executionRate: 1000.0
+ executionType: PeriodicExecutionContext
+ creationDate:
+ year: 2008
+ month: 7
+ day: 9
+ hour: 16
+ minute: 49
+ second: 9
+ updateDate:
+ year:
+ month:
+ day:
+ hour:
+ minute:
+ second:
+ "rtcDoc::doc":
+ algorithm:
+ creator:
+ description:
+ inout:
+ license:
+ reference:
+ "rtcExt::versionUpLog":
+ language:
+ actions:
+ onInitialize:
+ implemented: True
+ "rtcDoc::doc":
+ description: onInitialize description
+ postCondition: onInitialize Post_condition
+ preCondition: onInitialize Pre_condition
+ onActivated:
+ implemented: True
+ "rtcDoc::doc":
+ description: onActivated description
+ postCondition: onActivated Post_condition
+ preCondition: onActivated Pre_condition
+ onDeactivated:
+ implemented: True
+ "rtcDoc::doc":
+ description: onDeactivated description
+ postCondition: onDeactivated Post_condition
+ preCondition: onDeactivated Pre_condition
+ onAborting:
+ implemented: True
+ "rtcDoc::doc":
+ description: onAborting description
+ postCondition: onAborting Post_condition
+ preCondition: onAborting Pre_condition
+ onError:
+ implemented: True
+ "rtcDoc::doc":
+ description: onError description
+ postCondition: onError Post_condition
+ preCondition: onError Pre_condition
+ onReset:
+ implemented: True
+ "rtcDoc::doc":
+ description: onReset description
+ postCondition: onReset Post_condition
+ preCondition: onReset Pre_condition
+ onFinalize:
+ implemented: True
+ "rtcDoc::doc":
+ description: onFinalize description
+ postCondition: onFinalize Post_condition
+ preCondition: onFinalize Pre_condition
+ onStartup:
+ implemented: True
+ "rtcDoc::doc":
+ description: onStartup description
+ postCondition: onStartup Post_condition
+ preCondition: onStartup Pre_condition
+ onRateChanged:
+ implemented: True
+ "rtcDoc::doc":
+ description: onRateChanged description
+ postCondition: onRateChanged Post_condition
+ preCondition: onRateChanged Pre_condition
+ onShutdown:
+ implemented: True
+ "rtcDoc::doc":
+ description: onShutdown description
+ postCondition: onShutdown Post_condition
+ preCondition: onShutdown Pre_condition
+ onExecute:
+ implemented: True
+ "rtcDoc::doc":
+ description: onExecute description
+ postCondition: onExecute Post_condition
+ preCondition: onExecute Pre_condition
+ onStateUpdate:
+ implemented: True
+ "rtcDoc::doc":
+ description: onStateUpdate description
+ postCondition: onStateUpdate Post_condition
+ preCondition: onStateUpdate Pre_condition
+ dataPorts:
+ -
+ portType: DataOutPort
+ name: recvData
+ type: TimedOctetSeq
+ interfaceType: CorbaPort
+ dataflowType: Push,Pull
+ subscriptionType: Periodic,New,Flush
+ idlFile:
+ "rtcDoc::doc":
+ type: TimedOctetSeq
+ description:
+ number: 0
+ occerrence:
+ operation:
+ semantics:
+ unit:
+ "rtcExt::position": RIGHT
+ "rtcExt::varname": recvData
+ -
+ portType: DataInPort
+ name: sendData
+ type: TimedOctetSeq
+ interfaceType: CorbaPort
+ dataflowType: Push,Pull
+ subscriptionType: Periodic,New,Flush
+ idlFile:
+ "rtcDoc::doc":
+ type: TimedOctetSeq
+ description:
+ number: 1
+ occerrence:
+ operation:
+ semantics:
+ unit:
+ "rtcExt::position": LEFT
+ "rtcExt::varname": sendData
+ servicePorts:
+ -
+ name: apiPort
+ "rtcDoc::doc":
+ description:
+ ifdescription:
+ "rtcExt::position": RIGHT
+ serviceInterface:
+ -
+ direction: Provided
+ name: flexiport
+ type: flexiport_intf
+ varname: flexiport
+ instanceName: flexiport
+ idlFile: flexiport.idl
+ path:
+ "rtcDoc::doc":
+ description:
+ docArgument:
+ docException:
+ docPostCondition:
+ docPreCondition:
+ docReturn:
+ configurationSet:
+ configuration:
+ -
+ name: portOpts
+ type: std::string
+ varname: portOpts
+ defaultValue: type=serial,device=/dev/ttyACM0,timeout=1
+ "rtcDoc::doc":
+ constraint: constraint
+ dataname: dataname
+ defaultValue: type=serial,device=/dev/ttyACM0,timeout=1
+ description: description
+ range: range
+ unit: unit
+ -
+ name: debug
+ type: int
+ varname: debug
+ defaultValue: 0
+ "rtcDoc::doc":
+ constraint: constraint
+ dataname: dataname
+ defaultValue: 0
+ description: description
+ range: range
+ unit: unit
+ -
+ name: timeout_sec
+ type: int
+ varname: timeout_sec
+ defaultValue: 1
+ "rtcDoc::doc":
+ constraint: constraint
+ dataname: dataname
+ defaultValue: 1
+ description: description
+ range: range
+ unit: unit
+ -
+ name: timeout_usec
+ type: int
+ varname: timeout_usec
+ defaultValue: 0
+ "rtcDoc::doc":
+ constraint: constraint
+ dataname: dataname
+ defaultValue: 0
+ description: description
+ range: range
+ unit: unit
+ -
+ name: readable
+ type: bool
+ varname: readable
+ defaultValue: 1
+ "rtcDoc::doc":
+ constraint: constraint
+ dataname: dataname
+ defaultValue: 1
+ description: description
+ range: range
+ unit: unit
+ -
+ name: writable
+ type: bool
+ varname: writable
+ defaultValue: 1
+ "rtcDoc::doc":
+ constraint: constraint
+ dataname: dataname
+ defaultValue: 1
+ description: description
+ range: range
+ unit: unit
+ -
+ name: sleepTime
+ type: int
+ varname: sleepTime
+ defaultValue: 10
+ "rtcDoc::doc":
+ constraint: constraint
+ dataname: dataname
+ defaultValue: 10
+ description: description
+ range: range
+ unit: unit
+ -
+ name: bufferSize
+ type: int
+ varname: bufferSize
+ defaultValue: 0
+ "rtcDoc::doc":
+ constraint: constraint
+ dataname: dataname
+ defaultValue: 0
+ description: description
+ range: range
+ unit: unit
+ parameters:
+
Added: openrtm/trunk/flexiport/FlexiportComp.cpp
===================================================================
--- openrtm/trunk/flexiport/FlexiportComp.cpp (rev 0)
+++ openrtm/trunk/flexiport/FlexiportComp.cpp 2009-09-30 02:25:28 UTC (rev 444)
@@ -0,0 +1,91 @@
+// -*- C++ -*-
+/*!
+ * @file FlexiportComp.cpp
+ * @brief Standalone component
+ * @date $Date$
+ *
+ * $Id$
+ */
+#include <rtm/Manager.h>
+#include <iostream>
+#include <string>
+#include "Flexiport.h"
+
+
+void MyModuleInit(RTC::Manager* manager)
+{
+ FlexiportInit(manager);
+ RTC::RtcBase* comp;
+
+ // Create a component
+ comp = manager->createComponent("Flexiport");
+
+
+ // Example
+ // The following procedure is examples how handle RT-Components.
+ // These should not be in this function.
+
+ // Get the component's object reference
+// RTC::RTObject_var rtobj;
+// rtobj = RTC::RTObject::_narrow(manager->getPOA()->servant_to_reference(comp));
+
+ // Get the port list of the component
+// PortList* portlist;
+// portlist = rtobj->get_ports();
+
+ // getting port profiles
+// std::cout << "Number of Ports: ";
+// std::cout << portlist->length() << std::endl << std::endl;
+// for (CORBA::ULong i(0), n(portlist->length()); i < n; ++i)
+// {
+// Port_ptr port;
+// port = (*portlist)[i];
+// std::cout << "Port" << i << " (name): ";
+// std::cout << port->get_port_profile()->name << std::endl;
+//
+// RTC::PortInterfaceProfileList iflist;
+// iflist = port->get_port_profile()->interfaces;
+// std::cout << "---interfaces---" << std::endl;
+// for (CORBA::ULong i(0), n(iflist.length()); i < n; ++i)
+// {
+// std::cout << "I/F name: ";
+// std::cout << iflist[i].instance_name << std::endl;
+// std::cout << "I/F type: ";
+// std::cout << iflist[i].type_name << std::endl;
+// const char* pol;
+// pol = iflist[i].polarity == 0 ? "PROVIDED" : "REQUIRED";
+// std::cout << "Polarity: " << pol << std::endl;
+// }
+// std::cout << "---properties---" << std::endl;
+// NVUtil::dump(port->get_port_profile()->properties);
+// std::cout << "----------------" << std::endl << std::endl;
+// }
+
+ return;
+}
+
+int main (int argc, char** argv)
+{
+ RTC::Manager* manager;
+ manager = RTC::Manager::init(argc, argv);
+
+ // Initialize manager
+ manager->init(argc, argv);
+
+ // Set module initialization proceduer
+ // This procedure will be invoked in activateManager() function.
+ manager->setModuleInitProc(MyModuleInit);
+
+ // Activate manager and register to naming service
+ manager->activateManager();
+
+ // run the manager in blocking mode
+ // runManager(false) is the default.
+ manager->runManager();
+
+ // If you want to run the manager in non-blocking mode, do like this
+ // manager->runManager(true);
+
+ return 0;
+}
+
Added: openrtm/trunk/flexiport/FlexiportComp_vc8.vcproj
===================================================================
--- openrtm/trunk/flexiport/FlexiportComp_vc8.vcproj (rev 0)
+++ openrtm/trunk/flexiport/FlexiportComp_vc8.vcproj 2009-09-30 02:25:28 UTC (rev 444)
@@ -0,0 +1,226 @@
+<?xml version="1.0" encoding="shift_jis"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="FlexiportComp"
+ ProjectGUID="{83A92EE1-4D8B-11DD-AA7E-001D090CD254}"
+ RootNamespace="FlexiportComp"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(ProjectDir)FlexiportComp\$(ConfigurationName)"
+ IntermediateDirectory="FlexiportComp\$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="0"
+ InheritedPropertySheets="$(SolutionDir)rtm_config.vsprops;$(SolutionDir)user_config.vsprops"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="set PATH=$(rtm_path);%PYTHON_ROOT%\\;%PATH%
for %%x in (*.idl) do rtm-skelwrapper.py --include-dir="" --skel-suffix=Skel --stub-suffix=Stub --idl-file=%%x
for %%x in (*.idl) do $(rtm_idlc) $(rtm_idlflags) %%x
"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="USE_stub_in_nt_dll;WIN32;_DEBUG;_CONSOLE;__WIN32__;__x86__;_WIN32_WINNT=0x0400;__NT__;__OSVERSION__=4;_CRT_SECURE_NO_DEPRECATE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="$(rtm_libd)"
+ OutputFile="$(OutDir)\FlexiportComp.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(ProjectDir)FlexiportComp\$(ConfigurationName)"
+ IntermediateDirectory="FlexiportComp\$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="0"
+ InheritedPropertySheets="$(SolutionDir)rtm_config.vsprops;$(SolutionDir)user_config.vsprops"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="set PATH=$(rtm_path);%PYTHON_ROOT%\\;%PATH%
for %%x in (*.idl) do rtm-skelwrapper.py --include-dir="" --skel-suffix=Skel --stub-suffix=Stub --idl-file=%%x
for %%x in (*.idl) do $(rtm_idlc) $(rtm_idlflags) %%x
"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="USE_stub_in_nt_dll;WIN32;NDEBUG;_CONSOLE;__WIN32__;__x86__;_WIN32_WINNT=0x0400;__NT__;__OSVERSION__=4;_CRT_SECURE_NO_DEPRECATE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="$(rtm_lib)"
+ OutputFile="$(OutDir)\FlexiportComp.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="false"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ LinkTimeCodeGeneration="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="if NOT EXIST "$(SolutionDir)\\components" mkdir "$(SolutionDir)\\components"
copy "$(OutDir)\\FlexiportComp.exe" "$(SolutionDir)\\components"
"
+ />
+
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{83A9E651-4D8B-11DD-83F7-001D090CD254}"
+ >
+ <File
+ RelativePath="Flexiport.cpp"
+ >
+ </File>
+ <File
+ RelativePath="FlexiportComp.cpp"
+ >
+ </File>
+ <File
+ RelativePath="flexiportSkel.cpp"
+ >
+ </File>
+ <File
+ RelativePath="flexiportSVC_impl.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{83A9E83A-4D8B-11DD-8E77-001D090CD254}"
+ >
+ <File
+ RelativePath="Flexiport.h"
+ >
+ </File>
+ <File
+ RelativePath="flexiportSkel.h"
+ >
+ </File>
+ <File
+ RelativePath="flexiportSVC_impl.h"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: openrtm/trunk/flexiport/FlexiportComp_vc9.vcproj
===================================================================
--- openrtm/trunk/flexiport/FlexiportComp_vc9.vcproj (rev 0)
+++ openrtm/trunk/flexiport/FlexiportComp_vc9.vcproj 2009-09-30 02:25:28 UTC (rev 444)
@@ -0,0 +1,226 @@
+<?xml version="1.0" encoding="shift_jis"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="FlexiportComp"
+ ProjectGUID="{83C689E1-4D8B-11DD-8F7C-001D090CD254}"
+ RootNamespace="FlexiportComp"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(ProjectDir)FlexiportComp\$(ConfigurationName)"
+ IntermediateDirectory="FlexiportComp\$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="0"
+ InheritedPropertySheets="$(SolutionDir)rtm_config.vsprops;$(SolutionDir)user_config.vsprops"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="set PATH=$(rtm_path);%PYTHON_ROOT%\\;%PATH%
for %%x in (*.idl) do rtm-skelwrapper.py --include-dir="" --skel-suffix=Skel --stub-suffix=Stub --idl-file=%%x
for %%x in (*.idl) do $(rtm_idlc) $(rtm_idlflags) %%x
"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="USE_stub_in_nt_dll;WIN32;_DEBUG;_CONSOLE;__WIN32__;__x86__;_WIN32_WINNT=0x0400;__NT__;__OSVERSION__=4;_CRT_SECURE_NO_DEPRECATE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="$(rtm_libd)"
+ OutputFile="$(OutDir)\FlexiportComp.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(ProjectDir)FlexiportComp\$(ConfigurationName)"
+ IntermediateDirectory="FlexiportComp\$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="0"
+ InheritedPropertySheets="$(SolutionDir)rtm_config.vsprops;$(SolutionDir)user_config.vsprops"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="set PATH=$(rtm_path);%PYTHON_ROOT%\\;%PATH%
for %%x in (*.idl) do rtm-skelwrapper.py --include-dir="" --skel-suffix=Skel --stub-suffix=Stub --idl-file=%%x
for %%x in (*.idl) do $(rtm_idlc) $(rtm_idlflags) %%x
"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="USE_stub_in_nt_dll;WIN32;NDEBUG;_CONSOLE;__WIN32__;__x86__;_WIN32_WINNT=0x0400;__NT__;__OSVERSION__=4;_CRT_SECURE_NO_DEPRECATE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="$(rtm_lib)"
+ OutputFile="$(OutDir)\FlexiportComp.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="false"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ LinkTimeCodeGeneration="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="if NOT EXIST "$(SolutionDir)\\components" mkdir "$(SolutionDir)\\components"
copy "$(OutDir)\\FlexiportComp.exe" "$(SolutionDir)\\components"
"
+ />
+
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{83C68BD7-4D8B-11DD-B30F-001D090CD254}"
+ >
+ <File
+ RelativePath="Flexiport.cpp"
+ >
+ </File>
+ <File
+ RelativePath="FlexiportComp.cpp"
+ >
+ </File>
+ <File
+ RelativePath="flexiportSkel.cpp"
+ >
+ </File>
+ <File
+ RelativePath="flexiportSVC_impl.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{83C68D14-4D8B-11DD-8740-001D090CD254}"
+ >
+ <File
+ RelativePath="Flexiport.h"
+ >
+ </File>
+ <File
+ RelativePath="flexiportSkel.h"
+ >
+ </File>
+ <File
+ RelativePath="flexiportSVC_impl.h"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: openrtm/trunk/flexiport/Flexiport_vc8.sln
===================================================================
--- openrtm/trunk/flexiport/Flexiport_vc8.sln (rev 0)
+++ openrtm/trunk/flexiport/Flexiport_vc8.sln 2009-09-30 02:25:28 UTC (rev 444)
@@ -0,0 +1,29 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FlexiportComp", "FlexiportComp_vc8.vcproj", "{83A92EE1-4D8B-11DD-AA7E-001D090CD254}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Flexiport", "Flexiport_vc8.vcproj", "{83B88FAE-4D8B-11DD-87A8-001D090CD254}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Release|Win32 = Release|Win32
+ Debug|Win32 = Debug|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {83A92EE1-4D8B-11DD-AA7E-001D090CD254}.Release|Win32.ActiveCfg = Release|Win32
+ {83A92EE1-4D8B-11DD-AA7E-001D090CD254}.Release|Win32.Build.0 = Release|Win32
+ {83A92EE1-4D8B-11DD-AA7E-001D090CD254}.Debug|Win32.ActiveCfg = Debug|Win32
+ {83A92EE1-4D8B-11DD-AA7E-001D090CD254}.Debug|Win32.Build.0 = Debug|Win32
+ {83B88FAE-4D8B-11DD-87A8-001D090CD254}.Release|Win32.ActiveCfg = Release|Win32
+ {83B88FAE-4D8B-11DD-87A8-001D090CD254}.Release|Win32.Build.0 = Release|Win32
+ {83B88FAE-4D8B-11DD-87A8-001D090CD254}.Debug|Win32.ActiveCfg = Debug|Win32
+ {83B88FAE-4D8B-11DD-87A8-001D090CD254}.Debug|Win32.Build.0 = Debug|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
Added: openrtm/trunk/flexiport/Flexiport_vc8.vcproj
===================================================================
--- openrtm/trunk/flexiport/Flexiport_vc8.vcproj (rev 0)
+++ openrtm/trunk/flexiport/Flexiport_vc8.vcproj 2009-09-30 02:25:28 UTC (rev 444)
@@ -0,0 +1,219 @@
+<?xml version="1.0" encoding="shift_jis"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="Flexiport"
+ ProjectGUID="{83B88FAE-4D8B-11DD-87A8-001D090CD254}"
+ RootNamespace="Flexiport"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(ProjectDir)Flexiport\$(ConfigurationName)"
+ IntermediateDirectory="Flexiport\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="0"
+ InheritedPropertySheets="$(SolutionDir)rtm_config.vsprops;$(SolutionDir)user_config.vsprops"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="set PATH=$(rtm_path);%PYTHON_ROOT%\\;%PATH%
for %%x in (*.idl) do rtm-skelwrapper.py --include-dir="" --skel-suffix=Skel --stub-suffix=Stub --idl-file=%%x
for %%x in (*.idl) do $(rtm_idlc) $(rtm_idlflags) %%x
"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="USE_stub_in_nt_dll;WIN32;_DEBUG;_WINDOWS;_USRDLL;__WIN32__;__NT__;__OSVERSION__=4;__x86__;_WIN32_WINNT=0x0400;_CRT_SECURE_NO_DEPRECATE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="$(rtm_libd)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(ProjectDir)Flexiport\$(ConfigurationName)"
+ IntermediateDirectory="Flexiport\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="0"
+ InheritedPropertySheets="$(SolutionDir)rtm_config.vsprops;$(SolutionDir)user_config.vsprops"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="set PATH=$(rtm_path);%PYTHON_ROOT%\\;%PATH%
for %%x in (*.idl) do rtm-skelwrapper.py --include-dir="" --skel-suffix=Skel --stub-suffix=Stub --idl-file=%%x
for %%x in (*.idl) do $(rtm_idlc) $(rtm_idlflags) %%x
"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="USE_stub_in_nt_dll;WIN32;NDEBUG;_WINDOWS;_USRDLL;__WIN32__;__NT__;__OSVERSION__=4;__x86__;_WIN32_WINNT=0x0400;_CRT_SECURE_NO_DEPRECATE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="$(rtm_lib)"
+ LinkIncremental="1"
+ GenerateDebugInformation="false"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="if NOT EXIST "$(SolutionDir)\\components" mkdir "$(SolutionDir)\\components"
copy "$(OutDir)\\Flexiport.dll" "$(SolutionDir)\\components"
"
+ />
+
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{83B891CA-4D8B-11DD-83CB-001D090CD254}"
+ >
+ <File
+ RelativePath="Flexiport.cpp"
+ >
+ </File>
+ <File
+ RelativePath="flexiportSkel.cpp"
+ >
+ </File>
+ <File
+ RelativePath="flexiportSVC_impl.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{83B8933A-4D8B-11DD-95D1-001D090CD254}"
+ >
+ <File
+ RelativePath="Flexiport.h"
+ >
+ </File>
+ <File
+ RelativePath="flexiportSkel.h"
+ >
+ </File>
+ <File
+ RelativePath="flexiportSVC_impl.h"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: openrtm/trunk/flexiport/Flexiport_vc9.sln
===================================================================
--- openrtm/trunk/flexiport/Flexiport_vc9.sln (rev 0)
+++ openrtm/trunk/flexiport/Flexiport_vc9.sln 2009-09-30 02:25:28 UTC (rev 444)
@@ -0,0 +1,29 @@
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FlexiportComp", "FlexiportComp_vc9.vcproj", "{83C689E1-4D8B-11DD-8F7C-001D090CD254}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Flexiport", "Flexiport_vc9.vcproj", "{83D4D630-4D8B-11DD-AF26-001D090CD254}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Release|Win32 = Release|Win32
+ Debug|Win32 = Debug|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {83C689E1-4D8B-11DD-8F7C-001D090CD254}.Release|Win32.ActiveCfg = Release|Win32
+ {83C689E1-4D8B-11DD-8F7C-001D090CD254}.Release|Win32.Build.0 = Release|Win32
+ {83C689E1-4D8B-11DD-8F7C-001D090CD254}.Debug|Win32.ActiveCfg = Debug|Win32
+ {83C689E1-4D8B-11DD-8F7C-001D090CD254}.Debug|Win32.Build.0 = Debug|Win32
+ {83D4D630-4D8B-11DD-AF26-001D090CD254}.Release|Win32.ActiveCfg = Release|Win32
+ {83D4D630-4D8B-11DD-AF26-001D090CD254}.Release|Win32.Build.0 = Release|Win32
+ {83D4D630-4D8B-11DD-AF26-001D090CD254}.Debug|Win32.ActiveCfg = Debug|Win32
+ {83D4D630-4D8B-11DD-AF26-001D090CD254}.Debug|Win32.Build.0 = Debug|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
Added: openrtm/trunk/flexiport/Flexiport_vc9.vcproj
===================================================================
--- openrtm/trunk/flexiport/Flexiport_vc9.vcproj (rev 0)
+++ openrtm/trunk/flexiport/Flexiport_vc9.vcproj 2009-09-30 02:25:28 UTC (rev 444)
@@ -0,0 +1,219 @@
+<?xml version="1.0" encoding="shift_jis"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="Flexiport"
+ ProjectGUID="{83D4D630-4D8B-11DD-AF26-001D090CD254}"
+ RootNamespace="Flexiport"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(ProjectDir)Flexiport\$(ConfigurationName)"
+ IntermediateDirectory="Flexiport\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="0"
+ InheritedPropertySheets="$(SolutionDir)rtm_config.vsprops;$(SolutionDir)user_config.vsprops"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="set PATH=$(rtm_path);%PYTHON_ROOT%\\;%PATH%
for %%x in (*.idl) do rtm-skelwrapper.py --include-dir="" --skel-suffix=Skel --stub-suffix=Stub --idl-file=%%x
for %%x in (*.idl) do $(rtm_idlc) $(rtm_idlflags) %%x
"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="USE_stub_in_nt_dll;WIN32;_DEBUG;_WINDOWS;_USRDLL;__WIN32__;__NT__;__OSVERSION__=4;__x86__;_WIN32_WINNT=0x0400;_CRT_SECURE_NO_DEPRECATE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="$(rtm_libd)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(ProjectDir)Flexiport\$(ConfigurationName)"
+ IntermediateDirectory="Flexiport\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="0"
+ InheritedPropertySheets="$(SolutionDir)rtm_config.vsprops;$(SolutionDir)user_config.vsprops"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="set PATH=$(rtm_path);%PYTHON_ROOT%\\;%PATH%
for %%x in (*.idl) do rtm-skelwrapper.py --include-dir="" --skel-suffix=Skel --stub-suffix=Stub --idl-file=%%x
for %%x in (*.idl) do $(rtm_idlc) $(rtm_idlflags) %%x
"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="USE_stub_in_nt_dll;WIN32;NDEBUG;_WINDOWS;_USRDLL;__WIN32__;__NT__;__OSVERSION__=4;__x86__;_WIN32_WINNT=0x0400;_CRT_SECURE_NO_DEPRECATE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="$(rtm_lib)"
+ LinkIncremental="1"
+ GenerateDebugInformation="false"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="if NOT EXIST "$(SolutionDir)\\components" mkdir "$(SolutionDir)\\components"
copy "$(OutDir)\\Flexiport.dll" "$(SolutionDir)\\components"
"
+ />
+
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{83D4D811-4D8B-11DD-B276-001D090CD254}"
+ >
+ <File
+ RelativePath="Flexiport.cpp"
+ >
+ </File>
+ <File
+ RelativePath="flexiportSkel.cpp"
+ >
+ </File>
+ <File
+ RelativePath="flexiportSVC_impl.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{83D4D95C-4D8B-11DD-8A9C-001D090CD254}"
+ >
+ <File
+ RelativePath="Flexiport.h"
+ >
+ </File>
+ <File
+ RelativePath="flexiportSkel.h"
+ >
+ </File>
+ <File
+ RelativePath="flexiportSVC_impl.h"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: openrtm/trunk/flexiport/Makefile.Flexiport
===================================================================
--- openrtm/trunk/flexiport/Makefile.Flexiport (rev 0)
+++ openrtm/trunk/flexiport/Makefile.Flexiport 2009-09-30 02:25:28 UTC (rev 444)
@@ -0,0 +1,83 @@
+# -*- Makefile -*-
+#
+# @file Makefile.Flexiport# @brief RTComponent makefile for "Flexiport component"
+# @date $Date$
+#
+# This file is generated by rtc-template with the following argments.
+#
+# /home/geoff/bin/rtc-template -bcxx --module-name=Flexiport \
+# --module-desc=Flexiport hardware data communications component \
+# --module-version=0.0.1 --module-vendor=Geoffrey Biggs, AIST \
+# --module-category=DataProvider --module-comp-type=STATIC \
+# --module-act-type=SPORADIC --module-max-inst=10 \
+# --outport=recvData:TimedOctetSeq --inport=sendData:TimedOctetSeq \
+# --config=portOpts:std::string:type=serial,device=/dev/ttyACM0,timeout=1 \
+# --config=debug:int:0 --config=timeout_sec:int:1 \
+# --config=timeout_usec:int:0 --config=readable:bool:1 \
+# --config=writable:bool:1 --config=sleepTime:int:10 \
+# --config=bufferSize:int:0 --service=apiPort:flexiport:flexiport_intf \
+# --service-idl=flexiport.idl
+#
+#
+# $Id$
+#
+CXXFLAGS = `rtm-config --cflags` -I. `pkg-config --cflags flexiport`
+LDFLAGS = `rtm-config --libs` `pkg-config --libs flexiport`
+SHFLAGS = -shared
+
+IDLC = `rtm-config --idlc`
+IDLFLAGS = `rtm-config --idlflags` -I`rtm-config --prefix`/include/rtm/idl
+WRAPPER = rtm-skelwrapper
+WRAPPER_FLAGS = --include-dir="" --skel-suffix=Skel --stub-suffix=Stub
+
+SKEL_OBJ = flexiportSkel.o
+STUB_OBJ =
+IMPL_OBJ = flexiportSVC_impl.o
+OBJS = Flexiport.o $(SKEL_OBJ) $(STUB_OBJ) $(IMPL_OBJ)
+
+.SUFFIXES : .so
+
+all: Flexiport.so FlexiportComp
+
+
+.cpp.o:
+ rm -f $@
+ $(CXX) $(CXXFLAGS) -c -o $@ $<
+
+.o.so:
+ rm -f $@
+ $(CXX) $(SHFLAGS) -o $@ $(OBJS) $(LDFLAGS)
+
+FlexiportComp: FlexiportComp.o $(OBJS)
+ $(CXX) -o $@ $(OBJS) FlexiportComp.o $(LDFLAGS)
+
+
+clean: clean_objs clean_skelstub
+ rm -f *~
+
+clean_objs:
+ rm -f $(OBJS) FlexiportComp.o Flexiport.so FlexiportComp
+
+clean_skelstub:
+ rm -f *Skel.h *Skel.cpp
+ rm -f *Stub.h *Stub.cpp
+
+flexiportSkel.cpp : flexiport.idl
+ $(IDLC) $(IDLFLAGS) flexiport.idl
+ $(WRAPPER) $(WRAPPER_FLAGS) --idl-file=flexiport.idl
+flexiportSkel.h : flexiport.idl
+ $(IDLC) $(IDLFLAGS) flexiport.idl
+ $(WRAPPER) $(WRAPPER_FLAGS) --idl-file=flexiport.idl
+
+
+Flexiport.so: $(OBJS)
+Flexiport.o: Flexiport.h flexiportSkel.h flexiportSVC_impl.h
+FlexiportComp.o: FlexiportComp.cpp Flexiport.cpp Flexiport.h flexiportSkel.h flexiportSVC_impl.h
+
+flexiportSVC_impl.o: flexiportSVC_impl.cpp flexiportSVC_impl.h flexiportSkel.h flexiportStub.h
+flexiportSkel.o: flexiportSkel.cpp flexiportSkel.h flexiportStub.h
+flexiportStub.o: flexiportStub.cpp flexiportStub.h
+
+
+# end of Makefile
+
Added: openrtm/trunk/flexiport/README.Flexiport
===================================================================
--- openrtm/trunk/flexiport/README.Flexiport (rev 0)
+++ openrtm/trunk/flexiport/README.Flexiport 2009-09-30 02:25:28 UTC (rev 444)
@@ -0,0 +1,268 @@
+#======================================================================
+# RTComponent: Flexiport specificatioin
+#
+# OpenRTM-aist-0.4.2
+#
+# Date: Wed Jul 9 16:49:09 2008
+#
+# This file is generated by rtc-template with the following argments.
+#
+# /home/geoff/bin/rtc-template -bcxx --module-name=Flexiport \
+# --module-desc=Flexiport hardware data communications component \
+# --module-version=0.0.1 --module-vendor=Geoffrey Biggs, AIST \
+# --module-category=DataProvider --module-comp-type=STATIC \
+# --module-act-type=SPORADIC --module-max-inst=10 \
+# --outport=recvData:TimedOctetSeq --inport=sendData:TimedOctetSeq \
+# --config=portOpts:std::string:type=serial,device=/dev/ttyACM0,timeout=1 \
+...
[truncated message content] |
|
From: <gb...@us...> - 2009-09-07 02:07:37
|
Revision: 443
http://gearbox.svn.sourceforge.net/gearbox/?rev=443&view=rev
Author: gbiggs
Date: 2009-09-07 02:07:27 +0000 (Mon, 07 Sep 2009)
Log Message:
-----------
Don't redeclare struct timespec if it already has been on Windows.
Modified Paths:
--------------
gearbox/trunk/doc/history.dox
gearbox/trunk/src/flexiport/timeout.h
Modified: gearbox/trunk/doc/history.dox
===================================================================
--- gearbox/trunk/doc/history.dox 2009-09-04 08:50:14 UTC (rev 442)
+++ gearbox/trunk/doc/history.dox 2009-09-07 02:07:27 UTC (rev 443)
@@ -39,6 +39,9 @@
- Bugfix: Errors in the way intensity data is retrieved have been fixed. (gbiggs, bug report by martimorta)
- New feature: The example now has an option, -i, to get intensity data.
+- libflexiport
+ - Bugfix: Don't redeclare timespec if it already has been on Windows. (gbiggs)
+
@section gbx_doc_history_907 Changes in Release 9.07
@par Updated libraries
Modified: gearbox/trunk/src/flexiport/timeout.h
===================================================================
--- gearbox/trunk/src/flexiport/timeout.h 2009-09-04 08:50:14 UTC (rev 442)
+++ gearbox/trunk/src/flexiport/timeout.h 2009-09-07 02:07:27 UTC (rev 443)
@@ -36,12 +36,14 @@
#else
#define FLEXIPORT_EXPORT __declspec (dllimport)
#endif
- // No timespec on Windows
- typedef struct timespec
- {
- int tv_sec;
- int tv_nsec;
- } timespec;
+ #if !defined (timespec)
+ // No timespec on Windows
+ typedef struct timespec
+ {
+ int tv_sec;
+ int tv_nsec;
+ } timespec;
+ #endif
#else
#define FLEXIPORT_EXPORT
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2009-09-04 08:50:23
|
Revision: 442
http://gearbox.svn.sourceforge.net/gearbox/?rev=442&view=rev
Author: gbiggs
Date: 2009-09-04 08:50:14 +0000 (Fri, 04 Sep 2009)
Log Message:
-----------
Fixed bugs in reading intensity data. Added -i option to example.
Modified Paths:
--------------
gearbox/trunk/doc/history.dox
gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp
gearbox/trunk/src/hokuyo_aist/test/example.cpp
Modified: gearbox/trunk/doc/history.dox
===================================================================
--- gearbox/trunk/doc/history.dox 2009-09-02 08:27:54 UTC (rev 441)
+++ gearbox/trunk/doc/history.dox 2009-09-04 08:50:14 UTC (rev 442)
@@ -35,6 +35,10 @@
- Bugfix: matched GPS status/solution enums to Novatel's internal types, there were gaps due to reserved values before.
Note: this will create mismatches with old log-files (not data, status/solution-type only)! (MichaelM, patch by Ian Mahon)
+- libhokuyo_aist
+ - Bugfix: Errors in the way intensity data is retrieved have been fixed. (gbiggs, bug report by martimorta)
+ - New feature: The example now has an option, -i, to get intensity data.
+
@section gbx_doc_history_907 Changes in Release 9.07
@par Updated libraries
Modified: gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp 2009-09-02 08:27:54 UTC (rev 441)
+++ gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp 2009-09-04 08:50:14 UTC (rev 442)
@@ -2467,7 +2467,7 @@
if (currentStep != numSteps)
{
throw HokuyoError (HOKUYO_ERR_PROTOCOL,
- "Read a different number of range readings than were asked for.");
+ "Read a different number of range readings than were asked for.");
}
}
@@ -2485,7 +2485,7 @@
// 3 byte data is a pain because it crosses the line boundary, it may overlap by 0, 1 or 2 bytes
char buffer[SCIP2_LINE_LENGTH];
- unsigned int currentStep = 0;
+ unsigned int currentRange = 0, currentIntensity = 0;
int numBytesInLine = 0, splitCount = 0;
char splitValue[3];
bool nextIsIntensity = false;
@@ -2523,40 +2523,43 @@
{
splitValue[2] = buffer[ii++];
if (nextIsIntensity)
- data->_intensities[currentStep] = Decode3ByteValue (splitValue);
+ data->_intensities[currentIntensity] = Decode3ByteValue (splitValue);
else
- data->_ranges[currentStep] = Decode3ByteValue (splitValue);
+ data->_ranges[currentRange] = Decode3ByteValue (splitValue);
}
else if (splitCount == 2)
{
splitValue[1] = buffer[ii++];
splitValue[2] = buffer[ii++];
if (nextIsIntensity)
- data->_intensities[currentStep] = Decode3ByteValue (splitValue);
+ data->_intensities[currentIntensity] = Decode3ByteValue (splitValue);
else
- data->_ranges[currentStep] = Decode3ByteValue (splitValue);
+ data->_ranges[currentRange] = Decode3ByteValue (splitValue);
}
else
{
if (nextIsIntensity)
- data->_intensities[currentStep] = Decode3ByteValue (&buffer[ii]);
+ data->_intensities[currentIntensity] = Decode3ByteValue (&buffer[ii]);
else
- data->_ranges[currentStep] = Decode3ByteValue (&buffer[ii]);
+ data->_ranges[currentRange] = Decode3ByteValue (&buffer[ii]);
ii += 3;
}
- if (data->_ranges[currentStep] > _maxRange && !nextIsIntensity)
+ if (data->_ranges[currentRange] > _maxRange && !nextIsIntensity)
{
cerr << "WARNING: HokuyoLaser::" << __func__ <<
- "() Value at step " << currentStep << " beyond maximum range: " <<
- data->_ranges[currentStep] << " (raw bytes: ";
+ "() Value at step " << currentRange << " beyond maximum range: " <<
+ data->_ranges[currentRange] << " (raw bytes: ";
if (splitCount != 0)
cerr << splitValue[0] << splitValue[1] << splitValue[2] << ")" << endl;
else
cerr << buffer[0] << buffer[1] << buffer[2] << ")" << endl;
}
- else if (data->_ranges[currentStep] < 20)
+ else if (data->_ranges[currentRange] < 20)
data->_error = true;
- currentStep++;
+ if (nextIsIntensity)
+ currentIntensity++;
+ else
+ currentRange++;
splitCount = 0; // Reset this here now that it's been used
nextIsIntensity = !nextIsIntensity; // Alternate between range and intensity values
}
@@ -2566,13 +2569,13 @@
if (_verbose)
{
- cerr << "HokuyoLaser::" << __func__ << "() Read " << currentStep <<
- " ranges and intensities." << endl;
+ cerr << "HokuyoLaser::" << __func__ << "() Read " << currentRange << " ranges and "
+ << currentIntensity << " intensities (expected " << numSteps << ")." << endl;
}
- if (currentStep != numSteps)
+ if (currentRange != numSteps || currentIntensity != numSteps)
{
throw HokuyoError (HOKUYO_ERR_PROTOCOL,
- "Read a different number of range and intensity readings than were asked for.");
+ "Read a different number of range or intensity readings than were asked for.");
}
}
Modified: gearbox/trunk/src/hokuyo_aist/test/example.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/test/example.cpp 2009-09-02 08:27:54 UTC (rev 441)
+++ gearbox/trunk/src/hokuyo_aist/test/example.cpp 2009-09-04 08:50:14 UTC (rev 442)
@@ -38,14 +38,14 @@
double startAngle = 0.0, endAngle = 0.0;
int firstStep = -1, lastStep = -1;
unsigned int baud = 19200, speed = 0, clusterCount = 1;
- bool getNew = false, verbose = false;
+ bool getIntensities = false, getNew = false, verbose = false;
#if defined (WIN32)
portOptions = "type=serial,device=COM3,timeout=1";
#else
int opt;
// Get some options from the command line
- while ((opt = getopt(argc, argv, "b:c:e:f:l:m:no:s:vh")) != -1)
+ while ((opt = getopt(argc, argv, "b:c:e:f:il:m:no:s:vh")) != -1)
{
switch (opt)
{
@@ -61,6 +61,9 @@
case 'f':
sscanf (optarg, "%d", &firstStep);
break;
+ case 'i':
+ getIntensities = true;
+ break;
case 'l':
sscanf (optarg, "%d", &lastStep);
break;
@@ -87,6 +90,7 @@
cout << "-c count\tCluster count." << endl;
cout << "-e angle\tEnd angle to get ranges to." << endl;
cout << "-f step\t\tFirst step to get ranges from." << endl;
+ cout << "-i\t\tGet intensity data along with ranges." << endl;
cout << "-l step\t\tLast step to get ranges to." << endl;
cout << "-m speed\tMotor speed." << endl;
cout << "-n\t\tGet new ranges instead of latest ranges." << endl;
@@ -142,6 +146,8 @@
// Get all ranges
if (getNew)
laser.GetNewRanges (&data, -1, -1, clusterCount);
+ else if (getIntensities)
+ laser.GetNewRangesAndIntensities (&data, -1, -1, clusterCount);
else
laser.GetRanges (&data, -1, -1, clusterCount);
}
@@ -150,6 +156,8 @@
// Get by step
if (getNew)
laser.GetNewRanges (&data, firstStep, lastStep, clusterCount);
+ else if (getIntensities)
+ laser.GetNewRangesAndIntensities (&data, firstStep, lastStep, clusterCount);
else
laser.GetRanges (&data, firstStep, lastStep, clusterCount);
}
@@ -158,6 +166,8 @@
// Get by angle
if (getNew)
laser.GetNewRangesByAngle (&data, startAngle, endAngle, clusterCount);
+ else if (getIntensities)
+ laser.GetNewRangesAndIntensitiesByAngle (&data, startAngle, endAngle, clusterCount);
else
laser.GetRangesByAngle (&data, startAngle, endAngle, clusterCount);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2009-09-02 08:28:12
|
Revision: 441
http://gearbox.svn.sourceforge.net/gearbox/?rev=441&view=rev
Author: gbiggs
Date: 2009-09-02 08:27:54 +0000 (Wed, 02 Sep 2009)
Log Message:
-----------
Added ME command summary
Modified Paths:
--------------
gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp
Modified: gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp 2009-09-02 08:24:40 UTC (rev 440)
+++ gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp 2009-09-02 08:27:54 UTC (rev 441)
@@ -150,7 +150,11 @@
M|D/S|Start(4)|End(4)|Cluster(2)|Interval(1)|Number(2)|LF
M|D/S|Start(4)|End(4)|Cluster(2)|Interval(1)|Number(2)|LF|Status(2)|Sum|LF|Data...|LF|LF
16 byte command block
- See also ME command featured only on UTM-30LX for getting intensity data.
+ME Get new data, including intensity data
+ M|E|Start(4)|End(4)|Cluster(2)|Interval(1)|Number(2)|LF
+ M|E|Start(4)|End(4)|Cluster(2)|Interval(1)|Number(2)|LF|Status(2)|Sum|LF|Data...|LF|LF
+ 16 byte command block
+ Featured only on UTM-30LX for getting intensity data.
GDGS Get latest data
G|D/S|Start(4)|End(4)|Cluster(2)|LF
G|D/S|Start(4)|End(4)|Cluster(2)|LF|Status(2)|Sum|LF|Data...|LF|LF
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2009-09-02 08:24:52
|
Revision: 440
http://gearbox.svn.sourceforge.net/gearbox/?rev=440&view=rev
Author: gbiggs
Date: 2009-09-02 08:24:40 +0000 (Wed, 02 Sep 2009)
Log Message:
-----------
Fixed bug caused by misinterpretation of ME command docs
Modified Paths:
--------------
gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp
Modified: gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp
===================================================================
--- gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp 2009-08-30 02:45:00 UTC (rev 439)
+++ gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp 2009-09-02 08:24:40 UTC (rev 440)
@@ -1639,7 +1639,6 @@
throw HokuyoError (HOKUYO_ERR_PROTOCOL, ss.str ());
}
// Then compare the parameters
- buffer[12] = '0'; // There will be zero scans remaining after this one
if (memcmp (&response[2], buffer, 13) != 0)
{
throw HokuyoError (HOKUYO_ERR_PROTOCOL, "Incorrect paramaters prefix for ME data.");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <to...@us...> - 2009-08-30 02:45:13
|
Revision: 439
http://gearbox.svn.sourceforge.net/gearbox/?rev=439&view=rev
Author: tobasco
Date: 2009-08-30 02:45:00 +0000 (Sun, 30 Aug 2009)
Log Message:
-----------
fixed build error in Linux
Modified Paths:
--------------
gearbox/trunk/src/gbxutilacfr/subhealth.h
Modified: gearbox/trunk/src/gbxutilacfr/subhealth.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/subhealth.h 2009-08-28 01:57:20 UTC (rev 438)
+++ gearbox/trunk/src/gbxutilacfr/subhealth.h 2009-08-30 02:45:00 UTC (rev 439)
@@ -36,7 +36,7 @@
//!
//! @sa Status, SubsystemStatus
//!
-class GBXUTILACFR_STATUS SubHealth
+class GBXUTILACFR_EXPORT SubHealth
{
public:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2009-08-28 01:57:28
|
Revision: 438
http://gearbox.svn.sourceforge.net/gearbox/?rev=438&view=rev
Author: gbiggs
Date: 2009-08-28 01:57:20 +0000 (Fri, 28 Aug 2009)
Log Message:
-----------
Made GbxUtilAcfr usable on Windows
Modified Paths:
--------------
gearbox/trunk/src/gbxutilacfr/CMakeLists.txt
gearbox/trunk/src/gbxutilacfr/exceptions.h
gearbox/trunk/src/gbxutilacfr/mathdefs.h
gearbox/trunk/src/gbxutilacfr/status.h
gearbox/trunk/src/gbxutilacfr/stoppable.h
gearbox/trunk/src/gbxutilacfr/subhealth.h
gearbox/trunk/src/gbxutilacfr/substatus.h
gearbox/trunk/src/gbxutilacfr/tokenise.h
gearbox/trunk/src/gbxutilacfr/tracer.h
gearbox/trunk/src/gbxutilacfr/trivialstatus.h
gearbox/trunk/src/gbxutilacfr/trivialtracer.h
Modified: gearbox/trunk/src/gbxutilacfr/CMakeLists.txt
===================================================================
--- gearbox/trunk/src/gbxutilacfr/CMakeLists.txt 2009-08-28 00:26:01 UTC (rev 437)
+++ gearbox/trunk/src/gbxutilacfr/CMakeLists.txt 2009-08-28 01:57:20 UTC (rev 438)
@@ -6,7 +6,14 @@
GBX_REQUIRE_OPTION( build LIB ${lib_name} ON )
if( build )
-
+ if (WIN32)
+ if (GBX_DEFAULT_LIB_TYPE STREQUAL SHARED)
+ add_definitions (-DGBXUTILACFR_EXPORTS)
+ else (GBX_DEFAULT_LIB_TYPE STREQUAL SHARED)
+ add_definitions (-DGBXUTILACFR_STATIC -DFLEXIPORT_STATIC)
+ endif (GBX_DEFAULT_LIB_TYPE STREQUAL SHARED)
+ endif (WIN32)
+
include( ${GBX_CMAKE_DIR}/UseBasicRules.cmake )
file( GLOB hdrs *.h )
Modified: gearbox/trunk/src/gbxutilacfr/exceptions.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/exceptions.h 2009-08-28 00:26:01 UTC (rev 437)
+++ gearbox/trunk/src/gbxutilacfr/exceptions.h 2009-08-28 01:57:20 UTC (rev 438)
@@ -11,6 +11,18 @@
#ifndef GBXUTILACFR_EXCEPTIONS_H
#define GBXUTILACFR_EXCEPTIONS_H
+#if defined (WIN32)
+ #if defined (GBXUTILACFR_STATIC)
+ #define GBXUTILACFR_EXPORT
+ #elif defined (GBXUTILACFR_EXPORTS)
+ #define GBXUTILACFR_EXPORT __declspec (dllexport)
+ #else
+ #define GBXUTILACFR_EXPORT __declspec (dllimport)
+ #endif
+#else
+ #define GBXUTILACFR_EXPORT
+#endif
+
/*
* STRINGIZE macro converts an expression into a string-literal.
* ERROR_INFO macro permits file-name and line-number data to be added to an error message.
@@ -50,7 +62,7 @@
where the ERROR_INFO macro inserts the offending file and line number.
*/
-class Exception : public std::exception
+class GBXUTILACFR_EXPORT Exception : public std::exception
{
public:
Exception(const char *file, const char *line, const std::string &message);
@@ -69,7 +81,7 @@
};
//! This exception is raised when something is wrong with the hardware.
-class HardwareException : public gbxutilacfr::Exception
+class GBXUTILACFR_EXPORT HardwareException : public gbxutilacfr::Exception
{
public:
HardwareException(const char *file, const char *line, const std::string &message)
Modified: gearbox/trunk/src/gbxutilacfr/mathdefs.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/mathdefs.h 2009-08-28 00:26:01 UTC (rev 437)
+++ gearbox/trunk/src/gbxutilacfr/mathdefs.h 2009-08-28 01:57:20 UTC (rev 438)
@@ -17,6 +17,18 @@
#ifndef GBXUTILACFR_MATH_DEFINITIONS_H
#define GBXUTILACFR_MATH_DEFINITIONS_H
+#if defined (WIN32)
+ #if defined (GBXUTILACFR_STATIC)
+ #define GBXUTILACFR_EXPORT
+ #elif defined (GBXUTILACFR_EXPORTS)
+ #define GBXUTILACFR_EXPORT __declspec (dllexport)
+ #else
+ #define GBXUTILACFR_EXPORT __declspec (dllimport)
+ #endif
+#else
+ #define GBXUTILACFR_EXPORT
+#endif
+
#include <assert.h>
/*****************************************************************************
@@ -66,7 +78,7 @@
//dox Normalises the angle [rad] to the range [-pi,pi)
//dox Don't return the normalised angle, because it's easy to make the
//dox mistake of doing: 'NORMALISE_ANGLE( myAngle )', ignoring the return value.
-inline void NORMALISE_ANGLE( double &theta )
+GBXUTILACFR_EXPORT inline void NORMALISE_ANGLE( double &theta )
{
double multiplier;
@@ -84,7 +96,7 @@
//dox Normalises the angle [rad] to the range [-pi,pi)
//dox Don't return the normalised angle, because it's easy to make the
//dox mistake of doing: 'NORMALISE_ANGLE( myAngle )', ignoring the return value.
-inline void NORMALISE_ANGLE( float &theta )
+GBXUTILACFR_EXPORT inline void NORMALISE_ANGLE( float &theta )
{
double thDouble = theta;
NORMALISE_ANGLE( thDouble );
@@ -169,7 +181,7 @@
//dox Modifies x to lie within [x_min,x_max]
//dox
template<typename T>
-void
+GBXUTILACFR_EXPORT void
CLIP_TO_LIMITS( const T &min_x, T &x, const T &max_x )
{
assert( min_x <= max_x );
Modified: gearbox/trunk/src/gbxutilacfr/status.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/status.h 2009-08-28 00:26:01 UTC (rev 437)
+++ gearbox/trunk/src/gbxutilacfr/status.h 2009-08-28 01:57:20 UTC (rev 438)
@@ -11,6 +11,18 @@
#ifndef GBXUTILACFR_STATUS_H
#define GBXUTILACFR_STATUS_H
+#if defined (WIN32)
+ #if defined (GBXUTILACFR_STATIC)
+ #define GBXUTILACFR_EXPORT
+ #elif defined (GBXUTILACFR_EXPORTS)
+ #define GBXUTILACFR_EXPORT __declspec (dllexport)
+ #else
+ #define GBXUTILACFR_EXPORT __declspec (dllimport)
+ #endif
+#else
+ #define GBXUTILACFR_EXPORT
+#endif
+
#include <string>
#include <vector>
@@ -32,7 +44,7 @@
};
//! Returns string equivalent of state enumerator.
-std::string toString( SubsystemState state );
+GBXUTILACFR_EXPORT std::string toString( SubsystemState state );
//! Possible subsystem status values
enum SubsystemHealth
@@ -46,10 +58,10 @@
};
//! Returns string equivalent of health enumerator.
-std::string toString( SubsystemHealth health );
+GBXUTILACFR_EXPORT std::string toString( SubsystemHealth health );
//! Status for a single subsystem
-struct SubsystemStatus
+struct GBXUTILACFR_EXPORT SubsystemStatus
{
//! Constructor.
SubsystemStatus( SubsystemState s=SubsystemIdle, SubsystemHealth h=SubsystemOk, const std::string& msg="",
@@ -80,7 +92,7 @@
};
//! Returns human-readable string with subsystem status information.
-std::string toString( const SubsystemStatus& status );
+GBXUTILACFR_EXPORT std::string toString( const SubsystemStatus& status );
//! Subsystem type which describes common behavior models of a subsystem.
enum SubsystemType {
@@ -91,7 +103,7 @@
};
//! Returns string equivalent of subsystem type enumerator.
-std::string toString( SubsystemType type );
+GBXUTILACFR_EXPORT std::string toString( SubsystemType type );
/*!
@brief Local interface to component status.
@@ -173,7 +185,7 @@
@sa Tracer
@sa SubStatus
*/
-class Status
+class GBXUTILACFR_EXPORT Status
{
public:
Modified: gearbox/trunk/src/gbxutilacfr/stoppable.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/stoppable.h 2009-08-28 00:26:01 UTC (rev 437)
+++ gearbox/trunk/src/gbxutilacfr/stoppable.h 2009-08-28 01:57:20 UTC (rev 438)
@@ -11,6 +11,18 @@
#ifndef GBXUTILACFR_STOPPABLE_H
#define GBXUTILACFR_STOPPABLE_H
+#if defined (WIN32)
+ #if defined (GBXUTILACFR_STATIC)
+ #define GBXUTILACFR_EXPORT
+ #elif defined (GBXUTILACFR_EXPORTS)
+ #define GBXUTILACFR_EXPORT __declspec (dllexport)
+ #else
+ #define GBXUTILACFR_EXPORT __declspec (dllimport)
+ #endif
+#else
+ #define GBXUTILACFR_EXPORT
+#endif
+
namespace gbxutilacfr {
/*!
@@ -45,7 +57,7 @@
@author Alex Makarenko
*/
-class Stoppable
+class GBXUTILACFR_EXPORT Stoppable
{
public:
virtual ~Stoppable() {};
Modified: gearbox/trunk/src/gbxutilacfr/subhealth.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/subhealth.h 2009-08-28 00:26:01 UTC (rev 437)
+++ gearbox/trunk/src/gbxutilacfr/subhealth.h 2009-08-28 01:57:20 UTC (rev 438)
@@ -11,6 +11,18 @@
#ifndef GBXUTILACFR_SUBSYSTEM_HEALTH_H
#define GBXUTILACFR_SUBSYSTEM_HEALTH_H
+#if defined (WIN32)
+ #if defined (GBXUTILACFR_STATIC)
+ #define GBXUTILACFR_EXPORT
+ #elif defined (GBXUTILACFR_EXPORTS)
+ #define GBXUTILACFR_EXPORT __declspec (dllexport)
+ #else
+ #define GBXUTILACFR_EXPORT __declspec (dllimport)
+ #endif
+#else
+ #define GBXUTILACFR_EXPORT
+#endif
+
#include <gbxutilacfr/status.h>
namespace gbxutilacfr {
@@ -24,7 +36,7 @@
//!
//! @sa Status, SubsystemStatus
//!
-class SubHealth
+class GBXUTILACFR_STATUS SubHealth
{
public:
Modified: gearbox/trunk/src/gbxutilacfr/substatus.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/substatus.h 2009-08-28 00:26:01 UTC (rev 437)
+++ gearbox/trunk/src/gbxutilacfr/substatus.h 2009-08-28 01:57:20 UTC (rev 438)
@@ -11,6 +11,18 @@
#ifndef GBXUTILACFR_SUBSYSTEM_STATUS_H
#define GBXUTILACFR_SUBSYSTEM_STATUS_H
+#if defined (WIN32)
+ #if defined (GBXUTILACFR_STATIC)
+ #define GBXUTILACFR_EXPORT
+ #elif defined (GBXUTILACFR_EXPORTS)
+ #define GBXUTILACFR_EXPORT __declspec (dllexport)
+ #else
+ #define GBXUTILACFR_EXPORT __declspec (dllimport)
+ #endif
+#else
+ #define GBXUTILACFR_EXPORT
+#endif
+
#include <gbxutilacfr/status.h>
namespace gbxutilacfr {
@@ -24,7 +36,7 @@
//!
//! @sa Status, @sa SubHealth
//!
-class SubStatus
+class GBXUTILACFR_EXPORT SubStatus
{
public:
Modified: gearbox/trunk/src/gbxutilacfr/tokenise.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/tokenise.h 2009-08-28 00:26:01 UTC (rev 437)
+++ gearbox/trunk/src/gbxutilacfr/tokenise.h 2009-08-28 01:57:20 UTC (rev 438)
@@ -11,6 +11,18 @@
#ifndef GBXUTILACFR_TOKENISE_H
#define GBXUTILACFR_TOKENISE_H
+#if defined (WIN32)
+ #if defined (GBXUTILACFR_STATIC)
+ #define GBXUTILACFR_EXPORT
+ #elif defined (GBXUTILACFR_EXPORTS)
+ #define GBXUTILACFR_EXPORT __declspec (dllexport)
+ #else
+ #define GBXUTILACFR_EXPORT __declspec (dllimport)
+ #endif
+#else
+ #define GBXUTILACFR_EXPORT
+#endif
+
#include <string>
#include <vector>
@@ -18,8 +30,8 @@
//! Takes a string containing tokens separated by a delimiter
//! Returns the vector of tokens
-std::vector<std::string> tokenise( const std::string &str,
- const std::string &delimiter );
+GBXUTILACFR_EXPORT std::vector<std::string> tokenise( const std::string &str,
+ const std::string &delimiter );
}
Modified: gearbox/trunk/src/gbxutilacfr/tracer.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/tracer.h 2009-08-28 00:26:01 UTC (rev 437)
+++ gearbox/trunk/src/gbxutilacfr/tracer.h 2009-08-28 01:57:20 UTC (rev 438)
@@ -11,6 +11,18 @@
#ifndef GBXUTILACFR_TRACER_H
#define GBXUTILACFR_TRACER_H
+#if defined (WIN32)
+ #if defined (GBXUTILACFR_STATIC)
+ #define GBXUTILACFR_EXPORT
+ #elif defined (GBXUTILACFR_EXPORTS)
+ #define GBXUTILACFR_EXPORT __declspec (dllexport)
+ #else
+ #define GBXUTILACFR_EXPORT __declspec (dllimport)
+ #endif
+#else
+ #define GBXUTILACFR_EXPORT
+#endif
+
#include <string>
namespace gbxutilacfr {
@@ -33,7 +45,7 @@
};
//! Returns a string corresponding to the enum element.
-std::string toString( TraceType type );
+GBXUTILACFR_EXPORT std::string toString( TraceType type );
//! Types of destinations for traced information.
enum DestinationType {
@@ -96,7 +108,7 @@
//!
//! @see Status
//!
-class Tracer
+class GBXUTILACFR_EXPORT Tracer
{
public:
virtual ~Tracer() {};
Modified: gearbox/trunk/src/gbxutilacfr/trivialstatus.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/trivialstatus.h 2009-08-28 00:26:01 UTC (rev 437)
+++ gearbox/trunk/src/gbxutilacfr/trivialstatus.h 2009-08-28 01:57:20 UTC (rev 438)
@@ -11,6 +11,18 @@
#ifndef GBXUTILACFR_TRIVIAL_STATUS_H
#define GBXUTILACFR_TRIVIAL_STATUS_H
+#if defined (WIN32)
+ #if defined (GBXUTILACFR_STATIC)
+ #define GBXUTILACFR_EXPORT
+ #elif defined (GBXUTILACFR_EXPORTS)
+ #define GBXUTILACFR_EXPORT __declspec (dllexport)
+ #else
+ #define GBXUTILACFR_EXPORT __declspec (dllimport)
+ #endif
+#else
+ #define GBXUTILACFR_EXPORT
+#endif
+
#include <gbxutilacfr/status.h>
#include <gbxutilacfr/tracer.h>
@@ -24,7 +36,7 @@
//!
//! @see Status
//!
-class TrivialStatus : public Status
+class GBXUTILACFR_EXPORT TrivialStatus : public Status
{
public:
Modified: gearbox/trunk/src/gbxutilacfr/trivialtracer.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/trivialtracer.h 2009-08-28 00:26:01 UTC (rev 437)
+++ gearbox/trunk/src/gbxutilacfr/trivialtracer.h 2009-08-28 01:57:20 UTC (rev 438)
@@ -11,6 +11,18 @@
#ifndef GBXUTILACFR_TRIVIAL_TRACER_H
#define GBXUTILACFR_TRIVIAL_TRACER_H
+#if defined (WIN32)
+ #if defined (GBXUTILACFR_STATIC)
+ #define GBXUTILACFR_EXPORT
+ #elif defined (GBXUTILACFR_EXPORTS)
+ #define GBXUTILACFR_EXPORT __declspec (dllexport)
+ #else
+ #define GBXUTILACFR_EXPORT __declspec (dllimport)
+ #endif
+#else
+ #define GBXUTILACFR_EXPORT
+#endif
+
#include <gbxutilacfr/tracer.h>
namespace gbxutilacfr {
@@ -20,7 +32,7 @@
//!
//! @see Tracer
//!
-class TrivialTracer : public Tracer
+class GBXUTILACFR_EXPORT TrivialTracer : public Tracer
{
public:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2009-08-28 00:50:27
|
Revision: 437
http://gearbox.svn.sourceforge.net/gearbox/?rev=437&view=rev
Author: gbiggs
Date: 2009-08-28 00:26:01 +0000 (Fri, 28 Aug 2009)
Log Message:
-----------
Clarified documentation
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-08-14 06:51:37 UTC (rev 436)
+++ gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp 2009-08-28 00:26:01 UTC (rev 437)
@@ -150,6 +150,7 @@
M|D/S|Start(4)|End(4)|Cluster(2)|Interval(1)|Number(2)|LF
M|D/S|Start(4)|End(4)|Cluster(2)|Interval(1)|Number(2)|LF|Status(2)|Sum|LF|Data...|LF|LF
16 byte command block
+ See also ME command featured only on UTM-30LX for getting intensity data.
GDGS Get latest data
G|D/S|Start(4)|End(4)|Cluster(2)|LF
G|D/S|Start(4)|End(4)|Cluster(2)|LF|Status(2)|Sum|LF|Data...|LF|LF
Modified: gearbox/trunk/src/hokuyo_aist/hokuyo_aist.h
===================================================================
--- gearbox/trunk/src/hokuyo_aist/hokuyo_aist.h 2009-08-14 06:51:37 UTC (rev 436)
+++ gearbox/trunk/src/hokuyo_aist/hokuyo_aist.h 2009-08-28 00:26:01 UTC (rev 437)
@@ -235,9 +235,9 @@
/// This constructor creates an empty HokuyoData with no data currently allocated.
HokuyoData ();
- /// This constructor performs a deep copy of range data.
+ /// This constructor performs a deep copy of existing 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.
+ /// This constructor performs a deep copy of existing range and intensity data.
HokuyoData (uint32_t *ranges, uint32_t *intensities, unsigned int length,
bool error, unsigned int time);
/// This copy constructor performs a deep copy of present data.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rum...@us...> - 2009-08-14 06:51:47
|
Revision: 436
http://gearbox.svn.sourceforge.net/gearbox/?rev=436&view=rev
Author: rumataxyz
Date: 2009-08-14 06:51:37 +0000 (Fri, 14 Aug 2009)
Log Message:
-----------
Updated main docs; added Ian to contributers, the sub-guys to users and put info about the patch into history
Modified Paths:
--------------
gearbox/trunk/doc/contributors.dox
gearbox/trunk/doc/history.dox
gearbox/trunk/doc/users.dox
Modified: gearbox/trunk/doc/contributors.dox
===================================================================
--- gearbox/trunk/doc/contributors.dox 2009-08-14 06:46:34 UTC (rev 435)
+++ gearbox/trunk/doc/contributors.dox 2009-08-14 06:51:37 UTC (rev 436)
@@ -23,6 +23,7 @@
- <a href="http://www.cas.edu.au/content.php/232.html?personid=45">Tobias Kaupp</a>
- <a href="http://www.cas.edu.au/content.php/232.html?personid=69">Michael Moser</a>
- John Yamokoski
+- <a href="http://www.cas.edu.au/content.php/232.html?personid=65">Ian Mahon</a>
@par Past contributors
Modified: gearbox/trunk/doc/history.dox
===================================================================
--- gearbox/trunk/doc/history.dox 2009-08-14 06:46:34 UTC (rev 435)
+++ gearbox/trunk/doc/history.dox 2009-08-14 06:51:37 UTC (rev 436)
@@ -31,6 +31,10 @@
@par Updated libraries
+- libGbxNovatelAcfr:
+ - Bugfix: matched GPS status/solution enums to Novatel's internal types, there were gaps due to reserved values before.
+ Note: this will create mismatches with old log-files (not data, status/solution-type only)! (MichaelM, patch by Ian Mahon)
+
@section gbx_doc_history_907 Changes in Release 9.07
@par Updated libraries
Modified: gearbox/trunk/doc/users.dox
===================================================================
--- gearbox/trunk/doc/users.dox 2009-08-14 06:46:34 UTC (rev 435)
+++ gearbox/trunk/doc/users.dox 2009-08-14 06:51:37 UTC (rev 436)
@@ -22,4 +22,6 @@
@par Projects
+- <a href="http://www.cas.edu.au/content.php/397.html">CAS Marine Robotic Systems</a>
+
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rum...@us...> - 2009-08-14 06:46:46
|
Revision: 435
http://gearbox.svn.sourceforge.net/gearbox/?rev=435&view=rev
Author: rumataxyz
Date: 2009-08-14 06:46:34 +0000 (Fri, 14 Aug 2009)
Log Message:
-----------
Bugfix, applied Ian Mahon's patch (tracker: Novatel Driver Update - ID: 2828247): matches our gps statu/solution-type enums with novatels (adds a bunch of reservedValueXX);
adds toStrings()s for those enums.
Added history to docu, to reflect this (and older gear).
Modified Paths:
--------------
gearbox/trunk/src/gbxnovatelacfr/driver.cpp
gearbox/trunk/src/gbxnovatelacfr/driver.h
gearbox/trunk/src/gbxnovatelacfr/novatel.dox
Modified: gearbox/trunk/src/gbxnovatelacfr/driver.cpp
===================================================================
--- gearbox/trunk/src/gbxnovatelacfr/driver.cpp 2009-08-14 05:02:58 UTC (rev 434)
+++ gearbox/trunk/src/gbxnovatelacfr/driver.cpp 2009-08-14 06:46:34 UTC (rev 435)
@@ -89,7 +89,7 @@
// helper functions for the toString() gear
std::string statusToString(gna::StatusMessageType statusMessageType, std::string statusMessage);
- std::string doubleVectorToString(vector<double > &vec, std::string seperator = std::string(" "));
+ std::string doubleVectorToString(const vector<double > &vec, const std::string seperator = std::string(" "));
}
namespace gbxnovatelacfr
@@ -741,7 +741,7 @@
}
std::string
-Config::toString(){
+Config::toString() const{
std::stringstream ss;
ss << "serialDevice_: " << serialDevice_ << " ";
ss << "baudRate_: " << baudRate_ << " ";
@@ -787,7 +787,7 @@
}
std::string
-SimpleConfig::toString(){
+SimpleConfig::toString() const{
std::stringstream ss;
ss << "serialDevice_: " << serialDevice_ << " ";
ss << "baudRate_: " << baudRate_ << " ";
@@ -808,7 +808,7 @@
}
std::string
-GpsOnlyConfig::toString(){
+GpsOnlyConfig::toString() const{
std::stringstream ss;
ss << "serialDevice_: " << serialDevice_ << " ";
ss << "baudRate_: " << baudRate_;
@@ -816,7 +816,7 @@
}
std::string
-InsPvaData::toString(){
+InsPvaData::toString() const{
std::stringstream ss;
ss << "InsPvaData ";
ss << "timeStampSec " << timeStampSec << " ";
@@ -837,7 +837,7 @@
};
std::string
-BestGpsPosData::toString(){
+BestGpsPosData::toString() const{
std::stringstream ss;
ss << "BestGpsPosData ";
ss << "timeStampSec " << timeStampSec << " ";
@@ -871,7 +871,7 @@
};
std::string
-BestGpsVelData::toString(){
+BestGpsVelData::toString() const{
std::stringstream ss;
ss << "BestGpsVelData ";
ss << "timeStampSec " << timeStampSec << " ";
@@ -890,7 +890,7 @@
};
std::string
-RawImuData::toString(){
+RawImuData::toString() const{
std::stringstream ss;
ss << "RawImuData ";
ss << "timeStampSec " << timeStampSec << " ";
@@ -907,6 +907,100 @@
return ss.str();
};
+std::string
+toString( StatusMessageType type ){
+ switch( type )
+ {
+ case NoMsg : return "None";
+ case Initialising: return "Initialising";
+ case Ok : return "Ok";
+ case Warning : return "Warning";
+ case Fault : return "Fault";
+ default: return "Unknown";
+ }
+}
+
+std::string
+toString( GpsSolutionStatusType type ){
+ switch( type ){
+ case SolComputed : return "SolComputed";
+ case InsufficientObs : return "InsufficientObs";
+ case NoConvergence : return "NoConvergence";
+ case Singularity : return "Singularity";
+ case CovTrace : return "CovTrace";
+ case TestDist : return "TestDist";
+ case ColdStart : return "ColdStart";
+ case VHLimit : return "VHLimit";
+ case Variance : return "Variance";
+ case Residuals : return "Residuals";
+ case DeltaPos : return "DeltaPos";
+ case NegativeVar : return "NegativeVar";
+ case ReservedGpsSolutionStatusType12: return "Reserved";
+ case IntegrityWarning : return "IntegrityWarning";
+ case InsInactive : return "InsInactive";
+ case InsAligning : return "InsAligning";
+ case InsBad : return "InsBad";
+ case ImuUnplugged : return "ImuUnplugged";
+ case Pending : return "Pending";
+ case InvalidFix : return "InvalidFix";
+ default: return "Unknown";
+ }
+}
+
+std::string
+toString( GpsPosVelType type ){
+ switch( type ){
+ case None : return "None";
+ case FixedPos : return "FixedPos";
+ case FixedHeight : return "FixedHeight";
+ case ReservedGpsPosVelType3 : return "Reserved";
+ case FloatConv : return "FloatConv";
+ case WideLane : return "WideLane";
+ case NarrowLane : return "NarrowLane";
+ case ReservedGpsPosVelType7 : return "Reserved";
+ case DopplerVelocity : return "DopplerVelocity";
+ case ReservedGpsPosVelType9 : return "Reserved";
+ case ReservedGpsPosVelType10: return "Reserved";
+ case ReservedGpsPosVelType11: return "Reserved";
+ case ReservedGpsPosVelType12: return "Reserved";
+ case ReservedGpsPosVelType13: return "Reserved";
+ case ReservedGpsPosVelType14: return "Reserved";
+ case ReservedGpsPosVelType15: return "Reserved";
+ case Single : return "Single";
+ case PsrDiff : return "PsrDiff";
+ case Waas : return "Waas";
+ case Propagated : return "Propagated";
+ case Omnistar : return "Omnistar";
+ case ReservedGpsPosVelType21: return "Reserved";
+ case ReservedGpsPosVelType22: return "Reserved";
+ case ReservedGpsPosVelType23: return "Reserved";
+ case ReservedGpsPosVelType24: return "Reserved";
+ case ReservedGpsPosVelType25: return "Reserved";
+ case ReservedGpsPosVelType26: return "Reserved";
+ case ReservedGpsPosVelType27: return "Reserved";
+ case ReservedGpsPosVelType28: return "Reserved";
+ case ReservedGpsPosVelType29: return "Reserved";
+ case ReservedGpsPosVelType30: return "Reserved";
+ case ReservedGpsPosVelType31: return "Reserved";
+ case L1Float : return "L1Float";
+ case IonoFreeFloat : return "IonoFreeFloat";
+ case NarrowFloat : return "NarrowFloat";
+ case L1Int : return "L1Int";
+ case WideInt : return "WideInt";
+ case NarrowInt : return "NarrowInt";
+ case RtkDirectIns : return "RtkDirectIns";
+ case Ins : return "Ins";
+ case InsPsrSp : return "InsPsrSp";
+ case InsPsrDiff : return "InsPsrDiff";
+ case InsRtkFloat : return "InsRtkFloat";
+ case InsRtkFixed : return "InsRtkFixed";
+ case OmniStarHp : return "OmniStarHp";
+ case OmniStarXp : return "OmniStarXp";
+ case CdGps : return "CdGps";
+ default: return "Unknown";
+ }
+}
+
} //namespace
namespace{
@@ -1285,77 +1379,23 @@
}
enum gna::GpsSolutionStatusType externalGpsSolutionStatus(uint32_t novatelGpsSolutionStatus){
- enum gna::GpsSolutionStatusType external;
- switch(novatelGpsSolutionStatus){
- case 0: external = gna::SolComputed; break;
- case 1: external = gna::InsufficientObs; break;
- case 2: external = gna::NoConvergence; break;
- case 3: external = gna::Singularity; break;
- case 4: external = gna::CovTrace; break;
- case 5: external = gna::TestDist; break;
- case 6: external = gna::ColdStart; break;
- case 7: external = gna::VHLimit; break;
- case 8: external = gna::Variance; break;
- case 9: external = gna::Residuals; break;
- case 10: external = gna::DeltaPos; break;
- case 11: external = gna::NegativeVar; break;
- case 13: external = gna::IntegrityWarning; break;
- case 14: external = gna::InsInactive; break;
- case 15: external = gna::InsAligning; break;
- case 16: external = gna::InsBad; break;
- case 17: external = gna::ImuUnplugged; break;
- case 18: external = gna::Pending; break;
- case 19: external = gna::InvalidFix; break;
-
- case 12: external = gna::ReservedGpsSolutionStatusType; break;
- default: external = gna::UnknownGpsSolutionStatusType; break;
- }
- return external;
+ if( novatelGpsSolutionStatus>=0 && novatelGpsSolutionStatus<=19 )
+ return static_cast<gna::GpsSolutionStatusType>(novatelGpsSolutionStatus);
+ else
+ return gna::UnknownGpsSolutionStatusType;
}
enum gna::GpsPosVelType externalGpsPosVelType(uint32_t novatelGpsPosVelType){
- enum gna::GpsPosVelType external;
- switch(novatelGpsPosVelType){
- case 0: external = gna::None; break;
- case 1: external = gna::FixedPos; break;
- case 2: external = gna::FixedHeight; break;
- case 4: external = gna::FloatConv; break;
- case 5: external = gna::WideLane; break;
- case 6: external = gna::NarrowLane; break;
- case 8: external = gna::DopplerVelocity; break;
- case 16: external = gna::Single; break;
- case 17: external = gna::PsrDiff; break;
- case 18: external = gna::Waas; break;
- case 19: external = gna::Propagated; break;
- case 20: external = gna::Omnistar; break;
- case 32: external = gna::L1Float; break;
- case 33: external = gna::IonoFreeFloat; break;
- case 34: external = gna::NarrowFloat; break;
- case 48: external = gna::L1Int; break;
- case 49: external = gna::WideInt; break;
- case 50: external = gna::NarrowInt; break;
- case 51: external = gna::RtkDirectIns; break;
- case 52: external = gna::Ins; break;
- case 53: external = gna::InsPsrSp; break;
- case 54: external = gna::InsPsrDiff; break;
- case 55: external = gna::InsRtkFloat; break;
- case 56: external = gna::InsRtkFixed; break;
- case 64: external = gna::OmniStarHp; break;
- case 65: external = gna::OmniStarXp; break;
- case 66: external = gna::CdGps; break;
-
- case 3: //fallthrough
- case 7: //fallthrough
- case 9: case 10: case 11: case 12: case 13: case 14: case 15: //fallthrough
- case 21: case 22: case 23: case 24: case 25: case 26: case 27: case 28: case 29: case 30: case 31: //fallthrough
- // these guys are _not_ named as reserved in the manual case 34: case 35: case 36: case 37: case 38: case 38: case 39: case 40: case 41: case 42: case 43: case 44: case 45: case 46: case 47:
- external = gna::ReservedGpsPosVelType; break;
- default: external = gna::UnknownGpsPosVelType; break;
- }
- return external;
+ // There are unused values between (and including) 35 to 47 and 57 to 63
+ if( (novatelGpsPosVelType>=0 && novatelGpsPosVelType<=34 ) ||
+ (novatelGpsPosVelType>=48 && novatelGpsPosVelType<=56 ) ||
+ (novatelGpsPosVelType>=64 && novatelGpsPosVelType<=66 ) )
+ return static_cast<gna::GpsPosVelType>(novatelGpsPosVelType);
+ else
+ return gna::UnknownGpsPosVelType;
}
- std::string doubleVectorToString(vector<double > &vec, std::string seperator){
+ std::string doubleVectorToString(const vector<double > &vec, const std::string seperator){
std::stringstream ss;
int max = vec.size();
ss << "[";
Modified: gearbox/trunk/src/gbxnovatelacfr/driver.h
===================================================================
--- gearbox/trunk/src/gbxnovatelacfr/driver.h 2009-08-14 05:02:58 UTC (rev 434)
+++ gearbox/trunk/src/gbxnovatelacfr/driver.h 2009-08-14 06:46:34 UTC (rev 435)
@@ -52,7 +52,7 @@
//! - offset has size 3
bool isValid() const;
//! Dumps the config in human readable form
- std::string toString();
+ std::string toString() const;
std::string serialDevice_;
int baudRate_;
@@ -73,7 +73,7 @@
//! - a non-empty device name
//! - baud rate is supported by device (9600, 19200, 38400, 115200, 230400)
bool isValid() const;
- std::string toString();
+ std::string toString() const;
std::string serialDevice_;
int baudRate_;
@@ -108,7 +108,7 @@
//! - not const, since it has limited self-fixing capabilities (for incorrect message-rates)
bool isValid();
//! Dumps the config in human readable form
- std::string toString();
+ std::string toString() const;
//!@name Serial settings
//
@@ -196,68 +196,96 @@
Fault //!< Problem, probably fatal
};
+//! Convert a StatusMessageType into a string
+std::string toString( StatusMessageType type );
+
+
//! Novatel's different solution status types.
//
//! Explanations from the manual.
enum GpsSolutionStatusType{
- SolComputed, //!< Solution computed
- InsufficientObs, //!< Insufficient observations
- NoConvergence, //!< No convergence
- Singularity, //!< Singularity at parameters matrix
- CovTrace, //!< Covariance trace exceeds maximum (trace > 1000 m)
- TestDist, //!< Test distance exceeded (maximum of 3 rejections if distance > 10 km)
- ColdStart, //!< Not yet converged from cold start
- VHLimit, //!< Height or velocity limits exceeded (in accordance with COCOM export licensing restrictions)
- Variance, //!< Variance exceeds limits
- Residuals, //!< Residuals are too large
- DeltaPos, //!< Delta position is too large
- NegativeVar, //!< Negative variance
- IntegrityWarning, //!< Large residuals make position unreliable
- InsInactive, //!< INS has not started yet
- InsAligning, //!< INS doing its coarse alignment
- InsBad, //!< INS position is bad
- ImuUnplugged, //!< No IMU detected
- Pending, //!< When a FIX POSITION command is entered, the receiver computes its own position and determines if the fixed position is valid
- InvalidFix, //!< The fixed position, entered using the FIX POSITION command, is not valid
- ReservedGpsSolutionStatusType,
+ SolComputed=0, //!< Solution computed
+ InsufficientObs=1, //!< Insufficient observations
+ NoConvergence=2, //!< No convergence
+ Singularity=3, //!< Singularity at parameters matrix
+ CovTrace=4, //!< Covariance trace exceeds maximum (trace > 1000 m)
+ TestDist=5, //!< Test distance exceeded (maximum of 3 rejections if distance > 10 km)
+ ColdStart=6, //!< Not yet converged from cold start
+ VHLimit=7, //!< Height or velocity limits exceeded (in accordance with COCOM export licensing restrictions)
+ Variance=8, //!< Variance exceeds limits
+ Residuals=9, //!< Residuals are too large
+ DeltaPos=10, //!< Delta position is too large
+ NegativeVar=11, //!< Negative variance
+ ReservedGpsSolutionStatusType12=12, //!< Value Reserved for future use
+ IntegrityWarning=13, //!< Large residuals make position unreliable
+ InsInactive=14, //!< INS has not started yet
+ InsAligning=15, //!< INS doing its coarse alignment
+ InsBad=16, //!< INS position is bad
+ ImuUnplugged=17, //!< No IMU detected
+ Pending=18, //!< When a FIX POSITION command is entered, the receiver computes its own position and determines if the fixed position is valid
+ InvalidFix=19, //!< The fixed position, entered using the FIX POSITION command, is not valid
UnknownGpsSolutionStatusType
};
+//! Convert a GpsSolutionStatusType into a string
+std::string toString( GpsSolutionStatusType type );
+
//! Novatel's different fix types.
//
//! Sadly mixed for position/velocity with some INS gear thrown in; explanations from the manual.
enum GpsPosVelType{
- None, //!< No solution
- FixedPos, //!< Position has been fixed by the FIX POSITION command or by position averaging
- FixedHeight, //!< Position has been fixed by the FIX HEIGHT, or FIX AUTO, command or by position averaging
- FloatConv, //!< Solution from floating point carrier phase ambiguities
- WideLane, //!< Solution from wide-lane ambiguities
- NarrowLane, //!< Solution from narrow-lane ambiguities
- DopplerVelocity, //!< Velocity computed using instantaneous Doppler
- Single, //!< Single point position
- PsrDiff, //!< Pseudorange differential solution
- Waas, //!< Solution calculated using corrections from an SBAS
- Propagated, //!< Propagated by a Kalman filter without new observations
- Omnistar, //!< OmniSTAR VBS position (L1 sub-meter) a
- L1Float, //!< Floating L1 ambiguity solution
- IonoFreeFloat, //!< Floating ionospheric-free ambiguity solution
- NarrowFloat, //!< Floating narrow-lane ambiguity solution
- L1Int, //!< Integer L1 ambiguity solution
- WideInt, //!< Integer wide-lane ambiguity solution
- NarrowInt, //!< Integer narrow-lane ambiguity solution
- RtkDirectIns, //!< RTK status where the RTK filter is directly initialized from the INS filter. b
- Ins, //!< INS calculated position corrected for the antenna b
- InsPsrSp, //!< INS pseudorange single point solution - no DGPS corrections b
- InsPsrDiff, //!< INS pseudorange differential solution b
- InsRtkFloat, //!< INS RTK floating point ambiguities solution b
- InsRtkFixed, //!< INS RTK fixed ambiguities solution b
- OmniStarHp, //!< OmniSTAR high precision a
- OmniStarXp, //!< OmniSTAR extra precision a
- CdGps, //!< Position solution using CDGPS corrections
- ReservedGpsPosVelType,
+ None=0, //!< No solution
+ FixedPos=1, //!< Position has been fixed by the FIX POSITION command or by position averaging
+ FixedHeight=2, //!< Position has been fixed by the FIX HEIGHT, or FIX AUTO, command or by position averaging
+ ReservedGpsPosVelType3=3, //!< Value Reserved for future use
+ FloatConv=4, //!< Solution from floating point carrier phase ambiguities
+ WideLane=5, //!< Solution from wide-lane ambiguities
+ NarrowLane=6, //!< Solution from narrow-lane ambiguities
+ ReservedGpsPosVelType7=7, //!< Value Reserved for future use
+ DopplerVelocity=8, //!< Velocity computed using instantaneous Doppler
+ ReservedGpsPosVelType9=9, //!< Value Reserved for future use
+ ReservedGpsPosVelType10=10, //!< Value Reserved for future use
+ ReservedGpsPosVelType11=11, //!< Value Reserved for future use
+ ReservedGpsPosVelType12=12, //!< Value Reserved for future use
+ ReservedGpsPosVelType13=13, //!< Value Reserved for future use
+ ReservedGpsPosVelType14=14, //!< Value Reserved for future use
+ ReservedGpsPosVelType15=15, //!< Value Reserved for future use
+ Single=16, //!< Single point position
+ PsrDiff=17, //!< Pseudorange differential solution
+ Waas=18, //!< Solution calculated using corrections from an SBAS
+ Propagated=19, //!< Propagated by a Kalman filter without new observations
+ Omnistar=20, //!< OmniSTAR VBS position (L1 sub-meter) a
+ ReservedGpsPosVelType21=21, //!< Value Reserved for future use
+ ReservedGpsPosVelType22=22, //!< Value Reserved for future use
+ ReservedGpsPosVelType23=23, //!< Value Reserved for future use
+ ReservedGpsPosVelType24=24, //!< Value Reserved for future use
+ ReservedGpsPosVelType25=25, //!< Value Reserved for future use
+ ReservedGpsPosVelType26=26, //!< Value Reserved for future use
+ ReservedGpsPosVelType27=27, //!< Value Reserved for future use
+ ReservedGpsPosVelType28=28, //!< Value Reserved for future use
+ ReservedGpsPosVelType29=29, //!< Value Reserved for future use
+ ReservedGpsPosVelType30=30, //!< Value Reserved for future use
+ ReservedGpsPosVelType31=31, //!< Value Reserved for future use
+ L1Float=32, //!< Floating L1 ambiguity solution
+ IonoFreeFloat=33, //!< Floating ionospheric-free ambiguity solution
+ NarrowFloat=34, //!< Floating narrow-lane ambiguity solution
+ L1Int=48, //!< Integer L1 ambiguity solution
+ WideInt=49, //!< Integer wide-lane ambiguity solution
+ NarrowInt=50, //!< Integer narrow-lane ambiguity solution
+ RtkDirectIns=51, //!< RTK status where the RTK filter is directly initialized from the INS filter. b
+ Ins=52, //!< INS calculated position corrected for the antenna b
+ InsPsrSp=53, //!< INS pseudorange single point solution - no DGPS corrections b
+ InsPsrDiff=54, //!< INS pseudorange differential solution b
+ InsRtkFloat=55, //!< INS RTK floating point ambiguities solution b
+ InsRtkFixed=56, //!< INS RTK fixed ambiguities solution b
+ OmniStarHp=64, //!< OmniSTAR high precision a
+ OmniStarXp=65, //!< OmniSTAR extra precision a
+ CdGps=66, //!< Position solution using CDGPS corrections
UnknownGpsPosVelType
};
+//! Convert a GpsPosVelType into a string
+std::string toString( GpsPosVelType type );
//! possible types GenericData can contain
enum DataType {
@@ -276,7 +304,7 @@
public:
virtual ~GenericData(){};
virtual DataType type() const=0;
- virtual std::string toString()=0;
+ virtual std::string toString() const=0;
private:
};
@@ -286,7 +314,7 @@
DataType type() const {
return InsPva;
}
- std::string toString();
+ std::string toString() const;
int gpsWeekNr; //!< number of full weeks since midnight 05/Jan/1980 (UTC)
double secIntoWeek; //!< yields GPS-time (together with @ref gpsWeekNr); continous (contrary to UTC which uses leapseconds)
double latitude; //!< [deg] north positive WGS84
@@ -326,7 +354,7 @@
DataType type() const {
return BestGpsPos;
}
- std::string toString();
+ std::string toString() const;
int gpsWeekNr; //!< number of full weeks since midnight 05/Jan/1980 (UTC)
unsigned int msIntoWeek; //!< yields GPS-time (together with @ref gpsWeekNr); continous (contrary to UTC which uses leapseconds)
GpsSolutionStatusType solutionStatus; //
@@ -360,7 +388,7 @@
DataType type() const {
return BestGpsVel;
}
- std::string toString();
+ std::string toString() const;
int gpsWeekNr; //!< number of full weeks since midnight 05/Jan/1980 (UTC)
unsigned int msIntoWeek; //!< yields GPS-time (together with @ref gpsWeekNr); continous (contrary to UTC which uses leapseconds)
GpsSolutionStatusType solutionStatus; //
@@ -384,7 +412,7 @@
DataType type() const {
return RawImu;
}
- std::string toString();
+ std::string toString() const;
int gpsWeekNr; //!< number of full weeks since midnight 05/Jan/1980 (UTC)
double secIntoWeek; //!< yields GPS-time (together with @ref gpsWeekNr); continous (contrary to UTC which uses leapseconds)
//!@name Change in speed
Modified: gearbox/trunk/src/gbxnovatelacfr/novatel.dox
===================================================================
--- gearbox/trunk/src/gbxnovatelacfr/novatel.dox 2009-08-14 05:02:58 UTC (rev 434)
+++ gearbox/trunk/src/gbxnovatelacfr/novatel.dox 2009-08-14 06:46:34 UTC (rev 435)
@@ -19,7 +19,7 @@
NovatelSPAN is a proprietary Novatel navigation system.
It minimally consists out of a Novatel OEMV GPS receiver (OEM4 receivers should be compatible).
If combined with an IMU, a SPAN system can provide an INS navigation solution at high rate (up to 100Hz).
-The driver initialises the hardware and reports navigation data continuously.
+The driver initializes the hardware and reports navigation data continuously.
for a full list of functions see @ref gbxnovatelacfr
@@ -176,6 +176,17 @@
use the receiver's 'freset' command to bring it back to factory-defaults. The driver itself does not do this,
on the grounds that it also might delete settings that were made persistent with good reason and purpose.
If you are sharing equipment, check with everybody involved, before you use this approach.
+
+@par History
+
+- August 2009: Bugfix (patch by Ian Mahon), driver's GPS status/solution-type enums matched to Novatel's.
+Note: This will create mismatches with old log-files (not data, status/solution-type only)!
+- January 2009: Accepted into distribution after second hardware review.
+- January 2009: Second hardware review, @ref gbxnovatelacfr_hw_reviews_alen
+- August 2008: First hardware review, @ref gbxnovatelacfr_hw_reviews_michael
+- July/August 2008: Code reviews by AlexB and GeoffB (see developer mailing-list archives)
+- June 2008: Started moving functionality from Orca/Hydro's insgps component to gearbox.
+
*/
/*!
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bo...@us...> - 2009-08-14 05:03:08
|
Revision: 434
http://gearbox.svn.sourceforge.net/gearbox/?rev=434&view=rev
Author: borax00
Date: 2009-08-14 05:02:58 +0000 (Fri, 14 Aug 2009)
Log Message:
-----------
MR Changes
Modified Paths:
--------------
gearbox/trunk/doc/history.dox
Modified: gearbox/trunk/doc/history.dox
===================================================================
--- gearbox/trunk/doc/history.dox 2009-07-11 07:06:06 UTC (rev 433)
+++ gearbox/trunk/doc/history.dox 2009-08-14 05:02:58 UTC (rev 434)
@@ -45,7 +45,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)
+ - Implemented store::peek() (Alexb)
- libGbxUtilAcfr:
- Status class: removed SubsystemStalled from the list of health types for a subsystem. The stall condition
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2009-07-11 07:06:12
|
Revision: 433
http://gearbox.svn.sourceforge.net/gearbox/?rev=433&view=rev
Author: russo2503v
Date: 2009-07-11 07:06:06 +0000 (Sat, 11 Jul 2009)
Log Message:
-----------
had to make a small change in the path
Modified Paths:
--------------
gearbox/trunk/doc/rebuild_docco.sh
Modified: gearbox/trunk/doc/rebuild_docco.sh
===================================================================
--- gearbox/trunk/doc/rebuild_docco.sh 2009-07-10 02:10:13 UTC (rev 432)
+++ gearbox/trunk/doc/rebuild_docco.sh 2009-07-11 07:06:06 UTC (rev 433)
@@ -26,7 +26,9 @@
SFSCPHOST=web.sf.net
SFSHELLHOST=shell.sf.net
SFPROJECT=gearbox
-SFDIR=/home/groups/g/ge/gearbox/htdocs/gearbox
+# alexm: not sure why this just changed
+# SFDIR=/home/groups/g/ge/gearbox/htdocs/gearbox
+SFDIR=/home/groups/g/ge/gearbox/htdocs
force ls
force $DOXYGENCMD $DOXYFILE
@@ -40,7 +42,9 @@
force scp $TARBALL $SFUSER@$SFSCPHOST:
# don't know how to combine this login with commands, do it manually
+echo ""
echo "when connected execute this:"
echo "cd $SFDIR; mv ~/$TARBALL .; tar -zxvf $TARBALL"
echo "to quit, type 'shutdown'"
+echo ""
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.
|