diff --git a/connections/socketcand.cpp b/connections/socketcand.cpp index a049d8c..d1c772c 100644 --- a/connections/socketcand.cpp +++ b/connections/socketcand.cpp @@ -326,8 +326,8 @@ QString SocketCANd::decodeFrames(QString data, int busNum) getQueue().queue(); } } - else - qDebug() << "can't get a frame, capture suspended"; + //else + // qDebug() << "can't get a frame, capture suspended"; //take out the data that we just processed and anything that is in front of it //this should keep broken frames from accumulating at in the data buffer diff --git a/mainwindow.cpp b/mainwindow.cpp index bd69a8e..9428090 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -988,6 +988,16 @@ void MainWindow::handleLoadFilters() } void MainWindow::handleSaveDecoded() +{ + handleSaveDecodedMethod(false); +} + +void MainWindow::handleSaveDecodedCsv() +{ + handleSaveDecodedMethod(true); +} + +void MainWindow::handleSaveDecodedMethod(bool csv) { QString filename; QFileDialog dialog(this); @@ -1006,8 +1016,12 @@ void MainWindow::handleSaveDecoded() { filename = dialog.selectedFiles()[0]; if (!filename.contains('.')) filename += ".txt"; - //saveDecodedTextFile(filename); - saveDecodedTextFileAsColumns(filename); + + if(csv) + saveDecodedTextFileAsColumns(filename); + else + saveDecodedTextFile(filename); + settings.setValue("FileIO/LoadSaveDirectory", dialog.directory().path()); } } diff --git a/mainwindow.h b/mainwindow.h index d4c716c..64b8cdf 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -91,6 +91,7 @@ private slots: void showDBCComparisonWindow(); void exitApp(); void handleSaveDecoded(); + void handleSaveDecodedCsv(); void connectionStatusUpdated(int conns); void gridClicked(QModelIndex); void gridDoubleClicked(QModelIndex); @@ -195,6 +196,7 @@ private: //private methods QString getSignalNameFromPosition(QPoint pos); uint32_t getMessageIDFromPosition(QPoint pos); + void handleSaveDecodedMethod(bool csv); void saveDecodedTextFile(QString); void saveDecodedTextFileAsColumns(QString); void addFrameToDisplay(CANFrame &, bool); diff --git a/ui/mainwindow.ui b/ui/mainwindow.ui index 77e1b5a..0136c80 100644 --- a/ui/mainwindow.ui +++ b/ui/mainwindow.ui @@ -368,7 +368,7 @@ 0 0 800 - 22 + 21 @@ -415,6 +415,7 @@ + @@ -615,6 +616,11 @@ DBC Comparison + + + Save Decoded Frames CSV + +