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

View file

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

View file

@ -31,8 +31,8 @@ CLlconServerDlg::CLlconServerDlg ( CServer* pNServP, QWidget* parent,
CLlconServerDlgBase ( parent, name, modal, f )
{
/* set text for version and application name */
TextLabelNameVersion->
setText(QString(APP_NAME) + tr(" server ") + QString(VERSION));
TextLabelNameVersion->setText ( QString ( APP_NAME ) +
tr ( " server " ) + QString ( VERSION ) );
/* Create bitmaps */
/* Define size of the bitmaps */
@ -49,16 +49,19 @@ CLlconServerDlg::CLlconServerDlg ( CServer* pNServP, QWidget* parent,
already there) */
ListViewClients->setColumnText ( 0, tr ( "Client IP : Port" ) );
ListViewClients->setColumnWidth ( 0, 170 );
ListViewClients->addColumn ( tr ( "Name" ) );
ListViewClients->setColumnAlignment ( 1, Qt::AlignLeft );
ListViewClients->setColumnWidth ( 1, 150 );
ListViewClients->addColumn ( tr ( "Put" ) );
ListViewClients->setColumnAlignment(1, Qt::AlignCenter);
ListViewClients->addColumn(tr("Get"));
ListViewClients->setColumnAlignment ( 2, Qt::AlignCenter );
ListViewClients->addColumn ( tr ( "Get" ) );
ListViewClients->setColumnAlignment ( 3, Qt::AlignCenter );
ListViewClients->addColumn ( tr ( "Jitter buffer size" ) );
ListViewClients->setColumnAlignment(3, Qt::AlignRight);
ListViewClients->addColumn(tr("Block Size In"));
ListViewClients->setColumnAlignment ( 4, Qt::AlignRight );
ListViewClients->addColumn(tr("Block Size Out"));
ListViewClients->addColumn ( tr ( "Block Size In" ) );
ListViewClients->setColumnAlignment ( 5, Qt::AlignRight );
ListViewClients->addColumn ( tr ( "Block Size Out" ) );
ListViewClients->setColumnAlignment ( 6, Qt::AlignRight );
ListViewClients->clear();
/* 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()
{
CVector<CHostAddress> vecHostAddresses;
CVector<std::string> vecsName;
CVector<int> veciJitBufSize;
CVector<int> veciNetwOutBlSiFact;
CVector<int> veciNetwInBlSiFact;
@ -106,7 +110,7 @@ void CLlconServerDlg::OnTimer()
ListViewMutex.lock();
pServer->GetConCliParam ( vecHostAddresses, veciJitBufSize,
pServer->GetConCliParam ( vecHostAddresses, vecsName, veciJitBufSize,
veciNetwOutBlSiFact, veciNetwInBlSiFact );
/* fill list with connected clients */
@ -114,20 +118,23 @@ void CLlconServerDlg::OnTimer()
{
if ( ! ( vecHostAddresses[i].InetAddr == QHostAddress ( (Q_UINT32) 0 ) ) )
{
/* main text (IP, port number) */
// IP, port number
vecpListViewItems[i]->setText ( 0, QString().sprintf ( "%s : %d",
vecHostAddresses[i].InetAddr.toString().latin1(),
vecHostAddresses[i].iPort ) /* IP, port */);
/* jitter buffer size (polling for updates) */
vecpListViewItems[i]->setText(3,
// name
vecpListViewItems[i]->setText ( 1, vecsName[i].c_str() );
// jitter buffer size (polling for updates)
vecpListViewItems[i]->setText ( 4,
QString().setNum ( veciJitBufSize[i] ) );
/* in / out network block sizes */
vecpListViewItems[i]->setText(4,
// in/out network block sizes
vecpListViewItems[i]->setText ( 5,
QString().setNum (
double ( veciNetwInBlSiFact[i] * MIN_BLOCK_DURATION_MS), 'f', 2 ) );
vecpListViewItems[i]->setText(5,
vecpListViewItems[i]->setText(6,
QString().setNum (
double ( veciNetwOutBlSiFact[i] * MIN_BLOCK_DURATION_MS), 'f', 2 ) );
@ -138,10 +145,11 @@ void CLlconServerDlg::OnTimer()
else
{
#ifdef _WIN32
/* remove text for Windows version */
// remove text for Windows version
vecpListViewItems[i]->setText ( 0, "" );
vecpListViewItems[i]->setText(3, "");
vecpListViewItems[i]->setText ( 1, "" );
vecpListViewItems[i]->setText ( 4, "" );
vecpListViewItems[i]->setText ( 5, "" );
#else
vecpListViewItems[i]->setVisible ( false );
#endif
@ -150,7 +158,7 @@ void CLlconServerDlg::OnTimer()
ListViewMutex.unlock();
/* response time (if available) */
// response time (if available)
if ( pServer->GetTimingStdDev ( dCurTiStdDev ) )
{
TextLabelResponseTime->setText ( QString().

View file

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

View file

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

View file

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