36 lines
694 B
C++
36 lines
694 B
C++
#include "mainwindow.h"
|
|
#include "ui_mainwindow.h"
|
|
#include <QMessageBox>
|
|
|
|
MainWindow::MainWindow(QWidget *parent)
|
|
: QMainWindow(parent)
|
|
, ui(new Ui::MainWindow)
|
|
{
|
|
ui->setupUi(this);
|
|
}
|
|
|
|
MainWindow::~MainWindow()
|
|
{
|
|
delete ui;
|
|
}
|
|
|
|
void MainWindow::on_btn_Initialize_clicked()
|
|
{
|
|
QString appDir = QCoreApplication::applicationDirPath();
|
|
QString iniFilePath = appDir + QString::fromStdString("/emsshow.ini");
|
|
|
|
m_controller.getConfiguration(iniFilePath);
|
|
}
|
|
|
|
|
|
void MainWindow::on_btn_Read_clicked()
|
|
{
|
|
if (!m_controller.Open())
|
|
{
|
|
QMessageBox::critical(this, tr("Critical Message"), tr("串口打开失败"));
|
|
return;
|
|
}
|
|
m_controller.Read();
|
|
}
|
|
|