49 #include <visp3/gui/vpPlot.h>
50 #include <visp3/sensor/vpComedi.h>
54 #ifdef VISP_HAVE_COMEDI
60 #ifdef VISP_HAVE_DISPLAY
61 vpPlot scope(1, 700, 700, 100, 200,
62 std::string(
"ATI physical sensor data (") + comedi.
getPhyDataUnits() + std::string(
")"));
64 for (
unsigned int i = 0; i < comedi.
getNChannel(); i++)
65 scope.setLegend(0, i,
"G" +
dynamic_cast<std::ostringstream &
>((std::ostringstream() << i)).str());
68 std::string file(
"recorded-physical-data-sync.txt");
69 std::ofstream f(file.c_str());
72 #ifdef VISP_HAVE_DISPLAY
75 std::cout <<
"Data recording during 20 seconds in progress..." << std::endl;
81 double timestamp = loop_time - start_time;
83 f << timestamp <<
" " << phydata.
t() << std::endl;
85 #ifdef VISP_HAVE_DISPLAY
86 scope.plot(0, timestamp, phydata);
94 std::cout <<
"You should install comedi to enable this test..." << std::endl;