##// END OF EJS Templates
Spectrograms implementation (2)...
Alexandre Leroux -
r950:333a8512d8bd
parent child
Show More
@@ -1,40 +1,68
1 #ifndef SCIQLOP_AMDARESULTPARSERDEFS_H
1 #ifndef SCIQLOP_AMDARESULTPARSERDEFS_H
2 #define SCIQLOP_AMDARESULTPARSERDEFS_H
2 #define SCIQLOP_AMDARESULTPARSERDEFS_H
3
3
4 #include <QtCore/QRegularExpression>
4 #include <QtCore/QRegularExpression>
5 #include <QtCore/QString>
5 #include <QtCore/QString>
6 #include <QtCore/QVariantHash>
6 #include <QtCore/QVariantHash>
7
7
8 // ////////// //
8 // ////////// //
9 // Properties //
9 // Properties //
10 // ////////// //
10 // ////////// //
11
11
12 /// Alias to represent properties read in the header of AMDA file
12 /// Alias to represent properties read in the header of AMDA file
13 using Properties = QVariantHash;
13 using Properties = QVariantHash;
14
14
15 extern const QString FILL_VALUE_PROPERTY;
16 extern const QString MAX_BANDS_PROPERTY;
17 extern const QString MIN_BANDS_PROPERTY;
18 extern const QString MAX_SAMPLING_PROPERTY;
19 extern const QString MIN_SAMPLING_PROPERTY;
15 extern const QString X_AXIS_UNIT_PROPERTY;
20 extern const QString X_AXIS_UNIT_PROPERTY;
21 extern const QString Y_AXIS_UNIT_PROPERTY;
22 extern const QString VALUES_UNIT_PROPERTY;
16
23
17 // /////////////////// //
24 // /////////////////// //
18 // Regular expressions //
25 // Regular expressions //
19 // /////////////////// //
26 // /////////////////// //
20
27
21 // AMDA V2
28 // AMDA V2
22 // /// Regex to find the header of the data in the file. This header indicates the end of comments
29 // /// Regex to find the header of the data in the file. This header indicates the end of comments
23 // in the file
30 // in the file
24 // const auto DATA_HEADER_REGEX = QRegularExpression{QStringLiteral("#\\s*DATA\\s*:")};
31 // const auto DATA_HEADER_REGEX = QRegularExpression{QStringLiteral("#\\s*DATA\\s*:")};
25
32
26 // AMDA V2
33 // AMDA V2
27 // /// ... PARAMETER_UNITS : nT ...
34 // /// ... PARAMETER_UNITS : nT ...
28 // /// ... PARAMETER_UNITS:nT ...
35 // /// ... PARAMETER_UNITS:nT ...
29 // /// ... PARAMETER_UNITS: mΒ² ...
36 // /// ... PARAMETER_UNITS: mΒ² ...
30 // /// ... PARAMETER_UNITS : m/s ...
37 // /// ... PARAMETER_UNITS : m/s ...
31 // const auto UNIT_REGEX = QRegularExpression{QStringLiteral("\\s*PARAMETER_UNITS\\s*:\\s*(.+)")};
38 // const auto UNIT_REGEX = QRegularExpression{QStringLiteral("\\s*PARAMETER_UNITS\\s*:\\s*(.+)")};
32
39
33 /// Regex to find x-axis unit in a line. Examples of valid lines:
40 /// Regex to find x-axis unit in a line. Examples of valid lines:
34 /// ... - Units : nT - ...
41 /// ... - Units : nT - ...
35 /// ... -Units:nT- ...
42 /// ... -Units:nT- ...
36 /// ... -Units: mΒ²- ...
43 /// ... -Units: mΒ²- ...
37 /// ... - Units : m/s - ...
44 /// ... - Units : m/s - ...
38 extern const QRegularExpression DEFAULT_X_AXIS_UNIT_REGEX;
45 extern const QRegularExpression DEFAULT_X_AXIS_UNIT_REGEX;
39
46
47 /// Regex to find fill value used in a line for a spectrogram
48 extern const QRegularExpression SPECTROGRAM_FILL_VALUE_REGEX;
49
50 /// Regex to find max bands in a line for a spectrogram
51 extern const QRegularExpression SPECTROGRAM_MAX_BANDS_REGEX;
52
53 /// Regex to find min bands in a line for a spectrogram
54 extern const QRegularExpression SPECTROGRAM_MIN_BANDS_REGEX;
55
56 /// Regex to find max x-axis sampling in a line for a spectrogram
57 extern const QRegularExpression SPECTROGRAM_MAX_SAMPLING_REGEX;
58
59 /// Regex to find min x-axis sampling in a line for a spectrogram
60 extern const QRegularExpression SPECTROGRAM_MIN_SAMPLING_REGEX;
61
62 /// Regex to find y-axis unit in a line for a spectrogram
63 extern const QRegularExpression SPECTROGRAM_Y_AXIS_UNIT_REGEX;
64
65 /// Regex to find values unit in a line for a spectrogram
66 extern const QRegularExpression SPECTROGRAM_VALUES_UNIT_REGEX;
67
40 #endif // SCIQLOP_AMDARESULTPARSERDEFS_H
68 #endif // SCIQLOP_AMDARESULTPARSERDEFS_H
@@ -1,6 +1,34
1 #include "AmdaResultParserDefs.h"
1 #include "AmdaResultParserDefs.h"
2
2
3 const QString FILL_VALUE_PROPERTY = QStringLiteral("fillValue");
4 const QString MAX_BANDS_PROPERTY = QStringLiteral("maxBands");
5 const QString MIN_BANDS_PROPERTY = QStringLiteral("minBands");
6 const QString MAX_SAMPLING_PROPERTY = QStringLiteral("maxSampling");
7 const QString MIN_SAMPLING_PROPERTY = QStringLiteral("minSampling");
3 const QString X_AXIS_UNIT_PROPERTY = QStringLiteral("xAxisUnit");
8 const QString X_AXIS_UNIT_PROPERTY = QStringLiteral("xAxisUnit");
9 const QString Y_AXIS_UNIT_PROPERTY = QStringLiteral("yAxisUnit");
10 const QString VALUES_UNIT_PROPERTY = QStringLiteral("valuesUnit");
4
11
5 const QRegularExpression DEFAULT_X_AXIS_UNIT_REGEX
12 const QRegularExpression DEFAULT_X_AXIS_UNIT_REGEX
6 = QRegularExpression{QStringLiteral("-\\s*Units\\s*:\\s*(.+?)\\s*-")};
13 = QRegularExpression{QStringLiteral("-\\s*Units\\s*:\\s*(.+?)\\s*-")};
14
15 const QRegularExpression SPECTROGRAM_FILL_VALUE_REGEX
16 = QRegularExpression{QStringLiteral("\\s*PARAMETER_FILL_VALUE\\s*:\\s*(.*)")};
17
18 const QRegularExpression SPECTROGRAM_MAX_BANDS_REGEX
19 = QRegularExpression{QStringLiteral("\\s*PARAMETER_TABLE_MAX_VALUES\\[0\\]\\s*:\\s*(.*)")};
20
21 const QRegularExpression SPECTROGRAM_MIN_BANDS_REGEX
22 = QRegularExpression{QStringLiteral("\\s*PARAMETER_TABLE_MIN_VALUES\\[0\\]\\s*:\\s*(.*)")};
23
24 const QRegularExpression SPECTROGRAM_MAX_SAMPLING_REGEX
25 = QRegularExpression{QStringLiteral("\\s*DATASET_MAX_SAMPLING\\s*:\\s*(.*)")};
26
27 const QRegularExpression SPECTROGRAM_MIN_SAMPLING_REGEX
28 = QRegularExpression{QStringLiteral("\\s*DATASET_MIN_SAMPLING\\s*:\\s*(.*)")};
29
30 const QRegularExpression SPECTROGRAM_Y_AXIS_UNIT_REGEX
31 = QRegularExpression{QStringLiteral("\\s*PARAMETER_TABLE_UNITS\\[0\\]\\s*:\\s*(.*)")};
32
33 const QRegularExpression SPECTROGRAM_VALUES_UNIT_REGEX
34 = QRegularExpression{QStringLiteral("\\s*PARAMETER_UNITS\\s*:\\s*(.*)")};
General Comments 0
You need to be logged in to leave comments. Login now