Changeset View
Changeset View
Standalone View
Standalone View
testclient/mainwindow.cpp
Show First 20 Lines • Show All 423 Lines • ▼ Show 20 Line(s) | 414 | { | |||
---|---|---|---|---|---|
424 | } | 424 | } | ||
425 | } | 425 | } | ||
426 | 426 | | |||
427 | void MainWindow::connectPBClicked() | 427 | void MainWindow::connectPBClicked() | ||
428 | { | 428 | { | ||
429 | if (core->state() == AtCore::DISCONNECTED) { | 429 | if (core->state() == AtCore::DISCONNECTED) { | ||
430 | if (core->initSerial(comboPort->currentText(), comboBAUD->currentText().toInt(), cbReset->isChecked())) { | 430 | if (core->initSerial(comboPort->currentText(), comboBAUD->currentText().toInt(), cbReset->isChecked())) { | ||
431 | connect(core, &AtCore::receivedMessage, logWidget, &LogWidget::appendRLog); | 431 | connect(core, &AtCore::receivedMessage, logWidget, &LogWidget::appendRLog); | ||
432 | connect(core->serial(), &SerialLayer::pushedCommand, logWidget, &LogWidget::appendSLog); | 432 | connect(core, &AtCore::pushedCommand, logWidget, &LogWidget::appendSLog); | ||
433 | logWidget->appendLog(tr("Serial connected")); | 433 | logWidget->appendLog(tr("Serial connected")); | ||
434 | if (!comboPlugin->currentText().contains(tr("Autodetect"))) { | 434 | if (!comboPlugin->currentText().contains(tr("Autodetect"))) { | ||
435 | core->loadFirmwarePlugin(comboPlugin->currentText()); | 435 | core->loadFirmwarePlugin(comboPlugin->currentText()); | ||
436 | if (cbReset->isChecked()) { | 436 | if (cbReset->isChecked()) { | ||
437 | //Wait a few seconds after connect to avoid the normal errors | 437 | //Wait a few seconds after connect to avoid the normal errors | ||
438 | QTimer::singleShot(5000, core, &AtCore::sdCardPrintStatus); | 438 | QTimer::singleShot(5000, core, &AtCore::sdCardPrintStatus); | ||
439 | } | 439 | } | ||
440 | } | 440 | } | ||
441 | } | 441 | } | ||
442 | } else { | 442 | } else { | ||
443 | disconnect(core, &AtCore::receivedMessage, logWidget, &LogWidget::appendRLog); | 443 | disconnect(core, &AtCore::receivedMessage, logWidget, &LogWidget::appendRLog); | ||
444 | disconnect(core->serial(), &SerialLayer::pushedCommand, logWidget, &LogWidget::appendSLog); | 444 | disconnect(core, &AtCore::pushedCommand, logWidget, &LogWidget::appendSLog); | ||
445 | core->closeConnection(); | 445 | core->closeConnection(); | ||
446 | core->setState(AtCore::DISCONNECTED); | 446 | core->setState(AtCore::DISCONNECTED); | ||
447 | logWidget->appendLog(tr("Disconnected")); | 447 | logWidget->appendLog(tr("Disconnected")); | ||
448 | } | 448 | } | ||
449 | } | 449 | } | ||
450 | 450 | | |||
451 | void MainWindow::printPBClicked() | 451 | void MainWindow::printPBClicked() | ||
452 | { | 452 | { | ||
▲ Show 20 Lines • Show All 139 Lines • Show Last 20 Lines |