Last night I was asked how to change the sample rate in Typica when using an NI USB TC-01 to make exported CSV files smaller. With that particular hardware there isn’t a way to change the sample rate (if you try, DAQmx errors out [fail gracefully? nah] so I made it a no-op), but we can do smaller CSV files. The easiest way to do that is to just output whatever is currently in the table view instead of always writing all the data.
CSV export is one of those features that I never use. It was put there because it’s trivial to implement and it checks a feature box that a lot of people think they need (though most realize after using the software for a while that they don’t really need it either because Typica can do whatever they were trying to do without the export step). That said, I do think this change potentially makes CSV export more useful so I’ll be making this the default behavior going forward.
If you’ve been compiling your own builds and want this now, just apply the following patch with ctangle prior to compiling. No configuration changes required.
@x
bool ZoomLog::saveCSV(QIODevice *device)
{
CSVOutput writer(model_ms, device, 0);
int c;
foreach(c, saveTempCols)
{
writer.addTemperatureColumn(model_ms->headerData(c, Qt::Horizontal).
toString(), c);
}
foreach(c, saveNoteCols)
{
writer.addAnnotationColumn(model_ms->headerData(c, Qt::Horizontal).
toString(), c);
}
return writer.output();
}
@y
bool ZoomLog::saveCSV(QIODevice *device)
{
CSVOutput writer(currentModel, device, 0);
int c;
foreach(c, saveTempCols)
{
writer.addTemperatureColumn(currentModel->headerData(c, Qt::Horizontal).
toString(), c);
}
foreach(c, saveNoteCols)
{
writer.addAnnotationColumn(currentModel->headerData(c, Qt::Horizontal).
toString(), c);
}
return writer.output();
}
@z
-
c0d3 likes this
-
appliedcoffeetechnology posted this
