|
在上位机代码中把需要保存数据通过log输出即可
- //Print Distance info
- if(_file)
- {
- QDateTime now = QDateTime::currentDateTime();
- QString s = now.toString("[yyyy-MM-dd hh:mm:ss]")+QString("Tag To Anthor0(%1,%2) Distance is %3\n").arg(_ancArray[0].x).arg(_ancArray[0].y).arg(ra[0]);
- QTextStream ts( _file );
- ts << s;
- s = now.toString("[yyyy-MM-dd hh:mm:ss]")+QString("Tag To Anthor1(%1,%2) Distance is %3\n").arg(_ancArray[1].x).arg(_ancArray[1].y).arg(ra[1]);
- ts << s;
- s = now.toString("[yyyy-MM-dd hh:mm:ss]")+QString("Tag To Anthor2(%1,%2) Distance is %3\n").arg(_ancArray[2].x).arg(_ancArray[2].y).arg(ra[2]);
- ts << s;
- if(count == 4)
- {
- s = now.toString("[yyyy-MM-dd hh:mm:ss]")+QString("Tag To Anthor3(%1,%2) Distance is %3\n").arg(_ancArray[3].x).arg(_ancArray[3].y).arg(ra[3]);
- ts << s;
- }
- }
复制代码 |
|