Thanks,
I am updating the model every 5 milliseconds, the model is preloaded with data and certain parts of this data is updated ( such as reading signal from a car for the rpm ).
This is the code I have now which is called every 5 milliseconds :
{
QList<QObject*> *pList = theApp->m_dcb.GetSignalList();
if( pList )
{
for( int i = 0; i < pList->count(); i++ )
{
CDADcb::CSignal* pSignal = (CDADcb::CSignal*)pList->at(i);
// This signal belong to this CAN id, there can be many signals that do
if( pSignal->m_strId == strId )
{
// we need to do the conversion here - TODO
pSignal->m_strRawData = strData;
pSignal->m_nCount++;
}
}
emit layoutChanged();
}
}
void DACanTreeModel::updateTable( QString strData, QString strId )
{
QList<QObject*> *pList = theApp->m_dcb.GetSignalList();
if( pList )
{
for( int i = 0; i < pList->count(); i++ )
{
CDADcb::CSignal* pSignal = (CDADcb::CSignal*)pList->at(i);
// This signal belong to this CAN id, there can be many signals that do
if( pSignal->m_strId == strId )
{
// we need to do the conversion here - TODO
pSignal->m_strRawData = strData;
pSignal->m_nCount++;
}
}
emit layoutChanged();
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks