Changeset View
Changeset View
Standalone View
Standalone View
src/atcore.cpp
Show First 20 Lines • Show All 228 Lines • ▼ Show 20 Line(s) | |||||
229 | { | 229 | { | ||
230 | d->lastMessage = message; | 230 | d->lastMessage = message; | ||
231 | if (message.startsWith(QString::fromLatin1("X:").toLocal8Bit())) { | 231 | if (message.startsWith(QString::fromLatin1("X:").toLocal8Bit())) { | ||
232 | d->printerStatus.posString = message; | 232 | d->printerStatus.posString = message; | ||
233 | d->printerStatus.posString.resize(d->printerStatus.posString.indexOf('E')); | 233 | d->printerStatus.posString.resize(d->printerStatus.posString.indexOf('E')); | ||
234 | d->printerStatus.posString.replace(':', ""); | 234 | d->printerStatus.posString.replace(':', ""); | ||
235 | } | 235 | } | ||
236 | 236 | | |||
237 | //Check if have temperature info and decode it | ||||
238 | temperature().decodeTemp(message); | ||||
237 | emit(receivedMessage(d->lastMessage)); | 239 | emit(receivedMessage(d->lastMessage)); | ||
238 | } | 240 | } | ||
239 | 241 | | |||
240 | void AtCore::setRelativePosition() | 242 | void AtCore::setRelativePosition() | ||
241 | { | 243 | { | ||
242 | pushCommand(GCode::toCommand(GCode::G91)); | 244 | pushCommand(GCode::toCommand(GCode::G91)); | ||
243 | } | 245 | } | ||
244 | 246 | | |||
245 | void AtCore::setAbsolutePosition() | 247 | void AtCore::setAbsolutePosition() | ||
246 | { | 248 | { | ||
247 | pushCommand(GCode::toCommand(GCode::G90)); | 249 | pushCommand(GCode::toCommand(GCode::G90)); | ||
248 | } | 250 | } | ||
249 | 251 | | |||
250 | float AtCore::percentagePrinted() | 252 | float AtCore::percentagePrinted() | ||
251 | { | 253 | { | ||
252 | return d->printerStatus.percentage; | 254 | return d->printerStatus.percentage; | ||
253 | } | 255 | } | ||
254 | 256 | | |||
255 | void AtCore::print(const QString &fileName) | 257 | void AtCore::print(const QString &fileName) | ||
256 | { | 258 | { | ||
257 | if (state() == CONNECTING) { | 259 | if (state() == CONNECTING) { | ||
patrickelectric: You can put everything here in temperature class and the plugin can use something like:
```… | |||||
if were gonna do that we might as well just continue to use extractTemp from the plugins and just change that to work more like this Do we have any examples of these firmwares output (these binary ones your talking about) rizzitello: if were gonna do that we might as well just continue to use extractTemp from the plugins and… | |||||
I am just saying that atcore isn't the place to add info extraction functions, this need to be inside plugins files or (less worst) in temperature class. If we gonna to start to put everything in atcore, just delete all plugins files, and that will be a big problem in future. patrickelectric: I am just saying that atcore isn't the place to add info extraction functions, this need to be… | |||||
258 | qCDebug(ATCORE_CORE) << "Load a firmware plugin to print."; | 260 | qCDebug(ATCORE_CORE) << "Load a firmware plugin to print."; | ||
259 | return; | 261 | return; | ||
260 | } | 262 | } | ||
261 | //START A THREAD AND CONNECT TO IT | 263 | //START A THREAD AND CONNECT TO IT | ||
262 | setState(STARTPRINT); | 264 | setState(STARTPRINT); | ||
263 | QThread *thread = new QThread(); | 265 | QThread *thread = new QThread(); | ||
264 | PrintThread *printThread = new PrintThread(this, fileName); | 266 | PrintThread *printThread = new PrintThread(this, fileName); | ||
265 | printThread->moveToThread(thread); | 267 | printThread->moveToThread(thread); | ||
▲ Show 20 Lines • Show All 257 Lines • Show Last 20 Lines |
You can put everything here in temperature class and the plugin can use something like:
AtCore is supposed to perform only operations and not decode, this'll not work in binary protocols or other temperature/protocol type message.