##// END OF EJS Templates
Closed
Pull request !290 Created on Thu, 21 Sep 2017 11:04:20, by
- Merge branch 'feature/ProgressAndCancel' into develop
- Fix progression bug when aborting a request for Amda plugin
- See last commit
- Fix bug when creating two variables crash the app.
- Update networkcontroller for abort mechanism
Pull request versions not available.
ver Time Author Commit Description
12 commits hidden, click expand to show them.
@@ -0,0 +1,52
1 #include "Variable/VariableCacheStrategy.h"
2
3 #include "Settings/SqpSettingsDefs.h"
4
5 #include "Variable/Variable.h"
6 #include "Variable/VariableController.h"
7
8 Q_LOGGING_CATEGORY(LOG_VariableCacheStrategy, "VariableCacheStrategy")
9
10 struct VariableCacheStrategy::VariableCacheStrategyPrivate {
11 VariableCacheStrategyPrivate() : m_CacheStrategy{CacheStrategy::FixedTolerance} {}
12
13 CacheStrategy m_CacheStrategy;
14 };
15
16
17 VariableCacheStrategy::VariableCacheStrategy(QObject *parent)
18 : QObject{parent}, impl{spimpl::make_unique_impl<VariableCacheStrategyPrivate>()}
19 {
20 }
21
22 std::pair<SqpRange, SqpRange>
23 VariableCacheStrategy::computeStrategyRanges(const SqpRange &vRange, const SqpRange &rangeRequested)
24 {
25
26 auto varRanges = std::pair<SqpRange, SqpRange>{};
27
28 auto toleranceFactor = SqpSettings::toleranceValue(GENERAL_TOLERANCE_AT_UPDATE_KEY,
29 GENERAL_TOLERANCE_AT_UPDATE_DEFAULT_VALUE);
30 auto tolerance = toleranceFactor * (rangeRequested.m_TEnd - rangeRequested.m_TStart);
31
32 switch (impl->m_CacheStrategy) {
33 case CacheStrategy::FixedTolerance: {
34 varRanges.first = rangeRequested;
35 varRanges.second
36 = SqpRange{rangeRequested.m_TStart - tolerance, rangeRequested.m_TEnd + tolerance};
37 break;
38 }
39
40 case CacheStrategy::TwoThreashold: {
41 // TODO Implement
42 break;
43 }
44 default:
45 qCCritical(LOG_VariableCacheStrategy())
46 << tr("Impossible to use compute the cache range with an unknow cache strategy");
47 // No action
48 break;
49 }
50
51 return varRanges;
52 }
@@ -8,5 +8,4 install_name_tool -change @rpath/QtPrintSupport.framework/Versions/5/QtPrintSupp
8 install_name_tool -change @rpath/QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui /tmp/SciQLOP.app/Contents/MacOS/sciqlop
8 install_name_tool -change @rpath/QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui /tmp/SciQLOP.app/Contents/MacOS/sciqlop
9 install_name_tool -change @rpath/QtWidgets.framework/Versions/5/QtWidgets @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets /tmp/SciQLOP.app/Contents/MacOS/sciqlop
9 install_name_tool -change @rpath/QtWidgets.framework/Versions/5/QtWidgets @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets /tmp/SciQLOP.app/Contents/MacOS/sciqlop
10 install_name_tool -change @rpath/QtNetwork.framework/Versions/5/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork /tmp/SciQLOP.app/Contents/MacOS/sciqlop
10 install_name_tool -change @rpath/QtNetwork.framework/Versions/5/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork /tmp/SciQLOP.app/Contents/MacOS/sciqlop
11 install_name_tool -change @rpath/QtSvg.framework/Versions/5/QtSvg @executable_path/../Frameworks/QtSvg.framework/Versions/5/QtSvg /tmp/SciQLOP.app/Contents/MacOS/sciqlop
12
11
@@ -22,11 +22,7 public:
22
22
23 virtual ~SqpIterator() noexcept = default;
23 virtual ~SqpIterator() noexcept = default;
24 SqpIterator(const SqpIterator &) = default;
24 SqpIterator(const SqpIterator &) = default;
25 SqpIterator &operator=(SqpIterator other)
25 SqpIterator &operator=(SqpIterator other) { swap(m_CurrentValue, other.m_CurrentValue); }
26 {
27 swap(m_CurrentValue, other.m_CurrentValue);
28 return *this;
29 }
30
26
31 SqpIterator &operator++()
27 SqpIterator &operator++()
32 {
28 {
@@ -21,17 +21,20 class Variable;
21 /**
21 /**
22 * Possible types of zoom operation
22 * Possible types of zoom operation
23 */
23 */
24 // enum class CacheStrategy { FixedTolerance, TwoThreashold };
24 enum class CacheStrategy { FixedTolerance, TwoThreashold };
25
26
25
27 /// This class aims to hande the cache strategy.
26 /// This class aims to hande the cache strategy.
28 class SCIQLOP_CORE_EXPORT VariableCacheStrategy {
27 class SCIQLOP_CORE_EXPORT VariableCacheStrategy : public QObject {
29
28 Q_OBJECT
30 public:
29 public:
31 virtual std::pair<SqpRange, SqpRange> computeRange(const SqpRange &vRange,
30 explicit VariableCacheStrategy(QObject *parent = 0);
32 const SqpRange &rangeRequested)
33 = 0;
34 };
35
31
32 std::pair<SqpRange, SqpRange> computeStrategyRanges(const SqpRange &vRange,
33 const SqpRange &rangeRequested);
34
35 private:
36 class VariableCacheStrategyPrivate;
37 spimpl::unique_impl_ptr<VariableCacheStrategyPrivate> impl;
38 };
36
39
37 #endif // SCIQLOP_VARIABLECACHESTRATEGY_H
40 #endif // SCIQLOP_VARIABLECACHESTRATEGY_H
@@ -19,6 +19,7 DataSeriesIteratorValue &DataSeriesIteratorValue::operator=(DataSeriesIteratorVa
19
19
20 int DataSeriesIteratorValue::distance(const DataSeriesIteratorValue &other) const
20 int DataSeriesIteratorValue::distance(const DataSeriesIteratorValue &other) const
21 {
21 {
22 auto dist = m_Impl->distance(*other.m_Impl);
22 return m_Impl->distance(*other.m_Impl);
23 return m_Impl->distance(*other.m_Impl);
23 }
24 }
24
25
@@ -66,20 +66,23 std::unique_ptr<IDataSeries> VectorSeries::clone() const
66 std::shared_ptr<IDataSeries> VectorSeries::subDataSeries(const SqpRange &range)
66 std::shared_ptr<IDataSeries> VectorSeries::subDataSeries(const SqpRange &range)
67 {
67 {
68 auto subXAxisData = std::vector<double>();
68 auto subXAxisData = std::vector<double>();
69 auto subValuesData = std::vector<double>();
69 auto subXValuesData = std::vector<double>();
70 auto subYValuesData = std::vector<double>();
71 auto subZValuesData = std::vector<double>();
70
72
71 this->lockRead();
73 this->lockRead();
72 {
74 {
73 auto bounds = xAxisRange(range.m_TStart, range.m_TEnd);
75 auto bounds = xAxisRange(range.m_TStart, range.m_TEnd);
74 for (auto it = bounds.first; it != bounds.second; ++it) {
76 for (auto it = bounds.first; it != bounds.second; ++it) {
75 subXAxisData.push_back(it->x());
77 subXAxisData.push_back(it->x());
76 subValuesData.push_back(it->value(0));
78 subXValuesData.push_back(it->value(0));
77 subValuesData.push_back(it->value(1));
79 subYValuesData.push_back(it->value(1));
78 subValuesData.push_back(it->value(2));
80 subZValuesData.push_back(it->value(2));
79 }
81 }
80 }
82 }
81 this->unlock();
83 this->unlock();
82
84
83 return std::make_shared<VectorSeries>(std::move(subXAxisData), std::move(subValuesData),
85 return std::make_shared<VectorSeries>(std::move(subXAxisData), std::move(subXValuesData),
86 std::move(subYValuesData), std::move(subZValuesData),
84 this->xAxisUnit(), this->valuesUnit());
87 this->xAxisUnit(), this->valuesUnit());
85 }
88 }
@@ -1,7 +1,6
1 #include <Variable/Variable.h>
1 #include <Variable/Variable.h>
2 #include <Variable/VariableAcquisitionWorker.h>
2 #include <Variable/VariableAcquisitionWorker.h>
3 #include <Variable/VariableCacheStrategy.h>
3 #include <Variable/VariableCacheStrategy.h>
4 #include <Variable/VariableCacheStrategyFactory.h>
5 #include <Variable/VariableController.h>
4 #include <Variable/VariableController.h>
6 #include <Variable/VariableModel.h>
5 #include <Variable/VariableModel.h>
7 #include <Variable/VariableSynchronizationGroup.h>
6 #include <Variable/VariableSynchronizationGroup.h>
@@ -80,9 +79,7 struct VariableController::VariableControllerPrivate {
80 : m_WorkingMutex{},
79 : m_WorkingMutex{},
81 m_VariableModel{new VariableModel{parent}},
80 m_VariableModel{new VariableModel{parent}},
82 m_VariableSelectionModel{new QItemSelectionModel{m_VariableModel, parent}},
81 m_VariableSelectionModel{new QItemSelectionModel{m_VariableModel, parent}},
83 // m_VariableCacheStrategy{std::make_unique<VariableCacheStrategy>()},
82 m_VariableCacheStrategy{std::make_unique<VariableCacheStrategy>()},
84 m_VariableCacheStrategy{VariableCacheStrategyFactory::createCacheStrategy(
85 CacheStrategy::SingleThreshold)},
86 m_VariableAcquisitionWorker{std::make_unique<VariableAcquisitionWorker>()},
83 m_VariableAcquisitionWorker{std::make_unique<VariableAcquisitionWorker>()},
87 q{parent}
84 q{parent}
88 {
85 {
@@ -576,14 +573,9 void VariableController::VariableControllerPrivate::processRequest(std::shared_p
576 auto varId = m_VariableToIdentifierMap.at(var);
573 auto varId = m_VariableToIdentifierMap.at(var);
577
574
578 auto varStrategyRangesRequested
575 auto varStrategyRangesRequested
579 = m_VariableCacheStrategy->computeRange(var->range(), rangeRequested);
576 = m_VariableCacheStrategy->computeStrategyRanges(var->range(), rangeRequested);
580
577 auto notInCacheRangeList = var->provideNotInCacheRangeList(varStrategyRangesRequested.second);
581 auto notInCacheRangeList = QVector<SqpRange>{varStrategyRangesRequested.second};
578 auto inCacheRangeList = var->provideInCacheRangeList(varStrategyRangesRequested.second);
582 auto inCacheRangeList = QVector<SqpRange>{};
583 if (m_VarIdToVarRequestIdQueueMap.find(varId) == m_VarIdToVarRequestIdQueueMap.cend()) {
584 notInCacheRangeList = var->provideNotInCacheRangeList(varStrategyRangesRequested.second);
585 inCacheRangeList = var->provideInCacheRangeList(varStrategyRangesRequested.second);
586 }
587
579
588 if (!notInCacheRangeList.empty()) {
580 if (!notInCacheRangeList.empty()) {
589 varRequest.m_RangeRequested = varStrategyRangesRequested.first;
581 varRequest.m_RangeRequested = varStrategyRangesRequested.first;
@@ -7,8 +7,7 tests = [
7 [['Data/TestTwoDimArrayData.cpp'],'test_2d','Two Dim Array test'],
7 [['Data/TestTwoDimArrayData.cpp'],'test_2d','Two Dim Array test'],
8 [['DataSource/TestDataSourceController.cpp'],'test_data_source','DataSourceController test'],
8 [['DataSource/TestDataSourceController.cpp'],'test_data_source','DataSourceController test'],
9 [['Variable/TestVariableCacheController.cpp'],'test_variable_cache','VariableCacheController test'],
9 [['Variable/TestVariableCacheController.cpp'],'test_variable_cache','VariableCacheController test'],
10 [['Variable/TestVariable.cpp'],'test_variable','Variable test'],
10 [['Variable/TestVariable.cpp'],'test_variable','Variable test']
11 [['Variable/TestVariableSync.cpp'],'test_variable_sync','Variable synchronization test']
12 ]
11 ]
13
12
14 foreach unit_test : tests
13 foreach unit_test : tests
@@ -11,7 +11,6 class RenameVariableDialog;
11 * @brief The RenameVariableDialog class represents the dialog to rename a variable
11 * @brief The RenameVariableDialog class represents the dialog to rename a variable
12 */
12 */
13 class RenameVariableDialog : public QDialog {
13 class RenameVariableDialog : public QDialog {
14 Q_OBJECT
15 public:
14 public:
16 explicit RenameVariableDialog(const QString &defaultName,
15 explicit RenameVariableDialog(const QString &defaultName,
17 const QVector<QString> &forbiddenNames,
16 const QVector<QString> &forbiddenNames,
@@ -7,7 +7,6 gui_moc_headers = [
7 'include/SqpApplication.h',
7 'include/SqpApplication.h',
8 'include/TimeWidget/TimeWidget.h',
8 'include/TimeWidget/TimeWidget.h',
9 'include/Variable/VariableInspectorWidget.h',
9 'include/Variable/VariableInspectorWidget.h',
10 'include/Variable/RenameVariableDialog.h',
11 'include/Visualization/qcustomplot.h',
10 'include/Visualization/qcustomplot.h',
12 'include/Visualization/VisualizationGraphWidget.h',
11 'include/Visualization/VisualizationGraphWidget.h',
13 'include/Visualization/VisualizationTabWidget.h',
12 'include/Visualization/VisualizationTabWidget.h',
@@ -22,7 +21,6 gui_ui_files = [
22 'ui/SidePane/SqpSidePane.ui',
21 'ui/SidePane/SqpSidePane.ui',
23 'ui/TimeWidget/TimeWidget.ui',
22 'ui/TimeWidget/TimeWidget.ui',
24 'ui/Variable/VariableInspectorWidget.ui',
23 'ui/Variable/VariableInspectorWidget.ui',
25 'ui/Variable/RenameVariableDialog.ui',
26 'ui/Variable/VariableMenuHeaderWidget.ui',
24 'ui/Variable/VariableMenuHeaderWidget.ui',
27 'ui/Visualization/VisualizationGraphWidget.ui',
25 'ui/Visualization/VisualizationGraphWidget.ui',
28 'ui/Visualization/VisualizationTabWidget.ui',
26 'ui/Visualization/VisualizationTabWidget.ui',
@@ -48,7 +46,6 gui_sources = [
48 'src/TimeWidget/TimeWidget.cpp',
46 'src/TimeWidget/TimeWidget.cpp',
49 'src/Variable/VariableInspectorWidget.cpp',
47 'src/Variable/VariableInspectorWidget.cpp',
50 'src/Variable/VariableMenuHeaderWidget.cpp',
48 'src/Variable/VariableMenuHeaderWidget.cpp',
51 'src/Variable/RenameVariableDialog.cpp',
52 'src/Visualization/VisualizationGraphHelper.cpp',
49 'src/Visualization/VisualizationGraphHelper.cpp',
53 'src/Visualization/VisualizationGraphRenderingDelegate.cpp',
50 'src/Visualization/VisualizationGraphRenderingDelegate.cpp',
54 'src/Visualization/VisualizationGraphWidget.cpp',
51 'src/Visualization/VisualizationGraphWidget.cpp',
@@ -94,22 +94,18 public:
94 auto variableModel = sqpApp->variableController().variableModel();
94 auto variableModel = sqpApp->variableController().variableModel();
95 variableModel->abortProgress(index);
95 variableModel->abortProgress(index);
96 }
96 }
97 return true;
98 }
97 }
99 else {
98 else {
100 return QStyledItemDelegate::editorEvent(event, model, option, index);
99 QStyledItemDelegate::editorEvent(event, model, option, index);
101 }
100 }
102 }
101 }
103 else {
102 else {
104 return QStyledItemDelegate::editorEvent(event, model, option, index);
103 QStyledItemDelegate::editorEvent(event, model, option, index);
105 }
104 }
106 }
105 }
107 else {
106 else {
108 return QStyledItemDelegate::editorEvent(event, model, option, index);
107 QStyledItemDelegate::editorEvent(event, model, option, index);
109 }
108 }
110
111
112 return QStyledItemDelegate::editorEvent(event, model, option, index);
113 }
109 }
114 };
110 };
115
111
@@ -184,29 +180,22 void VariableInspectorWidget::onTableMenuRequested(const QPoint &pos) noexcept
184 if (selectedVariables.size() == 1) {
180 if (selectedVariables.size() == 1) {
185 auto selectedVariable = selectedVariables.front();
181 auto selectedVariable = selectedVariables.front();
186
182
187 auto duplicateFun = [varW = std::weak_ptr<Variable>(selectedVariable)]()
183 auto duplicateFun = [&selectedVariable]() {
188 {
184 sqpApp->variableController().cloneVariable(selectedVariable);
189 if (auto var = varW.lock()) {
190 sqpApp->variableController().cloneVariable(var);
191 }
192 };
185 };
193
186
194 tableMenu.addAction(tr("Duplicate"), duplicateFun);
187 tableMenu.addAction(tr("Duplicate"), duplicateFun);
195
188
196 auto renameFun = [ varW = std::weak_ptr<Variable>(selectedVariable), &model, this ]()
189 auto renameFun = [&selectedVariable, &model, this]() {
197 {
190 // Generates forbidden names (names associated to existing variables)
198 if (auto var = varW.lock()) {
191 auto allVariables = model->variables();
199 // Generates forbidden names (names associated to existing variables)
192 auto forbiddenNames = QVector<QString>(allVariables.size());
200 auto allVariables = model->variables();
193 std::transform(allVariables.cbegin(), allVariables.cend(), forbiddenNames.begin(),
201 auto forbiddenNames = QVector<QString>(allVariables.size());
194 [](const auto &variable) { return variable->name(); });
202 std::transform(allVariables.cbegin(), allVariables.cend(),
195
203 forbiddenNames.begin(),
196 RenameVariableDialog dialog{selectedVariable->name(), forbiddenNames, this};
204 [](const auto &variable) { return variable->name(); });
197 if (dialog.exec() == QDialog::Accepted) {
205
198 selectedVariable->setName(dialog.name());
206 RenameVariableDialog dialog{var->name(), forbiddenNames, this};
207 if (dialog.exec() == QDialog::Accepted) {
208 var->setName(dialog.name());
209 }
210 }
199 }
211 };
200 };
212
201
@@ -1,7 +1,6
1
1
2 amdaplugin_moc_headers = [
2 amdaplugin_moc_headers = [
3 'include/AmdaPlugin.h',
3 'include/AmdaPlugin.h'
4 'include/AmdaProvider.h'
5 ]
4 ]
6
5
7 amdaplugin_sources = [
6 amdaplugin_sources = [
@@ -21,9 +21,8 namespace {
21 /// - %1: start date
21 /// - %1: start date
22 /// - %2: end date
22 /// - %2: end date
23 /// - %3: parameter id
23 /// - %3: parameter id
24 /// Old url: http://amda.irap.omp.eu/php/rest/
25 const auto AMDA_URL_FORMAT = QStringLiteral(
24 const auto AMDA_URL_FORMAT = QStringLiteral(
26 "http://amdatest.irap.omp.eu/php/rest/"
25 "http://amda.irap.omp.eu/php/rest/"
27 "getParameter.php?startTime=%1&stopTime=%2&parameterID=%3&outputFormat=ASCII&"
26 "getParameter.php?startTime=%1&stopTime=%2&parameterID=%3&outputFormat=ASCII&"
28 "timeFormat=ISO8601&gzip=0");
27 "timeFormat=ISO8601&gzip=0");
29
28
@@ -218,7 +217,7 void AmdaProvider::retrieveData(QUuid token, const SqpRange &dateTime, const QVa
218
217
219 // Don't do anything if the reply was abort
218 // Don't do anything if the reply was abort
220 if (reply->error() == QNetworkReply::NoError) {
219 if (reply->error() == QNetworkReply::NoError) {
221 auto downloadFileUrl = QUrl{QString{reply->readAll()}.trimmed()};
220 auto downloadFileUrl = QUrl{QString{reply->readAll()}};
222
221
223 qCInfo(LOG_AmdaProvider())
222 qCInfo(LOG_AmdaProvider())
224 << tr("TORM AmdaProvider::retrieveData downloadFileUrl:") << downloadFileUrl;
223 << tr("TORM AmdaProvider::retrieveData downloadFileUrl:") << downloadFileUrl;
@@ -17,38 +17,24 namespace {
17 /// Message in result file when the file was not found on server
17 /// Message in result file when the file was not found on server
18 const auto FILE_NOT_FOUND_MESSAGE = QStringLiteral("Not Found");
18 const auto FILE_NOT_FOUND_MESSAGE = QStringLiteral("Not Found");
19
19
20 /// Separator between values in a result line
21 const auto RESULT_LINE_SEPARATOR = QRegularExpression{QStringLiteral("\\s+")};
22
23 /// Regex to find the header of the data in the file. This header indicates the end of comments in
24 /// the file
25 const auto DATA_HEADER_REGEX = QRegularExpression{QStringLiteral("#\\s*DATA\\s*:")};
26
27 /// Format for dates in result files
20 /// Format for dates in result files
28 const auto DATE_FORMAT = QStringLiteral("yyyy-MM-ddThh:mm:ss.zzz");
21 const auto DATE_FORMAT = QStringLiteral("yyyy-MM-ddThh:mm:ss.zzz");
29
22
30 /// Regex to find unit in a line. Examples of valid lines:
23 /// Separator between values in a result line
31 /// ... PARAMETER_UNITS : nT ...
24 const auto RESULT_LINE_SEPARATOR = QRegularExpression{QStringLiteral("\\s+")};
32 /// ... PARAMETER_UNITS:nT ...
33 /// ... PARAMETER_UNITS: m² ...
34 /// ... PARAMETER_UNITS : m/s ...
35 const auto UNIT_REGEX = QRegularExpression{QStringLiteral("\\s*PARAMETER_UNITS\\s*:\\s*(.+)")};
36
25
37 QDateTime dateTimeFromString(const QString &stringDate) noexcept
26 /// Regex to find unit in a line. Examples of valid lines:
38 {
27 /// ... - Units : nT - ...
39 #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
28 /// ... -Units:nT- ...
40 return QDateTime::fromString(stringDate, Qt::ISODateWithMs);
29 /// ... -Units: m²- ...
41 #else
30 /// ... - Units : m/s - ...
42 return QDateTime::fromString(stringDate, DATE_FORMAT);
31 const auto UNIT_REGEX = QRegularExpression{QStringLiteral("-\\s*Units\\s*:\\s*(.+?)\\s*-")};
43 #endif
44 }
45
32
46 /// Converts a string date to a double date
33 /// Converts a string date to a double date
47 /// @return a double that represents the date in seconds, NaN if the string date can't be converted
34 /// @return a double that represents the date in seconds, NaN if the string date can't be converted
48 double doubleDate(const QString &stringDate) noexcept
35 double doubleDate(const QString &stringDate) noexcept
49 {
36 {
50 // Format: yyyy-MM-ddThh:mm:ss.zzz
37 auto dateTime = QDateTime::fromString(stringDate, DATE_FORMAT);
51 auto dateTime = dateTimeFromString(stringDate);
52 dateTime.setTimeSpec(Qt::UTC);
38 dateTime.setTimeSpec(Qt::UTC);
53 return dateTime.isValid() ? DateUtils::secondsSinceEpoch(dateTime)
39 return dateTime.isValid() ? DateUtils::secondsSinceEpoch(dateTime)
54 : std::numeric_limits<double>::quiet_NaN();
40 : std::numeric_limits<double>::quiet_NaN();
@@ -89,8 +75,8 Unit readXAxisUnit(QTextStream &stream)
89 {
75 {
90 QString line{};
76 QString line{};
91
77
92 // Searches unit in the comment lines (as long as the reading has not reached the data header)
78 // Searches unit in the comment lines
93 while (stream.readLineInto(&line) && !line.contains(DATA_HEADER_REGEX)) {
79 while (stream.readLineInto(&line) && isCommentLine(line)) {
94 auto match = UNIT_REGEX.match(line);
80 auto match = UNIT_REGEX.match(line);
95 if (match.hasMatch()) {
81 if (match.hasMatch()) {
96 return Unit{match.captured(1), true};
82 return Unit{match.captured(1), true};
@@ -111,21 +97,18 Unit readXAxisUnit(QTextStream &stream)
111 std::pair<std::vector<double>, std::vector<double> >
97 std::pair<std::vector<double>, std::vector<double> >
112 readResults(QTextStream &stream, AmdaResultParser::ValueType valueType)
98 readResults(QTextStream &stream, AmdaResultParser::ValueType valueType)
113 {
99 {
114 auto expectedNbValues = nbValues(valueType) + 1;
100 auto expectedNbValues = nbValues(valueType);
115
101
116 auto xData = std::vector<double>{};
102 auto xData = std::vector<double>{};
117 auto valuesData = std::vector<double>{};
103 auto valuesData = std::vector<double>{};
118
104
119 QString line{};
105 QString line{};
120
106
121 // Skip comment lines
107 while (stream.readLineInto(&line)) {
122 while (stream.readLineInto(&line) && isCommentLine(line)) {
108 // Ignore comment lines
123 }
109 if (!isCommentLine(line)) {
124
125 if (!stream.atEnd()) {
126 do {
127 auto lineData = line.split(RESULT_LINE_SEPARATOR, QString::SkipEmptyParts);
110 auto lineData = line.split(RESULT_LINE_SEPARATOR, QString::SkipEmptyParts);
128 if (lineData.size() == expectedNbValues) {
111 if (lineData.size() == expectedNbValues + 1) {
129 // X : the data is converted from date to double (in secs)
112 // X : the data is converted from date to double (in secs)
130 auto x = doubleDate(lineData.at(0));
113 auto x = doubleDate(lineData.at(0));
131
114
@@ -134,8 +117,8 readResults(QTextStream &stream, AmdaResultParser::ValueType valueType)
134 xData.push_back(x);
117 xData.push_back(x);
135
118
136 // Values
119 // Values
137 for (auto valueIndex = 1; valueIndex < expectedNbValues; ++valueIndex) {
120 for (auto valueIndex = 0; valueIndex < expectedNbValues; ++valueIndex) {
138 auto column = valueIndex;
121 auto column = valueIndex + 1;
139
122
140 bool valueOk;
123 bool valueOk;
141 auto value = lineData.at(column).toDouble(&valueOk);
124 auto value = lineData.at(column).toDouble(&valueOk);
@@ -161,7 +144,7 readResults(QTextStream &stream, AmdaResultParser::ValueType valueType)
161 qCWarning(LOG_AmdaResultParser())
144 qCWarning(LOG_AmdaResultParser())
162 << QObject::tr("Can't retrieve results from line %1: invalid line").arg(line);
145 << QObject::tr("Can't retrieve results from line %1: invalid line").arg(line);
163 }
146 }
164 } while (stream.readLineInto(&line));
147 }
165 }
148 }
166
149
167 return std::make_pair(std::move(xData), std::move(valuesData));
150 return std::make_pair(std::move(xData), std::move(valuesData));
@@ -203,6 +186,7 std::shared_ptr<IDataSeries> AmdaResultParser::readTxt(const QString &filePath,
203 auto xAxisUnit = readXAxisUnit(stream);
186 auto xAxisUnit = readXAxisUnit(stream);
204
187
205 // Reads results
188 // Reads results
189 stream.seek(0); // returns to the beginning of the file
206 auto results = readResults(stream, valueType);
190 auto results = readResults(stream, valueType);
207
191
208 // Creates data series
192 // Creates data series
@@ -1,64 +1,6
1 # -----------
1 #Sampling Time : 60
2 # AMDA INFO :
2 #Time Format : YYYY-MM-DDThh:mm:ss.mls
3 # -----------
3 #imf(0) - Type : Local Parameter @ CDPP/AMDA - Name : bx_gse - Units : nT - Size : 1 - Frame : GSE - Mission : ACE - Instrument : MFI - Dataset : mfi_final-prelim
4 # AMDA_ABOUT : Created by CDPP/AMDA(c)
5 # AMDA_VERSION : 3.5.0
6 # AMDA_ACKNOWLEDGEMENT : CDPP/AMDA Team
7 #
8 # --------------
9 # REQUEST INFO :
10 # --------------
11 # REQUEST_STRUCTURE : one-file-per-parameter-per-interval
12 # REQUEST_TIME_FORMAT : ISO 8601
13 # REQUEST_OUTPUT_PARAMS : imf
14 #
15 # -----------------
16 # BASE PARAMETERS :
17 # -----------------
18 #
19 # MISSION_ID : NONE
20 #
21 # INSTRUMENT_ID : NONE
22 #
23 # DATASET_ID : ace-imf-all
24 # DATASET_NAME : final / prelim
25 # DATASET_DESCRIPTION : Interplanetary Magnetic Field 16-sec Level2/PRELIM Data
26 # DATASET_SOURCE : CDPP/DDServer
27 # DATASET_GLOBAL_START : 1997-09-02T00:00:12.000
28 # DATASET_GLOBAL_STOP : 2017-09-16T23:59:57.000
29 # DATASET_MIN_SAMPLING : 16
30 # DATASET_MAX_SAMPLING : 16
31 # DATASET_CAVEATS :
32 The quality of ACE level 2 data is such that it is suitable for serious scientific study. However, to avoid confusion and misunderstanding, it is recommended that users consult with the appropriate ACE team members before publishing work derived from the data. The ACE team has worked hard to ensure that the level 2 data are free from errors, but the team cannot accept responsibility for erroneous data, or for misunderstandings about how the data may be used. This is especially true if the appropriate ACE team members are not consulted before publication. At the very least, preprints should be forwarded to the ACE team before publication.
33
34 # DATASET_ACKNOWLEDGEMENT :
35 Please acknowledge the ACE/MAG instrument team and the ACE Science Center
36
37 #
38 # PARAMETER_ID : imf
39 # PARAMETER_NAME : imf
40 # PARAMETER_SHORT_NAME : b_gse
41 # PARAMETER_COMPONENTS : bx,by,bz
42 # PARAMETER_UNITS : nT
43 # PARAMETER_COORDINATE_SYSTEM : GSE
44 # PARAMETER_TENSOR_ORDER : 0
45 # PARAMETER_SI_CONVERSION : 1e-9>T
46 # PARAMETER_TABLE : None
47 # PARAMETER_FILL_VALUE : nan
48 # PARAMETER_UCD : phys.magField
49 #
50 #
51 # ---------------
52 # INTERVAL INFO :
53 # ---------------
54 # INTERVAL_START : 2013-09-23T08:58:12.000
55 # INTERVAL_STOP : 2013-09-23T09:11:48.000
56 #
57 # ------
58 # DATA :
59 # ------
60 # DATA_COLUMNS : AMDA_TIME, imf[0]
61 #
62 2013-09-23T09:00:30.000 NaN
4 2013-09-23T09:00:30.000 NaN
63 2013-09-23T09:01:30.000 -2.71850
5 2013-09-23T09:01:30.000 -2.71850
64 2013-09-23T09:02:30.000 -2.52150 No newline at end of file
6 2013-09-23T09:02:30.000 -2.52150
@@ -1,64 +1,6
1 # -----------
1 #Sampling Time : 60
2 # AMDA INFO :
2 #Time Format : YYYY-MM-DDThh:mm:ss.mls
3 # -----------
3 #imf(0) - Type : Local Parameter @ CDPP/AMDA - Name : bx_gse - Units : nT - Size : 1 - Frame : GSE - Mission : ACE - Instrument : MFI - Dataset : mfi_final-prelim
4 # AMDA_ABOUT : Created by CDPP/AMDA(c)
5 # AMDA_VERSION : 3.5.0
6 # AMDA_ACKNOWLEDGEMENT : CDPP/AMDA Team
7 #
8 # --------------
9 # REQUEST INFO :
10 # --------------
11 # REQUEST_STRUCTURE : one-file-per-parameter-per-interval
12 # REQUEST_TIME_FORMAT : ISO 8601
13 # REQUEST_OUTPUT_PARAMS : imf
14 #
15 # -----------------
16 # BASE PARAMETERS :
17 # -----------------
18 #
19 # MISSION_ID : NONE
20 #
21 # INSTRUMENT_ID : NONE
22 #
23 # DATASET_ID : ace-imf-all
24 # DATASET_NAME : final / prelim
25 # DATASET_DESCRIPTION : Interplanetary Magnetic Field 16-sec Level2/PRELIM Data
26 # DATASET_SOURCE : CDPP/DDServer
27 # DATASET_GLOBAL_START : 1997-09-02T00:00:12.000
28 # DATASET_GLOBAL_STOP : 2017-09-16T23:59:57.000
29 # DATASET_MIN_SAMPLING : 16
30 # DATASET_MAX_SAMPLING : 16
31 # DATASET_CAVEATS :
32 The quality of ACE level 2 data is such that it is suitable for serious scientific study. However, to avoid confusion and misunderstanding, it is recommended that users consult with the appropriate ACE team members before publishing work derived from the data. The ACE team has worked hard to ensure that the level 2 data are free from errors, but the team cannot accept responsibility for erroneous data, or for misunderstandings about how the data may be used. This is especially true if the appropriate ACE team members are not consulted before publication. At the very least, preprints should be forwarded to the ACE team before publication.
33
34 # DATASET_ACKNOWLEDGEMENT :
35 Please acknowledge the ACE/MAG instrument team and the ACE Science Center
36
37 #
38 # PARAMETER_ID : imf
39 # PARAMETER_NAME : imf
40 # PARAMETER_SHORT_NAME : b_gse
41 # PARAMETER_COMPONENTS : bx,by,bz
42 # PARAMETER_UNITS : nT
43 # PARAMETER_COORDINATE_SYSTEM : GSE
44 # PARAMETER_TENSOR_ORDER : 0
45 # PARAMETER_SI_CONVERSION : 1e-9>T
46 # PARAMETER_TABLE : None
47 # PARAMETER_FILL_VALUE : nan
48 # PARAMETER_UCD : phys.magField
49 #
50 #
51 # ---------------
52 # INTERVAL INFO :
53 # ---------------
54 # INTERVAL_START : 2013-09-23T08:58:12.000
55 # INTERVAL_STOP : 2013-09-23T09:11:48.000
56 #
57 # ------
58 # DATA :
59 # ------
60 # DATA_COLUMNS : AMDA_TIME, imf[0]
61 #
62 NaN -3.01425
4 NaN -3.01425
63 2013-09-23T09:01:30.000 -2.71850
5 2013-09-23T09:01:30.000 -2.71850
64 2013-09-23T09:02:30.000 -2.52150 No newline at end of file
6 2013-09-23T09:02:30.000 -2.52150
@@ -1,60 +1,2
1 # -----------
1 #Sampling Time : 60
2 # AMDA INFO :
2 #Time Format : YYYY-MM-DDThh:mm:ss.mls No newline at end of file
3 # -----------
4 # AMDA_ABOUT : Created by CDPP/AMDA(c)
5 # AMDA_VERSION : 3.5.0
6 # AMDA_ACKNOWLEDGEMENT : CDPP/AMDA Team
7 #
8 # --------------
9 # REQUEST INFO :
10 # --------------
11 # REQUEST_STRUCTURE : one-file-per-parameter-per-interval
12 # REQUEST_TIME_FORMAT : ISO 8601
13 # REQUEST_OUTPUT_PARAMS : imf
14 #
15 # -----------------
16 # BASE PARAMETERS :
17 # -----------------
18 #
19 # MISSION_ID : NONE
20 #
21 # INSTRUMENT_ID : NONE
22 #
23 # DATASET_ID : ace-imf-all
24 # DATASET_NAME : final / prelim
25 # DATASET_DESCRIPTION : Interplanetary Magnetic Field 16-sec Level2/PRELIM Data
26 # DATASET_SOURCE : CDPP/DDServer
27 # DATASET_GLOBAL_START : 1997-09-02T00:00:12.000
28 # DATASET_GLOBAL_STOP : 2017-09-16T23:59:57.000
29 # DATASET_MIN_SAMPLING : 16
30 # DATASET_MAX_SAMPLING : 16
31 # DATASET_CAVEATS :
32 The quality of ACE level 2 data is such that it is suitable for serious scientific study. However, to avoid confusion and misunderstanding, it is recommended that users consult with the appropriate ACE team members before publishing work derived from the data. The ACE team has worked hard to ensure that the level 2 data are free from errors, but the team cannot accept responsibility for erroneous data, or for misunderstandings about how the data may be used. This is especially true if the appropriate ACE team members are not consulted before publication. At the very least, preprints should be forwarded to the ACE team before publication.
33
34 # DATASET_ACKNOWLEDGEMENT :
35 Please acknowledge the ACE/MAG instrument team and the ACE Science Center
36
37 #
38 # PARAMETER_ID : imf
39 # PARAMETER_NAME : imf
40 # PARAMETER_SHORT_NAME : b_gse
41 # PARAMETER_COMPONENTS : bx,by,bz
42 # PARAMETER_COORDINATE_SYSTEM : GSE
43 # PARAMETER_TENSOR_ORDER : 0
44 # PARAMETER_SI_CONVERSION : 1e-9>T
45 # PARAMETER_TABLE : None
46 # PARAMETER_FILL_VALUE : nan
47 # PARAMETER_UCD : phys.magField
48 #
49 #
50 # ---------------
51 # INTERVAL INFO :
52 # ---------------
53 # INTERVAL_START : 2013-09-23T08:58:12.000
54 # INTERVAL_STOP : 2013-09-23T09:11:48.000
55 #
56 # ------
57 # DATA :
58 # ------
59 # DATA_COLUMNS : AMDA_TIME, imf[0]
60 # No newline at end of file
@@ -1,64 +1,6
1 # -----------
1 #Sampling Time : 60
2 # AMDA INFO :
2 #Time Format : YYYY-MM-DDThh:mm:ss.mls
3 # -----------
3 #imf(0) - Type : Local Parameter @ CDPP/AMDA - Name : bx_gse - Units : nT - Size : 1 - Frame : GSE - Mission : ACE - Instrument : MFI - Dataset : mfi_final-prelim
4 # AMDA_ABOUT : Created by CDPP/AMDA(c)
5 # AMDA_VERSION : 3.5.0
6 # AMDA_ACKNOWLEDGEMENT : CDPP/AMDA Team
7 #
8 # --------------
9 # REQUEST INFO :
10 # --------------
11 # REQUEST_STRUCTURE : one-file-per-parameter-per-interval
12 # REQUEST_TIME_FORMAT : ISO 8601
13 # REQUEST_OUTPUT_PARAMS : imf
14 #
15 # -----------------
16 # BASE PARAMETERS :
17 # -----------------
18 #
19 # MISSION_ID : NONE
20 #
21 # INSTRUMENT_ID : NONE
22 #
23 # DATASET_ID : ace-imf-all
24 # DATASET_NAME : final / prelim
25 # DATASET_DESCRIPTION : Interplanetary Magnetic Field 16-sec Level2/PRELIM Data
26 # DATASET_SOURCE : CDPP/DDServer
27 # DATASET_GLOBAL_START : 1997-09-02T00:00:12.000
28 # DATASET_GLOBAL_STOP : 2017-09-16T23:59:57.000
29 # DATASET_MIN_SAMPLING : 16
30 # DATASET_MAX_SAMPLING : 16
31 # DATASET_CAVEATS :
32 The quality of ACE level 2 data is such that it is suitable for serious scientific study. However, to avoid confusion and misunderstanding, it is recommended that users consult with the appropriate ACE team members before publishing work derived from the data. The ACE team has worked hard to ensure that the level 2 data are free from errors, but the team cannot accept responsibility for erroneous data, or for misunderstandings about how the data may be used. This is especially true if the appropriate ACE team members are not consulted before publication. At the very least, preprints should be forwarded to the ACE team before publication.
33
34 # DATASET_ACKNOWLEDGEMENT :
35 Please acknowledge the ACE/MAG instrument team and the ACE Science Center
36
37 #
38 # PARAMETER_ID : imf
39 # PARAMETER_NAME : imf
40 # PARAMETER_SHORT_NAME : b_gse
41 # PARAMETER_COMPONENTS : bx,by,bz
42 # PARAMETER_UNITS : nT
43 # PARAMETER_COORDINATE_SYSTEM : GSE
44 # PARAMETER_TENSOR_ORDER : 0
45 # PARAMETER_SI_CONVERSION : 1e-9>T
46 # PARAMETER_TABLE : None
47 # PARAMETER_FILL_VALUE : nan
48 # PARAMETER_UCD : phys.magField
49 #
50 #
51 # ---------------
52 # INTERVAL INFO :
53 # ---------------
54 # INTERVAL_START : 2013-09-23T08:58:12.000
55 # INTERVAL_STOP : 2013-09-23T09:11:48.000
56 #
57 # ------
58 # DATA :
59 # ------
60 # DATA_COLUMNS : AMDA_TIME, imf[0]
61 #
62 2013-09-23T09:00:30.000 -2.83950 1.05141 3.01547
4 2013-09-23T09:00:30.000 -2.83950 1.05141 3.01547
63 2013-09-23T09:01:30.000 -2.71850
5 2013-09-23T09:01:30.000 -2.71850
64 2013-09-23T09:02:30.000 -2.52150 No newline at end of file
6 2013-09-23T09:02:30.000 -2.52150
@@ -1,64 +1,6
1 # -----------
1 #Sampling Time : 60
2 # AMDA INFO :
2 #Time Format : YYYY-MM-DDThh:mm:ss.mls
3 # -----------
3 #imf(0) - Type : Local Parameter @ CDPP/AMDA - Name : bx_gse - Units : nT - Size : 1 - Frame : GSE - Mission : ACE - Instrument : MFI - Dataset : mfi_final-prelim
4 # AMDA_ABOUT : Created by CDPP/AMDA(c)
5 # AMDA_VERSION : 3.5.0
6 # AMDA_ACKNOWLEDGEMENT : CDPP/AMDA Team
7 #
8 # --------------
9 # REQUEST INFO :
10 # --------------
11 # REQUEST_STRUCTURE : one-file-per-parameter-per-interval
12 # REQUEST_TIME_FORMAT : ISO 8601
13 # REQUEST_OUTPUT_PARAMS : imf
14 #
15 # -----------------
16 # BASE PARAMETERS :
17 # -----------------
18 #
19 # MISSION_ID : NONE
20 #
21 # INSTRUMENT_ID : NONE
22 #
23 # DATASET_ID : ace-imf-all
24 # DATASET_NAME : final / prelim
25 # DATASET_DESCRIPTION : Interplanetary Magnetic Field 16-sec Level2/PRELIM Data
26 # DATASET_SOURCE : CDPP/DDServer
27 # DATASET_GLOBAL_START : 1997-09-02T00:00:12.000
28 # DATASET_GLOBAL_STOP : 2017-09-16T23:59:57.000
29 # DATASET_MIN_SAMPLING : 16
30 # DATASET_MAX_SAMPLING : 16
31 # DATASET_CAVEATS :
32 The quality of ACE level 2 data is such that it is suitable for serious scientific study. However, to avoid confusion and misunderstanding, it is recommended that users consult with the appropriate ACE team members before publishing work derived from the data. The ACE team has worked hard to ensure that the level 2 data are free from errors, but the team cannot accept responsibility for erroneous data, or for misunderstandings about how the data may be used. This is especially true if the appropriate ACE team members are not consulted before publication. At the very least, preprints should be forwarded to the ACE team before publication.
33
34 # DATASET_ACKNOWLEDGEMENT :
35 Please acknowledge the ACE/MAG instrument team and the ACE Science Center
36
37 #
38 # PARAMETER_ID : imf
39 # PARAMETER_NAME : imf
40 # PARAMETER_SHORT_NAME : b_gse
41 # PARAMETER_COMPONENTS : bx,by,bz
42 # PARAMETER_UNITS : nT
43 # PARAMETER_COORDINATE_SYSTEM : GSE
44 # PARAMETER_TENSOR_ORDER : 0
45 # PARAMETER_SI_CONVERSION : 1e-9>T
46 # PARAMETER_TABLE : None
47 # PARAMETER_FILL_VALUE : nan
48 # PARAMETER_UCD : phys.magField
49 #
50 #
51 # ---------------
52 # INTERVAL INFO :
53 # ---------------
54 # INTERVAL_START : 2013-09-23T08:58:12.000
55 # INTERVAL_STOP : 2013-09-23T09:11:48.000
56 #
57 # ------
58 # DATA :
59 # ------
60 # DATA_COLUMNS : AMDA_TIME, imf[0]
61 #
62 2013-09-23T09:00:30.000 -2.83950
4 2013-09-23T09:00:30.000 -2.83950
63 2013-09-23T09:01:30.000 -2.71850
5 2013-09-23T09:01:30.000 -2.71850
64 2013-09-23T09:02:30.000 -2.52150
6 2013-09-23T09:02:30.000 -2.52150
@@ -1,64 +1,5
1 # -----------
1 #Time Format : YYYY-MM-DDThh:mm:ss.mls
2 # AMDA INFO :
2 #imf - Type : Local Parameter @ CDPP/AMDA - Name : imf_gse - Units : nT - Size : 3 - Frame : GSE - Mission : ACE - Instrument : MFI - Dataset : mfi_final-prelim
3 # -----------
4 # AMDA_ABOUT : Created by CDPP/AMDA(c)
5 # AMDA_VERSION : 3.5.0
6 # AMDA_ACKNOWLEDGEMENT : CDPP/AMDA Team
7 #
8 # --------------
9 # REQUEST INFO :
10 # --------------
11 # REQUEST_STRUCTURE : one-file-per-parameter-per-interval
12 # REQUEST_TIME_FORMAT : ISO 8601
13 # REQUEST_OUTPUT_PARAMS : imf
14 #
15 # -----------------
16 # BASE PARAMETERS :
17 # -----------------
18 #
19 # MISSION_ID : NONE
20 #
21 # INSTRUMENT_ID : NONE
22 #
23 # DATASET_ID : ace-imf-all
24 # DATASET_NAME : final / prelim
25 # DATASET_DESCRIPTION : Interplanetary Magnetic Field 16-sec Level2/PRELIM Data
26 # DATASET_SOURCE : CDPP/DDServer
27 # DATASET_GLOBAL_START : 1997-09-02T00:00:12.000
28 # DATASET_GLOBAL_STOP : 2017-09-16T23:59:57.000
29 # DATASET_MIN_SAMPLING : 16
30 # DATASET_MAX_SAMPLING : 16
31 # DATASET_CAVEATS :
32 The quality of ACE level 2 data is such that it is suitable for serious scientific study. However, to avoid confusion and misunderstanding, it is recommended that users consult with the appropriate ACE team members before publishing work derived from the data. The ACE team has worked hard to ensure that the level 2 data are free from errors, but the team cannot accept responsibility for erroneous data, or for misunderstandings about how the data may be used. This is especially true if the appropriate ACE team members are not consulted before publication. At the very least, preprints should be forwarded to the ACE team before publication.
33
34 # DATASET_ACKNOWLEDGEMENT :
35 Please acknowledge the ACE/MAG instrument team and the ACE Science Center
36
37 #
38 # PARAMETER_ID : imf
39 # PARAMETER_NAME : imf
40 # PARAMETER_SHORT_NAME : b_gse
41 # PARAMETER_COMPONENTS : bx,by,bz
42 # PARAMETER_UNITS : nT
43 # PARAMETER_COORDINATE_SYSTEM : GSE
44 # PARAMETER_TENSOR_ORDER : 0
45 # PARAMETER_SI_CONVERSION : 1e-9>T
46 # PARAMETER_TABLE : None
47 # PARAMETER_FILL_VALUE : nan
48 # PARAMETER_UCD : phys.magField
49 #
50 #
51 # ---------------
52 # INTERVAL INFO :
53 # ---------------
54 # INTERVAL_START : 2012-09-27T06:47:56.000
55 # INTERVAL_STOP : 2012-09-27T08:09:32.000
56 #
57 # ------
58 # DATA :
59 # ------
60 # DATA_COLUMNS : AMDA_TIME, imf[0], imf[1], imf[2]
61 #
62 2013-07-02T09:13:50.000 -0.332000 3.20600 0.0580000
3 2013-07-02T09:13:50.000 -0.332000 3.20600 0.0580000
63 2013-07-02T09:14:06.000 -1.01100 2.99900 0.496000
4 2013-07-02T09:14:06.000 -1.01100 2.99900 0.496000
64 2013-07-02T09:14:22.000 -1.45700 2.78500 1.01800
5 2013-07-02T09:14:22.000 -1.45700 2.78500 1.01800
@@ -1,64 +1,6
1 # -----------
1 #Sampling Time : 60
2 # AMDA INFO :
2 #Time Format : YYYY-MM-DDThh:mm:ss.mls
3 # -----------
3 #imf(0) - Type : Local Parameter @ CDPP/AMDA - Name : bx_gse - Units : nT - Size : 1 - Frame : GSE - Mission : ACE - Instrument : MFI - Dataset : mfi_final-prelim
4 # AMDA_ABOUT : Created by CDPP/AMDA(c)
5 # AMDA_VERSION : 3.5.0
6 # AMDA_ACKNOWLEDGEMENT : CDPP/AMDA Team
7 #
8 # --------------
9 # REQUEST INFO :
10 # --------------
11 # REQUEST_STRUCTURE : one-file-per-parameter-per-interval
12 # REQUEST_TIME_FORMAT : ISO 8601
13 # REQUEST_OUTPUT_PARAMS : imf
14 #
15 # -----------------
16 # BASE PARAMETERS :
17 # -----------------
18 #
19 # MISSION_ID : NONE
20 #
21 # INSTRUMENT_ID : NONE
22 #
23 # DATASET_ID : ace-imf-all
24 # DATASET_NAME : final / prelim
25 # DATASET_DESCRIPTION : Interplanetary Magnetic Field 16-sec Level2/PRELIM Data
26 # DATASET_SOURCE : CDPP/DDServer
27 # DATASET_GLOBAL_START : 1997-09-02T00:00:12.000
28 # DATASET_GLOBAL_STOP : 2017-09-16T23:59:57.000
29 # DATASET_MIN_SAMPLING : 16
30 # DATASET_MAX_SAMPLING : 16
31 # DATASET_CAVEATS :
32 The quality of ACE level 2 data is such that it is suitable for serious scientific study. However, to avoid confusion and misunderstanding, it is recommended that users consult with the appropriate ACE team members before publishing work derived from the data. The ACE team has worked hard to ensure that the level 2 data are free from errors, but the team cannot accept responsibility for erroneous data, or for misunderstandings about how the data may be used. This is especially true if the appropriate ACE team members are not consulted before publication. At the very least, preprints should be forwarded to the ACE team before publication.
33
34 # DATASET_ACKNOWLEDGEMENT :
35 Please acknowledge the ACE/MAG instrument team and the ACE Science Center
36
37 #
38 # PARAMETER_ID : imf
39 # PARAMETER_NAME : imf
40 # PARAMETER_SHORT_NAME : b_gse
41 # PARAMETER_COMPONENTS : bx,by,bz
42 # PARAMETER_UNITS : nT
43 # PARAMETER_COORDINATE_SYSTEM : GSE
44 # PARAMETER_TENSOR_ORDER : 0
45 # PARAMETER_SI_CONVERSION : 1e-9>T
46 # PARAMETER_TABLE : None
47 # PARAMETER_FILL_VALUE : nan
48 # PARAMETER_UCD : phys.magField
49 #
50 #
51 # ---------------
52 # INTERVAL INFO :
53 # ---------------
54 # INTERVAL_START : 2013-09-23T08:58:12.000
55 # INTERVAL_STOP : 2013-09-23T09:11:48.000
56 #
57 # ------
58 # DATA :
59 # ------
60 # DATA_COLUMNS : AMDA_TIME, imf[0]
61 #
62 23/09/2013 07:50:30 -2.83950
4 23/09/2013 07:50:30 -2.83950
63 2013-09-23T09:01:30.000 -2.71850
5 2013-09-23T09:01:30.000 -2.71850
64 2013-09-23T09:02:30.000 -2.52150 No newline at end of file
6 2013-09-23T09:02:30.000 -2.52150
@@ -1,64 +1,6
1 # -----------
1 #Sampling Time : 60
2 # AMDA INFO :
2 #Time Format : YYYY-MM-DDThh:mm:ss.mls
3 # -----------
3 #Wrong unit comment
4 # AMDA_ABOUT : Created by CDPP/AMDA(c)
5 # AMDA_VERSION : 3.5.0
6 # AMDA_ACKNOWLEDGEMENT : CDPP/AMDA Team
7 #
8 # --------------
9 # REQUEST INFO :
10 # --------------
11 # REQUEST_STRUCTURE : one-file-per-parameter-per-interval
12 # REQUEST_TIME_FORMAT : ISO 8601
13 # REQUEST_OUTPUT_PARAMS : imf
14 #
15 # -----------------
16 # BASE PARAMETERS :
17 # -----------------
18 #
19 # MISSION_ID : NONE
20 #
21 # INSTRUMENT_ID : NONE
22 #
23 # DATASET_ID : ace-imf-all
24 # DATASET_NAME : final / prelim
25 # DATASET_DESCRIPTION : Interplanetary Magnetic Field 16-sec Level2/PRELIM Data
26 # DATASET_SOURCE : CDPP/DDServer
27 # DATASET_GLOBAL_START : 1997-09-02T00:00:12.000
28 # DATASET_GLOBAL_STOP : 2017-09-16T23:59:57.000
29 # DATASET_MIN_SAMPLING : 16
30 # DATASET_MAX_SAMPLING : 16
31 # DATASET_CAVEATS :
32 The quality of ACE level 2 data is such that it is suitable for serious scientific study. However, to avoid confusion and misunderstanding, it is recommended that users consult with the appropriate ACE team members before publishing work derived from the data. The ACE team has worked hard to ensure that the level 2 data are free from errors, but the team cannot accept responsibility for erroneous data, or for misunderstandings about how the data may be used. This is especially true if the appropriate ACE team members are not consulted before publication. At the very least, preprints should be forwarded to the ACE team before publication.
33
34 # DATASET_ACKNOWLEDGEMENT :
35 Please acknowledge the ACE/MAG instrument team and the ACE Science Center
36
37 #
38 # PARAMETER_ID : imf
39 # PARAMETER_NAME : imf
40 # PARAMETER_SHORT_NAME : b_gse
41 # PARAMETER_COMPONENTS : bx,by,bz
42 # PARAM_UNITS : wrong unit line
43 # PARAMETER_COORDINATE_SYSTEM : GSE
44 # PARAMETER_TENSOR_ORDER : 0
45 # PARAMETER_SI_CONVERSION : 1e-9>T
46 # PARAMETER_TABLE : None
47 # PARAMETER_FILL_VALUE : nan
48 # PARAMETER_UCD : phys.magField
49 #
50 #
51 # ---------------
52 # INTERVAL INFO :
53 # ---------------
54 # INTERVAL_START : 2013-09-23T08:58:12.000
55 # INTERVAL_STOP : 2013-09-23T09:11:48.000
56 #
57 # ------
58 # DATA :
59 # ------
60 # DATA_COLUMNS : AMDA_TIME, imf[0]
61 #
62 2013-09-23T09:00:30.000 -2.83950
4 2013-09-23T09:00:30.000 -2.83950
63 2013-09-23T09:01:30.000 -2.71850
5 2013-09-23T09:01:30.000 -2.71850
64 2013-09-23T09:02:30.000 -2.52150 No newline at end of file
6 2013-09-23T09:02:30.000 -2.52150
@@ -1,64 +1,6
1 # -----------
1 #Sampling Time : 60
2 # AMDA INFO :
2 #Time Format : YYYY-MM-DDThh:mm:ss.mls
3 # -----------
3 #imf(0) - Type : Local Parameter @ CDPP/AMDA - Name : bx_gse - Units : nT - Size : 1 - Frame : GSE - Mission : ACE - Instrument : MFI - Dataset : mfi_final-prelim
4 # AMDA_ABOUT : Created by CDPP/AMDA(c)
5 # AMDA_VERSION : 3.5.0
6 # AMDA_ACKNOWLEDGEMENT : CDPP/AMDA Team
7 #
8 # --------------
9 # REQUEST INFO :
10 # --------------
11 # REQUEST_STRUCTURE : one-file-per-parameter-per-interval
12 # REQUEST_TIME_FORMAT : ISO 8601
13 # REQUEST_OUTPUT_PARAMS : imf
14 #
15 # -----------------
16 # BASE PARAMETERS :
17 # -----------------
18 #
19 # MISSION_ID : NONE
20 #
21 # INSTRUMENT_ID : NONE
22 #
23 # DATASET_ID : ace-imf-all
24 # DATASET_NAME : final / prelim
25 # DATASET_DESCRIPTION : Interplanetary Magnetic Field 16-sec Level2/PRELIM Data
26 # DATASET_SOURCE : CDPP/DDServer
27 # DATASET_GLOBAL_START : 1997-09-02T00:00:12.000
28 # DATASET_GLOBAL_STOP : 2017-09-16T23:59:57.000
29 # DATASET_MIN_SAMPLING : 16
30 # DATASET_MAX_SAMPLING : 16
31 # DATASET_CAVEATS :
32 The quality of ACE level 2 data is such that it is suitable for serious scientific study. However, to avoid confusion and misunderstanding, it is recommended that users consult with the appropriate ACE team members before publishing work derived from the data. The ACE team has worked hard to ensure that the level 2 data are free from errors, but the team cannot accept responsibility for erroneous data, or for misunderstandings about how the data may be used. This is especially true if the appropriate ACE team members are not consulted before publication. At the very least, preprints should be forwarded to the ACE team before publication.
33
34 # DATASET_ACKNOWLEDGEMENT :
35 Please acknowledge the ACE/MAG instrument team and the ACE Science Center
36
37 #
38 # PARAMETER_ID : imf
39 # PARAMETER_NAME : imf
40 # PARAMETER_SHORT_NAME : b_gse
41 # PARAMETER_COMPONENTS : bx,by,bz
42 # PARAMETER_UNITS : nT
43 # PARAMETER_COORDINATE_SYSTEM : GSE
44 # PARAMETER_TENSOR_ORDER : 0
45 # PARAMETER_SI_CONVERSION : 1e-9>T
46 # PARAMETER_TABLE : None
47 # PARAMETER_FILL_VALUE : nan
48 # PARAMETER_UCD : phys.magField
49 #
50 #
51 # ---------------
52 # INTERVAL INFO :
53 # ---------------
54 # INTERVAL_START : 2013-09-23T08:58:12.000
55 # INTERVAL_STOP : 2013-09-23T09:11:48.000
56 #
57 # ------
58 # DATA :
59 # ------
60 # DATA_COLUMNS : AMDA_TIME, imf[0]
61 #
62 2013-09-23T09:00:30.000 abc
4 2013-09-23T09:00:30.000 abc
63 2013-09-23T09:01:30.000 -2.71850
5 2013-09-23T09:01:30.000 -2.71850
64 2013-09-23T09:02:30.000 -2.52150 No newline at end of file
6 2013-09-23T09:02:30.000 -2.52150
@@ -76,8 +76,6 private slots:
76
76
77 void TestAmdaAcquisition::testAcquisition()
77 void TestAmdaAcquisition::testAcquisition()
78 {
78 {
79 /// @todo: update test to be compatible with AMDA v2
80
81 // READ the ref file:
79 // READ the ref file:
82 auto filePath = QFileInfo{TESTS_RESOURCES_PATH, TESTS_AMDA_REF_FILE}.absoluteFilePath();
80 auto filePath = QFileInfo{TESTS_RESOURCES_PATH, TESTS_AMDA_REF_FILE}.absoluteFilePath();
83 auto results = AmdaResultParser::readTxt(filePath, AmdaResultParser::ValueType::SCALAR);
81 auto results = AmdaResultParser::readTxt(filePath, AmdaResultParser::ValueType::SCALAR);
@@ -144,13 +142,13 void TestAmdaAcquisition::testAcquisition()
144 // 2 : pan (jump) left for one hour
142 // 2 : pan (jump) left for one hour
145 auto nextVarRS = QDateTime{QDate{2012, 01, 02}, QTime{2, 1, 0, 0}};
143 auto nextVarRS = QDateTime{QDate{2012, 01, 02}, QTime{2, 1, 0, 0}};
146 auto nextVarRE = QDateTime{QDate{2012, 01, 02}, QTime{2, 2, 0, 0}};
144 auto nextVarRE = QDateTime{QDate{2012, 01, 02}, QTime{2, 2, 0, 0}};
147 // requestDataLoading(nextVarRS, nextVarRE);
145 requestDataLoading(nextVarRS, nextVarRE);
148
146
149
147
150 // 3 : pan (jump) right for one hour
148 // 3 : pan (jump) right for one hour
151 nextVarRS = QDateTime{QDate{2012, 01, 02}, QTime{2, 5, 0, 0}};
149 nextVarRS = QDateTime{QDate{2012, 01, 02}, QTime{2, 5, 0, 0}};
152 nextVarRE = QDateTime{QDate{2012, 01, 02}, QTime{2, 6, 0, 0}};
150 nextVarRE = QDateTime{QDate{2012, 01, 02}, QTime{2, 6, 0, 0}};
153 // requestDataLoading(nextVarRS, nextVarRE);
151 requestDataLoading(nextVarRS, nextVarRE);
154
152
155 // 4 : pan (overlay) right for 30 min
153 // 4 : pan (overlay) right for 30 min
156 nextVarRS = QDateTime{QDate{2012, 01, 02}, QTime{2, 5, 30, 0}};
154 nextVarRS = QDateTime{QDate{2012, 01, 02}, QTime{2, 5, 30, 0}};
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 2
there is 1 general comment from older versions, show it