|
|
|
#include "MainWindow.h"
|
|
|
|
#include "ui_MainWindow.h"
|
|
|
|
HonaAPI _honaAPI;
|
|
|
|
|
|
|
|
MainWindow::MainWindow(QWidget* parent)
|
|
|
|
: QMainWindow(parent)
|
|
|
|
, ui(new Ui::MainWindow)
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
|
|
|
connect(&_honaAPI, &HonaAPI::honaDataResult, this, &MainWindow::honaDataResultUi);
|
|
|
|
}
|
|
|
|
|
|
|
|
MainWindow::~MainWindow()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************************************/
|
|
|
|
void MainWindow::honaDataResultUi(QList<HonaPacket> honaPacketList, quint32 hsruLoss, quint32 Doa)
|
|
|
|
{
|
|
|
|
qDebug() << "honaDataResultUi inside " << honaPacketList.length();
|
|
|
|
QString _str;
|
|
|
|
for(auto i = 0; i < honaPacketList.length(); i++)
|
|
|
|
{
|
|
|
|
_str = "[" + QString::number(i) + "] " + "0x hsruLoss" + QString::number(hsruLoss);
|
|
|
|
_str += "\n *********************************************";
|
|
|
|
}
|
|
|
|
|
|
|
|
ui->dataFromMemory->setText(_str);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_testPLX_clicked()
|
|
|
|
{
|
|
|
|
ApiResult _resultInit = _honaAPI.init();
|
|
|
|
//ApiResult _deviceReset = _honaAPI.deviceReset();
|
|
|
|
//HonaSettings settings;
|
|
|
|
//ApiResult _configResult = _honaAPI.setConfig(settings);
|
|
|
|
//ApiResult isHsruStarted = _honaAPI.isHsruStarted();
|
|
|
|
ApiResult _hsruStartResult = _honaAPI.hsruStart();
|
|
|
|
|
|
|
|
//********************************************************
|
|
|
|
QString temp = ui->errorMonitoring->text();
|
|
|
|
if(_resultInit == ApiResult::error)
|
|
|
|
{
|
|
|
|
ui->errorMonitoring->setText(temp + "\n" + " Error _resultInit");
|
|
|
|
}
|
|
|
|
else if(_resultInit == ApiResult::success)
|
|
|
|
{
|
|
|
|
ui->errorMonitoring->setText(temp + "\n" + "success _resultInit");
|
|
|
|
}
|
|
|
|
//********************************************************
|
|
|
|
|
|
|
|
if(_hsruStartResult == ApiResult::error)
|
|
|
|
{
|
|
|
|
ui->errorMonitoring->setText(temp + "\n" + " Error _hsruStartResult");
|
|
|
|
}
|
|
|
|
else if(_hsruStartResult == ApiResult::success)
|
|
|
|
{
|
|
|
|
ui->errorMonitoring->setText(temp + "\n" + " success _hsruStartResult");
|
|
|
|
}
|
|
|
|
//********************************************************
|
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_stopHsru_clicked()
|
|
|
|
{
|
|
|
|
QString temp = ui->errorMonitoring->text();
|
|
|
|
ApiResult _hsruStop = _honaAPI.hsruStop();
|
|
|
|
if(_hsruStop == ApiResult::error)
|
|
|
|
{
|
|
|
|
ui->errorMonitoring->setText(temp + "\n" + " success _hsruStartResult");
|
|
|
|
}
|
|
|
|
}
|