set setting for opening serial device
This commit is contained in:
parent
bc064c38c6
commit
8945ead5d6
@ -24,6 +24,8 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
openSerialPort();
|
||||
|
||||
//ui->updateProgress->setRange(0, 100);
|
||||
//ui->updateProgress->reset();
|
||||
|
||||
@ -71,23 +73,18 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
MainWindow::~MainWindow() {
|
||||
//delete m_startTimer;
|
||||
//delete m_exitTimer;
|
||||
closeSerialPort();
|
||||
delete ui;
|
||||
}
|
||||
|
||||
bool MainWindow::openSerialPort() {
|
||||
// const SettingsDialog::Settings p = m_settings->settings();
|
||||
//m_serial->setPortName(p.name);
|
||||
//m_serial->setBaudRate(p.baudRate);
|
||||
//m_serial->setDataBits(p.dataBits);
|
||||
//m_serial->setParity(p.parity);
|
||||
//m_serial->setStopBits(p.stopBits);
|
||||
///m_serial->setFlowControl(p.flowControl);
|
||||
m_serial->setPortName("");
|
||||
m_serial->setBaudRate(QSerialPort::Baud115200);
|
||||
m_serial->setDataBits(QSerialPort::DataBits::Data8);
|
||||
m_serial->setParity(QSerialPort::Parity::NoParity);
|
||||
m_serial->setStopBits(QSerialPort::StopBits::OneStop);
|
||||
m_serial->setFlowControl(QSerialPort::FlowControl::HardwareControl);
|
||||
m_serial->setFlowControl(QSerialPort::FlowControl::NoFlowControl);
|
||||
if (m_serial->open(QIODevice::ReadWrite)) {
|
||||
//m_console->setEnabled(true);
|
||||
//m_console->setLocalEchoEnabled(p.localEchoEnabled);
|
||||
|
Loading…
Reference in New Issue
Block a user