changing implementation of continuous logging
uncommenting function declaration
This commit is contained in:
+14
-3
@@ -143,6 +143,9 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
|
|
||||||
connect(CANConManager::getInstance(), &CANConManager::framesReceived, model, &CANFrameModel::addFrames);
|
connect(CANConManager::getInstance(), &CANConManager::framesReceived, model, &CANFrameModel::addFrames);
|
||||||
|
|
||||||
|
//new implementation for continuous logging:
|
||||||
|
connect(CANConManager::getInstance(), &CANConManager::framesReceived, this, &MainWindow::logReceivedFrame);
|
||||||
|
|
||||||
lbStatusConnected.setText(tr("Connected to 0 buses"));
|
lbStatusConnected.setText(tr("Connected to 0 buses"));
|
||||||
lbHelp.setText(tr("Press F1 on any screen for help"));
|
lbHelp.setText(tr("Press F1 on any screen for help"));
|
||||||
lbHelp.setAlignment(Qt::AlignCenter);
|
lbHelp.setAlignment(Qt::AlignCenter);
|
||||||
@@ -579,6 +582,14 @@ void MainWindow::filterClearAll()
|
|||||||
model->setAllFilters(false);
|
model->setAllFilters(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::logReceivedFrame(CANConnection* conn, QVector<CANFrame> frames)
|
||||||
|
{
|
||||||
|
if (continuousLogging)
|
||||||
|
{
|
||||||
|
FrameFileIO::writeContinuousNative(&frames, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::tickGUIUpdate()
|
void MainWindow::tickGUIUpdate()
|
||||||
{
|
{
|
||||||
rxFrames = model->sendBulkRefresh();
|
rxFrames = model->sendBulkRefresh();
|
||||||
@@ -605,8 +616,8 @@ void MainWindow::tickGUIUpdate()
|
|||||||
|
|
||||||
if (continuousLogging)
|
if (continuousLogging)
|
||||||
{
|
{
|
||||||
const QVector<CANFrame> *modelFrames = model->getListReference();
|
// const QVector<CANFrame> *modelFrames = model->getListReference();
|
||||||
FrameFileIO::writeContinuousNative(modelFrames, modelFrames->count() - rxFrames);
|
// FrameFileIO::writeContinuousNative(modelFrames, modelFrames->count() - rxFrames);
|
||||||
|
|
||||||
continuousLogFlushCounter++;
|
continuousLogFlushCounter++;
|
||||||
if ((continuousLogFlushCounter % 3) == 0)
|
if ((continuousLogFlushCounter % 3) == 0)
|
||||||
@@ -617,7 +628,7 @@ void MainWindow::tickGUIUpdate()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ui->lblContMsg->setText("CONTINUOUS LOGGING");
|
ui->lblContMsg->setText("LOGGING");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (continuousLogFlushCounter > 8)
|
if (continuousLogFlushCounter > 8)
|
||||||
|
|||||||
+1
-1
@@ -94,7 +94,7 @@ private slots:
|
|||||||
void gridDoubleClicked(QModelIndex);
|
void gridDoubleClicked(QModelIndex);
|
||||||
void interpretToggled(bool);
|
void interpretToggled(bool);
|
||||||
void overwriteToggled(bool);
|
void overwriteToggled(bool);
|
||||||
//void logReceivedFrame(CANConnection*, QVector<CANFrame>);
|
void logReceivedFrame(CANConnection*, QVector<CANFrame>);
|
||||||
void tickGUIUpdate();
|
void tickGUIUpdate();
|
||||||
void toggleCapture();
|
void toggleCapture();
|
||||||
void normalizeTiming();
|
void normalizeTiming();
|
||||||
|
|||||||
Reference in New Issue
Block a user