@@ -458,35 +458,37 @@ void Communicator::processGCodeParserState(CommandAttributes commandAttributes,
458458 }
459459
460460 // Process GCore parser state
461- if (commandAttributes.tableIndex == TABLE_INDEX_UTIL2 ) {
462- // @TODO what is this ; for? is it '; ok'?
463- m_lastParserState = response.left (response.indexOf (" ; " ));
464-
465- auto modal = ModalStateParser::parse (m_lastParserState);
461+ // if (commandAttributes.tableIndex == TABLE_INDEX_UTIL2) {
462+ auto modal = ModalStateParser::parse (response);
466463 if (modal) {
467464 m_deviceContext.setModalState (*modal);
468- }
465+ emit log (modal-> toString ());
469466
470- // Update status in visualizer window
471- emit parserStateReceived (m_lastParserState );
467+ // Update status in visualizer window
468+ emit parserStateReceived (modal-> raw );
472469
473- // Store parser status
474- if ((m_senderState == SenderState::Transferring) || (m_senderState == SenderState::Stopping)) {
475- storeParserState ();
476- }
470+ // Store parser status
471+ if ((m_senderState == SenderState::Transferring) || (m_senderState == SenderState::Stopping)) {
472+ storeParserState ();
473+ }
477474
478- // Spindle speed
479- // @TODO what is the difference between this and processFeedSpindleSpeed??
480- static QRegularExpression rx (" .*S([\\ d\\ .]+)" );
475+ if (modal->spindleSpeed != -1 ) {
476+ emit spindleSpeedReceived (modal->spindleSpeed );
477+ }
478+
479+ // Spindle speed
480+ // @TODO what is the difference between this and processFeedSpindleSpeed??
481+ // static QRegularExpression rx(".*S([\\d\\.]+)");
481482
482- match = rx.match (response);
483- if (match.hasMatch ()) {
484- double spindleSpeed = match.captured (1 ).toDouble ();
485- emit spindleSpeedReceived (spindleSpeed);
483+ // match = rx.match(response);
484+ // if (match.hasMatch()) {
485+ // double spindleSpeed = match.captured(1).toDouble();
486+ // emit spindleSpeedReceived(spindleSpeed);
487+ // }
486488 }
487489
488490 m_updateParserState = true ;
489- }
491+ // }
490492}
491493
492494// processCommandResponse was moved to CommandBuffer::processResponse()
0 commit comments