You can subscribe to this list here.
| 2008 |
Jan
|
Feb
(58) |
Mar
(15) |
Apr
(23) |
May
(8) |
Jun
(92) |
Jul
(66) |
Aug
(6) |
Sep
(9) |
Oct
(44) |
Nov
(8) |
Dec
(1) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
(10) |
Feb
(8) |
Mar
(2) |
Apr
(8) |
May
(19) |
Jun
(11) |
Jul
(8) |
Aug
(6) |
Sep
(5) |
Oct
(4) |
Nov
(26) |
Dec
(4) |
| 2010 |
Jan
(5) |
Feb
(3) |
Mar
(4) |
Apr
(3) |
May
(4) |
Jun
|
Jul
(1) |
Aug
(16) |
Sep
(7) |
Oct
(3) |
Nov
(7) |
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <rus...@us...> - 2008-10-29 12:25:22
|
Revision: 357
http://gearbox.svn.sourceforge.net/gearbox/?rev=357&view=rev
Author: russo2503v
Date: 2008-10-29 12:25:17 +0000 (Wed, 29 Oct 2008)
Log Message:
-----------
docco only
Modified Paths:
--------------
gearbox/trunk/src/gbxutilacfr/status.h
Modified: gearbox/trunk/src/gbxutilacfr/status.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/status.h 2008-10-29 07:05:58 UTC (rev 356)
+++ gearbox/trunk/src/gbxutilacfr/status.h 2008-10-29 12:25:17 UTC (rev 357)
@@ -84,7 +84,7 @@
@par Overview
Status provides a machine-readable interface such that tools external
-to the library can monitor its status. A single Status object is meant
+to the component can monitor its status. A single Status object is meant
to be shared by all threads in the library, so the implementation must
be thread-safe. The idea is that Status tracks the state of a number
of subsystems (most often one per thread).
@@ -93,24 +93,69 @@
Status engine aware that it exists. If any other function is called before
the subsystem is added, a gbxutilacfr::Exception is thrown.
-The 'maxHeartbeatIntervalSec' parameter tells the Status engine how often it expects to hear
-from each subsystem. If the subsystem has not been heard from for
-longer than maxHeartbeatIntervalSec, it is assumed that the
-subsystem has stalled (hung).
+The default initial status of a subsystem is @c Idle with health @c OK.
-The initial default state is Initialising. As soon as initialisation
-of the subsystem is finished, you should call ok(). This maybe used by
-external tools as an indication that your subsystem is in "normal"
-working state.
-
-@par Local Calls
-
-After registering with setMaxHeartbeatInterval, set the subsystems'
-status with the various calls. Each of the calls is sufficient to let
+After registering a subsystem, a subsystem can report its state and health.
+Each of the calls is sufficient to let
the Status engine know that the subsystem is alive. The special call
'heartbeat' lets Status know that the subsystem is alive without
modifying its status.
+The 'maxHeartbeatIntervalSec' parameter tells the Status engine how often it
+should expect to hear from the subsystem. If no message is received from a subsystem for
+longer than @c maxHeartbeatIntervalSec, it is assumed that the subsystem has stalled (hung).
+
+@par State Machine
+
+The state machine of a subsystem is a chain of state transitions with one extra link:
+@verbatim
+Idle --> Initialising --> Working --> Finalising --> Shutdown
+ |___________________________^
+@endverbatim
+The following represents the Subsystem state machine in the format of
+State Machine Compiler (see smc.sf.net) :
+@verbatim
+Idle
+Entry { init(); }
+{
+ init
+ Initialising
+ {}
+}
+
+Initialising
+Entry { initialise(); }
+{
+ [ !isStopping ] finished
+ Working
+ {}
+
+ [ isStopping ] finished
+ Finalising
+ {}
+}
+
+Working
+Entry { work(); }
+{
+ finished
+ Finalising
+ {}
+}
+
+Finalising
+Entry { finalise(); }
+{
+ finished
+ Shutdown
+ {}
+}
+
+Shutdown
+{
+}
+@endverbatim
+
@sa Tracer
@sa SubStatus
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bo...@us...> - 2008-10-29 07:55:20
|
Revision: 355
http://gearbox.svn.sourceforge.net/gearbox/?rev=355&view=rev
Author: borax00
Date: 2008-10-29 07:00:58 +0000 (Wed, 29 Oct 2008)
Log Message:
-----------
allowed heartbeat interval in constructor
Modified Paths:
--------------
gearbox/trunk/src/gbxutilacfr/substatus.h
Modified: gearbox/trunk/src/gbxutilacfr/substatus.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/substatus.h 2008-10-29 07:00:45 UTC (rev 354)
+++ gearbox/trunk/src/gbxutilacfr/substatus.h 2008-10-29 07:00:58 UTC (rev 355)
@@ -29,12 +29,12 @@
public:
//! Sets a reference to the system Status and this subsystem's name.
- //! Adds this subsystem to the system with default (infinite) maximum heartbeat interval.
- SubStatus( Status& status, const std::string& subsystem ) :
+ //! Adds this subsystem to the system.
+ SubStatus( Status& status, const std::string& subsystem, double maxHeartbeatIntervalSec=-1.0 ) :
status_(status),
subsysName_(subsystem)
{
- status_.addSubsystem( subsysName_ );
+ status_.addSubsystem( subsysName_, maxHeartbeatIntervalSec );
};
//! Removes this subsystem from the system.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-10-29 07:06:06
|
Revision: 356
http://gearbox.svn.sourceforge.net/gearbox/?rev=356&view=rev
Author: russo2503v
Date: 2008-10-29 07:05:58 +0000 (Wed, 29 Oct 2008)
Log Message:
-----------
removed extra line break
Modified Paths:
--------------
gearbox/trunk/src/gbxutilacfr/exceptions.cpp
Modified: gearbox/trunk/src/gbxutilacfr/exceptions.cpp
===================================================================
--- gearbox/trunk/src/gbxutilacfr/exceptions.cpp 2008-10-29 07:00:58 UTC (rev 355)
+++ gearbox/trunk/src/gbxutilacfr/exceptions.cpp 2008-10-29 07:05:58 UTC (rev 356)
@@ -49,7 +49,7 @@
message_ += this->basename(file);
message_ += ":";
message_ += line;
- message_ += "): " + msgString + "\n";
+ message_ += "): " + msgString;
}
} // namespace
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bo...@us...> - 2008-10-29 07:00:58
|
Revision: 354
http://gearbox.svn.sourceforge.net/gearbox/?rev=354&view=rev
Author: borax00
Date: 2008-10-29 07:00:45 +0000 (Wed, 29 Oct 2008)
Log Message:
-----------
comment only
Modified Paths:
--------------
gearbox/trunk/src/gbxutilacfr/status.h
Modified: gearbox/trunk/src/gbxutilacfr/status.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/status.h 2008-10-29 07:00:16 UTC (rev 353)
+++ gearbox/trunk/src/gbxutilacfr/status.h 2008-10-29 07:00:45 UTC (rev 354)
@@ -112,6 +112,7 @@
modifying its status.
@sa Tracer
+@sa SubStatus
*/
class Status
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bo...@us...> - 2008-10-29 07:00:29
|
Revision: 353
http://gearbox.svn.sourceforge.net/gearbox/?rev=353&view=rev
Author: borax00
Date: 2008-10-29 07:00:16 +0000 (Wed, 29 Oct 2008)
Log Message:
-----------
formatting.
Modified Paths:
--------------
gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp
Modified: gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp 2008-10-28 13:21:22 UTC (rev 352)
+++ gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp 2008-10-29 07:00:16 UTC (rev 353)
@@ -223,6 +223,7 @@
tracer_.warning( ss.str() );
throw;
}
+
removeParsedData( buffer_, numBytesParsed );
if ( gotMessage )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-10-28 13:24:39
|
Revision: 351
http://gearbox.svn.sourceforge.net/gearbox/?rev=351&view=rev
Author: russo2503v
Date: 2008-10-28 13:20:00 +0000 (Tue, 28 Oct 2008)
Log Message:
-----------
docs
Modified Paths:
--------------
gearbox/trunk/src/gbxutilacfr/status.h
Modified: gearbox/trunk/src/gbxutilacfr/status.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/status.h 2008-10-28 09:32:51 UTC (rev 350)
+++ gearbox/trunk/src/gbxutilacfr/status.h 2008-10-28 13:20:00 UTC (rev 351)
@@ -148,6 +148,7 @@
//! Modifies maximum expected interval between heartbeats (in seconds).
//! When time since last heartbeat exceeds this, alarm is raised.
+ //! Negative interval means infinite interval.
//! Throws gbxutilacfr::Exception if the subsystem does not exist.
virtual void setMaxHeartbeatInterval( const std::string& subsystem, double intervalSec )=0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-10-28 13:24:38
|
Revision: 352
http://gearbox.svn.sourceforge.net/gearbox/?rev=352&view=rev
Author: russo2503v
Date: 2008-10-28 13:21:22 +0000 (Tue, 28 Oct 2008)
Log Message:
-----------
calls itself working when start running own thread.
Modified Paths:
--------------
gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp
Modified: gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp 2008-10-28 13:20:00 UTC (rev 351)
+++ gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp 2008-10-28 13:21:22 UTC (rev 352)
@@ -55,7 +55,6 @@
tracer_(tracer),
subStatus_( status, subsysName )
{
- subStatus_.setMaxHeartbeatInterval( 60 );
}
SerialDeviceHandler::~SerialDeviceHandler()
@@ -64,7 +63,7 @@
// The component may outlive this subsystem.
// So tell status that it might not hear from us for a while.
//
- subStatus_.setMaxHeartbeatInterval( 1e9 );
+ subStatus_.setMaxHeartbeatInterval( -1 );
}
void
@@ -88,6 +87,7 @@
void
SerialDeviceHandler::walk()
{
+ subStatus_.working();
double maxIntervalSec = serial_.timeout().sec + 1e6*serial_.timeout().usec;
subStatus_.setMaxHeartbeatInterval( maxIntervalSec * 5.0 );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-10-28 09:37:15
|
Revision: 350
http://gearbox.svn.sourceforge.net/gearbox/?rev=350&view=rev
Author: russo2503v
Date: 2008-10-28 09:32:51 +0000 (Tue, 28 Oct 2008)
Log Message:
-----------
added constructor, another toString(), and docco
Modified Paths:
--------------
gearbox/trunk/src/gbxutilacfr/status.cpp
gearbox/trunk/src/gbxutilacfr/status.h
Modified: gearbox/trunk/src/gbxutilacfr/status.cpp
===================================================================
--- gearbox/trunk/src/gbxutilacfr/status.cpp 2008-10-28 00:09:36 UTC (rev 349)
+++ gearbox/trunk/src/gbxutilacfr/status.cpp 2008-10-28 09:32:51 UTC (rev 350)
@@ -9,6 +9,7 @@
*/
#include "status.h"
+#include <sstream>
namespace gbxutilacfr {
@@ -46,4 +47,12 @@
return "Stalled";
}
+std::string toString( const SubsystemStatus& status )
+{
+ std::stringstream ss;
+ ss << "state="<<toString(status.state)<<" health="<<toString(status.health)
+ << " msg='"<<status.message<<"' since hearbeat="<<status.sinceHeartbeat;
+ return ss.str();
+}
+
} // namespace
Modified: gearbox/trunk/src/gbxutilacfr/status.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/status.h 2008-10-28 00:09:36 UTC (rev 349)
+++ gearbox/trunk/src/gbxutilacfr/status.h 2008-10-28 09:32:51 UTC (rev 350)
@@ -53,6 +53,13 @@
//! Status for a single subsystem
struct SubsystemStatus
{
+ //! Constructor.
+ SubsystemStatus( SubsystemState s=SubsystemIdle, SubsystemHealth h=SubsystemOk, const std::string& msg="", double beat=0.0 ) :
+ state(s),
+ health(h),
+ message(msg),
+ sinceHeartbeat(beat) {};
+
//! Current state in the subsystem's state machine. I.e. what is the subsystem doing?
SubsystemState state;
@@ -65,9 +72,12 @@
//! Ratio of time since last heartbeat to maximum expected time between heartbeats.
//! For example, sinceHeartbeat=0.5 means that half of normally expected interval between heartbeats
//! has elapsed.
- float sinceHeartbeat;
+ double sinceHeartbeat;
};
+//! Returns human-readable string with subsystem status information.
+std::string toString( const SubsystemStatus& status );
+
/*!
@brief Local interface to component status.
@@ -156,7 +166,11 @@
//! Sets state of the subsystem to Initialising. Note that empty message is assumed if none is supplied.
//! Throws gbxutilacfr::Exception if the subsystem does not exist.
virtual void initialising( const std::string& subsystem, const std::string& message="" )=0;
+ //! Sets state of the subsystem to Working. Note that empty message is assumed if none is supplied.
+ //! Throws gbxutilacfr::Exception if the subsystem does not exist.
virtual void working( const std::string& subsystem, const std::string& message="" )=0;
+ //! Sets state of the subsystem to Finalising. Note that empty message is assumed if none is supplied.
+ //! Throws gbxutilacfr::Exception if the subsystem does not exist.
virtual void finalising( const std::string& subsystem, const std::string& message="" )=0;
//
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bo...@us...> - 2008-10-28 00:09:46
|
Revision: 349
http://gearbox.svn.sourceforge.net/gearbox/?rev=349&view=rev
Author: borax00
Date: 2008-10-28 00:09:36 +0000 (Tue, 28 Oct 2008)
Log Message:
-----------
removed bad code that AlexM had detected and commented out.
Modified Paths:
--------------
gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp
Modified: gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp 2008-10-27 15:14:04 UTC (rev 348)
+++ gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp 2008-10-28 00:09:36 UTC (rev 349)
@@ -223,15 +223,6 @@
tracer_.warning( ss.str() );
throw;
}
-/* ALEXM: this is the diff from post-bindoon which broke poly device
- if ( numBytesParsed == 0 )
- {
- stringstream ss;
- ss << "SerialDeviceHandler: Zero bytes were parsed, but buffer contains "<<buffer_.size()<<" bytes! (gotMessage="<<gotMessage<<"). responseParser_ shouldn't do this to us.";
- tracer_.warning( ss.str() );
- numBytesParsed = 1;
- }
-ALEXM */
removeParsedData( buffer_, numBytesParsed );
if ( gotMessage )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-10-27 15:14:15
|
Revision: 348
http://gearbox.svn.sourceforge.net/gearbox/?rev=348&view=rev
Author: russo2503v
Date: 2008-10-27 15:14:04 +0000 (Mon, 27 Oct 2008)
Log Message:
-----------
made walk() private per c++ suggested style
Modified Paths:
--------------
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/safethread.h
Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/safethread.h
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/safethread.h 2008-10-27 13:02:07 UTC (rev 347)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/safethread.h 2008-10-27 15:14:04 UTC (rev 348)
@@ -51,11 +51,11 @@
//! errors and waits for someone to call stop().
virtual void run();
+private:
//! Implement this function in the derived class and put here all the stuff which your
//! thread needs to do.
virtual void walk()=0;
-private:
gbxutilacfr::Tracer& tracer_;
};
//! A smart pointer to the SafeThread class.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-10-27 13:02:15
|
Revision: 347
http://gearbox.svn.sourceforge.net/gearbox/?rev=347&view=rev
Author: russo2503v
Date: 2008-10-27 13:02:07 +0000 (Mon, 27 Oct 2008)
Log Message:
-----------
typo
Modified Paths:
--------------
gearbox/trunk/src/gbxutilacfr/status.h
Modified: gearbox/trunk/src/gbxutilacfr/status.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/status.h 2008-10-27 12:21:06 UTC (rev 346)
+++ gearbox/trunk/src/gbxutilacfr/status.h 2008-10-27 13:02:07 UTC (rev 347)
@@ -19,13 +19,19 @@
//! Possible subsystem status values
enum SubsystemState
{
+ //! Subsystem has been created but has not started initialisation process.
SubsystemIdle,
+ //! Subsystem is preparing to work, e.g. initialising its resources, etc.
SubsystemInitialising,
+ //! Subsystem is fully initialised and is performing its function.
SubsystemWorking,
+ //! Subsystem is preparing to shutdown, e.g. releasing its resources, etc.
SubsystemFinalising,
+ //! Subsystem is not longer functioning.
SubsystemShutdown
};
+//! Returns string equivalent of state enumerator.
std::string toString( SubsystemState state );
//! Possible subsystem status values
@@ -41,14 +47,16 @@
SubsystemStalled
};
+//! Returns string equivalent of health enumerator.
std::string toString( SubsystemHealth health );
//! Status for a single subsystem
struct SubsystemStatus
{
- //! Machine-readable status description
+ //! Current state in the subsystem's state machine. I.e. what is the subsystem doing?
SubsystemState state;
+ //! Subsystem's health. I.e. how is the subsystem doing?
SubsystemHealth health;
//! Human-readable status description
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-10-27 12:21:10
|
Revision: 346
http://gearbox.svn.sourceforge.net/gearbox/?rev=346&view=rev
Author: russo2503v
Date: 2008-10-27 12:21:06 +0000 (Mon, 27 Oct 2008)
Log Message:
-----------
Modified Paths:
--------------
gearbox/trunk/doc/history.dox
Modified: gearbox/trunk/doc/history.dox
===================================================================
--- gearbox/trunk/doc/history.dox 2008-10-27 12:18:47 UTC (rev 345)
+++ gearbox/trunk/doc/history.dox 2008-10-27 12:21:06 UTC (rev 346)
@@ -33,6 +33,7 @@
- libGbxUtilAcfr
- Changed interface for Tracer: when querying verbosity, default destination argument is 'ToAny' (AlexB).
- Changed implementation of TrivialTracer to allow multiple levels of tracing verbosity (AlexB).
+ - Status now describes status of subsystems in two orthogonal dimensions: state and health. (alexm)
@section gbx_doc_history_807 Changes in Release 8.07
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-10-27 12:18:58
|
Revision: 345
http://gearbox.svn.sourceforge.net/gearbox/?rev=345&view=rev
Author: russo2503v
Date: 2008-10-27 12:18:47 +0000 (Mon, 27 Oct 2008)
Log Message:
-----------
status describes state and health of subsystems
Modified Paths:
--------------
gearbox/trunk/src/gbxutilacfr/status.h
gearbox/trunk/src/gbxutilacfr/substatus.h
gearbox/trunk/src/gbxutilacfr/trivialstatus.cpp
gearbox/trunk/src/gbxutilacfr/trivialstatus.h
Added Paths:
-----------
gearbox/trunk/src/gbxutilacfr/status.cpp
Added: gearbox/trunk/src/gbxutilacfr/status.cpp
===================================================================
--- gearbox/trunk/src/gbxutilacfr/status.cpp (rev 0)
+++ gearbox/trunk/src/gbxutilacfr/status.cpp 2008-10-27 12:18:47 UTC (rev 345)
@@ -0,0 +1,49 @@
+/*
+ * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
+ * http://gearbox.sf.net/
+ * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp
+ *
+ * This distribution is licensed to you under the terms described in
+ * the LICENSE file included in this distribution.
+ *
+ */
+
+#include "status.h"
+
+namespace gbxutilacfr {
+
+std::string toString( SubsystemState state )
+{
+ switch ( state )
+ {
+ case SubsystemInitialising :
+ return "Initialising";
+ case SubsystemWorking :
+ return "Working";
+ case SubsystemFinalising :
+ return "Finalising";
+ case SubsystemIdle :
+ return "Idle";
+ case SubsystemShutdown :
+ break;
+ }
+ return "Shutdown";
+}
+
+std::string toString( SubsystemHealth health )
+{
+ switch ( health )
+ {
+ case SubsystemOk :
+ return "Ok";
+ case SubsystemWarning :
+ return "Warning";
+ case SubsystemFault :
+ return "Fault";
+ case SubsystemStalled :
+ break;
+ }
+ return "Stalled";
+}
+
+} // namespace
Modified: gearbox/trunk/src/gbxutilacfr/status.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/status.h 2008-10-26 03:45:15 UTC (rev 344)
+++ gearbox/trunk/src/gbxutilacfr/status.h 2008-10-27 12:18:47 UTC (rev 345)
@@ -17,26 +17,40 @@
namespace gbxutilacfr {
//! Possible subsystem status values
-enum SubsystemStatusType
+enum SubsystemState
{
- //! Subsystem is initialising -- it's not exactly OK yet, but there's also no fault yet.
- SubsystemStatusInitialising,
+ SubsystemIdle,
+ SubsystemInitialising,
+ SubsystemWorking,
+ SubsystemFinalising,
+ SubsystemShutdown
+};
+
+std::string toString( SubsystemState state );
+
+//! Possible subsystem status values
+enum SubsystemHealth
+{
//! Subsystem is OK
- SubsystemStatusOk,
+ SubsystemOk,
//! Subsystem has encountered an abnormal but non-fault condition
- SubsystemStatusWarning,
+ SubsystemWarning,
//! Subsystem has declared a fault
- SubsystemStatusFault,
+ SubsystemFault,
//! Subsystem has not been heard from for an abnormally long time
- SubsystemStatusStalled
+ SubsystemStalled
};
+std::string toString( SubsystemHealth health );
+
//! Status for a single subsystem
struct SubsystemStatus
{
//! Machine-readable status description
- SubsystemStatusType type;
+ SubsystemState state;
+ SubsystemHealth health;
+
//! Human-readable status description
std::string message;
@@ -119,29 +133,55 @@
//! Throws gbxutilacfr::Exception if the subsystem does not exist.
virtual void setMaxHeartbeatInterval( const std::string& subsystem, double intervalSec )=0;
- //! Sets subsystem status to Initialising. Note that empty message is assumed if none is supplied.
+ //
+ // BOTH STATE AND HEALTH CHANGES
+ //
+
+ //! Sets the status of a subsystem (both state and health) in an atomic operation. Use this method
+ //! when both state and health have changed.
+ virtual void setSubsystemStatus( const std::string& subsystem, SubsystemState state, SubsystemHealth health, const std::string& message="" )=0;
+
+ //
+ // STATE CHANGES
+ //
+
+ //! Sets state of the subsystem to Initialising. Note that empty message is assumed if none is supplied.
//! Throws gbxutilacfr::Exception if the subsystem does not exist.
virtual void initialising( const std::string& subsystem, const std::string& message="" )=0;
+ virtual void working( const std::string& subsystem, const std::string& message="" )=0;
+ virtual void finalising( const std::string& subsystem, const std::string& message="" )=0;
- //! Sets subsystem status to Ok. Note that empty message is assumed if none is supplied.
+ //
+ // HEALTH CHANGES
+ //
+
+ //! Sets subsystem health to Ok. Note that empty message is assumed if none is supplied.
//! Throws gbxutilacfr::Exception if the subsystem does not exist.
virtual void ok( const std::string& subsystem, const std::string& message="" )=0;
- //! Sets subsystem status to Warning.
+ //! Sets subsystem health to Warning.
//! Throws gbxutilacfr::Exception if the subsystem does not exist.
virtual void warning( const std::string& subsystem, const std::string& message )=0;
- //! Sets subsystem status to Fault.
+ //! Sets subsystem health to Fault.
//! Throws gbxutilacfr::Exception if the subsystem does not exist.
virtual void fault( const std::string& subsystem, const std::string& message )=0;
+ //
+ // NO CHANGE
+ //
+
//! Record heartbeat from a subsystem: let Status know the subsystem is alive without
//! modifying its status.
//! Throws gbxutilacfr::Exception if the subsystem does not exist.
virtual void heartbeat( const std::string& subsystem )=0;
- //! Some thread should call this function periodically in order for
- //! status publishing to happen.
+ //
+ // Utility
+ //
+
+ //! Some thread must call this function periodically in order for
+ //! status publishing to happen and stalls identified.
virtual void process()=0;
};
Modified: gearbox/trunk/src/gbxutilacfr/substatus.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/substatus.h 2008-10-26 03:45:15 UTC (rev 344)
+++ gearbox/trunk/src/gbxutilacfr/substatus.h 2008-10-27 12:18:47 UTC (rev 345)
@@ -20,13 +20,8 @@
//!
//! @par Overview
//!
-//! SubStatus provides a machine-readable interface such that other components can
-//! monitor this component's status.
+//! Provides a convenient interface for setting status information for one subsystem.
//!
-//! A single SubStatus object is meant to be shared by all threads in the component so the
-//! implementation must be thread-safe.
-//!
-//!
//! @sa Status
//!
class SubStatus
@@ -58,6 +53,12 @@
void initialising( const std::string& message="" ) { status_.initialising( subsysName_, message ); };
//! Passes this information to the system Status.
+ void working( const std::string& message="" ) { status_.working( subsysName_, message ); };
+
+ //! Passes this information to the system Status.
+ void finalising( const std::string& message="" ) { status_.finalising( subsysName_, message ); };
+
+ //! Passes this information to the system Status.
void ok( const std::string& message="" ) { status_.ok( subsysName_, message ); };
//! Passes this information to the system Status.
@@ -66,6 +67,9 @@
//! Passes this information to the system Status.
void fault( const std::string& message ) { status_.fault( subsysName_, message ); };
+ //! Returns system Status object
+ Status& status() { return status_; };
+
//! Returns subsystem's name
std::string name() const { return subsysName_; };
private:
Modified: gearbox/trunk/src/gbxutilacfr/trivialstatus.cpp
===================================================================
--- gearbox/trunk/src/gbxutilacfr/trivialstatus.cpp 2008-10-26 03:45:15 UTC (rev 344)
+++ gearbox/trunk/src/gbxutilacfr/trivialstatus.cpp 2008-10-27 12:18:47 UTC (rev 345)
@@ -12,19 +12,20 @@
#include <sstream>
#include "trivialstatus.h"
#include "exceptions.h"
+#include <assert.h>
using namespace std;
namespace gbxutilacfr {
TrivialStatus::TrivialStatus( Tracer& tracer,
- bool heartbeat, bool ok, bool init, bool warn, bool fault ) :
+ bool stateChange, bool ok, bool warn, bool fault, bool heartbeat ) :
tracer_(tracer),
- heartbeat_(heartbeat),
+ stateChange_(stateChange),
ok_(ok),
- init_(init),
warn_(warn),
- fault_(fault)
+ fault_(fault),
+ heartbeat_(heartbeat)
{
}
@@ -62,13 +63,48 @@
}
void
+TrivialStatus::setSubsystemStatus( const std::string& subsystem, SubsystemState state, SubsystemHealth health, const std::string& message )
+{
+ string trace = "TrivialStatus: subsystem "+subsystem+" changed state to "+gbxutilacfr::toString(state)+" with health "+gbxutilacfr::toString(health);
+ if (!message.empty() )
+ trace =+ ": '" + message + "'";
+ tracer_.info( trace );
+}
+
+void
TrivialStatus::initialising( const std::string& subsystem, const std::string& message )
{
- if ( init_ && !message.empty() )
- tracer_.info( "TrivialStatus: initialising subsystem "+subsystem+": '"+message+"'" );
+ if ( stateChange_ ) {
+ string trace = "TrivialStatus: subsystem "+subsystem+" changed state to Initialising";
+ if (!message.empty() )
+ trace =+ " and message: '" + message + "'";
+ tracer_.info( trace );
+ }
}
void
+TrivialStatus::working( const std::string& subsystem, const std::string& message )
+{
+ if ( stateChange_ ) {
+ string trace = "TrivialStatus: subsystem "+subsystem+" changed state to Working";
+ if (!message.empty() )
+ trace =+ ": '" + message + "'";
+ tracer_.info( trace );
+ }
+}
+
+void
+TrivialStatus::finalising( const std::string& subsystem, const std::string& message )
+{
+ if ( stateChange_ ) {
+ string trace = "TrivialStatus: subsystem "+subsystem+" changed state to Finalising";
+ if (!message.empty() )
+ trace =+ ": '" + message + "'";
+ tracer_.info( trace );
+ }
+}
+
+void
TrivialStatus::ok( const std::string& subsystem, const std::string& message )
{
if ( ok_ && !message.empty() )
Modified: gearbox/trunk/src/gbxutilacfr/trivialstatus.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/trivialstatus.h 2008-10-26 03:45:15 UTC (rev 344)
+++ gearbox/trunk/src/gbxutilacfr/trivialstatus.h 2008-10-27 12:18:47 UTC (rev 345)
@@ -18,8 +18,10 @@
//!
-//! @brief A trivial implementation of the status API which prints to cout.
+//! @brief A trivial implementation of the status API which does not assemble information.
//!
+//! System status information is not assembled but all changes are traced to Tracer.
+//!
//! @see Status
//!
class TrivialStatus : public Status
@@ -27,7 +29,7 @@
public:
TrivialStatus( Tracer& tracer,
- bool heartbeat=false, bool ok=false, bool init=false, bool warn=true, bool fault=true );
+ bool stateChange=true, bool ok=false, bool warn=true, bool fault=true, bool heartbeat=false );
virtual void addSubsystem( const std::string& subsystem, double maxHeartbeatIntervalSec=-1.0 );
virtual void removeSubsystem( const std::string& subsystem );
@@ -36,22 +38,29 @@
//! does not keep track of status, throws Exception on any query
virtual SubsystemStatus subsystemStatus( const std::string& subsystem );
virtual void setMaxHeartbeatInterval( const std::string& subsystem, double interval );
+
+ virtual void setSubsystemStatus( const std::string& subsystem, SubsystemState state, SubsystemHealth health, const std::string& message="" );
+
virtual void initialising( const std::string& subsystem, const std::string& message="" );
+ virtual void working( const std::string& subsystem, const std::string& message="" );
+ virtual void finalising( const std::string& subsystem, const std::string& message="" );
+
virtual void ok( const std::string& subsystem, const std::string& message="" );
virtual void warning( const std::string& subsystem, const std::string& message );
virtual void fault( const std::string& subsystem, const std::string& message );
virtual void heartbeat( const std::string& subsystem );
+
virtual void process();
private:
Tracer& tracer_;
- bool heartbeat_;
+ bool stateChange_;
bool ok_;
- bool init_;
bool warn_;
bool fault_;
+ bool heartbeat_;
};
} // namespace
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-10-26 03:45:19
|
Revision: 344
http://gearbox.svn.sourceforge.net/gearbox/?rev=344&view=rev
Author: russo2503v
Date: 2008-10-26 03:45:15 +0000 (Sun, 26 Oct 2008)
Log Message:
-----------
commented out recent change which broke a serial device driver
Modified Paths:
--------------
gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp
Modified: gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp 2008-10-26 03:43:40 UTC (rev 343)
+++ gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp 2008-10-26 03:45:15 UTC (rev 344)
@@ -223,7 +223,7 @@
tracer_.warning( ss.str() );
throw;
}
-
+/* ALEXM: this is the diff from post-bindoon which broke poly device
if ( numBytesParsed == 0 )
{
stringstream ss;
@@ -231,7 +231,7 @@
tracer_.warning( ss.str() );
numBytesParsed = 1;
}
-
+ALEXM */
removeParsedData( buffer_, numBytesParsed );
if ( gotMessage )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-10-26 03:43:44
|
Revision: 343
http://gearbox.svn.sourceforge.net/gearbox/?rev=343&view=rev
Author: russo2503v
Date: 2008-10-26 03:43:40 +0000 (Sun, 26 Oct 2008)
Log Message:
-----------
documenting utility namespace of libGbxSickAcfr
Modified Paths:
--------------
gearbox/trunk/src/gbxsickacfr/doc.dox
Modified: gearbox/trunk/src/gbxsickacfr/doc.dox
===================================================================
--- gearbox/trunk/src/gbxsickacfr/doc.dox 2008-10-26 03:42:31 UTC (rev 342)
+++ gearbox/trunk/src/gbxsickacfr/doc.dox 2008-10-26 03:43:40 UTC (rev 343)
@@ -79,12 +79,4 @@
@see @ref gbx_library_gbxsickacfr
-*/
-
-/*!
-@brief A set of auxiliary functions using libIceUtil
-@namespace gbxiceutilacfr
-
-The library libGbxIceUtilAcfr is used internally by libraries and drivers developed at ACFR.
-
-*/
+*/
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-10-26 03:42:38
|
Revision: 342
http://gearbox.svn.sourceforge.net/gearbox/?rev=342&view=rev
Author: russo2503v
Date: 2008-10-26 03:42:31 +0000 (Sun, 26 Oct 2008)
Log Message:
-----------
documenting utility namespace of libGbxSickAcfr
Modified Paths:
--------------
gearbox/trunk/doc/doxyfile
Modified: gearbox/trunk/doc/doxyfile
===================================================================
--- gearbox/trunk/doc/doxyfile 2008-10-25 03:46:59 UTC (rev 341)
+++ gearbox/trunk/doc/doxyfile 2008-10-26 03:42:31 UTC (rev 342)
@@ -83,7 +83,7 @@
*.c \
*.cc
RECURSIVE = YES
-EXCLUDE =
+EXCLUDE = ../src/gbxsickacfr/gbxiceutilacfr/
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXAMPLE_PATH = ../src
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-10-25 03:47:02
|
Revision: 341
http://gearbox.svn.sourceforge.net/gearbox/?rev=341&view=rev
Author: russo2503v
Date: 2008-10-25 03:46:59 +0000 (Sat, 25 Oct 2008)
Log Message:
-----------
minor changes related to GBX_DEFAULT_LIB_TYPE
Modified Paths:
--------------
gearbox/trunk/doc/buildsys.dox
Modified: gearbox/trunk/doc/buildsys.dox
===================================================================
--- gearbox/trunk/doc/buildsys.dox 2008-10-25 03:46:06 UTC (rev 340)
+++ gearbox/trunk/doc/buildsys.dox 2008-10-25 03:46:59 UTC (rev 341)
@@ -55,7 +55,7 @@
FILE( GLOB hdrs *.h )
FILE( GLOB srcs *.cpp )
- GBX_ADD_LIBRARY( ${lib_name} ${srcs} )
+ GBX_ADD_LIBRARY( ${lib_name} DEFAULT ${srcs} )
TARGET_LINK_LIBRARIES( ${lib_name} ${dep_libs} )
GBX_ADD_HEADERS( gbxadvanced ${hdrs} )
@@ -163,15 +163,18 @@
GBX_ADD_LIBRARY( ${lib_name} DEFAULT ${srcs} )
TARGET_LINK_LIBRARIES( ${lib_name} ${dep_libs} )
@endverbatim
-Here we tell CMake to create rules for building a library of the default type (shared or static) and to specify dependencies. Now you can see why we bothered with defining variables. These commands are generic and can be easily used for other libraries.
+
@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 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).
@c TARGET_LINK_LIBRARIES is a standard CMake command. It specifies that our library is to be linked to our dependencies.
+Now you can see why we bothered with defining variables. These commands are generic and can be easily used for other libraries.
+
@verbatim
GBX_ADD_HEADERS( gbxadvanced ${hdrs} )
@endverbatim
@@ -185,6 +188,11 @@
@section gbx_doc_buildsys_varlist A list of useful CMake variables defined by GearBox
+Build system configuration:
+@verbatim
+GBX_DEFAULT_LIB_TYPE # Valid options {SHARED, STATIC}. Defaults to SHARED.
+@endverbatim
+
OS variables: evaluate to TRUE when running on the corresponding OS, otherwise to FALSE. We define our own because the standard CMake ones are inconsistently named and the one for Linux is not defined.
@verbatim
GBX_OS_LINUX
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-10-25 03:46:08
|
Revision: 340
http://gearbox.svn.sourceforge.net/gearbox/?rev=340&view=rev
Author: russo2503v
Date: 2008-10-25 03:46:06 +0000 (Sat, 25 Oct 2008)
Log Message:
-----------
enabled documentation for gbxiceutilafr namespace
Modified Paths:
--------------
gearbox/trunk/src/gbxsickacfr/doc.dox
Modified: gearbox/trunk/src/gbxsickacfr/doc.dox
===================================================================
--- gearbox/trunk/src/gbxsickacfr/doc.dox 2008-10-25 03:45:39 UTC (rev 339)
+++ gearbox/trunk/src/gbxsickacfr/doc.dox 2008-10-25 03:46:06 UTC (rev 340)
@@ -79,4 +79,12 @@
@see @ref gbx_library_gbxsickacfr
-*/
\ No newline at end of file
+*/
+
+/*!
+@brief A set of auxiliary functions using libIceUtil
+@namespace gbxiceutilacfr
+
+The library libGbxIceUtilAcfr is used internally by libraries and drivers developed at ACFR.
+
+*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-10-25 03:45:49
|
Revision: 339
http://gearbox.svn.sourceforge.net/gearbox/?rev=339&view=rev
Author: russo2503v
Date: 2008-10-25 03:45:39 +0000 (Sat, 25 Oct 2008)
Log Message:
-----------
enabled documentation for gbxiceutilafr namespace
Modified Paths:
--------------
gearbox/trunk/doc/doxyfile
Modified: gearbox/trunk/doc/doxyfile
===================================================================
--- gearbox/trunk/doc/doxyfile 2008-10-24 02:56:23 UTC (rev 338)
+++ gearbox/trunk/doc/doxyfile 2008-10-25 03:45:39 UTC (rev 339)
@@ -83,7 +83,7 @@
*.c \
*.cc
RECURSIVE = YES
-EXCLUDE = ../src/gbxsickacfr/gbxiceutilacfr/
+EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXAMPLE_PATH = ../src
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2008-10-24 02:56:39
|
Revision: 338
http://gearbox.svn.sourceforge.net/gearbox/?rev=338&view=rev
Author: russo2503v
Date: 2008-10-24 02:56:23 +0000 (Fri, 24 Oct 2008)
Log Message:
-----------
docco: added not on smart pointers.
Modified Paths:
--------------
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/buffer.h
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/notify.h
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/store.h
Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/buffer.h
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/buffer.h 2008-10-23 04:31:34 UTC (rev 337)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/buffer.h 2008-10-24 02:56:23 UTC (rev 338)
@@ -34,7 +34,9 @@
/*!
@brief A thread-safe data pipe with buffer semantics.
-For a type-safe buffer, template over the specific object Type you want to put in it. Buffering Ice smart pointers requires a specialized class PtrBuffer.
+For a type-safe buffer, template over the specific object Type you want to put in it. You can use
+this container for storing smart pointers (e.g. IceUtil smart pointers). In this case the container will
+only store the pointers and will not perform a deep copy.
You should always try to @ref get() data before blocking with @ref getNext() because closely spaced push events may be lost. For example:
@verbatim
@@ -57,7 +59,7 @@
@endverbatim
@note This implementation uses IceUtil threading classes. See example in sec. 28.9.2 of the Ice manual.
-@see PtrBuffer, Notify, Proxy
+@see Notify, Proxy
*/
template<class Type>
class Buffer : public IceUtil::Monitor<IceUtil::Mutex>
@@ -113,7 +115,7 @@
* Non-popping and non-blocking read from the front of the buffer.
*
* Calls to @ref get() on an empty buffer raises an gbxutilacfr::Exception exception.
- * You can trap these and call @ref getNext() which will block until new data arrives.
+ * You can catch these and call @ref getNext() which will block until new data arrives.
*/
void get( Type & obj ) const;
Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/notify.h
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/notify.h 2008-10-23 04:31:34 UTC (rev 337)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/notify.h 2008-10-24 02:56:23 UTC (rev 338)
@@ -43,6 +43,9 @@
* Write new data with Notify::set. The data is delivered to the data handler by
* calling NotifyHandler::handleData in the registered NotifyHandler.
*
+ * When used with smart pointers (e.g. IceUtil smart pointers), this class will not
+ * perform a deep copy.
+ *
* @see Buffer, Proxy
*/
template<class Type>
Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/store.h
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/store.h 2008-10-23 04:31:34 UTC (rev 337)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/store.h 2008-10-24 02:56:23 UTC (rev 338)
@@ -1,6 +1,6 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
- * http://gearbox.sf.net/
+ http://gearbox.sf.net/
* Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp
*
* This distribution is licensed to you under the terms described in
@@ -20,20 +20,23 @@
namespace gbxiceutilacfr {
/*!
- * @brief Thread-safe storage for a single data objects.
- *
- * This container is similar to a circular Buffer of size one but with two
- * differences:
- * - a copy of the data is always available, yet the user knows when new
- * data has arrived by calling isNewData().
- * - getNext() returns the new data arrives (not when the buffer
- * is non-empty.
- *
- * Write to it with set(). Read its contents with get(). Trying to read from
- * an empty Store raises an gbxutilacfr::Exception.
- *
- * @note Replaces the deprecated Proxy class.
- * @see Buffer, Notify
+@brief Thread-safe storage for a single data objects.
+
+This container is similar to a circular Buffer of size one but with two
+differences:
+- a copy of the data is always available, yet the user knows when new
+ data has arrived by calling isNewData().
+- getNext() returns the new data arrives (not when the buffer
+ is non-empty.
+
+You can use this container for storing smart pointers (e.g. IceUtil smart pointers).
+In this case the container will only store the pointer and will not perform a deep copy.
+
+Write to it with set(). Read its contents with get(). Trying to read from
+an empty Store raises an gbxutilacfr::Exception.
+
+@note Replaces the deprecated Proxy class.
+@see Buffer, Notify
*/
template<class Type>
class Store : public IceUtil::Monitor<IceUtil::Mutex>
@@ -60,14 +63,13 @@
void get( Type & obj ) const;
/*!
- * @brief Waits until the next update and returns the new value.
- * If the Store is empty, @ref getNext blocks until the Store is set and returns the new value.
- * By default, there is no timeout (negative value). Returns 0 if successful.
- *
- * If timeout is set to a positive value (in milliseconds) and the wait times out, the function returns -1
- * and the object argument itself is not touched. In the rare event of spurious wakeup,
- * the return value is 1.
- *
+ @brief Waits until the next update and returns the new value.
+ If the Store is empty, @ref getNext blocks until the Store is set and returns the new value.
+ By default, there is no timeout (negative value). Returns 0 if successful.
+
+ If timeout is set to a positive value (in milliseconds) and the wait times out, the function returns -1
+ and the object argument itself is not touched. In the rare event of spurious wakeup,
+ the return value is 1.
*/
int getNext( Type & obj, int timeoutMs=-1 ) const;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bo...@us...> - 2008-10-23 04:31:50
|
Revision: 337
http://gearbox.svn.sourceforge.net/gearbox/?rev=337&view=rev
Author: borax00
Date: 2008-10-23 04:31:34 +0000 (Thu, 23 Oct 2008)
Log Message:
-----------
turned -Wconversion off again.
Modified Paths:
--------------
gearbox/trunk/cmake/UseBasicRules.cmake
Modified: gearbox/trunk/cmake/UseBasicRules.cmake
===================================================================
--- gearbox/trunk/cmake/UseBasicRules.cmake 2008-10-23 03:23:13 UTC (rev 336)
+++ gearbox/trunk/cmake/UseBasicRules.cmake 2008-10-23 04:31:34 UTC (rev 337)
@@ -16,7 +16,13 @@
# Platform-specific compiler and linker flags
#
IF( NOT GBX_OS_WIN )
- ADD_DEFINITIONS( "-Wall -Wconversion" )
+ ADD_DEFINITIONS( "-Wall" )
+#
+# AlexB: Using -Wconversion finds some real bugs, but turns up lots of
+# false positives, especially in gcc4.3.
+# (see: http://gcc.gnu.org/ml/gcc/2008-05/msg00363.html)
+#
+# ADD_DEFINITIONS( "-Wall -Wconversion" )
ELSE ( NOT GBX_OS_WIN )
ADD_DEFINITIONS( "-Wall -D_CRT_SECURE_NO_DEPRECATE" )
ENDIF( NOT GBX_OS_WIN )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gb...@us...> - 2008-10-23 03:23:20
|
Revision: 336
http://gearbox.svn.sourceforge.net/gearbox/?rev=336&view=rev
Author: gbiggs
Date: 2008-10-23 03:23:13 +0000 (Thu, 23 Oct 2008)
Log Message:
-----------
Fixed a couple of incorrect switch values
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 2008-10-21 08:00:51 UTC (rev 335)
+++ gearbox/trunk/src/hokuyo_aist/hokuyo_aist.cpp 2008-10-23 03:23:13 UTC (rev 336)
@@ -649,8 +649,6 @@
{
switch (errorCode)
{
- case -1:
- return "No error.";
case 1:
return "No object in the range.";
case 2:
@@ -671,8 +669,6 @@
{
switch (errorCode)
{
- case -1:
- return "No error.";
case 0:
return "Detected object is possibly at 22m.";
case 1:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bo...@us...> - 2008-10-21 08:01:12
|
Revision: 335
http://gearbox.svn.sourceforge.net/gearbox/?rev=335&view=rev
Author: borax00
Date: 2008-10-21 08:00:51 +0000 (Tue, 21 Oct 2008)
Log Message:
-----------
cleaned up some warnings.
Modified Paths:
--------------
gearbox/trunk/src/gbxsickacfr/messages.cpp
Modified: gearbox/trunk/src/gbxsickacfr/messages.cpp
===================================================================
--- gearbox/trunk/src/gbxsickacfr/messages.cpp 2008-10-21 07:27:28 UTC (rev 334)
+++ gearbox/trunk/src/gbxsickacfr/messages.cpp 2008-10-21 08:00:51 UTC (rev 335)
@@ -583,7 +583,7 @@
{
uChar loByte = buf[pos];
uChar hiByte = buf[pos+1];
- d->ranges[i] = ( ((hiByte&0x1f)<<8) + loByte ) * rangeConversion;
+ d->ranges[i] = (float)(( ((hiByte&0x1f)<<8) + loByte ) * rangeConversion);
d->intensities[i] = (hiByte & 0xe0) >> 5;
pos += sizeof(uint16_t);
@@ -703,8 +703,8 @@
int pos=0;
buffer[pos++] = STX;
buffer[pos++] = ADDRESS;
- buffer[pos++] = commandAndData.size() & 0x00ff;
- buffer[pos++] = commandAndData.size() >> 8;
+ buffer[pos++] = (unsigned char)(commandAndData.size() & 0x00ff);
+ buffer[pos++] = (unsigned char)(commandAndData.size() >> 8);
memcpy( &(buffer[pos]),
&(commandAndData[0]),
@@ -712,8 +712,8 @@
int checksum = computeSickChecksum( &(buffer[0]),
buffer.size()-CHECKSUM_LENGTH );
- buffer[ buffer.size()-2 ] = checksum & 0xFF;
- buffer[ buffer.size()-1 ] = checksum >> 8;
+ buffer[ buffer.size()-2 ] = (unsigned char)(checksum & 0xFF);
+ buffer[ buffer.size()-1 ] = (unsigned char)(checksum >> 8);
}
void
@@ -989,8 +989,8 @@
int pos=0;
commandAndData[pos++] = CMD_CONFIGURE_LMS;
- commandAndData[pos++] = c.blanking & 0xff;
- commandAndData[pos++] = (c.blanking>>8) & 0xff;
+ commandAndData[pos++] = (unsigned char)(c.blanking & 0xff);
+ commandAndData[pos++] = (unsigned char)((c.blanking>>8) & 0xff);
commandAndData[pos++] = 0x70; // not used for lms 211/221/291
commandAndData[pos++] = c.sensitivity;
@@ -1023,10 +1023,10 @@
commandAndData[pos++] = c.pixelOrientedEvaluation;
commandAndData[pos++] = c.singleMeasuredValueEvaluation;
- commandAndData[pos++] = c.restartTimeFields & 0xff;
- commandAndData[pos++] = (c.restartTimeFields>>8) & 0xff;
- commandAndData[pos++] = c.multipleEvaluationForDazzle & 0xff;
- commandAndData[pos++] = (c.multipleEvaluationForDazzle>>8) & 0xff;
+ commandAndData[pos++] = (unsigned char)(c.restartTimeFields & 0xff);
+ commandAndData[pos++] = (unsigned char)((c.restartTimeFields>>8) & 0xff);
+ commandAndData[pos++] = (unsigned char)(c.multipleEvaluationForDazzle & 0xff);
+ commandAndData[pos++] = (unsigned char)((c.multipleEvaluationForDazzle>>8) & 0xff);
assert( pos == (int)(commandAndData.size()) );
}
@@ -1046,10 +1046,10 @@
commandAndData.resize( 5 );
commandAndData[0] = CMD_SWITCH_VARIANT;
- commandAndData[1] = scanningAngle & 0xff;
- commandAndData[2] = (scanningAngle>>8) & 0xff;
- commandAndData[3] = angularResolution & 0xff;
- commandAndData[4] = (angularResolution>>8) & 0xff;
+ commandAndData[1] = (unsigned char)(scanningAngle & 0xff);
+ commandAndData[2] = (unsigned char)((scanningAngle>>8) & 0xff);
+ commandAndData[3] = (unsigned char)(angularResolution & 0xff);
+ commandAndData[4] = (unsigned char)((angularResolution>>8) & 0xff);
}
void constructRequestOperatingDataCounter( std::vector<uChar> &commandAndData )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bo...@us...> - 2008-10-21 07:27:37
|
Revision: 334
http://gearbox.svn.sourceforge.net/gearbox/?rev=334&view=rev
Author: borax00
Date: 2008-10-21 07:27:28 +0000 (Tue, 21 Oct 2008)
Log Message:
-----------
Changed interface of Tracer and improved implemnentation of TrivialTracer.
Modified Paths:
--------------
gearbox/trunk/doc/history.dox
gearbox/trunk/src/gbxutilacfr/tracer.h
gearbox/trunk/src/gbxutilacfr/trivialtracer.h
Modified: gearbox/trunk/doc/history.dox
===================================================================
--- gearbox/trunk/doc/history.dox 2008-10-21 07:21:16 UTC (rev 333)
+++ gearbox/trunk/doc/history.dox 2008-10-21 07:27:28 UTC (rev 334)
@@ -25,6 +25,15 @@
@section gbx_doc_history_head Changes in SVN since Last Release
+@par Updated libraries
+
+- libGbxSickAcfr
+ - A bit more careful when dealing with chunks of buffer that can't be parsed, should be a bit more robust (AlexB).
+
+- libGbxUtilAcfr
+ - Changed interface for Tracer: when querying verbosity, default destination argument is 'ToAny' (AlexB).
+ - Changed implementation of TrivialTracer to allow multiple levels of tracing verbosity (AlexB).
+
@section gbx_doc_history_807 Changes in Release 8.07
@par Project wide
Modified: gearbox/trunk/src/gbxutilacfr/tracer.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/tracer.h 2008-10-21 07:21:16 UTC (rev 333)
+++ gearbox/trunk/src/gbxutilacfr/tracer.h 2008-10-21 07:27:28 UTC (rev 334)
@@ -133,7 +133,7 @@
//! function yourself @e before calling error() if there is a significant overhead
//! in forming the tracing string. See class documentation for an example of such
//! usage.
- virtual int verbosity( TraceType traceType, DestinationType destType ) const = 0;
+ virtual int verbosity( TraceType traceType, DestinationType destType=ToAny ) const = 0;
static std::string toString( Tracer::TraceType type )
{
Modified: gearbox/trunk/src/gbxutilacfr/trivialtracer.h
===================================================================
--- gearbox/trunk/src/gbxutilacfr/trivialtracer.h 2008-10-21 07:21:16 UTC (rev 333)
+++ gearbox/trunk/src/gbxutilacfr/trivialtracer.h 2008-10-21 07:27:28 UTC (rev 334)
@@ -37,7 +37,7 @@
virtual void warning( const std::string &message, int level=1 );
virtual void error( const std::string &message, int level=1 );
virtual void debug( const std::string &message, int level=1 );
- virtual int verbosity( TraceType traceType, DestinationType destType ) const;
+ virtual int verbosity( TraceType traceType, DestinationType destType=Tracer::ToAny ) const;
private:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bo...@us...> - 2008-10-21 07:21:25
|
Revision: 333
http://gearbox.svn.sourceforge.net/gearbox/?rev=333&view=rev
Author: borax00
Date: 2008-10-21 07:21:16 +0000 (Tue, 21 Oct 2008)
Log Message:
-----------
dont throw an exception during parseResponse(), or the buffer wont get eaten up.
Modified Paths:
--------------
gearbox/trunk/src/gbxsickacfr/driver.cpp
gearbox/trunk/src/gbxsickacfr/messages.cpp
Modified: gearbox/trunk/src/gbxsickacfr/driver.cpp
===================================================================
--- gearbox/trunk/src/gbxsickacfr/driver.cpp 2008-10-21 07:03:25 UTC (rev 332)
+++ gearbox/trunk/src/gbxsickacfr/driver.cpp 2008-10-21 07:21:16 UTC (rev 333)
@@ -309,7 +309,7 @@
assert( angleIncrementInHundredthDegrees == ANGULAR_RESOLUTION_1_0_DEG ||
angleIncrementInHundredthDegrees == ANGULAR_RESOLUTION_0_5_DEG ||
angleIncrementInHundredthDegrees == ANGULAR_RESOLUTION_0_25_DEG );
- return angleIncrementInHundredthDegrees;
+ return (uint16_t)angleIncrementInHundredthDegrees;
}
bool
Modified: gearbox/trunk/src/gbxsickacfr/messages.cpp
===================================================================
--- gearbox/trunk/src/gbxsickacfr/messages.cpp 2008-10-21 07:03:25 UTC (rev 332)
+++ gearbox/trunk/src/gbxsickacfr/messages.cpp 2008-10-21 07:21:16 UTC (rev 333)
@@ -120,7 +120,7 @@
uint16_t getWord( const uChar *buf, int &pos )
{
- uint16_t word = buf[pos] | (buf[pos+1]<<8);
+ uint16_t word = (uint16_t)( buf[pos] | (buf[pos+1]<<8) );
pos += sizeof(uint16_t);
return word;
}
@@ -187,7 +187,7 @@
bool
LmsResponse::isError() const
{
- uChar generalStatus = status & STATUS_GENERAL_MASK ;
+ uChar generalStatus = (uChar)( status & STATUS_GENERAL_MASK );
if ( generalStatusIsError( generalStatus ) )
{
return true;
@@ -212,7 +212,7 @@
bool
LmsResponse::isWarn() const
{
- uChar generalStatus = status & STATUS_GENERAL_MASK ;
+ uChar generalStatus = (uChar)( status & STATUS_GENERAL_MASK );
if ( generalStatusIsWarn( generalStatus ) )
{
return true;
@@ -547,8 +547,8 @@
{
LmsMeasurementData *d = new LmsMeasurementData;
- uChar measurementMode = buf[1] >> 6;
- float rangeConversion;
+ uChar measurementMode = (uChar)( buf[1] >> 6 );
+ double rangeConversion;
if ( measurementMode == MEASURED_VALUE_UNIT_MM )
{
rangeConversion = 1.0/1000.0;
@@ -913,8 +913,16 @@
response = new LmsResponse;
response->type = buffer[msgStart+4];
response->status = buffer[msgStart+telegramLength-3];
- parseResponse( response->type, &(buffer[msgStart+5]), commandAndDataLength-2, *response );
- return true;
+
+ try {
+ parseResponse( response->type, &(buffer[msgStart+5]), commandAndDataLength-2, *response );
+ return true;
+ }
+ catch ( const std::exception &e )
+ {
+ cout << __func__ << "(): Error parsing response: " << e.what() << endl;
+ return false;
+ }
}
void
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|