Both FlowView and Frame Details will now auto refresh when reopened. But, also there is a new interface that allows the various screens to get status updates. This is currently only active in the Frame Details screen and not completely yet but it is started and functional.
This commit is contained in:
@@ -67,7 +67,13 @@ void FlowViewWindow::showEvent(QShowEvent* event)
|
|||||||
{
|
{
|
||||||
QDialog::showEvent(event);
|
QDialog::showEvent(event);
|
||||||
refreshIDList();
|
refreshIDList();
|
||||||
|
if (ui->listFrameID->count() > 0)
|
||||||
|
{
|
||||||
|
changeID(ui->listFrameID->item(0)->text());
|
||||||
|
ui->listFrameID->setCurrentRow(0);
|
||||||
|
}
|
||||||
updateFrameLabel();
|
updateFrameLabel();
|
||||||
|
qDebug() << "FlowView show event was processed";
|
||||||
}
|
}
|
||||||
|
|
||||||
FlowViewWindow::~FlowViewWindow()
|
FlowViewWindow::~FlowViewWindow()
|
||||||
|
|||||||
+38
-3
@@ -1,5 +1,6 @@
|
|||||||
#include "frameinfowindow.h"
|
#include "frameinfowindow.h"
|
||||||
#include "ui_frameinfowindow.h"
|
#include "ui_frameinfowindow.h"
|
||||||
|
#include "mainwindow.h"
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
|
|
||||||
FrameInfoWindow::FrameInfoWindow(QVector<CANFrame> *frames, QWidget *parent) :
|
FrameInfoWindow::FrameInfoWindow(QVector<CANFrame> *frames, QWidget *parent) :
|
||||||
@@ -8,12 +9,20 @@ FrameInfoWindow::FrameInfoWindow(QVector<CANFrame> *frames, QWidget *parent) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
modelFrames = frames;
|
modelFrames = frames;
|
||||||
|
|
||||||
|
connect(ui->listFrameID, SIGNAL(currentTextChanged(QString)), this, SLOT(updateDetailsWindow(QString)));
|
||||||
|
connect(MainWindow::getReference(), SIGNAL(framesUpdated(int)), this, SLOT(updatedFrames(int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void FrameInfoWindow::showEvent(QShowEvent* event)
|
void FrameInfoWindow::showEvent(QShowEvent* event)
|
||||||
{
|
{
|
||||||
QDialog::showEvent(event);
|
QDialog::showEvent(event);
|
||||||
refreshIDList();
|
refreshIDList();
|
||||||
|
if (ui->listFrameID->count() > 0)
|
||||||
|
{
|
||||||
|
updateDetailsWindow(ui->listFrameID->item(0)->text());
|
||||||
|
ui->listFrameID->setCurrentRow(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FrameInfoWindow::~FrameInfoWindow()
|
FrameInfoWindow::~FrameInfoWindow()
|
||||||
@@ -21,7 +30,31 @@ FrameInfoWindow::~FrameInfoWindow()
|
|||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FrameInfoWindow::updateDetailsWindow(QListWidgetItem *item)
|
//remember, negative numbers are special -1 = all frames deleted, -2 = totally new set of frames.
|
||||||
|
void FrameInfoWindow::updatedFrames(int numFrames)
|
||||||
|
{
|
||||||
|
if (numFrames == -1) //all frames deleted. Kill the display
|
||||||
|
{
|
||||||
|
ui->listFrameID->clear();
|
||||||
|
ui->treeDetails->clear();
|
||||||
|
refreshIDList();
|
||||||
|
}
|
||||||
|
else if (numFrames == -2) //all new set of frames. Reset
|
||||||
|
{
|
||||||
|
refreshIDList();
|
||||||
|
if (ui->listFrameID->count() > 0)
|
||||||
|
{
|
||||||
|
updateDetailsWindow(ui->listFrameID->item(0)->text());
|
||||||
|
ui->listFrameID->setCurrentRow(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else //just got some new frames. See if they are relevant.
|
||||||
|
{
|
||||||
|
//not done yet. :(
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void FrameInfoWindow::updateDetailsWindow(QString newID)
|
||||||
{
|
{
|
||||||
int idx, numFrames, targettedID;
|
int idx, numFrames, targettedID;
|
||||||
int minLen, maxLen, thisLen;
|
int minLen, maxLen, thisLen;
|
||||||
@@ -31,7 +64,9 @@ void FrameInfoWindow::updateDetailsWindow(QListWidgetItem *item)
|
|||||||
int dataHistogram[256][8];
|
int dataHistogram[256][8];
|
||||||
QTreeWidgetItem *baseNode, *dataBase, *histBase, *numBase, *tempItem;
|
QTreeWidgetItem *baseNode, *dataBase, *histBase, *numBase, *tempItem;
|
||||||
|
|
||||||
targettedID = item->text().toInt(NULL, 16);
|
targettedID = newID.toInt(NULL, 16);
|
||||||
|
|
||||||
|
if (modelFrames->count() == 0) return;
|
||||||
|
|
||||||
qDebug() << "Started update details window with id " << targettedID;
|
qDebug() << "Started update details window with id " << targettedID;
|
||||||
|
|
||||||
@@ -50,7 +85,7 @@ void FrameInfoWindow::updateDetailsWindow(QListWidgetItem *item)
|
|||||||
ui->treeDetails->clear();
|
ui->treeDetails->clear();
|
||||||
|
|
||||||
baseNode = new QTreeWidgetItem();
|
baseNode = new QTreeWidgetItem();
|
||||||
baseNode->setText(0, QString("ID: 0x") + ui->listFrameID->currentItem()->text());
|
baseNode->setText(0, QString("ID: 0x") + newID );
|
||||||
|
|
||||||
if (frameCache[0].extended) //if these frames seem to be extended then try for J1939 decoding
|
if (frameCache[0].extended) //if these frames seem to be extended then try for J1939 decoding
|
||||||
{
|
{
|
||||||
|
|||||||
+2
-1
@@ -19,7 +19,8 @@ public:
|
|||||||
void showEvent(QShowEvent*);
|
void showEvent(QShowEvent*);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void updateDetailsWindow(QListWidgetItem *);
|
void updateDetailsWindow(QString);
|
||||||
|
void updatedFrames(int);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::FrameInfoWindow *ui;
|
Ui::FrameInfoWindow *ui;
|
||||||
|
|||||||
+1
-18
@@ -64,24 +64,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections>
|
<connections/>
|
||||||
<connection>
|
|
||||||
<sender>listFrameID</sender>
|
|
||||||
<signal>itemClicked(QListWidgetItem*)</signal>
|
|
||||||
<receiver>FrameInfoWindow</receiver>
|
|
||||||
<slot>updateDetailsWindow(QListWidgetItem*)</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>139</x>
|
|
||||||
<y>258</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>396</x>
|
|
||||||
<y>246</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
</connections>
|
|
||||||
<slots>
|
<slots>
|
||||||
<slot>updateDetailsWindow(QListWidgetItem*)</slot>
|
<slot>updateDetailsWindow(QListWidgetItem*)</slot>
|
||||||
</slots>
|
</slots>
|
||||||
|
|||||||
+17
-6
@@ -22,15 +22,16 @@ fuzzy scope - Try to find potential places where a given value might be stored -
|
|||||||
|
|
||||||
|
|
||||||
Things currently broken or in need of attention:
|
Things currently broken or in need of attention:
|
||||||
1. Need to standardize application where things might differ. All byte and bit references
|
1. Each screen should mention which file is loaded so that it's easier to keep track of what you're doing.
|
||||||
should be 0-7 not 1-8. All timings should be in microseconds.
|
|
||||||
2. The windows that deal with canbus data should update based on incoming frames. It should not be required to load files to use these windows
|
|
||||||
3. Test CRTD output to make sure it saves properly now
|
|
||||||
4. Screens like flowview seem to sometimes stick with the old data after you've already cleared and loaded a different file
|
|
||||||
5. Each screen should mention which file is loaded so that it's easier to keep track of what you're doing.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
QString MainWindow::loadedFileName = "";
|
QString MainWindow::loadedFileName = "";
|
||||||
|
MainWindow *MainWindow::selfRef = NULL;
|
||||||
|
|
||||||
|
MainWindow *MainWindow::getReference()
|
||||||
|
{
|
||||||
|
return selfRef;
|
||||||
|
}
|
||||||
|
|
||||||
MainWindow::MainWindow(QWidget *parent) :
|
MainWindow::MainWindow(QWidget *parent) :
|
||||||
QMainWindow(parent),
|
QMainWindow(parent),
|
||||||
@@ -38,6 +39,8 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
selfRef = this;
|
||||||
|
|
||||||
this->setWindowTitle("Savvy CAN V" + QString::number(VERSION));
|
this->setWindowTitle("Savvy CAN V" + QString::number(VERSION));
|
||||||
|
|
||||||
model = new CANFrameModel();
|
model = new CANFrameModel();
|
||||||
@@ -194,6 +197,7 @@ void MainWindow::gotFrames(int FPS, int framesSinceLastUpdate)
|
|||||||
if (framesSinceLastUpdate > 0)
|
if (framesSinceLastUpdate > 0)
|
||||||
{
|
{
|
||||||
bDirty = true;
|
bDirty = true;
|
||||||
|
emit framesUpdated(framesSinceLastUpdate); //anyone care that frames were updated?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,6 +218,8 @@ void MainWindow::clearFrames()
|
|||||||
ui->lbNumFrames->setText(QString::number(model->rowCount()));
|
ui->lbNumFrames->setText(QString::number(model->rowCount()));
|
||||||
bDirty = false;
|
bDirty = false;
|
||||||
loadedFileName = "";
|
loadedFileName = "";
|
||||||
|
updateFileStatus();
|
||||||
|
emit framesUpdated(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::changeBaudRates()
|
void MainWindow::changeBaudRates()
|
||||||
@@ -306,6 +312,7 @@ void MainWindow::loadCRTDFile(QString filename)
|
|||||||
if (ui->cbAutoScroll->isChecked()) ui->canFramesView->scrollToBottom();
|
if (ui->cbAutoScroll->isChecked()) ui->canFramesView->scrollToBottom();
|
||||||
|
|
||||||
updateFileStatus();
|
updateFileStatus();
|
||||||
|
emit framesUpdated(-2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::saveCRTDFile(QString filename)
|
void MainWindow::saveCRTDFile(QString filename)
|
||||||
@@ -397,6 +404,7 @@ void MainWindow::loadNativeCSVFile(QString filename)
|
|||||||
if (ui->cbAutoScroll->isChecked()) ui->canFramesView->scrollToBottom();
|
if (ui->cbAutoScroll->isChecked()) ui->canFramesView->scrollToBottom();
|
||||||
|
|
||||||
updateFileStatus();
|
updateFileStatus();
|
||||||
|
emit framesUpdated(-2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::saveNativeCSVFile(QString filename)
|
void MainWindow::saveNativeCSVFile(QString filename)
|
||||||
@@ -487,6 +495,7 @@ void MainWindow::loadGenericCSVFile(QString filename)
|
|||||||
if (ui->cbAutoScroll->isChecked()) ui->canFramesView->scrollToBottom();
|
if (ui->cbAutoScroll->isChecked()) ui->canFramesView->scrollToBottom();
|
||||||
|
|
||||||
updateFileStatus();
|
updateFileStatus();
|
||||||
|
emit framesUpdated(-2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::saveGenericCSVFile(QString filename)
|
void MainWindow::saveGenericCSVFile(QString filename)
|
||||||
@@ -566,6 +575,7 @@ void MainWindow::loadLogFile(QString filename)
|
|||||||
if (ui->cbAutoScroll->isChecked()) ui->canFramesView->scrollToBottom();
|
if (ui->cbAutoScroll->isChecked()) ui->canFramesView->scrollToBottom();
|
||||||
|
|
||||||
updateFileStatus();
|
updateFileStatus();
|
||||||
|
emit framesUpdated(-2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::saveLogFile(QString filename)
|
void MainWindow::saveLogFile(QString filename)
|
||||||
@@ -631,6 +641,7 @@ void MainWindow::loadMicrochipFile(QString filename)
|
|||||||
if (ui->cbAutoScroll->isChecked()) ui->canFramesView->scrollToBottom();
|
if (ui->cbAutoScroll->isChecked()) ui->canFramesView->scrollToBottom();
|
||||||
|
|
||||||
updateFileStatus();
|
updateFileStatus();
|
||||||
|
emit framesUpdated(-2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::saveMicrochipFile(QString filename)
|
void MainWindow::saveMicrochipFile(QString filename)
|
||||||
|
|||||||
+4
-1
@@ -27,6 +27,7 @@ class MainWindow : public QMainWindow
|
|||||||
public:
|
public:
|
||||||
explicit MainWindow(QWidget *parent = 0);
|
explicit MainWindow(QWidget *parent = 0);
|
||||||
static QString loadedFileName;
|
static QString loadedFileName;
|
||||||
|
static MainWindow *getReference();
|
||||||
~MainWindow();
|
~MainWindow();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@@ -63,11 +64,13 @@ signals:
|
|||||||
void sendCANFrame(const CANFrame *, int);
|
void sendCANFrame(const CANFrame *, int);
|
||||||
void stopFrameCapturing();
|
void stopFrameCapturing();
|
||||||
void startFrameCapturing();
|
void startFrameCapturing();
|
||||||
void gotNewFrames();
|
|
||||||
|
|
||||||
|
//-1 = frames cleared, -2 = a new file has been loaded (so all frames are different), otherwise # of new frames
|
||||||
|
void framesUpdated(int numFrames); //something has updated the frame list
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::MainWindow *ui;
|
Ui::MainWindow *ui;
|
||||||
|
static MainWindow *selfRef;
|
||||||
|
|
||||||
//canbus related data
|
//canbus related data
|
||||||
CANFrameModel *model;
|
CANFrameModel *model;
|
||||||
|
|||||||
Reference in New Issue
Block a user