third attempt to port to QT4, not working, still a lot to do...
This commit is contained in:
parent
221a612427
commit
8b0389c192
5 changed files with 178 additions and 190 deletions
|
@ -105,6 +105,9 @@
|
|||
#define TIME_MOV_AV_RESPONSE 30 // seconds
|
||||
#define LEN_MOV_AV_RESPONSE ( TIME_MOV_AV_RESPONSE * 1000 / MIN_BLOCK_DURATION_MS )
|
||||
|
||||
// GUI definition: width/heigth size of LED pixmaps
|
||||
#define LED_WIDTH_HEIGHT_SIZE_PIXEL 13
|
||||
|
||||
|
||||
#define _MAXSHORT 32767
|
||||
#define _MAXBYTE 255 // binary: 11111111
|
||||
|
|
|
@ -27,40 +27,29 @@
|
|||
|
||||
/* Implementation *************************************************************/
|
||||
CLlconServerDlg::CLlconServerDlg ( CServer* pNServP, QWidget* parent )
|
||||
: pServer ( pNServP ), QDialog ( parent )
|
||||
: pServer ( pNServP ), QDialog ( parent ),
|
||||
BitmCubeGreen ( LED_WIDTH_HEIGHT_SIZE_PIXEL, LED_WIDTH_HEIGHT_SIZE_PIXEL ),
|
||||
BitmCubeRed ( LED_WIDTH_HEIGHT_SIZE_PIXEL, LED_WIDTH_HEIGHT_SIZE_PIXEL ),
|
||||
BitmCubeYellow ( LED_WIDTH_HEIGHT_SIZE_PIXEL, LED_WIDTH_HEIGHT_SIZE_PIXEL )
|
||||
{
|
||||
/* set text for version and application name */
|
||||
TextLabelNameVersion->setText ( QString ( APP_NAME ) +
|
||||
tr ( " server " ) + QString ( VERSION ) );
|
||||
|
||||
/* Create bitmaps */
|
||||
/* Define size of the bitmaps */
|
||||
const int iXSize = 13;
|
||||
const int iYSize = 13;
|
||||
BitmCubeGreen.resize ( iXSize, iYSize );
|
||||
BitmCubeGreen.fill ( QColor ( 0, 255, 0 ) );
|
||||
BitmCubeRed.resize ( iXSize, iYSize );
|
||||
BitmCubeRed.fill ( QColor ( 255, 0, 0 ) );
|
||||
BitmCubeYellow.resize ( iXSize, iYSize );
|
||||
BitmCubeYellow.fill ( QColor ( 255, 255, 0 ) );
|
||||
|
||||
/* set up list view for connected clients (We assume that one column is
|
||||
already there) */
|
||||
ListViewClients->setColumnText ( 0, tr ( "Client IP : Port" ) );
|
||||
// set up list view for connected clients
|
||||
ListViewClients->setColumnWidth ( 0, 170 );
|
||||
ListViewClients->addColumn ( tr ( "Name" ) );
|
||||
ListViewClients->setColumnAlignment ( 1, Qt::AlignLeft );
|
||||
// ListViewClients->setColumnAlignment ( 1, Qt::AlignLeft );
|
||||
ListViewClients->setColumnWidth ( 1, 150 );
|
||||
ListViewClients->addColumn ( tr ( "Put" ) );
|
||||
ListViewClients->setColumnAlignment ( 2, Qt::AlignCenter );
|
||||
ListViewClients->addColumn ( tr ( "Get" ) );
|
||||
ListViewClients->setColumnAlignment ( 3, Qt::AlignCenter );
|
||||
ListViewClients->addColumn ( tr ( "Jitter buffer size" ) );
|
||||
ListViewClients->setColumnAlignment ( 4, Qt::AlignRight );
|
||||
ListViewClients->addColumn ( tr ( "Block Size In" ) );
|
||||
ListViewClients->setColumnAlignment ( 5, Qt::AlignRight );
|
||||
ListViewClients->addColumn ( tr ( "Block Size Out" ) );
|
||||
ListViewClients->setColumnAlignment ( 6, Qt::AlignRight );
|
||||
// ListViewClients->setColumnAlignment ( 2, Qt::AlignCenter );
|
||||
// ListViewClients->setColumnAlignment ( 3, Qt::AlignCenter );
|
||||
// ListViewClients->setColumnAlignment ( 4, Qt::AlignRight );
|
||||
// ListViewClients->setColumnAlignment ( 5, Qt::AlignRight );
|
||||
// ListViewClients->setColumnAlignment ( 6, Qt::AlignRight );
|
||||
ListViewClients->clear();
|
||||
|
||||
/* insert items in reverse order because in Windows all of them are
|
||||
|
@ -74,26 +63,27 @@ CLlconServerDlg::CLlconServerDlg ( CServer* pNServP, QWidget* parent )
|
|||
#endif
|
||||
}
|
||||
|
||||
/* Init timing jitter text label */
|
||||
// Init timing jitter text label
|
||||
TextLabelResponseTime->setText ( "" );
|
||||
|
||||
|
||||
/* Main menu bar -------------------------------------------------------- */
|
||||
pMenu = new QMenuBar ( this );
|
||||
pMenu->insertItem ( tr ( "&?" ), new CLlconHelpMenu ( this ) );
|
||||
pMenu->setSeparator ( QMenuBar::InWindowsStyle );
|
||||
// pMenu->insertItem ( tr ( "&?" ), new CLlconHelpMenu ( this ) );
|
||||
pMenu->addMenu ( new CLlconHelpMenu ( this ) );
|
||||
//pMenu->setSeparator ( QMenuBar::InWindowsStyle );
|
||||
|
||||
/* Now tell the layout about the menu */
|
||||
CLlconServerDlgBaseLayout->setMenuBar ( pMenu );
|
||||
// Now tell the layout about the menu
|
||||
layout()->setMenuBar ( pMenu );
|
||||
|
||||
|
||||
/* connections ---------------------------------------------------------- */
|
||||
/* timers */
|
||||
// timers
|
||||
QObject::connect ( &Timer, SIGNAL ( timeout() ), this, SLOT ( OnTimer() ) );
|
||||
|
||||
|
||||
/* timers --------------------------------------------------------------- */
|
||||
/* start timer for GUI controls */
|
||||
// start timer for GUI controls
|
||||
Timer.start ( GUI_CONTRL_UPDATE_TIME );
|
||||
}
|
||||
|
||||
|
|
15
src/main.cpp
15
src/main.cpp
|
@ -104,7 +104,7 @@ cerr << "logging ";
|
|||
exit ( 1 );
|
||||
}
|
||||
|
||||
/* Application object */
|
||||
// Application object
|
||||
QApplication app ( argc, argv, bUseGUI );
|
||||
|
||||
if ( bIsClient )
|
||||
|
@ -118,10 +118,10 @@ cerr << "logging ";
|
|||
Settings.Load ( strIniFileName );
|
||||
|
||||
// GUI object
|
||||
CLlconClientDlg ClientDlg ( &Client, 0, 0, FALSE, Qt::WStyle_MinMax );
|
||||
CLlconClientDlg ClientDlg ( &Client, 0 );
|
||||
|
||||
// set main window
|
||||
app.setMainWidget ( &ClientDlg );
|
||||
app.setActiveWindow ( &ClientDlg );
|
||||
pApp = &app; // Needed for post-event routine
|
||||
|
||||
// show dialog
|
||||
|
@ -140,11 +140,10 @@ cerr << "logging ";
|
|||
if ( bUseGUI )
|
||||
{
|
||||
// GUI object for the server
|
||||
CLlconServerDlg ServerDlg ( &Server, 0, 0, FALSE,
|
||||
Qt::WStyle_MinMax );
|
||||
CLlconServerDlg ServerDlg ( &Server, 0 );
|
||||
|
||||
// set main window
|
||||
app.setMainWidget ( &ServerDlg );
|
||||
app.setActiveWindow ( &ServerDlg );
|
||||
pApp = &app; // needed for post-event routine
|
||||
|
||||
// show dialog
|
||||
|
@ -154,7 +153,7 @@ cerr << "logging ";
|
|||
else
|
||||
{
|
||||
// only start application without using the GUI
|
||||
qDebug ( CAboutDlg::GetVersionAndNameStr ( false ) );
|
||||
qDebug() << CAboutDlg::GetVersionAndNameStr ( false );
|
||||
app.exec();
|
||||
}
|
||||
}
|
||||
|
@ -262,6 +261,6 @@ void PostWinMessage ( const _MESSAGE_IDENT MessID, const int iMessageParam,
|
|||
new CLlconEvent ( MessID, iMessageParam, iChanNum );
|
||||
|
||||
// Qt will delete the event object when done
|
||||
QThread::postEvent ( pApp->mainWidget(), LlconEv );
|
||||
// QThread::postEvent ( pApp->mainWidget(), LlconEv );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,20 +30,16 @@
|
|||
|
||||
|
||||
/* Implementation *************************************************************/
|
||||
CMultiColorLEDbase::CMultiColorLEDbase()
|
||||
CMultiColorLEDbase::CMultiColorLEDbase() :
|
||||
BitmCubeGreen ( LED_WIDTH_HEIGHT_SIZE_PIXEL, LED_WIDTH_HEIGHT_SIZE_PIXEL ),
|
||||
BitmCubeRed ( LED_WIDTH_HEIGHT_SIZE_PIXEL, LED_WIDTH_HEIGHT_SIZE_PIXEL ),
|
||||
BitmCubeGrey ( LED_WIDTH_HEIGHT_SIZE_PIXEL, LED_WIDTH_HEIGHT_SIZE_PIXEL ),
|
||||
BitmCubeYellow ( LED_WIDTH_HEIGHT_SIZE_PIXEL, LED_WIDTH_HEIGHT_SIZE_PIXEL )
|
||||
{
|
||||
/* Define size of the bitmaps */
|
||||
const int iXSize = 13;
|
||||
const int iYSize = 13;
|
||||
|
||||
/* Create bitmaps */
|
||||
BitmCubeGreen.resize ( iXSize, iYSize );
|
||||
BitmCubeGreen.fill ( QColor ( 0, 255, 0 ) );
|
||||
BitmCubeRed.resize ( iXSize, iYSize );
|
||||
BitmCubeRed.fill ( QColor ( 255, 0, 0 ) );
|
||||
BitmCubeGrey.resize ( iXSize, iYSize );
|
||||
BitmCubeGrey.fill ( QColor ( 192, 192, 192 ) );
|
||||
BitmCubeYellow.resize ( iXSize, iYSize );
|
||||
BitmCubeYellow.fill ( QColor ( 255, 255, 0 ) );
|
||||
|
||||
/* Init color flags */
|
||||
|
@ -141,21 +137,21 @@ void CMultiColorLEDbase::SetLight ( int iNewStatus )
|
|||
switch ( iNewStatus )
|
||||
{
|
||||
case MUL_COL_LED_GREEN:
|
||||
/* Green light */
|
||||
// Green light
|
||||
bFlagGreenLi = true;
|
||||
TimerGreenLight.changeInterval ( iUpdateTime );
|
||||
TimerGreenLight.setInterval ( iUpdateTime );
|
||||
break;
|
||||
|
||||
case MUL_COL_LED_YELLOW:
|
||||
/* Yellow light */
|
||||
// Yellow light
|
||||
bFlagYellowLi = true;
|
||||
TimerYellowLight.changeInterval ( iUpdateTime );
|
||||
TimerYellowLight.setInterval ( iUpdateTime );
|
||||
break;
|
||||
|
||||
case MUL_COL_LED_RED:
|
||||
/* Red light */
|
||||
// Red light
|
||||
bFlagRedLi = true;
|
||||
TimerRedLight.changeInterval ( iUpdateTime );
|
||||
TimerRedLight.setInterval ( iUpdateTime );
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ void CServer::Stop()
|
|||
// logging
|
||||
QString strLogStr = CLogTimeDate::toString() + "Server stopped";
|
||||
|
||||
qDebug ( strLogStr ); // on console
|
||||
qDebug() << strLogStr; // on console
|
||||
Logging << strLogStr; // in log file
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue