bug fix for server

This commit is contained in:
Volker Fischer 2008-03-28 21:46:13 +00:00
parent 6d8160c518
commit 25161fa55a
5 changed files with 74 additions and 65 deletions

View file

@ -114,7 +114,7 @@
<item>
<widget class="QLabel" name="TextLabelCopyright" >
<property name="text" >
<string>Copyright (C) 2005 - 2006</string>
<string>Copyright (C) 2005 - 2008</string>
</property>
<property name="wordWrap" >
<bool>false</bool>

View file

@ -1,5 +1,5 @@
/******************************************************************************\
* Copyright (c) 2004-2006
* Copyright (c) 2004-2008
*
* Author(s):
* Volker Fischer
@ -63,7 +63,7 @@ CLlconServerDlg::CLlconServerDlg ( CServer* pNServP, QWidget* parent )
for ( int i = MAX_NUM_CHANNELS - 1; i >= 0; i-- )
{
vecpListViewItems[i] = new CServerListViewItem ( ListViewClients );
vecpListViewItems[i]->setHidden ( false );
vecpListViewItems[i]->setHidden ( true );
}
// Init timing jitter text label
@ -108,9 +108,9 @@ void CLlconServerDlg::OnTimer()
if ( !( vecHostAddresses[i].InetAddr == QHostAddress ( (quint32) 0 ) ) )
{
// IP, port number
vecpListViewItems[i]->setText ( 0, QString().sprintf ( "%s : %d",
vecHostAddresses[i].InetAddr.toString(),
vecHostAddresses[i].iPort ) /* IP, port */);
vecpListViewItems[i]->setText ( 0, QString("%1 : %2" ).
arg ( vecHostAddresses[i].InetAddr.toString() ).
arg ( vecHostAddresses[i].iPort ) );
// name
vecpListViewItems[i]->setText ( 1, vecsName[i] );
@ -123,15 +123,15 @@ void CLlconServerDlg::OnTimer()
vecpListViewItems[i]->setText ( 5,
QString().setNum (
double ( veciNetwInBlSiFact[i] * MIN_BLOCK_DURATION_MS ), 'f', 2 ) );
vecpListViewItems[i]->setText(6,
vecpListViewItems[i]->setText ( 6,
QString().setNum (
double ( veciNetwOutBlSiFact[i] * MIN_BLOCK_DURATION_MS ), 'f', 2 ) );
vecpListViewItems[i]->setHidden ( true );
vecpListViewItems[i]->setHidden ( false );
}
else
{
vecpListViewItems[i]->setHidden ( false );
vecpListViewItems[i]->setHidden ( true );
}
}

View file

@ -70,6 +70,9 @@ CMultiColorLED::CMultiColorLED ( QWidget* parent, Qt::WindowFlags f )
this, SLOT ( OnTimerGreenLight() ) );
connect ( &TimerYellowLight, SIGNAL ( timeout() ),
this, SLOT ( OnTimerYellowLight() ) );
connect ( this, SIGNAL ( newPixmap ( const QPixmap& ) ),
this, SLOT ( OnNewPixmap ( const QPixmap& ) ) );
}
void CMultiColorLED::Reset()
@ -109,7 +112,8 @@ void CMultiColorLED::UpdateColor()
{
if ( eColorFlag != RL_RED )
{
setPixmap ( BitmCubeRed );
//setPixmap ( BitmCubeRed );
emit newPixmap ( BitmCubeRed );
eColorFlag = RL_RED;
}
return;
@ -119,7 +123,8 @@ void CMultiColorLED::UpdateColor()
{
if ( eColorFlag != RL_YELLOW )
{
setPixmap ( BitmCubeYellow );
//setPixmap ( BitmCubeYellow );
emit newPixmap ( BitmCubeYellow );
eColorFlag = RL_YELLOW;
}
return;
@ -129,7 +134,8 @@ void CMultiColorLED::UpdateColor()
{
if ( eColorFlag != RL_GREEN )
{
setPixmap ( BitmCubeGreen );
//setPixmap ( BitmCubeGreen );
emit newPixmap ( BitmCubeGreen );
eColorFlag = RL_GREEN;
}
return;

View file

@ -85,15 +85,17 @@ protected slots:
void OnTimerRedLight();
void OnTimerGreenLight();
void OnTimerYellowLight();
virtual void OnNewPixmap ( const QPixmap& newPixmap ) { setPixmap ( newPixmap ); }
signals:
void newPixmap ( const QPixmap& newPixmap );
};
// TODO list view item LED does not work anymore
class CMultColLEDListViewItem : public CMultiColorLED
{
Q_OBJECT
public:
CMultColLEDListViewItem ( const int iNewCol ) : iColumn ( iNewCol ),
pListViewItem ( NULL ) {}
@ -103,15 +105,16 @@ public:
pListViewItem = pNewListViewItem;
}
protected:
virtual void SetPixmap ( QPixmap& NewBitmap )
protected slots:
virtual void OnNewPixmap ( const QPixmap& newPixmap )
{
if ( pListViewItem != NULL )
{
pListViewItem->setIcon ( iColumn, QIcon ( NewBitmap ) );
pListViewItem->setIcon ( iColumn, QIcon ( newPixmap ) );
}
}
protected:
QTreeWidgetItem* pListViewItem;
int iColumn;
};