SIde-Channel Analysis toolKit (SICAK)
Software toolkit for side-channel analysis
keysight3000.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 KEYSIGHT3000_H
30 #define KEYSIGHT3000_H
31 
32 #include <QObject>
33 #include <QtPlugin>
34 #include <string>
35 #include <cstdlib>
36 #include "oscilloscope.h"
37 #include "scpidevice.h"
38 #include "exceptions.hpp"
39 
47 class Keysight3000 : public QObject, Oscilloscope {
48 
49  Q_OBJECT
50  Q_PLUGIN_METADATA(IID "cz.cvut.fit.Sicak.OscilloscopeInterface/1.0" FILE "keysight3000.json")
51  Q_INTERFACES(Oscilloscope)
52 
53 public:
54 
55  Keysight3000();
56  virtual ~Keysight3000() override;
57 
58  virtual QString getPluginName() override;
59  virtual QString getPluginInfo() override;
60 
62  virtual void init(const char * filename) override;
63  virtual void deInit() override;
64 
65  virtual QString queryDevices() override;
66 
67  virtual void setChannel(int & channel, bool & enabled, Coupling & coupling, Impedance & impedance, int & rangemV, int & offsetmV, BandwidthLimiter & bwLimit) override;
68  virtual void setTrigger(int & sourceChannel, float & level, TriggerSlope & slope) override;
69  virtual void unsetTrigger() override;
71  virtual void setTiming(float & preTriggerRange, float & postTriggerRange, size_t & samples, size_t & captures) override;
72  virtual void run() override;
73  virtual void stop() override;
74 
75  virtual size_t getCurrentSetup(size_t & samples, size_t & captures) override;
76  virtual size_t getValues(int channel, PowerTraces<int16_t> & traces) override;
77  virtual size_t getValues(int channel, int16_t * buffer, size_t len, size_t & samples, size_t & captures) override;
78 
79 protected:
80  ScpiDevice m_handle;
81  size_t m_samples;
82  bool m_triggered;
83  bool m_opened;
84 
85 };
86 
87 #endif /* KEYSIGHT3000_H */
virtual void stop() override
Stop the oscilloscope.
Definition: keysight3000.cpp:345
BandwidthLimiter
Bandwidth limit of the oscilloscope channel.
Definition: oscilloscope.h:59
Class providing SCPI device interface, either using USBTMC Linux Module, or using VISA libraries.
virtual QString getPluginInfo() override
Plugin info.
Definition: keysight3000.cpp:49
SCPI device interface, using either USBTMC Linux module or VISA library.
Definition: scpidevice.h:55
This header file contains exceptions.
virtual QString queryDevices() override
Query available devices.
Definition: keysight3000.cpp:75
virtual void unsetTrigger() override
Unset the trigger.
Definition: keysight3000.cpp:270
virtual void run() override
Run the oscilloscope: wait for trigger when triggered, otherwise capture immediately.
Definition: keysight3000.cpp:330
TriggerSlope
Edge slope of the oscilloscope trigger.
Definition: oscilloscope.h:66
virtual void init(const char *filename) override
Initialize the oscilloscope, use filename=/dev/usbtmc0 on Linux or filename=VISAADDRESS on Windows.
Definition: keysight3000.cpp:53
virtual QString getPluginName() override
Plugin name.
Definition: keysight3000.cpp:45
virtual void deInit() override
Deinitialize the plugin.
Definition: keysight3000.cpp:65
virtual void setChannel(int &channel, bool &enabled, Coupling &coupling, Impedance &impedance, int &rangemV, int &offsetmV, BandwidthLimiter &bwLimit) override
Set the channel settings, real values may be returned by driver to the references.
Definition: keysight3000.cpp:89
Oscilloscope plugin interface for use e.g. in meas.
virtual void setTiming(float &preTriggerRange, float &postTriggerRange, size_t &samples, size_t &captures) override
Set the timing settings, real values may be returned by driver to the references: e....
Definition: keysight3000.cpp:276
Coupling
Coupling of the oscilloscope channel.
Definition: oscilloscope.h:47
Impedance
Impedance of the oscilloscope channel.
Definition: oscilloscope.h:53
Oscilloscope plugin for Keysight 3000 series oscilloscope, using ScpiDevice for communication.
Definition: keysight3000.h:47
Oscilloscope QT plugin interface.
Definition: oscilloscope.h:42
virtual void setTrigger(int &sourceChannel, float &level, TriggerSlope &slope) override
Set the trigger settings, real values may be returned by driver to the references.
Definition: keysight3000.cpp:209
virtual size_t getCurrentSetup(size_t &samples, size_t &captures) override
Returns current samples/captures settings.
Definition: keysight3000.cpp:357
A class representing a Matrix with 'noOfTraces' power traces, with 'samplesPerTrace' samples per powe...
Definition: types_power.hpp:44
virtual size_t getValues(int channel, PowerTraces< int16_t > &traces) override
Downloads values from the oscilloscope, first waits for the aquisition to complete.
Definition: keysight3000.cpp:395