SIde-Channel Analysis toolKit (SICAK)
Software toolkit for side-channel analysis
meas.h
Go to the documentation of this file.
1 /*
2 * SICAK - SIde-Channel Analysis toolKit
3 * Copyright (C) 2018 Petr Socha, FIT, CTU in Prague
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18 
29 #ifndef MEAS_H
30 #define MEAS_H
31 
32 #include <QObject>
33 #include <QCommandLineParser>
34 #include "measurement.h"
35 #include "oscilloscope.h"
36 #include "chardevice.h"
37 
45 class Meas: public QObject {
46 
47 Q_OBJECT
48 
49 public:
50 
51  enum CommandLineParseResult {
52  CommandLineTaskPlanned,
53  CommandLineNOP,
54  CommandLineError,
55  CommandLineVersionRequested,
56  CommandLineHelpRequested,
57  CommandLineQueryRequested
58  };
59 
60  Meas(QObject *parent = 0) : QObject(parent), m_id(""), m_param(""), m_measurementModule(""), m_measurementsN(0), m_oscilloscopeModule(""), m_oscilloscopeDevice(""), m_oscilloscopeConfig(""), m_chardeviceModule(""), m_chardeviceDevice(""), m_chardeviceConfig(""), m_measurement(nullptr), m_oscilloscope(nullptr), m_chardevice(nullptr) {}
61 
63  CommandLineParseResult parseCommandLineParams(QCommandLineParser & parser);
64 
65 protected:
66 
68  bool loadMeasurementModule();
72  bool loadChardeviceModule();
73 
77  bool initConfigChardevice();
78 
79  // parameters from command line
80  QString m_id;
81  QString m_param;
82 
83  QString m_measurementModule;
84  size_t m_measurementsN;
85 
86  QString m_oscilloscopeModule;
87  QString m_oscilloscopeDevice;
88  QString m_oscilloscopeConfig;
89 
90  QString m_chardeviceModule;
91  QString m_chardeviceDevice;
92  QString m_chardeviceConfig;
93 
94  // Modules
95  Measurement * m_measurement;
96  Oscilloscope * m_oscilloscope;
97  CharDevice * m_chardevice;
98 
99 public slots:
100 
102  void queryPlugins();
104  void run();
105 
106 
107 signals:
108 
109  void finished();
110 
111 };
112 
113 #endif /* MEAS_H */
114 
bool loadOscilloscopeModule()
Load the specified oscilloscope module.
Definition: meas.cpp:286
Character device QT plugin interface.
Definition: chardevice.h:42
void run()
Load and configure all the modules and run the measurement scenario.
Definition: meas.cpp:796
Measurement scenario QT plugin interface.
Definition: measurement.h:43
CommandLineParseResult parseCommandLineParams(QCommandLineParser &parser)
Parse parameters from the command line and configuration files and plan tasks for event loop accordin...
Definition: meas.cpp:48
Measurement scenario plugin interface for use e.g. in meas.
Character device plugin interface for use e.g. in meas.
Oscilloscope plugin interface for use e.g. in meas.
bool loadChardeviceModule()
Load the specified character device module.
Definition: meas.cpp:320
bool initConfigOscilloscope()
Initialize and configure loaded oscilloscope from given config file.
Definition: meas.cpp:354
Oscilloscope QT plugin interface.
Definition: oscilloscope.h:42
Class providing text-based UI front-end to Measurement, Oscilloscope and CharDevice plug-in modules.
Definition: meas.h:45
bool initConfigChardevice()
Initialize and configure loaded character device module from given config file.
Definition: meas.cpp:718
void queryPlugins()
Query and print available plugins.
Definition: meas.cpp:157
bool loadMeasurementModule()
Load the specified measurement scenario module.
Definition: meas.cpp:252