added command line argument --showanalyzerconsole to enable the analyzer console

This commit is contained in:
Volker Fischer 2013-03-02 19:52:13 +00:00
parent f9b13ec2f6
commit 478fd285be
5 changed files with 53 additions and 12 deletions

View File

@ -65,13 +65,20 @@ CAnalyzerConsole::CAnalyzerConsole ( CClient* pNCliP,
// timers // timers
QObject::connect ( &TimerErrRateUpdate, SIGNAL ( timeout() ), QObject::connect ( &TimerErrRateUpdate, SIGNAL ( timeout() ),
this, SLOT ( OnTimerErrRateUpdate() ) ); this, SLOT ( OnTimerErrRateUpdate() ) );
}
void CAnalyzerConsole::showEvent ( QShowEvent* )
// Timers ------------------------------------------------------------------ {
// start timer for error rate graph // start timer for error rate graph
TimerErrRateUpdate.start ( ERR_RATE_GRAPH_UPDATE_TIME_MS ); TimerErrRateUpdate.start ( ERR_RATE_GRAPH_UPDATE_TIME_MS );
} }
void CAnalyzerConsole::hideEvent ( QHideEvent* )
{
// if window is closed, stop timer
TimerErrRateUpdate.stop();
}
void CAnalyzerConsole::OnTimerErrRateUpdate() void CAnalyzerConsole::OnTimerErrRateUpdate()
{ {
// generate current graph image // generate current graph image

View File

@ -52,6 +52,9 @@ public:
protected: protected:
virtual void showEvent ( QShowEvent* );
virtual void hideEvent ( QHideEvent* );
void DrawFrame(); void DrawFrame();
void DrawErrorRateTrace(); void DrawErrorRateTrace();
int CalcYPosInGraph ( const double dAxisMin, int CalcYPosInGraph ( const double dAxisMin,

View File

@ -31,6 +31,7 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP,
const bool bNewConnectOnStartup, const bool bNewConnectOnStartup,
const bool bNewDisalbeLEDs, const bool bNewDisalbeLEDs,
const bool bNewShowComplRegConnList, const bool bNewShowComplRegConnList,
const bool bShowAnalyzerConsole,
QWidget* parent, QWidget* parent,
Qt::WindowFlags f ) : Qt::WindowFlags f ) :
QDialog ( parent, f ), QDialog ( parent, f ),
@ -39,7 +40,8 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP,
bUnreadChatMessage ( false ), bUnreadChatMessage ( false ),
ClientSettingsDlg ( pNCliP, parent, Qt::Window ), ClientSettingsDlg ( pNCliP, parent, Qt::Window ),
ChatDlg ( parent, Qt::Window ), ChatDlg ( parent, Qt::Window ),
ConnectDlg ( bNewShowComplRegConnList, parent, Qt::Dialog ) ConnectDlg ( bNewShowComplRegConnList, parent, Qt::Dialog ),
AnalyzerConsole ( pNCliP, parent, Qt::Window )
{ {
setupUi ( this ); setupUi ( this );
@ -320,6 +322,13 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP,
pViewMenu->addAction ( tr ( "&General Settings..." ), this, pViewMenu->addAction ( tr ( "&General Settings..." ), this,
SLOT ( OnOpenGeneralSettings() ) ); SLOT ( OnOpenGeneralSettings() ) );
// optionally show analyzer console entry
if ( bShowAnalyzerConsole )
{
pViewMenu->addAction ( tr ( "&Analyzer Console..." ), this,
SLOT ( OnOpenAnalyzerConsole() ) );
}
pViewMenu->addSeparator(); pViewMenu->addSeparator();
pViewMenu->addAction ( tr ( "E&xit" ), this, pViewMenu->addAction ( tr ( "E&xit" ), this,
@ -458,15 +467,6 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP,
// Timers ------------------------------------------------------------------ // Timers ------------------------------------------------------------------
// start timer for status bar // start timer for status bar
TimerStatus.start ( LED_BAR_UPDATE_TIME_MS ); TimerStatus.start ( LED_BAR_UPDATE_TIME_MS );
// TODO finish work on analyzer console and put this in a hidden View menu entry
/*
// TEST
CAnalyzerConsole* pAnalyzerConsole = new CAnalyzerConsole ( pClient, this );
pAnalyzerConsole->show();
*/
} }
void CLlconClientDlg::closeEvent ( QCloseEvent* Event ) void CLlconClientDlg::closeEvent ( QCloseEvent* Event )
@ -475,6 +475,7 @@ void CLlconClientDlg::closeEvent ( QCloseEvent* Event )
ClientSettingsDlg.close(); ClientSettingsDlg.close();
ConnectDlg.close(); ConnectDlg.close();
ChatDlg.close(); ChatDlg.close();
AnalyzerConsole.close();
// if connected, terminate connection // if connected, terminate connection
if ( pClient->IsRunning() ) if ( pClient->IsRunning() )
@ -680,6 +681,16 @@ void CLlconClientDlg::ShowChatWindow()
UpdateDisplay(); UpdateDisplay();
} }
void CLlconClientDlg::ShowAnalyzerConsole()
{
// open analyzer console dialog
AnalyzerConsole.show();
// make sure dialog is upfront and has focus
AnalyzerConsole.raise();
AnalyzerConsole.activateWindow();
}
void CLlconClientDlg::OnSettingsStateChanged ( int value ) void CLlconClientDlg::OnSettingsStateChanged ( int value )
{ {
if ( value == Qt::Checked ) if ( value == Qt::Checked )

View File

@ -73,6 +73,7 @@ public:
const bool bNewConnectOnStartup, const bool bNewConnectOnStartup,
const bool bNewDisalbeLEDs, const bool bNewDisalbeLEDs,
const bool bNewShowComplRegConnList, const bool bNewShowComplRegConnList,
const bool bShowAnalyzerConsole,
QWidget* parent = 0, QWidget* parent = 0,
Qt::WindowFlags f = 0 ); Qt::WindowFlags f = 0 );
@ -81,6 +82,7 @@ protected:
void SetMyWindowTitle ( const int iNumClients ); void SetMyWindowTitle ( const int iNumClients );
void ShowGeneralSettings(); void ShowGeneralSettings();
void ShowChatWindow(); void ShowChatWindow();
void ShowAnalyzerConsole();
void UpdateAudioFaderSlider(); void UpdateAudioFaderSlider();
void UpdateRevSelection(); void UpdateRevSelection();
void ConnectDisconnect ( const bool bDoStart, void ConnectDisconnect ( const bool bDoStart,
@ -106,6 +108,7 @@ protected:
CClientSettingsDlg ClientSettingsDlg; CClientSettingsDlg ClientSettingsDlg;
CChatDlg ChatDlg; CChatDlg ChatDlg;
CConnectDlg ConnectDlg; CConnectDlg ConnectDlg;
CAnalyzerConsole AnalyzerConsole;
public slots: public slots:
void OnAboutToQuit() { pSettings->Save(); } void OnAboutToQuit() { pSettings->Save(); }
@ -124,6 +127,7 @@ public slots:
void OnOpenGeneralSettings() { ShowGeneralSettings(); } void OnOpenGeneralSettings() { ShowGeneralSettings(); }
void OnOpenChatDialog() { ShowChatWindow(); } void OnOpenChatDialog() { ShowChatWindow(); }
void OnOpenAnalyzerConsole() { ShowAnalyzerConsole(); }
void OnInstPicturesMenuTriggered ( QAction* SelAction ); void OnInstPicturesMenuTriggered ( QAction* SelAction );

View File

@ -59,6 +59,7 @@ int main ( int argc, char** argv )
bool bConnectOnStartup = false; bool bConnectOnStartup = false;
bool bDisalbeLEDs = false; bool bDisalbeLEDs = false;
bool bShowComplRegConnList = false; bool bShowComplRegConnList = false;
bool bShowAnalyzerConsole = false;
bool bCentServPingServerInList = false; bool bCentServPingServerInList = false;
int iNumServerChannels = DEFAULT_USED_NUM_CHANNELS; int iNumServerChannels = DEFAULT_USED_NUM_CHANNELS;
quint16 iPortNumber = LLCON_DEFAULT_PORT_NUMBER; quint16 iPortNumber = LLCON_DEFAULT_PORT_NUMBER;
@ -172,6 +173,20 @@ int main ( int argc, char** argv )
} }
// Show analyzer console -----------------------------------------------
// Undocumented debugging command line argument: Show the analyzer
// console to debug network buffer properties.
if ( GetFlagArgument ( argv,
i,
"--showanalyzerconsole", // no short form
"--showanalyzerconsole" ) )
{
bShowAnalyzerConsole = true;
tsConsole << "- show analyzer console" << endl;
continue;
}
// Use logging --------------------------------------------------------- // Use logging ---------------------------------------------------------
if ( GetStringArgument ( tsConsole, if ( GetStringArgument ( tsConsole,
argc, argc,
@ -393,6 +408,7 @@ int main ( int argc, char** argv )
bConnectOnStartup, bConnectOnStartup,
bDisalbeLEDs, bDisalbeLEDs,
bShowComplRegConnList, bShowComplRegConnList,
bShowAnalyzerConsole,
0, 0,
Qt::Window ); Qt::Window );