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
QObject::connect ( &TimerErrRateUpdate, SIGNAL ( timeout() ),
this, SLOT ( OnTimerErrRateUpdate() ) );
}
// Timers ------------------------------------------------------------------
void CAnalyzerConsole::showEvent ( QShowEvent* )
{
// start timer for error rate graph
TimerErrRateUpdate.start ( ERR_RATE_GRAPH_UPDATE_TIME_MS );
}
void CAnalyzerConsole::hideEvent ( QHideEvent* )
{
// if window is closed, stop timer
TimerErrRateUpdate.stop();
}
void CAnalyzerConsole::OnTimerErrRateUpdate()
{
// generate current graph image

View file

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

View file

@ -31,6 +31,7 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP,
const bool bNewConnectOnStartup,
const bool bNewDisalbeLEDs,
const bool bNewShowComplRegConnList,
const bool bShowAnalyzerConsole,
QWidget* parent,
Qt::WindowFlags f ) :
QDialog ( parent, f ),
@ -39,7 +40,8 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP,
bUnreadChatMessage ( false ),
ClientSettingsDlg ( pNCliP, parent, Qt::Window ),
ChatDlg ( parent, Qt::Window ),
ConnectDlg ( bNewShowComplRegConnList, parent, Qt::Dialog )
ConnectDlg ( bNewShowComplRegConnList, parent, Qt::Dialog ),
AnalyzerConsole ( pNCliP, parent, Qt::Window )
{
setupUi ( this );
@ -320,6 +322,13 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP,
pViewMenu->addAction ( tr ( "&General Settings..." ), this,
SLOT ( OnOpenGeneralSettings() ) );
// optionally show analyzer console entry
if ( bShowAnalyzerConsole )
{
pViewMenu->addAction ( tr ( "&Analyzer Console..." ), this,
SLOT ( OnOpenAnalyzerConsole() ) );
}
pViewMenu->addSeparator();
pViewMenu->addAction ( tr ( "E&xit" ), this,
@ -458,15 +467,6 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP,
// Timers ------------------------------------------------------------------
// start timer for status bar
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 )
@ -475,6 +475,7 @@ void CLlconClientDlg::closeEvent ( QCloseEvent* Event )
ClientSettingsDlg.close();
ConnectDlg.close();
ChatDlg.close();
AnalyzerConsole.close();
// if connected, terminate connection
if ( pClient->IsRunning() )
@ -680,6 +681,16 @@ void CLlconClientDlg::ShowChatWindow()
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 )
{
if ( value == Qt::Checked )

View file

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

View file

@ -59,6 +59,7 @@ int main ( int argc, char** argv )
bool bConnectOnStartup = false;
bool bDisalbeLEDs = false;
bool bShowComplRegConnList = false;
bool bShowAnalyzerConsole = false;
bool bCentServPingServerInList = false;
int iNumServerChannels = DEFAULT_USED_NUM_CHANNELS;
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 ---------------------------------------------------------
if ( GetStringArgument ( tsConsole,
argc,
@ -393,6 +408,7 @@ int main ( int argc, char** argv )
bConnectOnStartup,
bDisalbeLEDs,
bShowComplRegConnList,
bShowAnalyzerConsole,
0,
Qt::Window );