Garmin Fleet Management Controller  2.19.0
CLogViewerDlg.cpp
Go to the documentation of this file.
1 /*********************************************************************
2 *
3 * MODULE NAME:
4 * CLogViewerDlg.cpp
5 *
6 * Copyright 2008-2009 by Garmin Ltd. or its subsidiaries.
7 *---------------------------------------------------------------------
8 * $NoKeywords$
9 *********************************************************************/
10 
11 #include "stdafx.h"
12 #include "CLogViewerDlg.h"
13 #include "Logger.h"
14 #include "SerialPort.h"
15 
16 #define EDGE_SPACING 7
17 
18 using namespace std;
19 
20 IMPLEMENT_DYNAMIC( CLogViewerDlg, CDialog )
21 
22 BEGIN_MESSAGE_MAP( CLogViewerDlg, CDialog )
23  ON_BN_CLICKED( IDOK, OnBnClickedOk )
24  ON_WM_SIZE()
25  ON_WM_GETMINMAXINFO()
26  ON_LBN_SELCHANGE( IDC_LOG_LST_PACKETS, OnLbnSelchangeLog )
27  ON_BN_CLICKED( IDC_LOG_BTN_VIEW_OTHER, OnBnClickedViewOther )
28  ON_BN_CLICKED( IDC_LOG_BTN_VIEW_CURRENT, OnBnClickedViewCurrent )
29  ON_BN_CLICKED( IDC_LOG_BTN_CLEAR, OnBnClickedClearLog )
30  ON_BN_CLICKED( IDC_LOG_BTN_SAVE_AS, OnBnClickedSaveAs )
31  ON_BN_CLICKED( IDC_LOG_BTN_FIND_NEXT, OnBnClickedFindNext )
32  ON_MESSAGE( WM_EVENT( EVENT_LOG_PACKET ), OnPacketLogged )
33  #if( FMI_SUPPORT_A602 )
34  ON_BN_CLICKED( IDC_LOG_BTN_RESEND, resendPacket )
35  #endif
36 END_MESSAGE_MAP()
37 
38 //----------------------------------------------------------------------
45 //----------------------------------------------------------------------
46 CLogViewerDlg::CLogViewerDlg
47  (
48  LogParser * aLogParser,
49  CWnd * aParentWnd,
50  BOOL aOpenOtherLog
51  )
52  : CDialog( IDD_LOG, aParentWnd )
53  , mSelectedPacketText( _T("") )
54  , mSearchDirection( SEARCH_DOWN )
55  , mLogParser( aLogParser )
56 {
57 mOpenOtherLog = aOpenOtherLog;
58 }
59 
60 //----------------------------------------------------------------------
62 //----------------------------------------------------------------------
64 {
65 }
66 
67 //----------------------------------------------------------------------
70 //----------------------------------------------------------------------
72  (
73  CDataExchange * aDataExchange
74  )
75 {
76  CDialog::DoDataExchange( aDataExchange );
77  DDX_Text( aDataExchange, IDC_LOG_TXT_SELECTED_PACKET, mSelectedPacketText );
78  DDX_Text( aDataExchange, IDC_LOG_EDIT_SEARCH_TEXT, mSearchText );
79  DDX_Control( aDataExchange, IDC_LOG_LST_PACKETS, mPacketListBox );
80  DDX_Control( aDataExchange, IDC_LOG_TXT_SELECTED_PACKET, mCurrentPacketControl );
81  DDX_Control( aDataExchange, IDOK, mCloseButton );
82  DDX_Control( aDataExchange, IDC_LOG_BTN_VIEW_OTHER, mViewOtherButton );
83  DDX_Control( aDataExchange, IDC_LOG_BTN_VIEW_CURRENT, mViewCurrentButton );
84  DDX_Control( aDataExchange, IDC_LOG_LBL_SELECTED_PACKET, mCurrentPacketTitleLabel );
85  DDX_Control( aDataExchange, IDC_LOG_LBL_PACKETS, mPacketListTitleLabel );
86  DDX_Control( aDataExchange, IDC_LOG_LBL_LOG_NAME, mLogNameTitleLabel );
87  DDX_Control( aDataExchange, IDC_LOG_TXT_LOG_NAME, mLogNameControl );
88  DDX_Control( aDataExchange, IDC_LOG_BTN_SAVE_AS, mSaveButton );
89  DDX_Control( aDataExchange, IDC_LOG_BTN_CLEAR, mClearButton );
90  DDX_Control( aDataExchange, IDC_LOG_BTN_FIND_NEXT, mFindNextButton );
91  DDX_Control( aDataExchange, IDC_LOG_RDO_UP, mSearchUpRadioButton );
92  DDX_Control( aDataExchange, IDC_LOG_RDO_DOWN, mSearchDownRadioButton );
93  DDX_Control( aDataExchange, IDC_LOG_EDIT_SEARCH_TEXT, mSearchTextControl );
94  DDX_Control( aDataExchange, IDC_LOG_GRP_SEARCH, mSearchGroupBox );
95  DDX_Control( aDataExchange, IDC_LOG_BTN_RESEND, mResendButton );
96  DDX_Radio( aDataExchange, IDC_LOG_RDO_UP, mSearchDirection );
97 }
98 
99 //----------------------------------------------------------------------
107 //----------------------------------------------------------------------
109 {
110  CDialog::OnInitDialog();
111 
112  if( mOpenOtherLog )
113  {
114  mOpenOtherLog = FALSE;
115  OnBnClickedViewOther();
116  }
117  else
118  {
119  mLogParser->init( CString( Logger::LOG_FILE ) );
120  resetView();
121  UpdateLogDisplay();
122  }
123  UpdateData( FALSE );
124  SetWindowPos( NULL, 500, 350, 0, 0, SWP_NOZORDER );
125  return TRUE;
126 } /* OnInitDialog() */
127 
128 //----------------------------------------------------------------------
132 //----------------------------------------------------------------------
133 afx_msg LPARAM CLogViewerDlg::OnPacketLogged( WPARAM, LPARAM )
134 {
135  UpdateLogDisplay();
136  return 0;
137 } /* OnPacketLogged() */
138 
139 //----------------------------------------------------------------------
143 //----------------------------------------------------------------------
145 {
146  BOOL scroll = FALSE;
147  int maxScroll;
148  int scrolledTo;
149 
150  scrolledTo = mPacketListBox.GetScrollPos( SB_VERT );
151  maxScroll = mPacketListBox.GetScrollLimit( SB_VERT );
152 
153  if( scrolledTo == maxScroll )
154  {
155  scroll = TRUE;
156  }
157 
158  if( updateView() && scroll )
159  {
160  mPacketListBox.SetTopIndex( mPacketListBox.GetCount() - 1 );
161  }
162 }
163 
164 //----------------------------------------------------------------------
168 //----------------------------------------------------------------------
170 {
171  UpdateData( TRUE );
172 
173  mLogParser->readLog();
174  while( mPacketListBox.GetCount() < mLogParser->getLineCount() )
175  {
176  mPacketListBox.AddString( mLogParser->getPacketTitle( mPacketListBox.GetCount() ) );
177  }
178 
179  UpdateData( FALSE );
180 
181  return TRUE;
182 }
183 
184 //----------------------------------------------------------------------
186 //----------------------------------------------------------------------
188 {
189  DestroyWindow();
190  //not modal so don't call OnOK()
191 } /* OnBnClickedOk */
192 
193 //----------------------------------------------------------------------
195 //----------------------------------------------------------------------
197 {
198  DestroyWindow();
199 } /* OnCancel */
200 
201 //----------------------------------------------------------------------
209 //----------------------------------------------------------------------
211 {
212  CDialog::PostNcDestroy();
213 
215 } /* PostNcDestroy() */
216 
217 //----------------------------------------------------------------------
231 //----------------------------------------------------------------------
233  (
234  UINT aType,
235  int aClientWidth,
236  int aClientHeight
237  )
238 {
239  CDialog::OnSize( aType, aClientWidth, aClientHeight );
240 
241  //check to make sure dialog is initialized...
242  //only need to check one field
243  if( mPacketListTitleLabel.GetSafeHwnd() != NULL )
244  {
245  UpdateData( FALSE );
246  //-----------------------------------------------------------------
247  //move the search group box
248  CRect searchGroupRect;
249  mSearchGroupBox.GetClientRect( &searchGroupRect );
250  searchGroupRect.MoveToX( EDGE_SPACING );
251  searchGroupRect.MoveToY( aClientHeight - searchGroupRect.Height() - EDGE_SPACING );
252  mSearchGroupBox.MoveWindow( searchGroupRect );
253 
254  //move radio buttons
255  CRect upRadioRect;
256  mSearchUpRadioButton.GetClientRect( &upRadioRect );
257  upRadioRect.MoveToX( searchGroupRect.CenterPoint().x - upRadioRect.Width() - 2 );
258  upRadioRect.MoveToY( searchGroupRect.top + 10 );
259  mSearchUpRadioButton.MoveWindow( upRadioRect );
260 
261  CRect downRadioRect;
262  mSearchDownRadioButton.GetClientRect( &downRadioRect );
263  downRadioRect.MoveToX( searchGroupRect.CenterPoint().x + 2 );
264  downRadioRect.MoveToY( upRadioRect.top );
265  mSearchDownRadioButton.MoveWindow( downRadioRect );
266 
267  //move edit box
268  CRect findEditRect;
269  mSearchTextControl.GetWindowRect( &findEditRect );
270  findEditRect.MoveToX( searchGroupRect.left + EDGE_SPACING );
271  findEditRect.MoveToY( upRadioRect.bottom + 2 );
272  mSearchTextControl.MoveWindow( findEditRect );
273 
274  //move 'find next' button
275  CRect findNextRect;
276  mFindNextButton.GetWindowRect( &findNextRect );
277  findNextRect.MoveToXY( findEditRect.right + EDGE_SPACING, findEditRect.top );
278  mFindNextButton.MoveWindow( findNextRect );
279 
280  //-----------------------------------------------------------------
281  //resize the packet list
282  CRect packetListTitleRect;
283  mPacketListTitleLabel.GetWindowRect( &packetListTitleRect );
284  packetListTitleRect.MoveToXY( EDGE_SPACING, EDGE_SPACING );
285  mPacketListTitleLabel.MoveWindow( packetListTitleRect );
286 
287  CRect packetListRect;
288  mPacketListBox.GetWindowRect( &packetListRect );
289  packetListRect.MoveToXY( EDGE_SPACING, packetListTitleRect.bottom + 2 );
290  packetListRect.bottom = searchGroupRect.top - 15; // consume available height
291  mPacketListBox.MoveWindow( packetListRect );
292 
293  //-----------------------------------------------------------------
294  //move the "Viewing:" text to be bottom-aligned with the list box
295  CRect logNameTitleRect;
296  mLogNameTitleLabel.GetWindowRect( &logNameTitleRect );
297  logNameTitleRect.MoveToXY
298  (
299  packetListRect.right + 15,
300  packetListRect.bottom - logNameTitleRect.Height()
301  );
302  mLogNameTitleLabel.MoveWindow( logNameTitleRect );
303 
304  CRect logNameRect;
305  mLogNameControl.GetWindowRect( &logNameRect );
306  logNameRect.MoveToXY( logNameTitleRect.right + 4, logNameTitleRect.top );
307  logNameRect.right = aClientWidth - EDGE_SPACING; // consume available space
308  mLogNameControl.MoveWindow( logNameRect );
309 
310  //-----------------------------------------------------------------
311  //move the text above the packet information window
312  //resize and move the packet information window
313  CRect currentPacketTitleRect;
314  mCurrentPacketTitleLabel.GetWindowRect( &currentPacketTitleRect );
315  currentPacketTitleRect.MoveToXY( packetListRect.right + 15, EDGE_SPACING );
316  mCurrentPacketTitleLabel.MoveWindow( currentPacketTitleRect );
317 
318  CRect currentPacketRect;
319  mCurrentPacketControl.GetWindowRect( &currentPacketRect );
320  currentPacketRect.MoveToXY( currentPacketTitleRect.left, packetListRect.top );
321  currentPacketRect.right = aClientWidth - EDGE_SPACING;
322  currentPacketRect.bottom = logNameRect.top - EDGE_SPACING;
323  mCurrentPacketControl.MoveWindow( currentPacketRect );
324 
325  mLogParser->setRenderWidth( currentPacketRect.Width() );
326 
327  //-----------------------------------------------------------------
328  // move the buttons; these are in a 3x2 grid with half-button-width
329  // padding on each side, and equal spacing
330  CRect buttonGroupRect;
331  buttonGroupRect.SetRect( currentPacketRect.left, searchGroupRect.top, aClientWidth - EDGE_SPACING, aClientHeight - EDGE_SPACING );
332 
333  CRect buttonRect;
334  mCloseButton.GetWindowRect( &buttonRect );
335  int buttonSpacing = ( buttonGroupRect.Width() - 4 * buttonRect.Width() ) / 4;
336 
337  buttonRect.MoveToXY
338  (
339  buttonGroupRect.CenterPoint().x - 3 * buttonRect.Width() / 2 - buttonSpacing,
340  buttonGroupRect.top
341  );
342  mResendButton.MoveWindow( buttonRect );
343 
344  buttonRect.MoveToXY
345  (
346  buttonGroupRect.CenterPoint().x - buttonRect.Width() / 2,
347  buttonGroupRect.top
348  );
349  mClearButton.MoveWindow( buttonRect );
350 
351  buttonRect.MoveToXY
352  (
353  buttonGroupRect.CenterPoint().x + buttonRect.Width() / 2 + buttonSpacing,
354  buttonGroupRect.top
355  );
356  mSaveButton.MoveWindow( buttonRect );
357 
358  buttonRect.MoveToXY
359  (
360  buttonGroupRect.CenterPoint().x - 3 * buttonRect.Width() / 2 - buttonSpacing,
361  buttonGroupRect.bottom - buttonRect.Height()
362  );
363  mViewOtherButton.MoveWindow( buttonRect );
364 
365  buttonRect.MoveToXY
366  (
367  buttonGroupRect.CenterPoint().x - buttonRect.Width() / 2,
368  buttonGroupRect.bottom - buttonRect.Height()
369  );
370  mViewCurrentButton.MoveWindow( buttonRect );
371 
372  buttonRect.MoveToXY
373  (
374  buttonGroupRect.CenterPoint().x + buttonRect.Width() / 2 + buttonSpacing,
375  buttonGroupRect.bottom - buttonRect.Height()
376  );
377  mCloseButton.MoveWindow( buttonRect );
378 
379  OnLbnSelchangeLog(); //packet window needs to be reformatted
380 
381  this->RedrawWindow();
382  }
383 }
384 
385 //----------------------------------------------------------------------
391 //----------------------------------------------------------------------
393  (
394  MINMAXINFO * aMinMaxInfo
395  )
396 {
397  aMinMaxInfo->ptMinTrackSize.x = 600;
398  aMinMaxInfo->ptMinTrackSize.y = 400;
399 }
400 
401 //----------------------------------------------------------------------
404 //----------------------------------------------------------------------
406 {
407  int selectedIndex = mPacketListBox.GetCurSel();
408  mLogParser->resendPacket( selectedIndex );
409 }
410 
411 //----------------------------------------------------------------------
416 //----------------------------------------------------------------------
418 {
419  UpdateData( TRUE );
420 
421  int selectedIndex = mPacketListBox.GetCurSel();
422  if( selectedIndex >= 0 && selectedIndex < mPacketListBox.GetCount() )
423  {
424  mSelectedPacketText = mLogParser->getPacketDetail( selectedIndex );
425  if( SerialPort::getInstance()->isOpen() )
426  {
427  mResendButton.EnableWindow( TRUE );
428  }
429  }
430 
431  UpdateData( FALSE );
432 }
433 
434 //----------------------------------------------------------------------
438 //----------------------------------------------------------------------
440 {
441  TCHAR workingDirectory[200];
442  // opening a file in another directory changes the current
443  // directory, which will cause problems because the log and data
444  // files are opened relative to the current directory. So, get the
445  // directory now so that it can be restored when the user is done
446  // picking a file.
447  DWORD returnValue = GetCurrentDirectory( 200, workingDirectory );
448  if( returnValue == 0 || returnValue > 200 )
449  {
450  MessageBox( _T("Unable to get current directory"), _T("Severe Error") );
451  OnCancel();
452  return;
453  }
454  CFileDialog dlg
455  (
456  TRUE,
457  _T("log"),
458  NULL,
459  OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
460  _T("Log Files (*.log)|*.log||")
461  );
462  if( dlg.DoModal() == IDOK )
463  {
464  mLogParser->init( dlg.GetPathName() );
465 
466  resetView();
467  UpdateLogDisplay();
468  }
469  SetCurrentDirectory( workingDirectory );
470 
471 } /* OnBnClickedViewOther */
472 
473 //----------------------------------------------------------------------
477 //----------------------------------------------------------------------
479 {
480  UpdateData( TRUE );
481  mPacketListBox.ResetContent();
482  mPacketListBox.SetTopIndex( mPacketListBox.GetCount() - 1 );
483 
484  mSelectedPacketText = _T("");
485  if( mLogParser->getFilename() == Logger::LOG_FILE )
486  {
487  mLogNameText.Format( _T(" Current Execution's Packet Log") );
488  mLogNameControl.SetWindowText( mLogNameText );
489  mClearButton.EnableWindow( TRUE );
490  }
491  else
492  {
493  mLogNameText.Format( _T(" %s"), mLogParser->getFilename() );
494  mLogNameControl.SetWindowText( mLogNameText );
495  mClearButton.EnableWindow( FALSE );
496  }
497 
498  mResendButton.EnableWindow( FALSE );
499  UpdateData( FALSE );
500 }
501 
502 //----------------------------------------------------------------------
506 //----------------------------------------------------------------------
508 {
509  if( mLogParser->getFilename() == Logger::LOG_FILE )
510  {
511  return; //already viewing current log
512  }
513 
514  mLogParser->init( CString( Logger::LOG_FILE ) );
515 
516  resetView();
517  UpdateLogDisplay();
518 } /* OnBnClickedViewCurrent */
519 
520 //----------------------------------------------------------------------
524 //----------------------------------------------------------------------
526 {
528  mLogParser->init( CString( Logger::LOG_FILE ) );
529 
530  resetView();
531 }
532 
533 //----------------------------------------------------------------------
537 //----------------------------------------------------------------------
539 {
540  int filenameLength = WideCharToMultiByte( CP_ACP, 0, mLogParser->getFilename(), -1, NULL, 0, NULL, NULL );
541  char *filenameAnsi = new char[filenameLength];
542  WideCharToMultiByte( CP_ACP, 0, mLogParser->getFilename(), -1, filenameAnsi, filenameLength, NULL, NULL );
543  ifstream logFile( filenameAnsi, ios_base::in );
544  delete filenameAnsi;
545 
546  if( logFile.good() )
547  {
548  //log is open..request mSaveButton file and mSaveButton
549  TCHAR workingDirectory[200];
550 
551  // opening a file in another directory changes the current
552  // directory, which will cause problems because the log and data
553  // files are opened relative to the current directory. So, get the
554  // directory now so that it can be restored when the user is done
555  // picking a file.
556  DWORD returnValue = GetCurrentDirectory( 200, workingDirectory );
557  if( returnValue == 0 || returnValue > 200 )
558  {
559  MessageBox( _T("Unable to get current directory"), _T("Severe Error") );
560  OnCancel();
561  return;
562  }
563 
564  CFileDialog dlg
565  (
566  FALSE,
567  _T("log"),
568  NULL,
569  OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
570  _T("Log Files (*.log)|*.log||")
571  );
572 
573  if( dlg.DoModal() == IDOK && dlg.GetFileName() != mLogParser->getFilename() )
574  {
575  std::string line;
576 
577  int filenameLength = WideCharToMultiByte( CP_ACP, 0, dlg.GetPathName(), -1, NULL, 0, NULL, NULL );
578  char *filename = new char[filenameLength];
579  WideCharToMultiByte( CP_ACP, 0, dlg.GetPathName().GetBuffer(), -1, filename, filenameLength, NULL, NULL );
580  ofstream destinationFile( filename, ios_base::out );
581  delete filename;
582  if( destinationFile.good() )
583  {
584  logFile.peek();
585  while( !logFile.eof() )
586  {
587  getline( logFile, line );
588  destinationFile << line << endl;
589  }
590  }
591  destinationFile.close();
592  }
593  SetCurrentDirectory( workingDirectory ); //change back (see above)
594  }
595  logFile.close();
596 }
597 
598 //----------------------------------------------------------------------
603 //----------------------------------------------------------------------
605 {
606  UpdateData( TRUE );
607 
608  if( mPacketListBox.GetCount() == 0 )
609  {
610  return; // nothing to search, so exit
611  }
612 
613  int selectedIndex = mPacketListBox.GetCurSel();
614  if( selectedIndex < 0 )
615  {
616  selectedIndex = 0;
617  }
618 
619  CString listItemText;
620  CString searchText = mSearchText;
621 
622  searchText.MakeLower(); //don't want to edit the text entered
623  if( searchText != _T("") )
624  {
625  mPacketListBox.setSearchString( searchText );
626  int nextIndex;
627  switch( mSearchDirection )
628  {
629  case SEARCH_UP: //up selected
630  {
631  for(nextIndex = selectedIndex - 1; nextIndex != selectedIndex; nextIndex-- )
632  {
633  if( nextIndex < 0 )
634  {
635  nextIndex = mPacketListBox.GetCount() - 1; //count is not zero-based
636  }
637  mPacketListBox.GetText( nextIndex, listItemText );
638  listItemText.MakeLower();
639  if( listItemText.Find( searchText, 0 ) != -1 )
640  {
641  mPacketListBox.SetCurSel( nextIndex );
642  OnLbnSelchangeLog(); //update packet info window
643  break;
644  }
645  }
646  break;
647  }
648  case SEARCH_DOWN: //down selected
649  {
650  for( nextIndex = selectedIndex + 1; nextIndex != selectedIndex; nextIndex++ )
651  {
652  if( nextIndex >= mPacketListBox.GetCount() )
653  {
654  nextIndex = 0;
655  if (nextIndex == selectedIndex )
656  break; //have to check condition since we are changing in middle
657  }
658  mPacketListBox.GetText( nextIndex, listItemText );
659  listItemText.MakeLower();
660  if( listItemText.Find( searchText, 0 ) != -1 )
661  {
662  mPacketListBox.SetCurSel( nextIndex );
663  OnLbnSelchangeLog(); //update packet info window
664  break;
665  }
666  }
667  break;
668  }
669  default:
670  return;
671  }
672  if( nextIndex == selectedIndex ) //either not found at all, or index highlighted is the only one
673  {
674  mPacketListBox.GetText( selectedIndex, listItemText );
675  listItemText.MakeLower();
676  CString error;
677  if( listItemText.Find( searchText, 0 ) != -1 ) //no more occurrences of this
678  {
679  error.Format( _T("No more occurrences of '%s' were found"), mSearchText );
680  }
681  else //not found at all
682  {
683  error.Format( _T("'%s' was not found "), mSearchText );
684  }
685  MessageBox( error, _T("End of Search") );
686  }
687  }
688  else
689  {
690  mPacketListBox.setSearchString( _T("") );
691  MessageBox( _T("Search box is empty"), _T("Unable to search") );
692  }
693  mPacketListBox.RedrawWindow( 0, 0, RDW_FRAME|RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE );
694 }
afx_msg void OnBnClickedFindNext()
Click handler for the Find Next button.
afx_msg void OnBnClickedViewOther()
Click handler for the View Other button.
#define IDC_LOG_BTN_FIND_NEXT
Definition: resource.h:244
void resetView()
Reset the log view.
Abstract base class for log item parsers.
Definition: LogParser.h:23
static void clearLog()
Empties the packet log.
Definition: Logger.cpp:83
afx_msg void OnBnClickedOk()
Click handler for the OK button; destroys the window.
static const char * LOG_FILE
The log file that this Logger writes to.
Definition: Logger.h:37
afx_msg LPARAM OnPacketLogged(WPARAM, LPARAM)
Handles the Packet Logged event from Com; updates the packet list.
STL namespace.
#define EDGE_SPACING
Modeless log viewer dialog.
Definition: CLogViewerDlg.h:31
void UpdateLogDisplay()
Reads the log file and updates the packet list. If a packet was selected, keeps the packet selected a...
#define IDC_LOG_EDIT_SEARCH_TEXT
Definition: resource.h:249
#define IDC_LOG_LBL_PACKETS
Definition: resource.h:252
#define FALSE
Definition: garmin_types.h:46
#define IDC_LOG_TXT_SELECTED_PACKET
Definition: resource.h:258
#define TRUE
Definition: garmin_types.h:45
#define IDC_LOG_BTN_SAVE_AS
Definition: resource.h:246
virtual ~CLogViewerDlg()
Destructor.
#define IDC_LOG_GRP_SEARCH
Definition: resource.h:250
static SerialPort * getInstance()
Get the one and only serial port object.
Definition: SerialPort.cpp:36
afx_msg void OnBnClickedViewCurrent()
Click handler for the View Current button.
#define IDC_LOG_TXT_LOG_NAME
Definition: resource.h:257
afx_msg void OnCancel()
Handler for the Cancel action; destroys the window.
void PostNcDestroy()
Perform final cleanup on the log viewer.
#define IDC_LOG_LST_PACKETS
Definition: resource.h:254
afx_msg void OnLbnSelchangeLog()
Selection Changed handler for the packet list.
BOOL updateView()
Update the log view.
#define IDC_LOG_LBL_SELECTED_PACKET
Definition: resource.h:253
afx_msg void OnGetMinMaxInfo(MINMAXINFO *aMinMaxInfo)
Called on every resize to get the resize bounds.
afx_msg void OnBnClickedClearLog()
Click handler for the Clear Log button.
virtual void DoDataExchange(CDataExchange *aDataExchange)
Perform dialog data exchange and validation.
#define IDC_LOG_BTN_VIEW_CURRENT
Definition: resource.h:247
#define IDC_LOG_BTN_CLEAR
Definition: resource.h:243
void resendPacket()
Retransmit the selected packet for debugging purposes.
#define IDD_LOG
Definition: resource.h:32
#define IDC_LOG_BTN_VIEW_OTHER
Definition: resource.h:248
#define WM_EVENT(_event)
Translation from an application event to the corresponding Windows message.
#define IDC_LOG_BTN_RESEND
Definition: resource.h:245
afx_msg void OnSize(UINT aType, int aClientWidth, int aClientHeight)
Called after the dialog is resized; repositions the contents of the display.
#define IDC_LOG_RDO_DOWN
Definition: resource.h:255
afx_msg void OnBnClickedSaveAs()
Click handler for the Save As button.
#define IDC_LOG_RDO_UP
Definition: resource.h:256
BOOL OnInitDialog()
Initialize the dialog.
#define IDC_LOG_LBL_LOG_NAME
Definition: resource.h:251
static void post(EventId aEventId, uint32 aEventData=0, void *aEventDataPtr=NULL, BOOL handleNow=FALSE)
Posts a message to all windows that have registered to get events.
Definition: Event.cpp:67