Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/atcoreinstancewidget.cpp
Show All 30 Lines | 27 | AtCoreInstanceWidget::AtCoreInstanceWidget(QWidget *parent): | |||
---|---|---|---|---|---|
31 | m_printAction(nullptr) | 31 | m_printAction(nullptr) | ||
32 | { | 32 | { | ||
33 | ui = new Ui::AtCoreInstanceWidget; | 33 | ui = new Ui::AtCoreInstanceWidget; | ||
34 | ui->setupUi(this); | 34 | ui->setupUi(this); | ||
35 | 35 | | |||
36 | ui->printProgressWidget->setVisible(false); | 36 | ui->printProgressWidget->setVisible(false); | ||
37 | buildMainToolbar(); | 37 | buildMainToolbar(); | ||
38 | buildToolbar(); | 38 | buildToolbar(); | ||
39 | buildConnectionToolbar(); | ||||
39 | enableControls(false); | 40 | enableControls(false); | ||
41 | updateProfileData(); | ||||
40 | initConnectsToAtCore(); | 42 | initConnectsToAtCore(); | ||
43 | m_mainToolBar->setHidden(true); | ||||
41 | } | 44 | } | ||
42 | 45 | | |||
43 | AtCoreInstanceWidget::~AtCoreInstanceWidget() | 46 | AtCoreInstanceWidget::~AtCoreInstanceWidget() | ||
44 | { | 47 | { | ||
48 | m_core.closeConnection(); | ||||
45 | delete ui; | 49 | delete ui; | ||
46 | } | 50 | } | ||
47 | 51 | | |||
48 | void AtCoreInstanceWidget::buildToolbar() | 52 | void AtCoreInstanceWidget::buildToolbar() | ||
49 | { | 53 | { | ||
50 | m_toolBar = new QToolBar(); | 54 | m_toolBar = new QToolBar(); | ||
51 | 55 | | |||
52 | auto lb = new QAction; | 56 | auto lb = new QAction; | ||
53 | lb->setIcon(style()->standardIcon(QStyle::SP_DirHomeIcon)); | 57 | lb->setIcon(style()->standardIcon(QStyle::SP_DirHomeIcon)); | ||
54 | lb->setDisabled(true); | 58 | lb->setDisabled(true); | ||
55 | m_toolBar->addAction(lb); | 59 | m_toolBar->addAction(lb); | ||
56 | 60 | | |||
57 | auto homeAll = new QAction("All"); | 61 | auto homeAll = new QAction("All"); | ||
58 | connect(homeAll, &QAction::triggered, [&]{ | 62 | connect(homeAll, &QAction::triggered, [this]{ | ||
59 | m_core.home(); | 63 | m_core.home(); | ||
60 | }); | 64 | }); | ||
61 | m_toolBar->addAction(homeAll); | 65 | m_toolBar->addAction(homeAll); | ||
62 | 66 | | |||
63 | for(auto homes : std::map<QString, int>{{"X", AtCore::X}, {"Y", AtCore::Y}, {"Z", AtCore::Z}}) { | 67 | for(auto homes : std::map<QString, int>{{"X", AtCore::X}, {"Y", AtCore::Y}, {"Z", AtCore::Z}}) { | ||
64 | auto home = new QAction(homes.first); | 68 | auto home = new QAction(homes.first); | ||
65 | connect(home, &QAction::triggered, [&, homes] { | 69 | connect(home, &QAction::triggered, [this, homes] { | ||
66 | m_core.home(homes.second); | 70 | m_core.home(homes.second); | ||
67 | }); | 71 | }); | ||
68 | m_toolBar->addAction(home); | 72 | m_toolBar->addAction(home); | ||
69 | } | 73 | } | ||
70 | 74 | | |||
71 | m_toolBar->addSeparator(); | 75 | m_toolBar->addSeparator(); | ||
72 | 76 | | |||
73 | auto *axis = new QAction("Axis"); | 77 | auto *axis = new QAction("Axis"); | ||
Show All 17 Lines | |||||
91 | ui->toolBarLayout->addWidget(m_toolBar); | 95 | ui->toolBarLayout->addWidget(m_toolBar); | ||
92 | ui->toolBarLayout->addStretch(); | 96 | ui->toolBarLayout->addStretch(); | ||
93 | } | 97 | } | ||
94 | 98 | | |||
95 | void AtCoreInstanceWidget::buildMainToolbar(){ | 99 | void AtCoreInstanceWidget::buildMainToolbar(){ | ||
96 | m_mainToolBar = new QToolBar(); | 100 | m_mainToolBar = new QToolBar(); | ||
97 | m_mainToolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); | 101 | m_mainToolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); | ||
98 | 102 | | |||
99 | auto disconnectAction = new QAction(style()->standardIcon(QStyle::SP_DialogCloseButton), i18n("Disconnect")); | | |||
100 | connect(this, &AtCoreInstanceWidget::disableDisconnect, disconnectAction, &QAction::setDisabled); | | |||
101 | connect(disconnectAction, &QAction::triggered, [&](){ | | |||
102 | m_core.closeConnection(); | | |||
103 | }); | | |||
104 | m_mainToolBar->addAction(disconnectAction); | | |||
105 | | ||||
106 | m_printAction = new QAction(style()->standardIcon(QStyle::SP_MediaPlay),i18n("Print")); | 103 | m_printAction = new QAction(style()->standardIcon(QStyle::SP_MediaPlay),i18n("Print")); | ||
107 | connect(m_printAction, &QAction::triggered, [ & ](){ | 104 | connect(m_printAction, &QAction::triggered, [ this ](){ | ||
108 | if(m_core.state() == AtCore::BUSY) { | 105 | if(m_core.state() == AtCore::BUSY) { | ||
109 | pausePrint(); | 106 | pausePrint(); | ||
110 | return; | 107 | return; | ||
111 | } | 108 | } | ||
112 | if (m_core.state() == AtCore::IDLE){ | 109 | if (m_core.state() == AtCore::IDLE){ | ||
113 | print(); | 110 | print(); | ||
114 | } else if (m_core.state() == AtCore::PAUSE) { | 111 | } else if (m_core.state() == AtCore::PAUSE) { | ||
115 | m_core.resume(); | 112 | m_core.resume(); | ||
116 | } | 113 | } | ||
117 | }); | 114 | }); | ||
118 | m_mainToolBar->addAction(m_printAction); | 115 | m_mainToolBar->addAction(m_printAction); | ||
119 | 116 | | |||
120 | auto stopAction = new QAction(style()->standardIcon(QStyle::SP_MediaStop),i18n("Stop")); | 117 | auto stopAction = new QAction(style()->standardIcon(QStyle::SP_MediaStop),i18n("Stop")); | ||
121 | connect(stopAction, &QAction::triggered, this, &AtCoreInstanceWidget::stopPrint); | 118 | connect(stopAction, &QAction::triggered, this, &AtCoreInstanceWidget::stopPrint); | ||
122 | connect(stopAction, &QAction::triggered, [&](){ | 119 | connect(stopAction, &QAction::triggered, [this](){ | ||
123 | m_printAction->setText(i18n("Print")); | 120 | m_printAction->setText(i18n("Print")); | ||
124 | m_printAction->setIcon(style()->standardIcon(QStyle::SP_MediaPlay)); | 121 | m_printAction->setIcon(style()->standardIcon(QStyle::SP_MediaPlay)); | ||
125 | }); | 122 | }); | ||
126 | m_mainToolBar->addAction(stopAction); | 123 | m_mainToolBar->addAction(stopAction); | ||
127 | 124 | | |||
128 | auto disableMotorsAction = new QAction(style()->standardIcon(QStyle::SP_MediaStop),i18n("Disable Motors")); | 125 | auto disableMotorsAction = new QAction(style()->standardIcon(QStyle::SP_MediaStop),i18n("Disable Motors")); | ||
129 | connect(disableMotorsAction, &QAction::triggered, this, &AtCoreInstanceWidget::disableMotors); | 126 | connect(disableMotorsAction, &QAction::triggered, this, &AtCoreInstanceWidget::disableMotors); | ||
130 | m_mainToolBar->addAction(disableMotorsAction); | 127 | m_mainToolBar->addAction(disableMotorsAction); | ||
131 | 128 | | |||
132 | ui->mainToolBarLayout->addWidget(m_mainToolBar); | 129 | ui->mainToolBarLayout->addWidget(m_mainToolBar); | ||
133 | ui->mainToolBarLayout->addStretch(); | | |||
134 | } | 130 | } | ||
135 | void AtCoreInstanceWidget::startConnection(const QString& serialPort, const QMap<QString, QVariant>& profiles){ | 131 | | ||
136 | m_core.initSerial(serialPort, profiles["bps"].toInt()); | 132 | void AtCoreInstanceWidget::buildConnectionToolbar() | ||
133 | { | ||||
134 | m_connectToolBar = new QToolBar(); | ||||
135 | m_comboPort = new QComboBox; | ||||
136 | m_comboPort->setEditable(true); | ||||
137 | QLabel *deviceLabel = new QLabel(i18n("Device")); | ||||
138 | QHBoxLayout *deviceLayout = new QHBoxLayout; | ||||
139 | deviceLayout->addWidget(deviceLabel); | ||||
140 | deviceLayout->addWidget(m_comboPort,100); | ||||
141 | | ||||
142 | m_comboProfile = new QComboBox; | ||||
143 | m_comboProfile->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed); | ||||
144 | QHBoxLayout *profileLayout = new QHBoxLayout; | ||||
145 | QLabel *profileLabel = new QLabel(i18n("Profile")); | ||||
146 | profileLayout->addWidget(profileLabel); | ||||
147 | profileLayout->addWidget(m_comboProfile,100); | ||||
148 | | ||||
149 | QHBoxLayout *connectLayout = new QHBoxLayout; | ||||
150 | connectLayout->addLayout(deviceLayout,50); | ||||
151 | connectLayout->addLayout(profileLayout,50); | ||||
152 | | ||||
153 | m_connectWidget = new QWidget(); | ||||
154 | m_connectWidget->setLayout(connectLayout); | ||||
155 | m_connectToolBar->addWidget(m_connectWidget); | ||||
156 | | ||||
157 | m_connectButton = new QPushButton(i18n("Connect")); | ||||
158 | m_connectButton->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed); | ||||
159 | connect(this, &AtCoreInstanceWidget::disableDisconnect, m_connectButton, &QPushButton::setDisabled); | ||||
160 | connect(m_connectButton, &QPushButton::clicked, this, &AtCoreInstanceWidget::connectButtonClicked); | ||||
161 | ui->mainToolBarLayout->addWidget(m_connectToolBar); | ||||
162 | ui->mainToolBarLayout->addWidget(m_connectButton); | ||||
163 | | ||||
164 | } | ||||
165 | | ||||
166 | void AtCoreInstanceWidget::connectButtonClicked() | ||||
167 | { | ||||
168 | if(m_core.state() == AtCore::DISCONNECTED) { | ||||
169 | if (m_comboProfile->currentText().isEmpty()) { | ||||
170 | QMessageBox::critical(this, i18n("Error"), i18n("Please, create a profile to connect on Settings!")); | ||||
171 | return; | ||||
172 | } | ||||
173 | | ||||
174 | if (m_comboPort->currentText().isEmpty()) { | ||||
175 | QMessageBox::critical(this, i18n("Error"), i18n("Please, connect a serial device to continue!")); | ||||
176 | return; | ||||
177 | } | ||||
178 | | ||||
179 | //Get profile data before connecting. | ||||
180 | QString profile = m_comboProfile->currentText(); | ||||
181 | m_settings.beginGroup("GeneralSettings"); | ||||
182 | m_settings.beginGroup(profile); | ||||
183 | QMap<QString, QVariant> data; | ||||
184 | data["bps"] = m_settings.value(QStringLiteral("bps"), QStringLiteral("115200")); | ||||
185 | data["bedTemp"] = m_settings.value(QStringLiteral("maximumTemperatureBed"), QStringLiteral("0")); | ||||
186 | data["hotendTemp"] = m_settings.value(QStringLiteral("maximumTemperatureExtruder"), QStringLiteral("0")); | ||||
187 | data["firmware"] = m_settings.value(QStringLiteral("firmware"),QStringLiteral("Auto-Detect")); | ||||
188 | data["postPause"] = m_settings.value(QStringLiteral("postPause"),QStringLiteral("")); | ||||
189 | data["name"] = profile; | ||||
190 | m_settings.endGroup(); | ||||
191 | m_settings.endGroup(); | ||||
192 | | ||||
193 | //then connect | ||||
194 | m_core.initSerial(m_comboPort->currentText(), data["bps"].toInt()); | ||||
137 | if(m_core.state() == AtCore::CONNECTING){ | 195 | if(m_core.state() == AtCore::CONNECTING){ | ||
138 | QString fw = profiles["firmware"].toString(); | 196 | profileData = data; | ||
197 | QString fw = profileData["firmware"].toString(); | ||||
139 | if( fw != QString("Auto-Detect")){ | 198 | if( fw != QString("Auto-Detect")){ | ||
140 | m_core.loadFirmwarePlugin(fw); | 199 | m_core.loadFirmwarePlugin(fw); | ||
141 | } | 200 | } | ||
201 | emit(connectionChanged(profileData["name"].toString())); | ||||
202 | } | ||||
203 | } else { | ||||
204 | m_core.closeConnection(); | ||||
205 | emit(connectionChanged(i18n("Connect a Printer"))); | ||||
142 | } | 206 | } | ||
143 | } | 207 | } | ||
144 | 208 | | |||
145 | void AtCoreInstanceWidget::initConnectsToAtCore() | 209 | void AtCoreInstanceWidget::initConnectsToAtCore() | ||
146 | { | 210 | { | ||
211 | m_core.setSerialTimerInterval(100); | ||||
212 | // Handle device changes | ||||
213 | connect(&m_core, &AtCore::portsChanged, this, &AtCoreInstanceWidget::updateSerialPort); | ||||
214 | | ||||
147 | // Handle AtCore status change | 215 | // Handle AtCore status change | ||
148 | connect(&m_core, &AtCore::stateChanged, this, &AtCoreInstanceWidget::handlePrinterStatusChanged); | 216 | connect(&m_core, &AtCore::stateChanged, this, &AtCoreInstanceWidget::handlePrinterStatusChanged); | ||
149 | 217 | | |||
150 | // If the number of extruders from the printer change, we need to update the radiobuttons on the widget | 218 | // If the number of extruders from the printer change, we need to update the radiobuttons on the widget | ||
151 | connect(this, &AtCoreInstanceWidget::extruderCountChanged, ui->bedExtWidget, &BedExtruderWidget::setExtruderCount); | 219 | connect(this, &AtCoreInstanceWidget::extruderCountChanged, ui->bedExtWidget, &BedExtruderWidget::setExtruderCount); | ||
152 | 220 | | |||
153 | // Bed and Extruder temperatures management | 221 | // Bed and Extruder temperatures management | ||
154 | connect(ui->bedExtWidget, &BedExtruderWidget::bedTemperatureChanged, &m_core, &AtCore::setBedTemp); | 222 | connect(ui->bedExtWidget, &BedExtruderWidget::bedTemperatureChanged, &m_core, &AtCore::setBedTemp); | ||
155 | connect(ui->bedExtWidget, &BedExtruderWidget::extTemperatureChanged, &m_core, &AtCore::setExtruderTemp); | 223 | connect(ui->bedExtWidget, &BedExtruderWidget::extTemperatureChanged, &m_core, &AtCore::setExtruderTemp); | ||
156 | 224 | | |||
157 | // Connect AtCore temperatures changes on Atelier Plot | 225 | // Connect AtCore temperatures changes on Atelier Plot | ||
158 | connect(&m_core.temperature(), &Temperature::bedTemperatureChanged, [ & ](const float& temp) { | 226 | connect(&m_core.temperature(), &Temperature::bedTemperatureChanged, [ this ](const float& temp) { | ||
159 | checkTemperature(0x00, 0, temp); | 227 | checkTemperature(0x00, 0, temp); | ||
160 | ui->plotWidget->appendPoint(i18n("Actual Bed"), temp); | 228 | ui->plotWidget->appendPoint(i18n("Actual Bed"), temp); | ||
161 | ui->plotWidget->update(); | 229 | ui->plotWidget->update(); | ||
162 | ui->bedExtWidget->updateBedTemp(temp); | 230 | ui->bedExtWidget->updateBedTemp(temp); | ||
163 | }); | 231 | }); | ||
164 | connect(&m_core.temperature(), &Temperature::bedTargetTemperatureChanged, [ & ](const float& temp) { | 232 | connect(&m_core.temperature(), &Temperature::bedTargetTemperatureChanged, [ this ](const float& temp) { | ||
165 | checkTemperature(0x01, 0, temp); | 233 | checkTemperature(0x01, 0, temp); | ||
166 | ui->plotWidget->appendPoint(i18n("Target Bed"), temp); | 234 | ui->plotWidget->appendPoint(i18n("Target Bed"), temp); | ||
167 | ui->plotWidget->update(); | 235 | ui->plotWidget->update(); | ||
168 | ui->bedExtWidget->updateBedTargetTemp(temp); | 236 | ui->bedExtWidget->updateBedTargetTemp(temp); | ||
169 | }); | 237 | }); | ||
170 | connect(&m_core.temperature(), &Temperature::extruderTemperatureChanged, [ & ](const float& temp) { | 238 | connect(&m_core.temperature(), &Temperature::extruderTemperatureChanged, [ this ](const float& temp) { | ||
171 | checkTemperature(0x02, 0, temp); | 239 | checkTemperature(0x02, 0, temp); | ||
172 | ui->plotWidget->appendPoint(i18n("Actual Ext.1"), temp); | 240 | ui->plotWidget->appendPoint(i18n("Actual Ext.1"), temp); | ||
173 | ui->plotWidget->update(); | 241 | ui->plotWidget->update(); | ||
174 | ui->bedExtWidget->updateExtTemp(temp); | 242 | ui->bedExtWidget->updateExtTemp(temp); | ||
175 | }); | 243 | }); | ||
176 | connect(&m_core.temperature(), &Temperature::extruderTargetTemperatureChanged, [ & ](const float& temp) { | 244 | connect(&m_core.temperature(), &Temperature::extruderTargetTemperatureChanged, [ this ](const float& temp) { | ||
177 | checkTemperature(0x03, 0, temp); | 245 | checkTemperature(0x03, 0, temp); | ||
178 | ui->plotWidget->appendPoint(i18n("Target Ext.1"), temp); | 246 | ui->plotWidget->appendPoint(i18n("Target Ext.1"), temp); | ||
179 | ui->plotWidget->update(); | 247 | ui->plotWidget->update(); | ||
180 | ui->bedExtWidget->updateExtTargetTemp(temp); | 248 | ui->bedExtWidget->updateExtTargetTemp(temp); | ||
181 | }); | 249 | }); | ||
182 | 250 | | |||
183 | connect(ui->pushGCodeWidget, &PushGCodeWidget::push, [ & ](QString command) { | 251 | connect(ui->pushGCodeWidget, &PushGCodeWidget::push, [ this ](QString command) { | ||
184 | ui->logWidget->addLog("Push " + command); | 252 | ui->logWidget->addLog("Push " + command); | ||
185 | m_core.pushCommand(command); | 253 | m_core.pushCommand(command); | ||
186 | }); | 254 | }); | ||
187 | 255 | | |||
188 | // Fan, Flow and Speed management | 256 | // Fan, Flow and Speed management | ||
189 | connect(ui->ratesControlWidget, &RatesControlWidget::fanSpeedChanged, &m_core, &AtCore::setFanSpeed); | 257 | connect(ui->ratesControlWidget, &RatesControlWidget::fanSpeedChanged, &m_core, &AtCore::setFanSpeed); | ||
190 | connect(ui->ratesControlWidget, &RatesControlWidget::flowRateChanged, &m_core, &AtCore::setFlowRate); | 258 | connect(ui->ratesControlWidget, &RatesControlWidget::flowRateChanged, &m_core, &AtCore::setFlowRate); | ||
191 | connect(ui->ratesControlWidget, &RatesControlWidget::printSpeedChanged, &m_core, &AtCore::setPrinterSpeed); | 259 | connect(ui->ratesControlWidget, &RatesControlWidget::printSpeedChanged, &m_core, &AtCore::setPrinterSpeed); | ||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | 302 | { | |||
235 | m_core.disableMotors(0); | 303 | m_core.disableMotors(0); | ||
236 | } | 304 | } | ||
237 | 305 | | |||
238 | void AtCoreInstanceWidget::handlePrinterStatusChanged(AtCore::STATES newState) | 306 | void AtCoreInstanceWidget::handlePrinterStatusChanged(AtCore::STATES newState) | ||
239 | { | 307 | { | ||
240 | static QString stateString; | 308 | static QString stateString; | ||
241 | switch (newState) { | 309 | switch (newState) { | ||
242 | case AtCore::CONNECTING: { | 310 | case AtCore::CONNECTING: { | ||
311 | m_core.setSerialTimerInterval(0); | ||||
312 | m_connectButton->setText(i18n("Disconnect")); | ||||
313 | m_connectToolBar->setHidden(true); | ||||
314 | m_mainToolBar->setHidden(false); | ||||
243 | stateString = i18n("Connecting..."); | 315 | stateString = i18n("Connecting..."); | ||
244 | connect(&m_core, &AtCore::receivedMessage, this, &AtCoreInstanceWidget::checkReceivedCommand); | 316 | connect(&m_core, &AtCore::receivedMessage, this, &AtCoreInstanceWidget::checkReceivedCommand); | ||
245 | connect(m_core.serial(), &SerialLayer::pushedCommand, this, &AtCoreInstanceWidget::checkPushedCommands); | 317 | connect(m_core.serial(), &SerialLayer::pushedCommand, this, &AtCoreInstanceWidget::checkPushedCommands); | ||
246 | } break; | 318 | } break; | ||
247 | case AtCore::IDLE: { | 319 | case AtCore::IDLE: { | ||
248 | stateString = i18n("Connected to ") + m_core.serial()->portName(); | 320 | stateString = i18n("Connected to ") + m_core.serial()->portName(); | ||
249 | emit extruderCountChanged(m_core.extruderCount()); | 321 | emit extruderCountChanged(m_core.extruderCount()); | ||
250 | ui->logWidget->addLog(i18n("Serial connected")); | 322 | ui->logWidget->addLog(i18n("Serial connected")); | ||
251 | emit disableDisconnect(false); | 323 | emit disableDisconnect(false); | ||
252 | enableControls(true); | 324 | enableControls(true); | ||
253 | } break; | 325 | } break; | ||
254 | case AtCore::DISCONNECTED: { | 326 | case AtCore::DISCONNECTED: { | ||
255 | stateString = i18n("Not Connected"); | 327 | stateString = i18n("Not Connected"); | ||
256 | disconnect(&m_core, &AtCore::receivedMessage, this, &AtCoreInstanceWidget::checkReceivedCommand); | 328 | disconnect(&m_core, &AtCore::receivedMessage, this, &AtCoreInstanceWidget::checkReceivedCommand); | ||
257 | disconnect(m_core.serial(), &SerialLayer::pushedCommand, this, &AtCoreInstanceWidget::checkPushedCommands); | 329 | disconnect(m_core.serial(), &SerialLayer::pushedCommand, this, &AtCoreInstanceWidget::checkPushedCommands); | ||
258 | ui->logWidget->addLog(i18n("Serial disconnected")); | 330 | ui->logWidget->addLog(i18n("Serial disconnected")); | ||
331 | m_core.setSerialTimerInterval(100); | ||||
332 | m_connectButton->setText(i18n("Connect")); | ||||
333 | m_connectToolBar->setHidden(false); | ||||
334 | m_mainToolBar->setHidden(true); | ||||
259 | enableControls(false); | 335 | enableControls(false); | ||
260 | } break; | 336 | } break; | ||
261 | case AtCore::STARTPRINT: { | 337 | case AtCore::STARTPRINT: { | ||
262 | stateString = i18n("Starting Print"); | 338 | stateString = i18n("Starting Print"); | ||
263 | ui->printProgressWidget->setVisible(true); | 339 | ui->printProgressWidget->setVisible(true); | ||
264 | connect(&m_core, &AtCore::printProgressChanged, ui->printProgressWidget, &PrintProgressWidget::updateProgressBar); | 340 | connect(&m_core, &AtCore::printProgressChanged, ui->printProgressWidget, &PrintProgressWidget::updateProgressBar); | ||
265 | } break; | 341 | } break; | ||
266 | case AtCore::FINISHEDPRINT: { | 342 | case AtCore::FINISHEDPRINT: { | ||
▲ Show 20 Lines • Show All 96 Lines • ▼ Show 20 Line(s) | |||||
363 | { | 439 | { | ||
364 | return (m_core.state() != AtCore::DISCONNECTED); | 440 | return (m_core.state() != AtCore::DISCONNECTED); | ||
365 | } | 441 | } | ||
366 | 442 | | |||
367 | void AtCoreInstanceWidget::setOpenFiles(const QList<QUrl>& files) | 443 | void AtCoreInstanceWidget::setOpenFiles(const QList<QUrl>& files) | ||
368 | { | 444 | { | ||
369 | m_files = files; | 445 | m_files = files; | ||
370 | } | 446 | } | ||
447 | | ||||
448 | void AtCoreInstanceWidget::updateSerialPort(const QStringList &ports) | ||||
449 | { | ||||
450 | m_comboPort->clear(); | ||||
451 | m_comboPort->addItems(ports); | ||||
452 | } | ||||
453 | | ||||
454 | void AtCoreInstanceWidget::updateProfileData() | ||||
455 | { | ||||
456 | m_settings.beginGroup("GeneralSettings"); | ||||
457 | QStringList profiles = m_settings.childGroups(); | ||||
458 | m_settings.endGroup(); | ||||
459 | m_comboProfile->clear(); | ||||
460 | m_comboProfile->addItems(profiles); | ||||
461 | } |