21 #include <qmessagebox.h> 36 : qt_editdata(parent, name, modal, fl)
66 unsigned int numrows =
tcal.size();
67 unsigned int numcols = 0;
69 for (
unsigned int i=0; i<numrows; i++)
70 numcols =
tcal[i].size() > numcols ?
tcal[i].size() : numcols;
72 datatable->setNumRows(numrows);
73 datatable->setNumCols(2*numcols);
76 for (
unsigned int j=0; j<numcols; j+=1){
77 char outp[12], inp[12];
78 sprintf(outp,
"Output %d", j+1);
79 sprintf(inp,
"Input %d", j+1);
80 datatable->horizontalHeader()->setLabel( j*2, outp);
81 datatable->horizontalHeader()->setLabel( j*2+1, inp);
85 for (
unsigned int i=0; i<numrows; i++){
87 for (
unsigned int j=0; j<
tcal[i].size(); j++){
89 datatable->setItem( i, 2*j,
90 new QTableItem( datatable,
91 QTableItem::WhenCurrent,
92 QString::number(
tcal[i][j].first ) ) );
93 datatable->setItem( i, 2*j+1,
94 new QTableItem( datatable,
95 QTableItem::WhenCurrent,
96 QString::number(
tcal[i][j].second ) ) );
107 unsigned int numrows = datatable->numRows();
108 unsigned int numcols = datatable->numCols();
111 for (
unsigned int i=0; i<numrows; i++){
114 for (
unsigned int j=0; j<numcols; j+=2){
117 f.first = datatable->text(i,j).toDouble(&oktmp);
119 f.second = datatable->text(i,j+1).toDouble(&oktmp);
130 QMessageBox::critical(
this,
132 "Data is corrupt. Cannot store it.\nOnly numbers are allowed.",
141 int main(
int argc,
char **argv)
149 fprintf(stderr,
"Testing qt_editdata\n");
int main(int argc, char **argv)
std::pair< double, double > fulcrum
cData::trackerCal getTrackerCal()
std::vector< sensorCal > trackerCal
std::vector< fulcrum > sensorCal
bool setTrackerCal(cData::trackerCal t)