CTimeDiagramDlgBar Class Reference

#include <TimeDiagramDlgBar.h>

Inheritance diagram for CTimeDiagramDlgBar:

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

Public Types

 IDD = IDD_DIALOG_BAR_TIME_DIAGRAM
enum  { IDD = IDD_DIALOG_BAR_TIME_DIAGRAM }

Public Member Functions

 CTimeDiagramDlgBar ()
 ~CTimeDiagramDlgBar ()
virtual bool handleMessage (InMessage &message)

Public Attributes

CStatic m_static1
CSliderCtrl m_averageSlider
CComboBox m_stopCombo

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 OnSelchangeStopCombo ()
afx_msg void OnHScroll (UINT nSBCode, UINT nPos, CScrollBar *pScrollBar)
 DECLARE_MESSAGE_MAP ()

Private Types

 displayLogFiles
 stopTimesOnRobot
 stopTimesLocal
 millisecondsPerView = 100
 ringBufferSize = 500
enum  StopMode { displayLogFiles, stopTimesOnRobot, stopTimesLocal }
enum  { millisecondsPerView = 100, ringBufferSize = 500 }

Private Member Functions

void deleteBrushes ()
void createBrushes ()
void saveCurrentSelection ()
void loadSelection ()
void unselectAll ()
void exportToFileAsCSV ()
void calculateAverageValues (Stopwatch::StopwatchEventID stopwatchEventID)
void clearBuffers ()

Private Attributes

enum CTimeDiagramDlgBar::StopMode stopMode
CRect rect
CDC dcOffScreen
CBitmap * bmpOffScreen
CBitmap * oldBitmap
CBrush brush [Stopwatch::numberOfStopwatchEventIDs]
COLORREF crColor [Stopwatch::numberOfStopwatchEventIDs]
CBrush * oldBrush
int averageRange
bool showTime [Stopwatch::numberOfStopwatchEventIDs]
int numberOfSelectedTimes
RingBuffer< unsigned long,
ringBufferSize > 
startTime [Stopwatch::numberOfStopwatchEventIDs]
RingBuffer< unsigned long,
ringBufferSize > 
measuredTime [Stopwatch::numberOfStopwatchEventIDs]
RingBuffer< unsigned long,
ringBufferSize > 
counter [Stopwatch::numberOfStopwatchEventIDs]
double averageMeasuredTime [Stopwatch::numberOfStopwatchEventIDs]
double averageFrequency [Stopwatch::numberOfStopwatchEventIDs]
unsigned long maxMeasuredTime [Stopwatch::numberOfStopwatchEventIDs]
unsigned long minMeasuredTime [Stopwatch::numberOfStopwatchEventIDs]

Detailed Description

A dialog bar to view time diagrams

Definition at line 25 of file TimeDiagramDlgBar.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
IDD 

Definition at line 43 of file TimeDiagramDlgBar.h.

anonymous enum [private]

Enumerator:
millisecondsPerView 
ringBufferSize 

Definition at line 92 of file TimeDiagramDlgBar.h.

enum CTimeDiagramDlgBar::StopMode [private]

Enumerator:
displayLogFiles 
stopTimesOnRobot 
stopTimesLocal 

Definition at line 70 of file TimeDiagramDlgBar.h.


Constructor & Destructor Documentation

CTimeDiagramDlgBar::CTimeDiagramDlgBar (  ) 

Default constructor.

Definition at line 15 of file TimeDiagramDlgBar.cpp.

References bmpOffScreen, and oldBitmap.

CTimeDiagramDlgBar::~CTimeDiagramDlgBar (  ) 

Definition at line 24 of file TimeDiagramDlgBar.cpp.

References averageRange, bmpOffScreen, dcOffScreen, deleteBrushes(), oldBitmap, and saveCurrentSelection().


Member Function Documentation

void CTimeDiagramDlgBar::calculateAverageValues ( Stopwatch::StopwatchEventID  stopwatchEventID  )  [private]

Definition at line 389 of file TimeDiagramDlgBar.cpp.

References averageFrequency, averageMeasuredTime, averageRange, counter, RingBuffer< V, n >::getEntry(), RingBuffer< V, n >::getNumberOfEntries(), maxMeasuredTime, measuredTime, minMeasuredTime, and startTime.

Referenced by handleMessage(), and OnHScroll().

void CTimeDiagramDlgBar::clearBuffers (  )  [private]

clears all time buffers in the dialog

Definition at line 413 of file TimeDiagramDlgBar.cpp.

References averageFrequency, averageMeasuredTime, counter, displayLogFiles, RingBuffer< V, n >::init(), loadSelection(), maxMeasuredTime, measuredTime, minMeasuredTime, Stopwatch::numberOfStopwatchEventIDs, showTime, startTime, and stopMode.

Referenced by handleMessage(), and OnSelchangeStopCombo().

void CTimeDiagramDlgBar::createBrushes (  )  [private]

Definition at line 519 of file TimeDiagramDlgBar.cpp.

References Stopwatch::ballLocator, brush, crColor, Stopwatch::imageProcessor, Stopwatch::numberOfStopwatchEventIDs, and Stopwatch::selfLocator.

CTimeDiagramDlgBar::DECLARE_MESSAGE_MAP (  )  [protected]

Reimplemented from CDynamicBarDlg.

void CTimeDiagramDlgBar::deleteBrushes (  )  [private]

Definition at line 533 of file TimeDiagramDlgBar.cpp.

References brush, and Stopwatch::numberOfStopwatchEventIDs.

Referenced by ~CTimeDiagramDlgBar().

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

Definition at line 38 of file TimeDiagramDlgBar.cpp.

References IDC_TD_AVERAGE_SLIDER, IDC_TD_STATIC1, IDC_TD_STOP_COMBO, m_averageSlider, m_static1, and m_stopCombo.

void CTimeDiagramDlgBar::exportToFileAsCSV (  )  [private]

Definition at line 680 of file TimeDiagramDlgBar.cpp.

References averageFrequency, averageMeasuredTime, endl(), File::getGTDir(), Stopwatch::getStopwatchEventIDName(), maxMeasuredTime, minMeasuredTime, Stopwatch::numberOfStopwatchEventIDs, and showTime.

Referenced by OnContextMenu().

bool CTimeDiagramDlgBar::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 345 of file TimeDiagramDlgBar.cpp.

References RingBuffer< V, n >::add(), averageMeasuredTime, InMessage::bin, calculateAverageValues(), clearBuffers(), counter, displayLogFiles, InMessage::getMessageID(), idStopwatch, maxMeasuredTime, measuredTime, minMeasuredTime, numberOfSelectedTimes, showTime, startTime, and stopMode.

void CTimeDiagramDlgBar::loadSelection (  )  [private]

Definition at line 594 of file TimeDiagramDlgBar.cpp.

References DebugKey::always, DebugKey::disabled, displayLogFiles, CRobotControlDebugKeyTables::forPhysicalRobots, CRobotControlDebugKeyTables::forSimulatedRobots, Stopwatch::getDebugKeyID(), getDebugKeyTables(), Stopwatch::getStopwatchEventIDName(), Stopwatch::imageProcessor, numberOfSelectedTimes, Stopwatch::numberOfStopwatchEventIDs, Stopwatch::selfLocator, DebugKeyTable::set(), showTime, stopMode, stopTimesLocal, and stopTimesOnRobot.

Referenced by clearBuffers(), and OnSelchangeStopCombo().

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

Definition at line 435 of file TimeDiagramDlgBar.cpp.

References DebugKey::always, DebugKey::disabled, displayLogFiles, exportToFileAsCSV(), CRobotControlDebugKeyTables::forPhysicalRobots, CRobotControlDebugKeyTables::forSimulatedRobots, Stopwatch::getDebugKeyID(), getDebugKeyTables(), Stopwatch::getStopwatchEventIDName(), numberOfSelectedTimes, Stopwatch::numberOfStopwatchEventIDs, CRobotControlDebugKeyTables::sendForPhysicalRobots(), CRobotControlDebugKeyTables::sendForSimulatedRobots(), DebugKeyTable::set(), showTime, stopMode, stopTimesLocal, stopTimesOnRobot, and VERIFY.

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

Definition at line 727 of file TimeDiagramDlgBar.cpp.

References averageRange, calculateAverageValues(), m_averageSlider, m_static1, Stopwatch::numberOfStopwatchEventIDs, and text.

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

Reimplemented from CDynamicDialog.

Definition at line 60 of file TimeDiagramDlgBar.cpp.

References CDynamicDialog::OnInitDialog(), text, and TRUE.

void CTimeDiagramDlgBar::OnPaint (  )  [protected]

Definition at line 87 of file TimeDiagramDlgBar.cpp.

References averageFrequency, averageMeasuredTime, brush, dcOffScreen, FALSE, RingBuffer< V, n >::getEntry(), Stopwatch::getStopwatchEventIDName(), CDynamicWnd::Layout(), maxMeasuredTime, measuredTime, millisecondsPerView, minMeasuredTime, numberOfSelectedTimes, Stopwatch::numberOfStopwatchEventIDs, rect, showTime, and startTime.

void CTimeDiagramDlgBar::OnSelchangeStopCombo (  )  [protected]

Definition at line 542 of file TimeDiagramDlgBar.cpp.

References clearBuffers(), displayLogFiles, getDebugKeyTables(), loadSelection(), m_stopCombo, saveCurrentSelection(), CRobotControlDebugKeyTables::sendForPhysicalRobots(), CRobotControlDebugKeyTables::sendForSimulatedRobots(), stopMode, stopTimesLocal, stopTimesOnRobot, and unselectAll().

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

Reimplemented from CDynamicDialog.

Definition at line 318 of file TimeDiagramDlgBar.cpp.

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

void CTimeDiagramDlgBar::saveCurrentSelection (  )  [private]

Definition at line 655 of file TimeDiagramDlgBar.cpp.

References displayLogFiles, Stopwatch::getStopwatchEventIDName(), Stopwatch::numberOfStopwatchEventIDs, showTime, stopMode, stopTimesLocal, and stopTimesOnRobot.

Referenced by OnSelchangeStopCombo(), and ~CTimeDiagramDlgBar().

void CTimeDiagramDlgBar::unselectAll (  )  [private]

Definition at line 577 of file TimeDiagramDlgBar.cpp.

References DebugKey::disabled, CRobotControlDebugKeyTables::forPhysicalRobots, CRobotControlDebugKeyTables::forSimulatedRobots, Stopwatch::getDebugKeyID(), getDebugKeyTables(), numberOfSelectedTimes, Stopwatch::numberOfStopwatchEventIDs, DebugKeyTable::set(), and showTime.

Referenced by OnSelchangeStopCombo().


Member Data Documentation

double CTimeDiagramDlgBar::averageFrequency[Stopwatch::numberOfStopwatchEventIDs] [private]

Definition at line 107 of file TimeDiagramDlgBar.h.

Referenced by calculateAverageValues(), clearBuffers(), exportToFileAsCSV(), and OnPaint().

double CTimeDiagramDlgBar::averageMeasuredTime[Stopwatch::numberOfStopwatchEventIDs] [private]

Definition at line 106 of file TimeDiagramDlgBar.h.

Referenced by calculateAverageValues(), clearBuffers(), exportToFileAsCSV(), handleMessage(), and OnPaint().

int CTimeDiagramDlgBar::averageRange [private]

the range over that average times and average frequencies are calculated

Definition at line 95 of file TimeDiagramDlgBar.h.

Referenced by calculateAverageValues(), OnHScroll(), and ~CTimeDiagramDlgBar().

CBitmap* CTimeDiagramDlgBar::bmpOffScreen [private]

Definition at line 85 of file TimeDiagramDlgBar.h.

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

CBrush CTimeDiagramDlgBar::brush[Stopwatch::numberOfStopwatchEventIDs] [private]

Definition at line 88 of file TimeDiagramDlgBar.h.

Referenced by createBrushes(), deleteBrushes(), and OnPaint().

RingBuffer<unsigned long, ringBufferSize> CTimeDiagramDlgBar::counter[Stopwatch::numberOfStopwatchEventIDs] [private]

Definition at line 104 of file TimeDiagramDlgBar.h.

Referenced by calculateAverageValues(), clearBuffers(), and handleMessage().

COLORREF CTimeDiagramDlgBar::crColor[Stopwatch::numberOfStopwatchEventIDs] [private]

Definition at line 89 of file TimeDiagramDlgBar.h.

Referenced by createBrushes().

CDC CTimeDiagramDlgBar::dcOffScreen [private]

Definition at line 84 of file TimeDiagramDlgBar.h.

Referenced by OnPaint(), OnSize(), and ~CTimeDiagramDlgBar().

CSliderCtrl CTimeDiagramDlgBar::m_averageSlider

Definition at line 45 of file TimeDiagramDlgBar.h.

Referenced by DoDataExchange(), and OnHScroll().

CStatic CTimeDiagramDlgBar::m_static1

Definition at line 44 of file TimeDiagramDlgBar.h.

Referenced by DoDataExchange(), and OnHScroll().

CComboBox CTimeDiagramDlgBar::m_stopCombo

Definition at line 46 of file TimeDiagramDlgBar.h.

Referenced by DoDataExchange(), and OnSelchangeStopCombo().

unsigned long CTimeDiagramDlgBar::maxMeasuredTime[Stopwatch::numberOfStopwatchEventIDs] [private]

Definition at line 108 of file TimeDiagramDlgBar.h.

Referenced by calculateAverageValues(), clearBuffers(), exportToFileAsCSV(), handleMessage(), and OnPaint().

RingBuffer<unsigned long, ringBufferSize> CTimeDiagramDlgBar::measuredTime[Stopwatch::numberOfStopwatchEventIDs] [private]

Definition at line 103 of file TimeDiagramDlgBar.h.

Referenced by calculateAverageValues(), clearBuffers(), handleMessage(), and OnPaint().

unsigned long CTimeDiagramDlgBar::minMeasuredTime[Stopwatch::numberOfStopwatchEventIDs] [private]

Definition at line 109 of file TimeDiagramDlgBar.h.

Referenced by calculateAverageValues(), clearBuffers(), exportToFileAsCSV(), handleMessage(), and OnPaint().

int CTimeDiagramDlgBar::numberOfSelectedTimes [private]

Definition at line 99 of file TimeDiagramDlgBar.h.

Referenced by handleMessage(), loadSelection(), OnContextMenu(), OnPaint(), and unselectAll().

CBitmap* CTimeDiagramDlgBar::oldBitmap [private]

Definition at line 86 of file TimeDiagramDlgBar.h.

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

CBrush* CTimeDiagramDlgBar::oldBrush [private]

Definition at line 90 of file TimeDiagramDlgBar.h.

CRect CTimeDiagramDlgBar::rect [private]

Definition at line 82 of file TimeDiagramDlgBar.h.

Referenced by OnPaint(), and OnSize().

bool CTimeDiagramDlgBar::showTime[Stopwatch::numberOfStopwatchEventIDs] [private]

Definition at line 98 of file TimeDiagramDlgBar.h.

Referenced by clearBuffers(), exportToFileAsCSV(), handleMessage(), loadSelection(), OnContextMenu(), OnPaint(), saveCurrentSelection(), and unselectAll().

RingBuffer<unsigned long, ringBufferSize> CTimeDiagramDlgBar::startTime[Stopwatch::numberOfStopwatchEventIDs] [private]

Definition at line 102 of file TimeDiagramDlgBar.h.

Referenced by calculateAverageValues(), clearBuffers(), handleMessage(), and OnPaint().

enum CTimeDiagramDlgBar::StopMode CTimeDiagramDlgBar::stopMode [private]

Referenced by clearBuffers(), handleMessage(), loadSelection(), OnContextMenu(), OnSelchangeStopCombo(), and saveCurrentSelection().


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