59 lines
1.3 KiB
C++
59 lines
1.3 KiB
C++
#include <QCoreApplication>
|
|
#include <QThread>
|
|
|
|
#include "witmotiondll.h"
|
|
#include "qtserialport.h"
|
|
|
|
void delay_tc(uint32_t millisecond)
|
|
{
|
|
QThread::sleep(millisecond/1000);
|
|
std::cout<<"This is delay_tc!!!!!!!!!!"<<std::endl;
|
|
}
|
|
|
|
void printf_tc(const char* text)
|
|
{
|
|
printf(text);
|
|
}
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
QCoreApplication a(argc, argv);
|
|
|
|
SerialPortBase * serialPort = new QtSerialport();
|
|
// SerialPortBase * serialPort = new windowsSerialPort();
|
|
|
|
serialPort->OpenSerialPort("COM15", 9600);
|
|
|
|
WitmotionDll * tmp = new WitmotionDll(serialPort);
|
|
tmp->delayMsRegister(delay_tc);
|
|
tmp->printfRegister(printf_tc);
|
|
tmp->setDelayTimeMs(1000);
|
|
|
|
tmp->installationOrientation(ORIENT_VERTICAL);
|
|
// tmp->algorithm(ALGROITHM9);
|
|
// tmp->setTimeZone(UTC_P12);
|
|
// tmp->SetBaudrate(WIT_BAUD_115200);
|
|
// tmp->SetReturnRate(RRATE_20HZ);
|
|
|
|
// tmp->SetDeviceAddress(124);
|
|
|
|
// tmp->setD0Model(DOL);
|
|
// tmp->setD0HighLevelPulseWidth(20);
|
|
// tmp->setD0Period(5);
|
|
|
|
// RETURN_CONTENT_STRUCT content;
|
|
// content.time = true;
|
|
// content.angular_velocity = true;
|
|
// content.euler_angle = true;
|
|
// content.ground_velocity = true;
|
|
// content.quaternion = true;
|
|
// tmp->setContent(content);
|
|
|
|
|
|
// tmp->recordData();
|
|
|
|
serialPort->CloseSerialPort();
|
|
|
|
// return a.exec();
|
|
}
|