2022-11-01 16:18:53 +03:00
|
|
|
#include "Generator.hpp"
|
|
|
|
#include "Oscilloscope.hpp"
|
2022-10-31 14:07:36 +03:00
|
|
|
#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);
|
|
|
|
|
2022-11-01 16:18:53 +03:00
|
|
|
if (device.get_name() == "AKIP-3409-4")
|
|
|
|
generator_path = path;
|
|
|
|
else if (device.get_name() == "AKIP-4131/1")
|
|
|
|
oscilloscope_path = path;
|
2022-10-31 14:07:36 +03:00
|
|
|
else {
|
|
|
|
std::cerr << "Devices not available!" << std::endl;
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
|
|
|
}
|
2022-11-10 15:26:32 +03:00
|
|
|
|
2022-10-31 14:07:36 +03:00
|
|
|
Generator generator(generator_path);
|
|
|
|
Oscilloscope oscilloscope(oscilloscope_path);
|
|
|
|
|
|
|
|
|
|
|
|
// work with devices
|
|
|
|
|
2022-11-10 15:26:32 +03:00
|
|
|
std::cout << oscilloscope.query("C1:WF? DAT2").substr(1, 3) << std::endl;
|
2022-10-31 14:07:36 +03:00
|
|
|
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|