some more work for ping message
This commit is contained in:
parent
1b2e1dcb6e
commit
788908b0d2
6 changed files with 71 additions and 34 deletions
|
@ -1,5 +1,5 @@
|
||||||
/******************************************************************************\
|
/******************************************************************************\
|
||||||
* Copyright (c) 2004-2006
|
* Copyright (c) 2004-2008
|
||||||
*
|
*
|
||||||
* Author(s):
|
* Author(s):
|
||||||
* Volker Fischer
|
* Volker Fischer
|
||||||
|
@ -70,13 +70,21 @@ CChannelSet::CChannelSet()
|
||||||
QObject::connect ( &vecChannels[4], SIGNAL ( NameHasChanged() ), this, SLOT ( OnNameHasChangedCh4() ) );
|
QObject::connect ( &vecChannels[4], SIGNAL ( NameHasChanged() ), this, SLOT ( OnNameHasChangedCh4() ) );
|
||||||
QObject::connect ( &vecChannels[5], SIGNAL ( NameHasChanged() ), this, SLOT ( OnNameHasChangedCh5() ) );
|
QObject::connect ( &vecChannels[5], SIGNAL ( NameHasChanged() ), this, SLOT ( OnNameHasChangedCh5() ) );
|
||||||
|
|
||||||
// chate text received
|
// chat text received
|
||||||
QObject::connect ( &vecChannels[0], SIGNAL ( ChatTextReceived ( QString ) ), this, SLOT ( OnChatTextReceivedCh0 ( QString ) ) );
|
QObject::connect ( &vecChannels[0], SIGNAL ( ChatTextReceived ( QString ) ), this, SLOT ( OnChatTextReceivedCh0 ( QString ) ) );
|
||||||
QObject::connect ( &vecChannels[1], SIGNAL ( ChatTextReceived ( QString ) ), this, SLOT ( OnChatTextReceivedCh1 ( QString ) ) );
|
QObject::connect ( &vecChannels[1], SIGNAL ( ChatTextReceived ( QString ) ), this, SLOT ( OnChatTextReceivedCh1 ( QString ) ) );
|
||||||
QObject::connect ( &vecChannels[2], SIGNAL ( ChatTextReceived ( QString ) ), this, SLOT ( OnChatTextReceivedCh2 ( QString ) ) );
|
QObject::connect ( &vecChannels[2], SIGNAL ( ChatTextReceived ( QString ) ), this, SLOT ( OnChatTextReceivedCh2 ( QString ) ) );
|
||||||
QObject::connect ( &vecChannels[3], SIGNAL ( ChatTextReceived ( QString ) ), this, SLOT ( OnChatTextReceivedCh3 ( QString ) ) );
|
QObject::connect ( &vecChannels[3], SIGNAL ( ChatTextReceived ( QString ) ), this, SLOT ( OnChatTextReceivedCh3 ( QString ) ) );
|
||||||
QObject::connect ( &vecChannels[4], SIGNAL ( ChatTextReceived ( QString ) ), this, SLOT ( OnChatTextReceivedCh4 ( QString ) ) );
|
QObject::connect ( &vecChannels[4], SIGNAL ( ChatTextReceived ( QString ) ), this, SLOT ( OnChatTextReceivedCh4 ( QString ) ) );
|
||||||
QObject::connect ( &vecChannels[5], SIGNAL ( ChatTextReceived ( QString ) ), this, SLOT ( OnChatTextReceivedCh5 ( QString ) ) );
|
QObject::connect ( &vecChannels[5], SIGNAL ( ChatTextReceived ( QString ) ), this, SLOT ( OnChatTextReceivedCh5 ( QString ) ) );
|
||||||
|
|
||||||
|
// ping message received
|
||||||
|
QObject::connect ( &vecChannels[0], SIGNAL ( PingReceived ( QTime ) ), this, SLOT ( OnPingReceivedCh0 ( QTime ) ) );
|
||||||
|
QObject::connect ( &vecChannels[1], SIGNAL ( PingReceived ( QTime ) ), this, SLOT ( OnPingReceivedCh1 ( QTime ) ) );
|
||||||
|
QObject::connect ( &vecChannels[2], SIGNAL ( PingReceived ( QTime ) ), this, SLOT ( OnPingReceivedCh2 ( QTime ) ) );
|
||||||
|
QObject::connect ( &vecChannels[3], SIGNAL ( PingReceived ( QTime ) ), this, SLOT ( OnPingReceivedCh3 ( QTime ) ) );
|
||||||
|
QObject::connect ( &vecChannels[4], SIGNAL ( PingReceived ( QTime ) ), this, SLOT ( OnPingReceivedCh4 ( QTime ) ) );
|
||||||
|
QObject::connect ( &vecChannels[5], SIGNAL ( PingReceived ( QTime ) ), this, SLOT ( OnPingReceivedCh5 ( QTime ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
CVector<CChannelShortInfo> CChannelSet::CreateChannelList()
|
CVector<CChannelShortInfo> CChannelSet::CreateChannelList()
|
||||||
|
@ -475,6 +483,9 @@ CChannel::CChannel() : sName ( "" ),
|
||||||
|
|
||||||
QObject::connect( &Protocol, SIGNAL ( ChatTextReceived ( QString ) ),
|
QObject::connect( &Protocol, SIGNAL ( ChatTextReceived ( QString ) ),
|
||||||
this, SIGNAL ( ChatTextReceived ( QString ) ) );
|
this, SIGNAL ( ChatTextReceived ( QString ) ) );
|
||||||
|
|
||||||
|
QObject::connect( &Protocol, SIGNAL ( PingReceived ( QTime ) ),
|
||||||
|
this, SIGNAL ( PingReceived ( QTime ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void CChannel::SetEnable ( const bool bNEnStat )
|
void CChannel::SetEnable ( const bool bNEnStat )
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/******************************************************************************\
|
/******************************************************************************\
|
||||||
* Copyright (c) 2004-2006
|
* Copyright (c) 2004-2008
|
||||||
*
|
*
|
||||||
* Author(s):
|
* Author(s):
|
||||||
* Volker Fischer
|
* Volker Fischer
|
||||||
|
@ -118,6 +118,7 @@ public:
|
||||||
void CreateReqJitBufMes() { Protocol.CreateReqJitBufMes(); }
|
void CreateReqJitBufMes() { Protocol.CreateReqJitBufMes(); }
|
||||||
void CreateReqConnClientsList() { Protocol.CreateReqConnClientsList(); }
|
void CreateReqConnClientsList() { Protocol.CreateReqConnClientsList(); }
|
||||||
void CreateChatTextMes ( const QString& strChatText ) { Protocol.CreateChatTextMes ( strChatText ); }
|
void CreateChatTextMes ( const QString& strChatText ) { Protocol.CreateChatTextMes ( strChatText ); }
|
||||||
|
void CreatePingMes ( const QTime time ) { Protocol.CreatePingMes ( time ); }
|
||||||
|
|
||||||
void CreateNetwBlSiFactMes ( const int iNetwBlSiFact )
|
void CreateNetwBlSiFactMes ( const int iNetwBlSiFact )
|
||||||
{
|
{
|
||||||
|
@ -194,6 +195,7 @@ signals:
|
||||||
void ProtocolStatus ( bool bOk );
|
void ProtocolStatus ( bool bOk );
|
||||||
void NameHasChanged();
|
void NameHasChanged();
|
||||||
void ChatTextReceived ( QString strChatText );
|
void ChatTextReceived ( QString strChatText );
|
||||||
|
void PingReceived ( QTime time );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -285,6 +287,13 @@ public slots:
|
||||||
void OnChatTextReceivedCh4 ( QString strChatText ) { CreateAndSendChatTextForAllConChannels ( 4, strChatText ); }
|
void OnChatTextReceivedCh4 ( QString strChatText ) { CreateAndSendChatTextForAllConChannels ( 4, strChatText ); }
|
||||||
void OnChatTextReceivedCh5 ( QString strChatText ) { CreateAndSendChatTextForAllConChannels ( 5, strChatText ); }
|
void OnChatTextReceivedCh5 ( QString strChatText ) { CreateAndSendChatTextForAllConChannels ( 5, strChatText ); }
|
||||||
|
|
||||||
|
void OnPingReceivedCh0 ( QTime time ) { vecChannels[0].CreatePingMes ( time ); }
|
||||||
|
void OnPingReceivedCh1 ( QTime time ) { vecChannels[1].CreatePingMes ( time ); }
|
||||||
|
void OnPingReceivedCh2 ( QTime time ) { vecChannels[2].CreatePingMes ( time ); }
|
||||||
|
void OnPingReceivedCh3 ( QTime time ) { vecChannels[3].CreatePingMes ( time ); }
|
||||||
|
void OnPingReceivedCh4 ( QTime time ) { vecChannels[4].CreatePingMes ( time ); }
|
||||||
|
void OnPingReceivedCh5 ( QTime time ) { vecChannels[5].CreatePingMes ( time ); }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void MessReadyForSending ( int iChID, CVector<uint8_t> vecMessage );
|
void MessReadyForSending ( int iChID, CVector<uint8_t> vecMessage );
|
||||||
};
|
};
|
||||||
|
|
|
@ -88,6 +88,12 @@ void CClient::OnNewConnection()
|
||||||
Channel.CreateReqConnClientsList();
|
Channel.CreateReqConnClientsList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CClient::OnReceivePingMessage ( QTime time )
|
||||||
|
{
|
||||||
|
// calculate difference between received time and current time
|
||||||
|
emit PingTimeReceived ( time.msecsTo ( QTime().currentTime() ) );
|
||||||
|
}
|
||||||
|
|
||||||
bool CClient::SetServerAddr ( QString strNAddr )
|
bool CClient::SetServerAddr ( QString strNAddr )
|
||||||
{
|
{
|
||||||
QHostAddress InetAddr;
|
QHostAddress InetAddr;
|
||||||
|
|
|
@ -124,6 +124,9 @@ public:
|
||||||
void SendTextMess ( const QString& strChatText )
|
void SendTextMess ( const QString& strChatText )
|
||||||
{ Channel.CreateChatTextMes ( strChatText ); }
|
{ Channel.CreateChatTextMes ( strChatText ); }
|
||||||
|
|
||||||
|
void SendPingMess()
|
||||||
|
{ Channel.CreatePingMes ( QTime().currentTime() ); }
|
||||||
|
|
||||||
CSound* GetSndInterface() { return &Sound; }
|
CSound* GetSndInterface() { return &Sound; }
|
||||||
CChannel* GetChannel() { return &Channel; }
|
CChannel* GetChannel() { return &Channel; }
|
||||||
|
|
||||||
|
@ -182,10 +185,12 @@ public slots:
|
||||||
void OnReqJittBufSize();
|
void OnReqJittBufSize();
|
||||||
void OnProtocolStatus ( bool bOk );
|
void OnProtocolStatus ( bool bOk );
|
||||||
void OnNewConnection();
|
void OnNewConnection();
|
||||||
|
void OnReceivePingMessage ( QTime time );
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void ConClientListMesReceived ( CVector<CChannelShortInfo> vecChanInfo );
|
void ConClientListMesReceived ( CVector<CChannelShortInfo> vecChanInfo );
|
||||||
void ChatTextReceived ( QString strChatText );
|
void ChatTextReceived ( QString strChatText );
|
||||||
|
void PingTimeReceived ( int iPingTime );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -164,6 +164,12 @@ void CClientSettingsDlg::OnOpenChatOnNewMessageStateChanged ( int value )
|
||||||
|
|
||||||
void CClientSettingsDlg::UpdateDisplay()
|
void CClientSettingsDlg::UpdateDisplay()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
// TEST
|
||||||
|
//pClient->SendPingMess();
|
||||||
|
|
||||||
|
|
||||||
// response time
|
// response time
|
||||||
TextLabelStdDevTimer->setText ( QString().
|
TextLabelStdDevTimer->setText ( QString().
|
||||||
setNum ( pClient->GetTimingStdDev(), 'f', 2 ) + " ms" );
|
setNum ( pClient->GetTimingStdDev(), 'f', 2 ) + " ms" );
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/******************************************************************************\
|
/******************************************************************************\
|
||||||
* Copyright (c) 2004-2006
|
* Copyright (c) 2004-2008
|
||||||
*
|
*
|
||||||
* Author(s):
|
* Author(s):
|
||||||
* Volker Fischer
|
* Volker Fischer
|
||||||
|
|
Loading…
Reference in a new issue