40 #include <boost/cstdint.hpp>
49 #define EVENT_DATE_FORMAT "yyyy:MM:dd-HH:mm:ss.zzz000"
53 int main(
int argc,
char **argv)
55 QApplication app(argc, argv);
60 std::cout <<
"Usage: sscPositionFileReader [-v] <filename> <timestamp>\nTimestamp format " <<
EVENT_DATE_FORMAT << std::endl;
65 bool verbose = (QString(argv[1]) ==
"-v");
67 QString posFile(argv[arg++]);
72 startTS = QString(argv[arg++]);
76 std::cout <<
"This is a version 1 of the record format, and requires a timestamp parameter.";
80 boost::uint64_t tsModifier = 0;
84 boost::uint64_t ret64 = startTime.toTime_t();
88 tsModifier = ret64 & (std::numeric_limits<boost::uint64_t>::max() ^ 0xffffffff);
90 std::cout <<
"Start time: " << startTS <<
", converted to " << startTime.toString(
EVENT_DATE_FORMAT) << std::endl;
112 std::cout <<
"reading file [" << posFile.toStdString() <<
"]" << std::endl;
114 std::cout <<
"[index]\ttimestamp\tmatrix\ttoolIndex" << std::endl;
116 while (!reader.
atEnd())
121 if (!reader.
read(&T, ×tamp, &index))
123 toolIndex = QString(index);
127 if (!reader.
read(&T, ×tamp, &toolIndex))
131 boost::uint64_t ts64 = (boost::uint64_t)timestamp;
140 <<
"index:\t"<< index <<
'\t'
141 <<
"tool id:\t" << toolIndex.toStdString() <<
'\t'
144 <<
"matrix:\n" << T <<
'\n'
149 std::cout <<
"[" << index <<
"]" <<
'\t';
151 boost::array<double, 16> val = T.flatten();
153 std::cout <<
'\t' << toolIndex.toStdString();
154 std::cout << std::endl;
static QString timestampToString(double timestamp)
#define EVENT_DATE_FORMAT
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
std::ostream & stream_range(std::ostream &s, ITER begin, ITER end, char separator=' ')
int main(int argc, char *argv[])
Reader class for the position file.
bool read(Transform3D *matrix, double *timestamp, int *toolIndex)