CValueHistoryDlgBar Class Reference

#include <ValueHistoryDlgBar.h>

Inheritance diagram for CValueHistoryDlgBar:

CRobotControlDialogBar CDynamicBarDlg MessageHandler CDynamicChildDlg CDynamicDialog CDynamicWndEx CDynamicWnd List of all members.

Public Types

 cameraMatrixIsValid
 ballPerceptX
 ballPerceptY
 ballPerceptDistance
 ballPerceptAngle
 ballPerceptDistanceBearingBased
 ballPerceptAngleBearingBased
 ballPerceptDistanceSizeBased
 ballPerceptAngleSizeBased
 ballPositionDistance
 ballPositionAngle
 ballPositionSpeedAbs
 ballPositionSpeedDir
 specialPerceptRobotPoseX
 specialPerceptRobotPoseY
 specialPerceptRobotPoseAngle
 psdPerceptToFarAway
 psdPerceptX
 psdPerceptY
 psdPerceptZ
 robotPoseX
 robotPoseY
 robotPoseAngle
 robotPoseSpeed
 walkSpeedX
 walkSpeedY
 walkSpeedRotation
 positionInWalkCycle
 neckHeightCalculatedFromLegSensors
 neckHeightProvidedByMotionControl
 bodyRollCalculatedFromLegSensors
 bodyRollProvidedByMotionControl
 bodyRollCalculatedFromAccelerationSensors
 bodyTiltCalculatedFromLegSensors
 bodyTiltProvidedByMotionControl
 bodyTiltCalculatedFromAccelerationSensors
 numberOfValueIDs
 IDD = IDD_DIALOG_BAR_VALUE_HISTORY
enum  valueID {
  cameraMatrixIsValid, ballPerceptX, ballPerceptY, ballPerceptDistance,
  ballPerceptAngle, ballPerceptDistanceBearingBased, ballPerceptAngleBearingBased, ballPerceptDistanceSizeBased,
  ballPerceptAngleSizeBased, ballPositionDistance, ballPositionAngle, ballPositionSpeedAbs,
  ballPositionSpeedDir, specialPerceptRobotPoseX, specialPerceptRobotPoseY, specialPerceptRobotPoseAngle,
  psdPerceptToFarAway, psdPerceptX, psdPerceptY, psdPerceptZ,
  robotPoseX, robotPoseY, robotPoseAngle, robotPoseSpeed,
  walkSpeedX, walkSpeedY, walkSpeedRotation, positionInWalkCycle,
  neckHeightCalculatedFromLegSensors, neckHeightProvidedByMotionControl, bodyRollCalculatedFromLegSensors, bodyRollProvidedByMotionControl,
  bodyRollCalculatedFromAccelerationSensors, bodyTiltCalculatedFromLegSensors, bodyTiltProvidedByMotionControl, bodyTiltCalculatedFromAccelerationSensors,
  numberOfValueIDs
}
enum  { IDD = IDD_DIALOG_BAR_VALUE_HISTORY }

Public Member Functions

 CValueHistoryDlgBar ()
 ~CValueHistoryDlgBar ()
virtual bool handleMessage (InMessage &message)
void addValue (valueID id, unsigned long timeStamp, double value, bool halfSiz=false)

Static Public Member Functions

static const char * getValueIDName (valueID id)

Public Attributes

CSliderCtrl m_scaleSlider
CSliderCtrl m_timeRangeSlider
CStatic m_timeRangeStatic
CButton m_freezeButton

Protected Types

 maxNumberOfEntries = 1000
enum  { maxNumberOfEntries = 1000 }

Protected Member Functions

virtual void DoDataExchange (CDataExchange *pDX)
virtual BOOL OnInitDialog ()
afx_msg void OnPaint ()
afx_msg void OnSize (UINT nType, int cx, int cy)
afx_msg void OnContextMenu (CWnd *pWnd, CPoint point)
afx_msg void OnHScroll (UINT nSBCode, UINT nPos, CScrollBar *pScrollBar)
afx_msg void OnFreezeButton ()
 DECLARE_MESSAGE_MAP ()
void paintValue (int x, int y, int size, PaintMethodsWin32::PaintStyle style)
void clear ()

Protected Attributes

int timeRange
double scale
unsigned long latestTimeStamp
RingBuffer< double, maxNumberOfEntries > valueHistory [numberOfValueIDs]
RingBuffer< unsigned long,
maxNumberOfEntries > 
timeStamps [numberOfValueIDs]
RingBuffer< bool, maxNumberOfEntries > halfSize [numberOfValueIDs]
bool displayValue [numberOfValueIDs]
PaintMethodsWin32::PaintStyle paintStyles [numberOfValueIDs]
bool freeze

Private Member Functions

void saveAllCSV ()

Private Attributes

CRect rect
CDC dcOffScreen
CBitmap * bmpOffScreen
CBitmap * oldBitmap

Detailed Description

A dialog bar to display certain values over time

Definition at line 22 of file ValueHistoryDlgBar.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
IDD 

Definition at line 144 of file ValueHistoryDlgBar.h.

anonymous enum [protected]

The maximum numbers of entries that can be stored per value

Enumerator:
maxNumberOfEntries 

Definition at line 193 of file ValueHistoryDlgBar.h.

enum CValueHistoryDlgBar::valueID

IDs for values to display

Enumerator:
cameraMatrixIsValid 
ballPerceptX 
ballPerceptY 
ballPerceptDistance 
ballPerceptAngle 
ballPerceptDistanceBearingBased 
ballPerceptAngleBearingBased 
ballPerceptDistanceSizeBased 
ballPerceptAngleSizeBased 
ballPositionDistance 
ballPositionAngle 
ballPositionSpeedAbs 
ballPositionSpeedDir 
specialPerceptRobotPoseX 
specialPerceptRobotPoseY 
specialPerceptRobotPoseAngle 
psdPerceptToFarAway 
psdPerceptX 
psdPerceptY 
psdPerceptZ 
robotPoseX 
robotPoseY 
robotPoseAngle 
robotPoseSpeed 
walkSpeedX 
walkSpeedY 
walkSpeedRotation 
positionInWalkCycle 
neckHeightCalculatedFromLegSensors 
neckHeightProvidedByMotionControl 
bodyRollCalculatedFromLegSensors 
bodyRollProvidedByMotionControl 
bodyRollCalculatedFromAccelerationSensors 
bodyTiltCalculatedFromLegSensors 
bodyTiltProvidedByMotionControl 
bodyTiltCalculatedFromAccelerationSensors 
numberOfValueIDs 

Definition at line 26 of file ValueHistoryDlgBar.h.


Constructor & Destructor Documentation

CValueHistoryDlgBar::CValueHistoryDlgBar (  ) 

Default constructor.

Definition at line 34 of file ValueHistoryDlgBar.cpp.

References bmpOffScreen, freeze, and oldBitmap.

CValueHistoryDlgBar::~CValueHistoryDlgBar (  ) 

Destructor

Definition at line 44 of file ValueHistoryDlgBar.cpp.

References bmpOffScreen, dcOffScreen, displayValue, getValueIDName(), numberOfValueIDs, oldBitmap, scale, and timeRange.


Member Function Documentation

void CValueHistoryDlgBar::addValue ( valueID  id,
unsigned long  timeStamp,
double  value,
bool  halfSiz = false 
)

Adds a new value to display

Parameters:
id the id of the value
timeStamp the time when the value was generated
value the value
halfSiz specifies whether the value shall be painted half as large as usual

Definition at line 427 of file ValueHistoryDlgBar.cpp.

References RingBuffer< V, n >::add(), clear(), freeze, halfSize, latestTimeStamp, timeStamps, and valueHistory.

Referenced by handleMessage().

void CValueHistoryDlgBar::clear (  )  [protected]

called to delete every pieces of data added so far

Definition at line 657 of file ValueHistoryDlgBar.cpp.

References freeze, halfSize, RingBuffer< V, n >::init(), latestTimeStamp, numberOfValueIDs, timeStamps, and valueHistory.

Referenced by addValue(), and OnContextMenu().

CValueHistoryDlgBar::DECLARE_MESSAGE_MAP (  )  [protected]

Reimplemented from CDynamicBarDlg.

void CValueHistoryDlgBar::DoDataExchange ( CDataExchange *  pDX  )  [protected, virtual]

Definition at line 60 of file ValueHistoryDlgBar.cpp.

References IDC_VALUE_HISTORY_FREEZE_BUTTON, IDC_VALUE_HISTORY_SCALE_SLIDER, IDC_VALUE_HISTORY_TIME_SLIDER, IDC_VALUE_HISTORY_TIME_STATIC, m_freezeButton, m_scaleSlider, m_timeRangeSlider, and m_timeRangeStatic.

static const char* CValueHistoryDlgBar::getValueIDName ( valueID  id  )  [inline, static]

returns the name for an id

Definition at line 72 of file ValueHistoryDlgBar.h.

References ballPerceptAngle, ballPerceptAngleBearingBased, ballPerceptAngleSizeBased, ballPerceptDistance, ballPerceptDistanceBearingBased, ballPerceptDistanceSizeBased, ballPerceptX, ballPerceptY, ballPositionAngle, ballPositionDistance, ballPositionSpeedAbs, ballPositionSpeedDir, bodyRollCalculatedFromAccelerationSensors, bodyRollCalculatedFromLegSensors, bodyRollProvidedByMotionControl, bodyTiltCalculatedFromAccelerationSensors, bodyTiltCalculatedFromLegSensors, bodyTiltProvidedByMotionControl, cameraMatrixIsValid, neckHeightCalculatedFromLegSensors, neckHeightProvidedByMotionControl, positionInWalkCycle, psdPerceptToFarAway, psdPerceptX, psdPerceptY, psdPerceptZ, robotPoseAngle, robotPoseSpeed, robotPoseX, robotPoseY, specialPerceptRobotPoseAngle, specialPerceptRobotPoseX, specialPerceptRobotPoseY, walkSpeedRotation, walkSpeedX, and walkSpeedY.

Referenced by OnContextMenu(), OnPaint(), saveAllCSV(), and ~CValueHistoryDlgBar().

bool CValueHistoryDlgBar::handleMessage ( InMessage message  )  [virtual]

Called from a MessageQueue to distribute messages

Parameters:
message The message that can be read.
Returns:
true if the message was read (handled).

Reimplemented from CRobotControlDialogBar.

Definition at line 277 of file ValueHistoryDlgBar.cpp.

References Vector2< V >::abs(), addValue(), Vector2< V >::angle(), Geometry::angleTo(), ballPerceptAngle, ballPerceptAngleBearingBased, ballPerceptAngleSizeBased, ballPerceptDistance, ballPerceptDistanceBearingBased, ballPerceptDistanceSizeBased, ballPerceptX, ballPerceptY, ballPositionAngle, ballPositionDistance, ballPositionSpeedAbs, ballPositionSpeedDir, BallPercept::ballWasSeen, InMessage::bin, BodyPosture::bodyRollCalculatedFromAccelerationSensors, bodyRollCalculatedFromAccelerationSensors, BodyPosture::bodyRollCalculatedFromLegSensors, bodyRollCalculatedFromLegSensors, BodyPosture::bodyRollProvidedByMotionControl, bodyRollProvidedByMotionControl, BodyPosture::bodyTiltCalculatedFromAccelerationSensors, bodyTiltCalculatedFromAccelerationSensors, BodyPosture::bodyTiltCalculatedFromLegSensors, bodyTiltCalculatedFromLegSensors, BodyPosture::bodyTiltProvidedByMotionControl, bodyTiltProvidedByMotionControl, cameraMatrixIsValid, SpecialPercept::checkerboard, SpecialPercept::checkerPose, Geometry::distanceTo(), MotionInfo::executedMotionRequest, BodyPosture::frameNumber, MotionRequest::frameNumber, SpecialPercept::frameNumber, CameraMatrix::frameNumber, BallPercept::frameNumber, RobotPose::frameNumber, BallPercept::getAngle(), BallPercept::getAngleBearingBased(), BallPercept::getAngleSizeBased(), BallPercept::getDistance(), BallPercept::getDistanceBearingBased(), BallPercept::getDistanceSizeBased(), InMessage::getMessageID(), BallPercept::getOffsetBearingBased(), idBodyPosture, idMotionInfo, idPercepts, idSpecialPercept, idWorldState, CameraMatrix::isValid, BodyPosture::neckHeightCalculatedFromLegSensors, neckHeightCalculatedFromLegSensors, BodyPosture::neckHeightProvidedByMotionControl, neckHeightProvidedByMotionControl, PSDPercept::numOfPercepts, MotionInfo::positionInWalkCycle, positionInWalkCycle, psdPerceptToFarAway, psdPerceptX, psdPerceptY, psdPerceptZ, RECEIVE_PERCEPTS, RECEIVE_WORLDSTATE, robotPoseAngle, robotPoseSpeed, robotPoseX, robotPoseY, Pose2D::rotation, BallModel::seen, specialPerceptRobotPoseAngle, specialPerceptRobotPoseX, specialPerceptRobotPoseY, SeenBallPosition::speed, toDegrees(), Pose2D::translation, SpecialPercept::type, WalkRequest::walkParams, MotionRequest::walkRequest, walkSpeedRotation, walkSpeedX, walkSpeedY, Vector2< V >::x, and Vector2< V >::y.

void CValueHistoryDlgBar::OnContextMenu ( CWnd *  pWnd,
CPoint  point 
) [protected]

Definition at line 672 of file ValueHistoryDlgBar.cpp.

References clear(), displayValue, getValueIDName(), numberOfValueIDs, saveAllCSV(), and VERIFY.

void CValueHistoryDlgBar::OnFreezeButton (  )  [protected]

Definition at line 724 of file ValueHistoryDlgBar.cpp.

References freeze, and m_freezeButton.

void CValueHistoryDlgBar::OnHScroll ( UINT  nSBCode,
UINT  nPos,
CScrollBar *  pScrollBar 
) [protected]

Definition at line 709 of file ValueHistoryDlgBar.cpp.

References m_scaleSlider, m_timeRangeSlider, m_timeRangeStatic, scale, text, and timeRange.

BOOL CValueHistoryDlgBar::OnInitDialog (  )  [protected, virtual]

Reimplemented from CDynamicDialog.

Definition at line 83 of file ValueHistoryDlgBar.cpp.

References PaintMethodsWin32::PaintStyle::cross, PaintMethodsWin32::PaintStyle::filledCircle, PaintMethodsWin32::PaintStyle::filledSquare, PaintMethodsWin32::PaintStyle::horizontalLine, CDynamicDialog::OnInitDialog(), PaintMethodsWin32::PaintStyle::square, text, TRUE, and PaintMethodsWin32::PaintStyle::vcross.

void CValueHistoryDlgBar::OnPaint (  )  [protected]

Definition at line 451 of file ValueHistoryDlgBar.cpp.

References dcOffScreen, displayValue, FALSE, getValueIDName(), halfSize, int(), latestTimeStamp, maxNumberOfEntries, numberOfValueIDs, paintStyles, paintValue(), rect, scale, text, timeRange, timeStamps, and valueHistory.

void CValueHistoryDlgBar::OnSize ( UINT  nType,
int  cx,
int  cy 
) [protected]

Reimplemented from CDynamicDialog.

Definition at line 628 of file ValueHistoryDlgBar.cpp.

References bmpOffScreen, dcOffScreen, oldBitmap, CDynamicDialog::OnSize(), and rect.

void CValueHistoryDlgBar::paintValue ( int  x,
int  y,
int  size,
PaintMethodsWin32::PaintStyle  style 
) [protected]

Paints a value to a given position

Definition at line 570 of file ValueHistoryDlgBar.cpp.

References PaintMethodsWin32::PaintStyle::brushColor, PaintMethodsWin32::PaintStyle::circle, PaintMethodsWin32::PaintStyle::cross, dcOffScreen, PaintMethodsWin32::PaintStyle::filledCircle, PaintMethodsWin32::PaintStyle::filledSquare, PaintMethodsWin32::PaintStyle::horizontalLine, PaintMethodsWin32::PaintStyle::penColor, PaintMethodsWin32::PaintStyle::penWidth, PaintMethodsWin32::PaintStyle::shape, PaintMethodsWin32::PaintStyle::square, and PaintMethodsWin32::PaintStyle::vcross.

Referenced by OnPaint().

void CValueHistoryDlgBar::saveAllCSV (  )  [private]

saves all data to a CSV (comma separated values) file (separate time lines for all data

Definition at line 732 of file ValueHistoryDlgBar.cpp.

References endl(), File::getGTDir(), RingBuffer< V, n >::getNumberOfEntries(), getValueIDName(), maxNumberOfEntries, numberOfValueIDs, timeStamps, and valueHistory.

Referenced by OnContextMenu().


Member Data Documentation

CBitmap* CValueHistoryDlgBar::bmpOffScreen [private]

Definition at line 173 of file ValueHistoryDlgBar.h.

Referenced by CValueHistoryDlgBar(), OnSize(), and ~CValueHistoryDlgBar().

CDC CValueHistoryDlgBar::dcOffScreen [private]

Definition at line 172 of file ValueHistoryDlgBar.h.

Referenced by OnPaint(), OnSize(), paintValue(), and ~CValueHistoryDlgBar().

bool CValueHistoryDlgBar::displayValue[numberOfValueIDs] [protected]

If the values shall be dislplayed

Definition at line 205 of file ValueHistoryDlgBar.h.

Referenced by OnContextMenu(), OnPaint(), and ~CValueHistoryDlgBar().

bool CValueHistoryDlgBar::freeze [protected]

if true, no new values are added

Definition at line 214 of file ValueHistoryDlgBar.h.

Referenced by addValue(), clear(), CValueHistoryDlgBar(), and OnFreezeButton().

RingBuffer<bool,maxNumberOfEntries> CValueHistoryDlgBar::halfSize[numberOfValueIDs] [protected]

The half size history for each value

Definition at line 202 of file ValueHistoryDlgBar.h.

Referenced by addValue(), clear(), and OnPaint().

unsigned long CValueHistoryDlgBar::latestTimeStamp [protected]

The last received time stamp

Definition at line 190 of file ValueHistoryDlgBar.h.

Referenced by addValue(), clear(), and OnPaint().

CButton CValueHistoryDlgBar::m_freezeButton

Definition at line 148 of file ValueHistoryDlgBar.h.

Referenced by DoDataExchange(), and OnFreezeButton().

CSliderCtrl CValueHistoryDlgBar::m_scaleSlider

Definition at line 145 of file ValueHistoryDlgBar.h.

Referenced by DoDataExchange(), and OnHScroll().

CSliderCtrl CValueHistoryDlgBar::m_timeRangeSlider

Definition at line 146 of file ValueHistoryDlgBar.h.

Referenced by DoDataExchange(), and OnHScroll().

CStatic CValueHistoryDlgBar::m_timeRangeStatic

Definition at line 147 of file ValueHistoryDlgBar.h.

Referenced by DoDataExchange(), and OnHScroll().

CBitmap* CValueHistoryDlgBar::oldBitmap [private]

Definition at line 174 of file ValueHistoryDlgBar.h.

Referenced by CValueHistoryDlgBar(), OnSize(), and ~CValueHistoryDlgBar().

PaintMethodsWin32::PaintStyle CValueHistoryDlgBar::paintStyles[numberOfValueIDs] [protected]

The paint style for each value

Definition at line 208 of file ValueHistoryDlgBar.h.

Referenced by OnPaint().

CRect CValueHistoryDlgBar::rect [private]

Definition at line 171 of file ValueHistoryDlgBar.h.

Referenced by OnPaint(), and OnSize().

double CValueHistoryDlgBar::scale [protected]

zoom factor for the values displayed in the dialog

Definition at line 187 of file ValueHistoryDlgBar.h.

Referenced by OnHScroll(), OnPaint(), and ~CValueHistoryDlgBar().

int CValueHistoryDlgBar::timeRange [protected]

the range of time that is displayed in the dialog (in seconds )

Definition at line 184 of file ValueHistoryDlgBar.h.

Referenced by OnHScroll(), OnPaint(), and ~CValueHistoryDlgBar().

RingBuffer<unsigned long,maxNumberOfEntries> CValueHistoryDlgBar::timeStamps[numberOfValueIDs] [protected]

The time stamp history for each value

Definition at line 199 of file ValueHistoryDlgBar.h.

Referenced by addValue(), clear(), OnPaint(), and saveAllCSV().

RingBuffer<double,maxNumberOfEntries> CValueHistoryDlgBar::valueHistory[numberOfValueIDs] [protected]

The valueHistory for each value

Definition at line 196 of file ValueHistoryDlgBar.h.

Referenced by addValue(), clear(), OnPaint(), and saveAllCSV().


The documentation for this class was generated from the following files:
Generated on Thu Dec 7 01:26:39 2006 for DT2005.panorama by  doxygen 1.4.7