Add two new buttons to expand or collapse all signals.
This commit is contained in:
@@ -129,6 +129,8 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
connect(ui->actionSignal_Viewer, &QAction::triggered, this, &MainWindow::showSignalViewer);
|
connect(ui->actionSignal_Viewer, &QAction::triggered, this, &MainWindow::showSignalViewer);
|
||||||
connect(ui->actionSave_Continuous_Logfile, &QAction::triggered, this, &MainWindow::handleContinousLogging);
|
connect(ui->actionSave_Continuous_Logfile, &QAction::triggered, this, &MainWindow::handleContinousLogging);
|
||||||
connect(ui->actionTemporal_Graph, &QAction::triggered, this, &MainWindow::showTemporalGraphWindow);
|
connect(ui->actionTemporal_Graph, &QAction::triggered, this, &MainWindow::showTemporalGraphWindow);
|
||||||
|
connect(ui->btnExpandAll, &QAbstractButton::clicked, this, &MainWindow::expandAllRows);
|
||||||
|
connect(ui->btnCollapseAll, &QAbstractButton::clicked, this, &MainWindow::collapseAllRows);
|
||||||
|
|
||||||
connect(CANConManager::getInstance(), &CANConManager::framesReceived, model, &CANFrameModel::addFrames);
|
connect(CANConManager::getInstance(), &CANConManager::framesReceived, model, &CANFrameModel::addFrames);
|
||||||
|
|
||||||
@@ -382,6 +384,48 @@ void MainWindow::headerClicked(int logicalIndex)
|
|||||||
model->sortByColumn(logicalIndex);
|
model->sortByColumn(logicalIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::expandAllRows()
|
||||||
|
{
|
||||||
|
bool goAhead = false;
|
||||||
|
int numRows = ui->canFramesView->model()->rowCount();
|
||||||
|
|
||||||
|
if (numRows > 20000)
|
||||||
|
{
|
||||||
|
QMessageBox::StandardButton confirmDialog;
|
||||||
|
confirmDialog = QMessageBox::question(this, "Really?", "It's not recommended to use this\non more than 20000 frames.\nIt can take a long time.\n\nYou have been warned!\nStill do it?",
|
||||||
|
QMessageBox::Yes|QMessageBox::No);
|
||||||
|
|
||||||
|
if (confirmDialog == QMessageBox::Yes) goAhead = true;
|
||||||
|
}
|
||||||
|
else goAhead = true;
|
||||||
|
|
||||||
|
if (goAhead)
|
||||||
|
{
|
||||||
|
ui->canFramesView->resizeRowsToContents();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::collapseAllRows()
|
||||||
|
{
|
||||||
|
bool goAhead = false;
|
||||||
|
int numRows = ui->canFramesView->model()->rowCount();
|
||||||
|
|
||||||
|
if (numRows > 50000)
|
||||||
|
{
|
||||||
|
QMessageBox::StandardButton confirmDialog;
|
||||||
|
confirmDialog = QMessageBox::question(this, "Really?", "It's not recommended to use this\non more than 50000 frames.\nIt can take a long time.\n\nYou have been warned!\nStill do it?",
|
||||||
|
QMessageBox::Yes|QMessageBox::No);
|
||||||
|
|
||||||
|
if (confirmDialog == QMessageBox::Yes) goAhead = true;
|
||||||
|
}
|
||||||
|
else goAhead = true;
|
||||||
|
|
||||||
|
if (goAhead)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < numRows; i++) ui->canFramesView->setRowHeight(i, normalRowHeight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::gridClicked(QModelIndex idx)
|
void MainWindow::gridClicked(QModelIndex idx)
|
||||||
{
|
{
|
||||||
//qDebug() << "Grid Clicked";
|
//qDebug() << "Grid Clicked";
|
||||||
|
|||||||
@@ -63,6 +63,8 @@ private slots:
|
|||||||
void showGraphingWindow();
|
void showGraphingWindow();
|
||||||
void showFrameDataAnalysis();
|
void showFrameDataAnalysis();
|
||||||
void clearFrames();
|
void clearFrames();
|
||||||
|
void expandAllRows();
|
||||||
|
void collapseAllRows();
|
||||||
void showPlaybackWindow();
|
void showPlaybackWindow();
|
||||||
void showFlowViewWindow();
|
void showFlowViewWindow();
|
||||||
void showFrameSenderWindow();
|
void showFrameSenderWindow();
|
||||||
|
|||||||
+34
-6
@@ -191,6 +191,23 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="cbOverwrite">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Overwrite Mode</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="Line" name="line">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="cbInterpret">
|
<widget class="QCheckBox" name="cbInterpret">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -199,12 +216,23 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="cbOverwrite">
|
<widget class="QPushButton" name="btnExpandAll">
|
||||||
<property name="enabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Overwrite Mode</string>
|
<string>Expand All Rows</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btnCollapseAll">
|
||||||
|
<property name="text">
|
||||||
|
<string>Collapse All Rows</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="Line" name="line_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -265,7 +293,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>800</width>
|
<width>800</width>
|
||||||
<height>22</height>
|
<height>23</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menu_RE_Tools">
|
<widget class="QMenu" name="menu_RE_Tools">
|
||||||
|
|||||||
@@ -194,6 +194,8 @@ public:
|
|||||||
for (int bitpos = 0; bitpos < sigSize; bitpos++)
|
for (int bitpos = 0; bitpos < sigSize; bitpos++)
|
||||||
{
|
{
|
||||||
if (bit < 64) {
|
if (bit < 64) {
|
||||||
|
int bytePos = bit / 8;
|
||||||
|
if (bytePos >= data.count()) return 0; //error!
|
||||||
if (data[bit / 8] & (1 << (bit % 8)))
|
if (data[bit / 8] & (1 << (bit % 8)))
|
||||||
result += (1ULL << bitpos);
|
result += (1ULL << bitpos);
|
||||||
}
|
}
|
||||||
@@ -206,6 +208,8 @@ public:
|
|||||||
for (int bitpos = 0; bitpos < sigSize; bitpos++)
|
for (int bitpos = 0; bitpos < sigSize; bitpos++)
|
||||||
{
|
{
|
||||||
if (bit < 64) {
|
if (bit < 64) {
|
||||||
|
int bytePos = bit / 8;
|
||||||
|
if (bytePos >= data.count()) return 0; //error!
|
||||||
if (data[bit / 8] & (1 << (bit % 8)))
|
if (data[bit / 8] & (1 << (bit % 8)))
|
||||||
result += (1ULL << (sigSize - bitpos - 1));
|
result += (1ULL << (sigSize - bitpos - 1));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user