#include "MainWindow.h" #include "ui_MainWindow.h" MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { // system("sudo PlxSdk/Bin/Plx_load 9054 d"); // system("echo jangal28 | sudo -S gedit"); ui->setupUi(this); connect(&_honaAPI, &HonaAPI::honaDataResult, this, &MainWindow::honaDataResultUi); } MainWindow::~MainWindow() { delete ui; } /*************************************************************************************************/ void MainWindow::honaDataResultUi(QList honaPacketList, quint32 hsruLoss, quint32 Doa) { QString _str; for(auto i = 0; i < honaPacketList.length(); i++) { _str += "\n[hsruLoss] :" + QString::number(hsruLoss, 16); _str += "\n[getToa] :" + QString::number(honaPacketList[i].getToa(), 16); _str += "\n[getDoa] :" + QString::number(honaPacketList[i].getDoa(), 16); _str += "\n[getPa1] :" + QString::number(honaPacketList[i].getPa1(), 16); _str += "\n[getPa2] :" + QString::number(honaPacketList[i].getPa2(), 16); _str += "\n[getPa3] :" + QString::number(honaPacketList[i].getPa3(), 16); _str += "\n[getPa4] :" + QString::number(honaPacketList[i].getPa4(), 16); _str += "\n[getCode] :" + QString::number(honaPacketList[i].getCode(), 16); _str += "\n[getCodeL] :" + QString::number(honaPacketList[i].getCodeL(), 16); _str += "\n[getCodeM] :" + QString::number(honaPacketList[i].getCodeM(), 16); } ui->dataFromMemory->setText(_str); } void MainWindow::on_testPLX_clicked() { ApiResult _resultInit = _honaAPI.init(); 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"); } }