mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-21 11:54:15 +01:00
Revert "GVS/Scope: Bugfix: Export all known data points into CSV not just one per screen redraw"
This reverts commit 2ce3365861e63a3e805bd25284d1b3b0a33430a0.
This commit is contained in:
parent
000373b421
commit
40e7bf5c59
@ -447,7 +447,6 @@ void ScopeGadgetWidget::uavObjectReceived(UAVObject* obj)
|
||||
foreach(PlotData* plotData, m_curvesData.values()) {
|
||||
if (plotData->append(obj)) m_csvLoggingDataUpdated=1;
|
||||
}
|
||||
csvLoggingAddData();
|
||||
}
|
||||
|
||||
void ScopeGadgetWidget::replotNewData()
|
||||
@ -611,7 +610,6 @@ int ScopeGadgetWidget::csvLoggingStart()
|
||||
m_csvLoggingStartTime = NOW;
|
||||
m_csvLoggingHeaderSaved=0;
|
||||
m_csvLoggingDataSaved=0;
|
||||
m_csvLoggingBuffer.clear();
|
||||
QDir PathCheck(m_csvLoggingPath);
|
||||
if (!PathCheck.exists())
|
||||
{
|
||||
@ -679,13 +677,20 @@ int ScopeGadgetWidget::csvLoggingInsertHeader()
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ScopeGadgetWidget::csvLoggingAddData()
|
||||
int ScopeGadgetWidget::csvLoggingInsertData()
|
||||
{
|
||||
if (!m_csvLoggingStarted) return -1;
|
||||
m_csvLoggingDataSaved=1;
|
||||
m_csvLoggingDataValid=0;
|
||||
QDateTime NOW = QDateTime::currentDateTime();
|
||||
QString tempString;
|
||||
|
||||
if(m_csvLoggingFile.open(QIODevice::WriteOnly | QIODevice::Append)== FALSE)
|
||||
{
|
||||
qDebug() << "Unable to open " << m_csvLoggingFile.fileName() << " for csv logging Data";
|
||||
}
|
||||
else
|
||||
{
|
||||
QTextStream ss( &tempString );
|
||||
ss << NOW.toString("yyyy-MM-dd") << ", " << NOW.toString("hh:mm:ss.z") << ", " ;
|
||||
|
||||
@ -712,29 +717,12 @@ int ScopeGadgetWidget::csvLoggingAddData()
|
||||
ss << endl;
|
||||
if (m_csvLoggingDataValid)
|
||||
{
|
||||
QTextStream ts( &m_csvLoggingBuffer );
|
||||
QTextStream ts( &m_csvLoggingFile );
|
||||
ts << tempString;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ScopeGadgetWidget::csvLoggingInsertData()
|
||||
{
|
||||
if (!m_csvLoggingStarted) return -1;
|
||||
m_csvLoggingDataSaved=1;
|
||||
|
||||
if(m_csvLoggingFile.open(QIODevice::WriteOnly | QIODevice::Append)== FALSE)
|
||||
{
|
||||
qDebug() << "Unable to open " << m_csvLoggingFile.fileName() << " for csv logging Data";
|
||||
}
|
||||
else
|
||||
{
|
||||
QTextStream ts( &m_csvLoggingFile );
|
||||
ts << m_csvLoggingBuffer;
|
||||
m_csvLoggingFile.close();
|
||||
}
|
||||
m_csvLoggingBuffer.clear();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -166,13 +166,11 @@ private:
|
||||
|
||||
QString m_csvLoggingName;
|
||||
QString m_csvLoggingPath;
|
||||
QString m_csvLoggingBuffer;
|
||||
QFile m_csvLoggingFile;
|
||||
|
||||
QMutex mutex;
|
||||
|
||||
int csvLoggingInsertHeader();
|
||||
int csvLoggingAddData();
|
||||
int csvLoggingInsertData();
|
||||
|
||||
void deleteLegend();
|
||||
|
Loading…
x
Reference in New Issue
Block a user