mirror of
https://github.com/galera951/experiment-automation.git
synced 2024-09-20 00:42:52 +03:00
43 lines
897 B
C++
43 lines
897 B
C++
#include "Generator.hpp"
|
|
#include "Oscilloscope.hpp"
|
|
#include <vector>
|
|
#include <unistd.h>
|
|
|
|
int main() {
|
|
|
|
// initialize generator and oscilloscope
|
|
|
|
std::string generator_path;
|
|
std::string oscilloscope_path;
|
|
|
|
for (size_t i = 0; i < 2; i++) {
|
|
auto path = "usbtmc" + std::to_string(i);
|
|
Device device(path);
|
|
|
|
if (device.get_name() == "AKIP-3409-4")
|
|
generator_path = path;
|
|
else if (device.get_name() == "AKIP-4131/1")
|
|
oscilloscope_path = path;
|
|
else {
|
|
std::cerr << "Devices not available!" << std::endl;
|
|
return EXIT_FAILURE;
|
|
}
|
|
}
|
|
|
|
Generator generator(generator_path);
|
|
Oscilloscope oscilloscope(oscilloscope_path);
|
|
|
|
|
|
// work with devices
|
|
|
|
//generator.buzz();
|
|
|
|
std::string waveform;
|
|
std::cout << "Input waveform (SINE, SQUARE, RAMP, PULSE, NOISE, ARB, DC, PRBS, IQ):" << std::endl;
|
|
std::cin >> waveform;
|
|
|
|
generator.set_waveform(waveform);
|
|
|
|
return EXIT_SUCCESS;
|
|
}
|