8 #include <QProgressDialog> 16 for (QWidget* widget : qApp->topLevelWidgets())
18 if (widget->inherits(
"QMainWindow"))
28 static std::vector<const char*> extensions = {
"ulg" };
35 const auto& filename = fileload_info->
filename;
39 if (!file.open(QIODevice::ReadOnly))
41 throw std::runtime_error(
"ULog: Failed to open file");
43 QByteArray file_array = file.readAll();
48 const auto& timeseries_map = parser.getTimeseriesMap();
50 for (
const auto& it : timeseries_map)
52 const std::string& sucsctiption_name = it.first;
55 for (
const auto&
data : timeseries.
data)
57 std::string series_name = sucsctiption_name +
data.first;
59 auto series = plot_data.
addNumeric(series_name);
61 for (
size_t i = 0; i <
data.second.size(); i++)
63 double msg_time =
static_cast<double>(timeseries.
timestamps[i]) * 0.000001;
65 series->second.pushBack(point);
71 dialog->setWindowTitle(QString(
"ULog file %1").
arg(filename));
72 dialog->setAttribute(Qt::WA_DeleteOnClose);
std::vector< uint64_t > timestamps
bool xmlSaveState(QDomDocument &doc, QDomElement &parent_element) const override
Override this method to save the status of the plugin to XML.
const std::vector< const char * > & compatibleFileExtensions() const override
Provide a list of file extensions that this plugin can open.
bool xmlLoadState(const QDomElement &parent_element) override
Override this method to load the status of the plugin from XML.
auto arg(const Char *name, const T &arg) -> detail::named_arg< Char, T >
QString filename
name of the file to open
bool readDataFromFile(PJ::FileLoadInfo *fileload_info, PlotDataMapRef &destination) override
TimeseriesMap::iterator addNumeric(const std::string &name, PlotGroup::Ptr group={})
typename PlotDataBase< double, Value >::Point Point
std::vector< std::pair< std::string, std::vector< double > > > data