OpenHantek
Loading...
Searching...
No Matches
ExporterCSV Class Reference

#include <exportcsv.h>

Inheritance diagram for ExporterCSV:
ExporterInterface

Public Member Functions

 ExporterCSV ()
void create (ExporterRegistry *registry) override
QString name () override
QString format () override
Type type () override
bool samples (const std::shared_ptr< PPresult > newData) override
bool save () override
float progress () override
 The progress of receiving and processing samples. If the exporter returns 1, it will be called back by the GUI via the save() method.
Public Member Functions inherited from ExporterInterface
virtual ~ExporterInterface ()

Private Member Functions

QFile * getFile ()
void fillHeaders (QTextStream &jsonStream, const ExporterData &dto, const char *sep)
void fillData (QTextStream &jsonStream, const ExporterData &dto, const char *sep)

Private Attributes

std::shared_ptr< PPresultdata

Additional Inherited Members

Public Types inherited from ExporterInterface
enum class  Type { SnapshotExport , ContinuousExport }
Protected Attributes inherited from ExporterInterface
ExporterRegistryregistry

Constructor & Destructor Documentation

◆ ExporterCSV()

ExporterCSV::ExporterCSV ( )

Member Function Documentation

◆ create()

void ExporterCSV::create ( ExporterRegistry * registry)
overridevirtual

Starts up this exporter. Acquires resources etc. Do not call this directly, it will be called by the exporter registry at some point. Release your resources in the destructor as usual.

Parameters
registryThe exporter registry instance. This is used to obtain a reference to the settings.

Implements ExporterInterface.

◆ fillData()

void ExporterCSV::fillData ( QTextStream & jsonStream,
const ExporterData & dto,
const char * sep )
private

◆ fillHeaders()

void ExporterCSV::fillHeaders ( QTextStream & jsonStream,
const ExporterData & dto,
const char * sep )
private

◆ format()

QString ExporterCSV::format ( )
overridevirtual
Returns
Return this exporter's data format. Will be used in graphical interfaces.

Implements ExporterInterface.

◆ getFile()

QFile * ExporterCSV::getFile ( )
private

◆ name()

QString ExporterCSV::name ( )
overridevirtual
Returns
Return the text representation / name of this exporter. Will be used in graphical interfaces.

Implements ExporterInterface.

◆ progress()

float ExporterCSV::progress ( )
overridevirtual

The progress of receiving and processing samples. If the exporter returns 1, it will be called back by the GUI via the save() method.

Returns
A number between 0..1 indicating the used capacity of this exporter. If this is a snapshot exporter, only 0 for "no samples processed yet" or 1 for "finished" will be returned. A continuous exporter may report the used memory / reserved memory ratio here.

Implements ExporterInterface.

◆ samples()

bool ExporterCSV::samples ( const std::shared_ptr< PPresult > newData)
overridevirtual

A new sample set from the ExporterRegistry. The exporter needs to be active to receive samples. If it is a snapshot exporter, only one set of samples will be received.

Returns
Return true if you want to receive another sample or false if you are done (progress()==1).

Implements ExporterInterface.

◆ save()

bool ExporterCSV::save ( )
overridevirtual

Exporter: Save your received data and perform any conversions necessary. This method will be called in the GUI thread context and can create and show dialogs if required.

Returns
Return true if saving succeeded otherwise false.

Implements ExporterInterface.

◆ type()

ExporterInterface::Type ExporterCSV::type ( )
overridevirtual
Returns
Return the type of this exporter.
See also
ExporterInterface::Type

Implements ExporterInterface.

Field Documentation

◆ data

std::shared_ptr< PPresult > ExporterCSV::data
private

The documentation for this class was generated from the following files: