improved implementation

This commit is contained in:
Volker Fischer 2006-03-04 11:12:47 +00:00
parent 83d61351bb
commit bcb421e175
2 changed files with 13 additions and 39 deletions

View File

@ -30,33 +30,20 @@
\******************************************************************************/
CChannelSet::CChannelSet()
{
// TEST for a test just connect each channel in a separate function
// TODO better solution!!!
QObject::connect ( &vecChannels[0], SIGNAL ( MessReadyForSending ( CVector<uint8_t> ) ),
this, SLOT ( OnSendProtMessageCh0 ( CVector<uint8_t> ) ) );
QObject::connect ( &vecChannels[1], SIGNAL ( MessReadyForSending ( CVector<uint8_t> ) ),
this, SLOT ( OnSendProtMessageCh0 ( CVector<uint8_t> ) ) );
QObject::connect ( &vecChannels[2], SIGNAL ( MessReadyForSending ( CVector<uint8_t> ) ),
this, SLOT ( OnSendProtMessageCh0 ( CVector<uint8_t> ) ) );
QObject::connect ( &vecChannels[3], SIGNAL ( MessReadyForSending ( CVector<uint8_t> ) ),
this, SLOT ( OnSendProtMessageCh0 ( CVector<uint8_t> ) ) );
QObject::connect ( &vecChannels[4], SIGNAL ( MessReadyForSending ( CVector<uint8_t> ) ),
this, SLOT ( OnSendProtMessageCh0 ( CVector<uint8_t> ) ) );
QObject::connect ( &vecChannels[5], SIGNAL ( MessReadyForSending ( CVector<uint8_t> ) ),
this, SLOT ( OnSendProtMessageCh0 ( CVector<uint8_t> ) ) );
QObject::connect ( &vecChannels[6], SIGNAL ( MessReadyForSending ( CVector<uint8_t> ) ),
this, SLOT ( OnSendProtMessageCh0 ( CVector<uint8_t> ) ) );
QObject::connect ( &vecChannels[7], SIGNAL ( MessReadyForSending ( CVector<uint8_t> ) ),
this, SLOT ( OnSendProtMessageCh0 ( CVector<uint8_t> ) ) );
QObject::connect ( &vecChannels[8], SIGNAL ( MessReadyForSending ( CVector<uint8_t> ) ),
this, SLOT ( OnSendProtMessageCh0 ( CVector<uint8_t> ) ) );
QObject::connect ( &vecChannels[9], SIGNAL ( MessReadyForSending ( CVector<uint8_t> ) ),
this, SLOT ( OnSendProtMessageCh0 ( CVector<uint8_t> ) ) );
// connect "message send"-message for each channel
for ( int i = 0; i < MAX_NUM_CHANNELS; i++ )
{
QObject::connect ( &vecChannels[i],
SIGNAL ( MessReadyForSending ( CVector<uint8_t> ) ),
this, SLOT ( OnSendProtMessage ( i, CVector<uint8_t> ) ) );
}
}
void CChannelSet::OnSendProtMessage ( int iChID, CVector<uint8_t> vecMessage )
{
// just pass message through and add channel ID
emit MessReadyForSending ( iChID,vecMessage );
}
int CChannelSet::GetFreeChan()
{

View File

@ -180,21 +180,8 @@ protected:
CChannel vecChannels[MAX_NUM_CHANNELS];
QMutex Mutex;
public slots:
// TODO better solution!!!
void OnSendProtMessageCh0(CVector<uint8_t> mess) { emit MessReadyForSending(0,mess); }
void OnSendProtMessageCh1(CVector<uint8_t> mess) { emit MessReadyForSending(1,mess); }
void OnSendProtMessageCh2(CVector<uint8_t> mess) { emit MessReadyForSending(2,mess); }
void OnSendProtMessageCh3(CVector<uint8_t> mess) { emit MessReadyForSending(3,mess); }
void OnSendProtMessageCh4(CVector<uint8_t> mess) { emit MessReadyForSending(4,mess); }
void OnSendProtMessageCh5(CVector<uint8_t> mess) { emit MessReadyForSending(5,mess); }
void OnSendProtMessageCh6(CVector<uint8_t> mess) { emit MessReadyForSending(6,mess); }
void OnSendProtMessageCh7(CVector<uint8_t> mess) { emit MessReadyForSending(7,mess); }
void OnSendProtMessageCh8(CVector<uint8_t> mess) { emit MessReadyForSending(8,mess); }
void OnSendProtMessageCh9(CVector<uint8_t> mess) { emit MessReadyForSending(9,mess); }
void OnSendProtMessage ( int iChID, CVector<uint8_t> vecMessage );
signals:
void MessReadyForSending ( int iChID, CVector<uint8_t> vecMessage );