MCPcopy Create free account
hub / github.com/collin80/SavvyCAN / saveGenericCSVFile

Method saveGenericCSVFile

framefileio.cpp:1790–1828  ·  view source on GitHub ↗

4f5,ff 34 23 45 24 e4

Source from the content-addressed store, hash-verified

1788
1789//4f5,ff 34 23 45 24 e4
1790bool FrameFileIO::saveGenericCSVFile(QString filename, const QVector<CANFrame>* frames)
1791{
1792 QFile *outFile = new QFile(filename);
1793 int lineCounter = 0;
1794
1795 if (!outFile->open(QIODevice::WriteOnly | QIODevice::Text))
1796 {
1797 delete outFile;
1798 return false;
1799 }
1800
1801 outFile->write("ID,Data Bytes");
1802 outFile->write("\n");
1803
1804 for (int c = 0; c < frames->count(); c++)
1805 {
1806 lineCounter++;
1807 if (lineCounter > 100)
1808 {
1809 qApp->processEvents();
1810 lineCounter = 0;
1811 }
1812
1813 outFile->write(QString::number(frames->at(c).ID, 16).toUpper().rightJustified(8, '0').toUtf8());
1814 outFile->putChar(44);
1815
1816 for (unsigned int temp = 0; temp < frames->at(c).len; temp++)
1817 {
1818 outFile->write(QString::number(frames->at(c).data[temp], 16).toUpper().rightJustified(2, '0').toUtf8());
1819 outFile->putChar(' ');
1820 }
1821
1822 outFile->write("\n");
1823
1824 }
1825 outFile->close();
1826 delete outFile;
1827 return true;
1828}
1829
1830bool FrameFileIO::isLogFile(QString filename)
1831{

Callers

nothing calls this directly

Calls 2

writeMethod · 0.80
atMethod · 0.80

Tested by

no test coverage detected