added channel name to server GUI

This commit is contained in:
Volker Fischer 2006-12-29 10:52:25 +00:00
parent e7551ca1a4
commit b8bad82676
6 changed files with 71 additions and 58 deletions

View file

@ -362,6 +362,7 @@ void CChannelSet::GetBlockAllConC ( CVector<int>& vecChanID,
} }
void CChannelSet::GetConCliParam ( CVector<CHostAddress>& vecHostAddresses, void CChannelSet::GetConCliParam ( CVector<CHostAddress>& vecHostAddresses,
CVector<std::string>& vecsName,
CVector<int>& veciJitBufSize, CVector<int>& veciJitBufSize,
CVector<int>& veciNetwOutBlSiFact, CVector<int>& veciNetwOutBlSiFact,
CVector<int>& veciNetwInBlSiFact ) CVector<int>& veciNetwInBlSiFact )
@ -370,6 +371,7 @@ void CChannelSet::GetConCliParam ( CVector<CHostAddress>& vecHostAddresses,
// init return values // init return values
vecHostAddresses.Init ( MAX_NUM_CHANNELS ); vecHostAddresses.Init ( MAX_NUM_CHANNELS );
vecsName.Init ( MAX_NUM_CHANNELS );
veciJitBufSize.Init ( MAX_NUM_CHANNELS ); veciJitBufSize.Init ( MAX_NUM_CHANNELS );
veciNetwOutBlSiFact.Init ( MAX_NUM_CHANNELS ); veciNetwOutBlSiFact.Init ( MAX_NUM_CHANNELS );
veciNetwInBlSiFact.Init ( MAX_NUM_CHANNELS ); veciNetwInBlSiFact.Init ( MAX_NUM_CHANNELS );
@ -381,9 +383,10 @@ void CChannelSet::GetConCliParam ( CVector<CHostAddress>& vecHostAddresses,
{ {
// get requested data // get requested data
vecHostAddresses[i] = InetAddr; vecHostAddresses[i] = InetAddr;
veciJitBufSize[i] = vecChannels[i].GetSockBufSize (); vecsName[i] = vecChannels[i].GetName();
veciNetwOutBlSiFact[i] = vecChannels[i].GetNetwBufSizeFactOut (); veciJitBufSize[i] = vecChannels[i].GetSockBufSize();
veciNetwInBlSiFact[i] = vecChannels[i].GetNetwBufSizeFactIn (); veciNetwOutBlSiFact[i] = vecChannels[i].GetNetwBufSizeFactOut();
veciNetwInBlSiFact[i] = vecChannels[i].GetNetwBufSizeFactIn();
} }
} }
} }

View file

@ -216,6 +216,7 @@ public:
CVector<CVector<double> >& vecvecdGains ); CVector<CVector<double> >& vecvecdGains );
void GetConCliParam ( CVector<CHostAddress>& vecHostAddresses, void GetConCliParam ( CVector<CHostAddress>& vecHostAddresses,
CVector<std::string>& vecsName,
CVector<int>& veciJitBufSize, CVector<int>& veciJitBufSize,
CVector<int>& veciNetwOutBlSiFact, CVector<int>& veciNetwOutBlSiFact,
CVector<int>& veciNetwInBlSiFact ); CVector<int>& veciNetwInBlSiFact );

View file

@ -31,34 +31,37 @@ CLlconServerDlg::CLlconServerDlg ( CServer* pNServP, QWidget* parent,
CLlconServerDlgBase ( parent, name, modal, f ) CLlconServerDlgBase ( parent, name, modal, f )
{ {
/* set text for version and application name */ /* set text for version and application name */
TextLabelNameVersion-> TextLabelNameVersion->setText ( QString ( APP_NAME ) +
setText(QString(APP_NAME) + tr(" server ") + QString(VERSION)); tr ( " server " ) + QString ( VERSION ) );
/* Create bitmaps */ /* Create bitmaps */
/* Define size of the bitmaps */ /* Define size of the bitmaps */
const int iXSize = 13; const int iXSize = 13;
const int iYSize = 13; const int iYSize = 13;
BitmCubeGreen.resize(iXSize, iYSize); BitmCubeGreen.resize ( iXSize, iYSize );
BitmCubeGreen.fill(QColor(0, 255, 0)); BitmCubeGreen.fill ( QColor ( 0, 255, 0 ) );
BitmCubeRed.resize(iXSize, iYSize); BitmCubeRed.resize ( iXSize, iYSize );
BitmCubeRed.fill(QColor(255, 0, 0)); BitmCubeRed.fill ( QColor ( 255, 0, 0 ) );
BitmCubeYellow.resize(iXSize, iYSize); BitmCubeYellow.resize ( iXSize, iYSize );
BitmCubeYellow.fill(QColor(255, 255, 0)); BitmCubeYellow.fill ( QColor ( 255, 255, 0 ) );
/* set up list view for connected clients (We assume that one column is /* set up list view for connected clients (We assume that one column is
already there) */ already there) */
ListViewClients->setColumnText(0, tr("Client IP : Port")); ListViewClients->setColumnText ( 0, tr ( "Client IP : Port" ) );
ListViewClients->setColumnWidth(0, 170); ListViewClients->setColumnWidth ( 0, 170 );
ListViewClients->addColumn(tr("Put")); ListViewClients->addColumn ( tr ( "Name" ) );
ListViewClients->setColumnAlignment(1, Qt::AlignCenter); ListViewClients->setColumnAlignment ( 1, Qt::AlignLeft );
ListViewClients->addColumn(tr("Get")); ListViewClients->setColumnWidth ( 1, 150 );
ListViewClients->setColumnAlignment(2, Qt::AlignCenter); ListViewClients->addColumn ( tr ( "Put" ) );
ListViewClients->addColumn(tr("Jitter buffer size")); ListViewClients->setColumnAlignment ( 2, Qt::AlignCenter );
ListViewClients->setColumnAlignment(3, Qt::AlignRight); ListViewClients->addColumn ( tr ( "Get" ) );
ListViewClients->addColumn(tr("Block Size In")); ListViewClients->setColumnAlignment ( 3, Qt::AlignCenter );
ListViewClients->setColumnAlignment(4, Qt::AlignRight); ListViewClients->addColumn ( tr ( "Jitter buffer size" ) );
ListViewClients->addColumn(tr("Block Size Out")); ListViewClients->setColumnAlignment ( 4, Qt::AlignRight );
ListViewClients->setColumnAlignment(5, 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->clear(); ListViewClients->clear();
/* insert items in reverse order because in Windows all of them are /* insert items in reverse order because in Windows all of them are
@ -99,6 +102,7 @@ CLlconServerDlg::CLlconServerDlg ( CServer* pNServP, QWidget* parent,
void CLlconServerDlg::OnTimer() void CLlconServerDlg::OnTimer()
{ {
CVector<CHostAddress> vecHostAddresses; CVector<CHostAddress> vecHostAddresses;
CVector<std::string> vecsName;
CVector<int> veciJitBufSize; CVector<int> veciJitBufSize;
CVector<int> veciNetwOutBlSiFact; CVector<int> veciNetwOutBlSiFact;
CVector<int> veciNetwInBlSiFact; CVector<int> veciNetwInBlSiFact;
@ -106,30 +110,33 @@ void CLlconServerDlg::OnTimer()
ListViewMutex.lock(); ListViewMutex.lock();
pServer->GetConCliParam ( vecHostAddresses, veciJitBufSize, pServer->GetConCliParam ( vecHostAddresses, vecsName, veciJitBufSize,
veciNetwOutBlSiFact, veciNetwInBlSiFact ); veciNetwOutBlSiFact, veciNetwInBlSiFact );
/* fill list with connected clients */ /* fill list with connected clients */
for (int i = 0; i < MAX_NUM_CHANNELS; i++) for ( int i = 0; i < MAX_NUM_CHANNELS; i++ )
{ {
if (!(vecHostAddresses[i].InetAddr == QHostAddress((Q_UINT32) 0))) if ( ! ( vecHostAddresses[i].InetAddr == QHostAddress ( (Q_UINT32) 0 ) ) )
{ {
/* main text (IP, port number) */ // IP, port number
vecpListViewItems[i]->setText(0, QString().sprintf("%s : %d", vecpListViewItems[i]->setText ( 0, QString().sprintf ( "%s : %d",
vecHostAddresses[i].InetAddr.toString().latin1(), vecHostAddresses[i].InetAddr.toString().latin1(),
vecHostAddresses[i].iPort) /* IP, port */); vecHostAddresses[i].iPort ) /* IP, port */);
/* jitter buffer size (polling for updates) */ // name
vecpListViewItems[i]->setText(3, vecpListViewItems[i]->setText ( 1, vecsName[i].c_str() );
QString().setNum(veciJitBufSize[i]));
/* in / out network block sizes */ // jitter buffer size (polling for updates)
vecpListViewItems[i]->setText(4, vecpListViewItems[i]->setText ( 4,
QString().setNum( QString().setNum ( veciJitBufSize[i] ) );
double(veciNetwInBlSiFact[i] * MIN_BLOCK_DURATION_MS), 'f', 2));
vecpListViewItems[i]->setText(5, // in/out network block sizes
QString().setNum( vecpListViewItems[i]->setText ( 5,
double(veciNetwOutBlSiFact[i] * MIN_BLOCK_DURATION_MS), 'f', 2)); QString().setNum (
double ( veciNetwInBlSiFact[i] * MIN_BLOCK_DURATION_MS), 'f', 2 ) );
vecpListViewItems[i]->setText(6,
QString().setNum (
double ( veciNetwOutBlSiFact[i] * MIN_BLOCK_DURATION_MS), 'f', 2 ) );
#ifndef _WIN32 #ifndef _WIN32
vecpListViewItems[i]->setVisible ( true ); vecpListViewItems[i]->setVisible ( true );
@ -138,10 +145,11 @@ void CLlconServerDlg::OnTimer()
else else
{ {
#ifdef _WIN32 #ifdef _WIN32
/* remove text for Windows version */ // remove text for Windows version
vecpListViewItems[i]->setText(0, ""); vecpListViewItems[i]->setText ( 0, "" );
vecpListViewItems[i]->setText(3, ""); vecpListViewItems[i]->setText ( 1, "" );
vecpListViewItems[i]->setText(4, ""); vecpListViewItems[i]->setText ( 4, "" );
vecpListViewItems[i]->setText ( 5, "" );
#else #else
vecpListViewItems[i]->setVisible ( false ); vecpListViewItems[i]->setVisible ( false );
#endif #endif
@ -150,36 +158,36 @@ void CLlconServerDlg::OnTimer()
ListViewMutex.unlock(); ListViewMutex.unlock();
/* response time (if available) */ // response time (if available)
if ( pServer->GetTimingStdDev ( dCurTiStdDev ) ) if ( pServer->GetTimingStdDev ( dCurTiStdDev ) )
{ {
TextLabelResponseTime->setText(QString(). TextLabelResponseTime->setText ( QString().
setNum(dCurTiStdDev, 'f', 2) + " ms"); setNum ( dCurTiStdDev, 'f', 2 ) + " ms" );
} }
else else
{ {
TextLabelResponseTime->setText("---"); TextLabelResponseTime->setText ( "---" );
} }
} }
void CLlconServerDlg::customEvent(QCustomEvent* Event) void CLlconServerDlg::customEvent ( QCustomEvent* Event )
{ {
if (Event->type() == QEvent::User + 11) if ( Event->type() == QEvent::User + 11 )
{ {
ListViewMutex.lock(); ListViewMutex.lock();
const int iMessType = ((CLlconEvent*) Event)->iMessType; const int iMessType = ( (CLlconEvent*) Event )->iMessType;
const int iStatus = ((CLlconEvent*) Event)->iStatus; const int iStatus = ( (CLlconEvent*) Event )->iStatus;
const int iChanNum = ((CLlconEvent*) Event)->iChanNum; const int iChanNum = ( (CLlconEvent*) Event )->iChanNum;
switch(iMessType) switch(iMessType)
{ {
case MS_JIT_BUF_PUT: case MS_JIT_BUF_PUT:
vecpListViewItems[iChanNum]->SetLight(0, iStatus); vecpListViewItems[iChanNum]->SetLight ( 0, iStatus );
break; break;
case MS_JIT_BUF_GET: case MS_JIT_BUF_GET:
vecpListViewItems[iChanNum]->SetLight(1, iStatus); vecpListViewItems[iChanNum]->SetLight ( 1, iStatus );
break; break;
} }

View file

@ -11,8 +11,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>629</width> <width>752</width>
<height>240</height> <height>239</height>
</rect> </rect>
</property> </property>
<property stdset="1"> <property stdset="1">

View file

@ -126,7 +126,7 @@ protected:
class CServerListViewItem : public QListViewItem class CServerListViewItem : public QListViewItem
{ {
public: public:
CServerListViewItem ( QListView* parent ) : LED0 ( 1 ), LED1 ( 2 ), CServerListViewItem ( QListView* parent ) : LED0 ( 2 ), LED1 ( 3 ),
QListViewItem ( parent ) QListViewItem ( parent )
{ {
LED0.SetListViewItemPointer ( this ); LED0.SetListViewItemPointer ( this );

View file

@ -50,10 +50,11 @@ public:
bool IsRunning() { return Timer.isActive (); } bool IsRunning() { return Timer.isActive (); }
void GetConCliParam ( CVector<CHostAddress>& vecHostAddresses, void GetConCliParam ( CVector<CHostAddress>& vecHostAddresses,
CVector<std::string>& vecsName,
CVector<int>& veciJitBufSize, CVector<int>& veciNetwOutBlSiFact, CVector<int>& veciJitBufSize, CVector<int>& veciNetwOutBlSiFact,
CVector<int>& veciNetwInBlSiFact) CVector<int>& veciNetwInBlSiFact)
{ {
ChannelSet.GetConCliParam ( vecHostAddresses, ChannelSet.GetConCliParam ( vecHostAddresses, vecsName,
veciJitBufSize, veciNetwOutBlSiFact, veciNetwInBlSiFact ); veciJitBufSize, veciNetwOutBlSiFact, veciNetwInBlSiFact );
} }