Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/bedextruderwidget.cpp
Show All 29 Lines | 27 | BedExtruderWidget::BedExtruderWidget(QWidget *parent) : | |||
---|---|---|---|---|---|
30 | , m_extruderThermo(new ThermoWidget(this, QString(i18n("HotEnd")))) | 30 | , m_extruderThermo(new ThermoWidget(this, QString(i18n("HotEnd")))) | ||
31 | , m_extrudersLayout(new QHBoxLayout) | 31 | , m_extrudersLayout(new QHBoxLayout) | ||
32 | , m_extruderBox(new QWidget(this)) | 32 | , m_extruderBox(new QWidget(this)) | ||
33 | { | 33 | { | ||
34 | m_bedThermo->setScale(0, 150); | 34 | m_bedThermo->setScale(0, 150); | ||
35 | m_extruderThermo->setScale(0, 250); | 35 | m_extruderThermo->setScale(0, 250); | ||
36 | m_extruderBox->setLayout(m_extrudersLayout); | 36 | m_extruderBox->setLayout(m_extrudersLayout); | ||
37 | 37 | | |||
38 | auto *label = new QLabel(i18n("Active Extruder:")); | 38 | auto *label = new QLabel(i18n("Active Extruder:"), this); | ||
39 | m_extrudersLayout->addWidget(label); | 39 | m_extrudersLayout->addWidget(label); | ||
40 | 40 | | |||
41 | auto *layout = new QHBoxLayout; | 41 | auto *layout = new QHBoxLayout; | ||
42 | layout->addWidget(m_extruderBox); | 42 | layout->addWidget(m_extruderBox); | ||
43 | layout->addWidget(m_bedThermo); | 43 | layout->addWidget(m_bedThermo); | ||
44 | layout->addWidget(m_extruderThermo); | 44 | layout->addWidget(m_extruderThermo); | ||
45 | 45 | | |||
46 | setLayout(layout); | 46 | setLayout(layout); | ||
47 | //Add Default Extruder | 47 | //Add Default Extruder | ||
48 | setExtruderCount(1); | 48 | setExtruderCount(1); | ||
49 | 49 | | |||
50 | connect(m_bedThermo, &ThermoWidget::targetTemperatureChanged, this, [this](int v) { | 50 | connect(m_bedThermo, &ThermoWidget::targetTemperatureChanged, this, [this](int v) { | ||
51 | qDebug() << "Receiving the temperature change for bed"; | | |||
patrickelectric: why are you removing debug information ? | |||||
rizzitello: Redundant since it is logged. | |||||
52 | emit bedTemperatureChanged(v, false); | 51 | emit bedTemperatureChanged(v, false); | ||
53 | }); | 52 | }); | ||
54 | 53 | | |||
55 | connect(m_extruderThermo, &ThermoWidget::targetTemperatureChanged, this, [this](int v) { | 54 | connect(m_extruderThermo, &ThermoWidget::targetTemperatureChanged, this, [this](int v) { | ||
56 | qDebug() << "Receiving the temperature changed for thermo"; | | |||
57 | emit extTemperatureChanged(v, currentExtruder(), false); | 55 | emit extTemperatureChanged(v, currentExtruder(), false); | ||
58 | }); | 56 | }); | ||
59 | } | 57 | } | ||
60 | 58 | | |||
61 | void BedExtruderWidget::setExtruderCount(int value) | 59 | void BedExtruderWidget::setExtruderCount(int value) | ||
62 | { | 60 | { | ||
63 | value > 1 ? m_extruderBox->setVisible(true) : m_extruderBox->setVisible(false); | 61 | value > 1 ? m_extruderBox->setVisible(true) : m_extruderBox->setVisible(false); | ||
64 | if (value == m_extruderCount) { | 62 | if (value == m_extruderCount) { | ||
65 | return; | 63 | return; | ||
66 | } else if (m_extruderCount < value) { | 64 | } | ||
65 | | ||||
66 | if (m_extruderCount < value) { | ||||
67 | //loop for the new buttons | 67 | //loop for the new buttons | ||
68 | for (int i = m_extruderCount; i < value; i++) { | 68 | for (int i = m_extruderCount; i < value; i++) { | ||
69 | auto *rb = new QRadioButton(QString::number(i + 1)); | 69 | auto *rb = new QRadioButton(QString::number(i + 1), this); | ||
70 | m_extrudersLayout->addWidget(rb); | 70 | m_extrudersLayout->addWidget(rb); | ||
71 | extruderMap.insert(i, rb); | 71 | extruderMap.insert(i, rb); | ||
72 | } | 72 | } | ||
73 | } else { | 73 | } else { | ||
74 | //remove buttons - need to test it! | 74 | //remove buttons - need to test it! | ||
75 | for (int i = m_extruderCount; i >= value; i--) { | 75 | for (int i = m_extruderCount; i >= value; i--) { | ||
76 | auto *rb = extruderMap.value(i); | 76 | auto *rb = extruderMap.value(i); | ||
77 | m_extrudersLayout->removeWidget(rb); | 77 | m_extrudersLayout->removeWidget(rb); | ||
▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines |
why are you removing debug information ?