fixes for network buffer factor setting

This commit is contained in:
Volker Fischer 2006-03-12 13:19:41 +00:00
parent 614708c9c3
commit 95389cbf7a
4 changed files with 101 additions and 47 deletions

View file

@ -283,17 +283,21 @@ void CChannel::SetNetwOutBlSiFact ( const int iNewBlockSizeFactor )
void CChannel::OnSendProtMessage ( CVector<uint8_t> vecMessage ) void CChannel::OnSendProtMessage ( CVector<uint8_t> vecMessage )
{ {
// only send messages if we are connected, otherwise delete complete queue
if ( IsConnected () ) // must be disabled to be able to receive network buffer size factor changes
{ // FIXME check, if this condition must be checked somewhere else!
// // only send messages if we are connected, otherwise delete complete queue
// if ( IsConnected() )
// {
// emit message to actually send the data // emit message to actually send the data
emit MessReadyForSending ( vecMessage ); emit MessReadyForSending ( vecMessage );
} // }
else // else
{ // {
// delete send message queue // // delete send message queue
Protocol.DeleteSendMessQueue(); // Protocol.DeleteSendMessQueue();
} // }
} }
@ -409,6 +413,7 @@ for ( int i = 0; i < iCurNetwInBlSiFact * MIN_BLOCK_SIZE_SAMPLES; i++ ) {
// only use protocol data if channel is connected // only use protocol data if channel is connected
// must be disabled to be able to receive network buffer size factor changes // must be disabled to be able to receive network buffer size factor changes
// FIXME check, if this condition must be checked somewhere else!
// if ( IsConnected() ) // if ( IsConnected() )
{ {

View file

@ -235,24 +235,28 @@ void CLlconClientDlg::OnSliderSndBufInChange(int value)
{ {
pClient->GetSndInterface()->SetInNumBuf(value); pClient->GetSndInterface()->SetInNumBuf(value);
TextSndBufIn->setText("In: " + QString().setNum(value)); TextSndBufIn->setText("In: " + QString().setNum(value));
UpdateDisplay();
} }
void CLlconClientDlg::OnSliderSndBufOutChange(int value) void CLlconClientDlg::OnSliderSndBufOutChange(int value)
{ {
pClient->GetSndInterface()->SetOutNumBuf(value); pClient->GetSndInterface()->SetOutNumBuf(value);
TextSndBufOut->setText("Out: " + QString().setNum(value)); TextSndBufOut->setText("Out: " + QString().setNum(value));
UpdateDisplay();
} }
void CLlconClientDlg::OnSliderNetBuf(int value) void CLlconClientDlg::OnSliderNetBuf(int value)
{ {
pClient->SetSockBufSize ( value ); pClient->SetSockBufSize ( value );
TextNetBuf->setText("Size: " + QString().setNum(value)); TextNetBuf->setText("Size: " + QString().setNum(value));
UpdateDisplay();
} }
void CLlconClientDlg::OnSliderNetBufSiFact(int value) void CLlconClientDlg::OnSliderNetBufSiFact(int value)
{ {
pClient->SetNetwBufSizeFact ( value ); pClient->SetNetwBufSizeFact ( value );
TextNetBufSiFact->setText("Fact.: " + QString().setNum(value)); TextNetBufSiFact->setText("Fact.: " + QString().setNum(value));
UpdateDisplay();
} }
void CLlconClientDlg::OnTimerSigMet () void CLlconClientDlg::OnTimerSigMet ()
@ -288,7 +292,7 @@ void CLlconClientDlg::OnTimerSigMet ()
ProgressBarInputLevelR->setProgress ( (int) ceil ( dCurSigLevelR ) ); ProgressBarInputLevelR->setProgress ( (int) ceil ( dCurSigLevelR ) );
} }
void CLlconClientDlg::OnTimerStatus () void CLlconClientDlg::UpdateDisplay()
{ {
/* show connection status in status bar */ /* show connection status in status bar */
if ( pClient->IsConnected () && pClient->IsRunning () ) if ( pClient->IsConnected () && pClient->IsRunning () )
@ -303,6 +307,10 @@ void CLlconClientDlg::OnTimerStatus ()
/* response time */ /* response time */
TextLabelStdDevTimer->setText(QString(). TextLabelStdDevTimer->setText(QString().
setNum(pClient->GetTimingStdDev(), 'f', 2) + " ms"); setNum(pClient->GetTimingStdDev(), 'f', 2) + " ms");
// current network buffer size
TextLabelActNetwBufSize->setText(QString().
setNum(double(pClient->GetNetwBufSizeFact() * MIN_BLOCK_DURATION_MS), 'f', 2) + " ms");
} }
void CLlconClientDlg::customEvent(QCustomEvent* Event) void CLlconClientDlg::customEvent(QCustomEvent* Event)

View file

@ -76,15 +76,17 @@ protected:
bool bConnected; bool bConnected;
QTimer TimerSigMet; QTimer TimerSigMet;
QTimer TimerStatus; QTimer TimerStatus;
virtual void customEvent ( QCustomEvent* Event ); virtual void customEvent ( QCustomEvent* Event );
virtual void closeEvent ( QCloseEvent * Event ); virtual void closeEvent ( QCloseEvent * Event );
void UpdateDisplay();
QMenuBar* pMenu; QMenuBar* pMenu;
public slots: public slots:
void OnConnectDisconBut(); void OnConnectDisconBut();
void OnTimerSigMet(); void OnTimerSigMet();
void OnTimerStatus (); void OnTimerStatus() { UpdateDisplay(); }
void OnSliderSndBufInChange ( int value ); void OnSliderSndBufInChange ( int value );
void OnSliderSndBufOutChange ( int value ); void OnSliderSndBufOutChange ( int value );
void OnSliderNetBuf ( int value ); void OnSliderNetBuf ( int value );

View file

@ -1095,7 +1095,7 @@
<name>title</name> <name>title</name>
<string>Measurement Results</string> <string>Measurement Results</string>
</property> </property>
<vbox> <hbox>
<property stdset="1"> <property stdset="1">
<name>margin</name> <name>margin</name>
<number>11</number> <number>11</number>
@ -1108,9 +1108,9 @@
<class>QLayoutWidget</class> <class>QLayoutWidget</class>
<property stdset="1"> <property stdset="1">
<name>name</name> <name>name</name>
<cstring>Layout16</cstring> <cstring>Layout17</cstring>
</property> </property>
<hbox> <vbox>
<property stdset="1"> <property stdset="1">
<name>margin</name> <name>margin</name>
<number>0</number> <number>0</number>
@ -1130,6 +1130,34 @@
<string>StdDev:</string> <string>StdDev:</string>
</property> </property>
</widget> </widget>
<widget>
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabelActNetwBufSizeLabel</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>Netw. Buf. Size:</string>
</property>
</widget>
</vbox>
</widget>
<widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout18</cstring>
</property>
<vbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget> <widget>
<class>QLabel</class> <class>QLabel</class>
<property stdset="1"> <property stdset="1">
@ -1141,12 +1169,23 @@
<string>val</string> <string>val</string>
</property> </property>
</widget> </widget>
</hbox> <widget>
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabelActNetwBufSize</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>val</string>
</property>
</widget> </widget>
</vbox> </vbox>
</widget> </widget>
</hbox> </hbox>
</widget> </widget>
</hbox>
</widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>
<class>CMultiColorLED</class> <class>CMultiColorLED</class>