Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/atcoreinstancewidget.cpp
Show First 20 Lines • Show All 395 Lines • ▼ Show 20 Line(s) | 391 | case AtCore::IDLE: { | |||
---|---|---|---|---|---|
396 | emit extruderCountChanged(m_core.extruderCount()); | 396 | emit extruderCountChanged(m_core.extruderCount()); | ||
397 | m_logWidget->appendLog(stateString); | 397 | m_logWidget->appendLog(stateString); | ||
398 | emit disableDisconnect(false); | 398 | emit disableDisconnect(false); | ||
399 | enableControls(true); | 399 | enableControls(true); | ||
400 | connectExtruderTemperatureData(true); | 400 | connectExtruderTemperatureData(true); | ||
401 | if (m_profileData["heatedBed"].toBool()) { | 401 | if (m_profileData["heatedBed"].toBool()) { | ||
402 | connectBedTemperatureData(true); | 402 | connectBedTemperatureData(true); | ||
403 | } | 403 | } | ||
404 | if (!m_core.availableFirmwarePlugins().contains(m_profileData["firmware"].toString())) { | ||||
405 | m_profileData["firmware"] = m_core.firmwarePlugin()->name().toLower(); | ||||
406 | saveProfile(); | ||||
407 | } | ||||
404 | } break; | 408 | } break; | ||
405 | case AtCore::DISCONNECTED: { | 409 | case AtCore::DISCONNECTED: { | ||
406 | if (m_connectionTimer->isActive()) { | 410 | if (m_connectionTimer->isActive()) { | ||
407 | m_connectionTimer->stop(); | 411 | m_connectionTimer->stop(); | ||
408 | } | 412 | } | ||
409 | stateString = i18n("Not Connected"); | 413 | stateString = i18n("Not Connected"); | ||
410 | disconnect(&m_core, &AtCore::receivedMessage, m_logWidget, &LogWidget::appendRLog); | 414 | disconnect(&m_core, &AtCore::receivedMessage, m_logWidget, &LogWidget::appendRLog); | ||
411 | disconnect(&m_core, &AtCore::pushedCommand, m_logWidget, &LogWidget::appendSLog); | 415 | disconnect(&m_core, &AtCore::pushedCommand, m_logWidget, &LogWidget::appendSLog); | ||
▲ Show 20 Lines • Show All 173 Lines • ▼ Show 20 Line(s) | 577 | QMap<QString, QVariant> data{ | |||
585 | , {"radius", m_settings.value(QStringLiteral("radius"), QStringLiteral("200"))} | 589 | , {"radius", m_settings.value(QStringLiteral("radius"), QStringLiteral("200"))} | ||
586 | , {"z_delta_dimension", m_settings.value(QStringLiteral("z_delta_dimension"), QStringLiteral("180"))} | 590 | , {"z_delta_dimension", m_settings.value(QStringLiteral("z_delta_dimension"), QStringLiteral("180"))} | ||
587 | }; | 591 | }; | ||
588 | m_settings.endGroup(); | 592 | m_settings.endGroup(); | ||
589 | m_settings.endGroup(); | 593 | m_settings.endGroup(); | ||
590 | return data; | 594 | return data; | ||
591 | } | 595 | } | ||
592 | 596 | | |||
597 | void AtCoreInstanceWidget::saveProfile() | ||||
598 | { | ||||
599 | QString profile = m_comboProfile->currentText(); | ||||
600 | m_settings.beginGroup("Profiles"); | ||||
601 | m_settings.beginGroup(m_profileData["name"].toString()); | ||||
602 | m_settings.setValue(QStringLiteral("firmware"), m_profileData["firmware"]); | ||||
603 | m_settings.endGroup(); | ||||
604 | m_settings.endGroup(); | ||||
605 | } | ||||
606 | | ||||
593 | void AtCoreInstanceWidget::connectBedTemperatureData(bool connected) | 607 | void AtCoreInstanceWidget::connectBedTemperatureData(bool connected) | ||
594 | { | 608 | { | ||
595 | if (connected) { | 609 | if (connected) { | ||
596 | if (m_plotWidget->plots().contains((i18n("Actual Bed")))) { | 610 | if (m_plotWidget->plots().contains((i18n("Actual Bed")))) { | ||
597 | return; | 611 | return; | ||
598 | } | 612 | } | ||
599 | m_plotWidget->addPlot(i18n("Actual Bed")); | 613 | m_plotWidget->addPlot(i18n("Actual Bed")); | ||
600 | connect(&m_core.temperature(), &Temperature::bedTemperatureChanged, [this](const float & temp) { | 614 | connect(&m_core.temperature(), &Temperature::bedTemperatureChanged, [this](const float & temp) { | ||
▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines |