00001 #ifndef DATALOAD_CSV_H 00002 #define DATALOAD_CSV_H 00003 00004 #include <QObject> 00005 #include <QtPlugin> 00006 #include "PlotJuggler/dataloader_base.h" 00007 00008 00009 class DataLoadCSV: public DataLoader 00010 { 00011 Q_OBJECT 00012 Q_PLUGIN_METADATA(IID "com.icarustechnology.PlotJuggler.DataLoader" "../dataloader.json") 00013 Q_INTERFACES(DataLoader) 00014 00015 public: 00016 DataLoadCSV(); 00017 virtual const std::vector<const char*>& compatibleFileExtensions() const override; 00018 00019 virtual bool readDataFromFile(FileLoadInfo* fileload_info, PlotDataMapRef& destination) override; 00020 00021 virtual ~DataLoadCSV(); 00022 00023 virtual const char* name() const override { return "DataLoad CSV"; } 00024 00025 virtual bool xmlSaveState(QDomDocument &doc, QDomElement &parent_element) const override; 00026 00027 virtual bool xmlLoadState(const QDomElement &parent_element ) override; 00028 00029 protected: 00030 QSize parseHeader(QFile *file, std::vector<std::string> &ordered_names); 00031 00032 private: 00033 std::vector<const char*> _extensions; 00034 00035 std::string _default_time_axis; 00036 00037 00038 }; 00039 00040 #endif // DATALOAD_CSV_H