Added menu items to export csv decoded data, still need wiring

This commit is contained in:
Andy Huska
2022-10-17 10:33:13 -05:00
parent c6c19b38aa
commit ef762e5ae5
4 changed files with 27 additions and 5 deletions
+2 -2
View File
@@ -326,8 +326,8 @@ QString SocketCANd::decodeFrames(QString data, int busNum)
getQueue().queue(); getQueue().queue();
} }
} }
else //else
qDebug() << "can't get a frame, capture suspended"; // qDebug() << "can't get a frame, capture suspended";
//take out the data that we just processed and anything that is in front of it //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 //this should keep broken frames from accumulating at in the data buffer
+16 -2
View File
@@ -988,6 +988,16 @@ void MainWindow::handleLoadFilters()
} }
void MainWindow::handleSaveDecoded() void MainWindow::handleSaveDecoded()
{
handleSaveDecodedMethod(false);
}
void MainWindow::handleSaveDecodedCsv()
{
handleSaveDecodedMethod(true);
}
void MainWindow::handleSaveDecodedMethod(bool csv)
{ {
QString filename; QString filename;
QFileDialog dialog(this); QFileDialog dialog(this);
@@ -1006,8 +1016,12 @@ void MainWindow::handleSaveDecoded()
{ {
filename = dialog.selectedFiles()[0]; filename = dialog.selectedFiles()[0];
if (!filename.contains('.')) filename += ".txt"; if (!filename.contains('.')) filename += ".txt";
//saveDecodedTextFile(filename);
saveDecodedTextFileAsColumns(filename); if(csv)
saveDecodedTextFileAsColumns(filename);
else
saveDecodedTextFile(filename);
settings.setValue("FileIO/LoadSaveDirectory", dialog.directory().path()); settings.setValue("FileIO/LoadSaveDirectory", dialog.directory().path());
} }
} }
+2
View File
@@ -91,6 +91,7 @@ private slots:
void showDBCComparisonWindow(); void showDBCComparisonWindow();
void exitApp(); void exitApp();
void handleSaveDecoded(); void handleSaveDecoded();
void handleSaveDecodedCsv();
void connectionStatusUpdated(int conns); void connectionStatusUpdated(int conns);
void gridClicked(QModelIndex); void gridClicked(QModelIndex);
void gridDoubleClicked(QModelIndex); void gridDoubleClicked(QModelIndex);
@@ -195,6 +196,7 @@ private:
//private methods //private methods
QString getSignalNameFromPosition(QPoint pos); QString getSignalNameFromPosition(QPoint pos);
uint32_t getMessageIDFromPosition(QPoint pos); uint32_t getMessageIDFromPosition(QPoint pos);
void handleSaveDecodedMethod(bool csv);
void saveDecodedTextFile(QString); void saveDecodedTextFile(QString);
void saveDecodedTextFileAsColumns(QString); void saveDecodedTextFileAsColumns(QString);
void addFrameToDisplay(CANFrame &, bool); void addFrameToDisplay(CANFrame &, bool);
+7 -1
View File
@@ -368,7 +368,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>800</width> <width>800</width>
<height>22</height> <height>21</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menu_RE_Tools"> <widget class="QMenu" name="menu_RE_Tools">
@@ -415,6 +415,7 @@
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionDBC_File_Manager"/> <addaction name="actionDBC_File_Manager"/>
<addaction name="actionSave_Decoded_Frames"/> <addaction name="actionSave_Decoded_Frames"/>
<addaction name="actionSave_Decoded_Frames_CSV"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionPreferences"/> <addaction name="actionPreferences"/>
<addaction name="separator"/> <addaction name="separator"/>
@@ -615,6 +616,11 @@
<string>DBC Comparison</string> <string>DBC Comparison</string>
</property> </property>
</action> </action>
<action name="actionSave_Decoded_Frames_CSV">
<property name="text">
<string>Save Decoded Frames CSV</string>
</property>
</action>
</widget> </widget>
<layoutdefault spacing="6" margin="11"/> <layoutdefault spacing="6" margin="11"/>
<resources/> <resources/>