diff --git a/src/frmabout.ui b/src/frmabout.ui index 285c553..8458c27 100644 --- a/src/frmabout.ui +++ b/src/frmabout.ui @@ -58,7 +58,10 @@ - <html><head/><body><p>Candle 2<br/>Version: 2.5<br/>License: GNU GENERAL PUBLIC LICENSE<a href="https://github.com/Schildkroet/Candle2/"><span style=" text-decoration: underline; color:#0000ff;"><br/></span></a>© 2015-2016 Hayrullin Denis Ravilevich<br/>© 2018-2023 Patrick F.</p><p>Visit: <a href="https://github.com/Schildkroet/Candle2/"><span style=" text-decoration: underline; color:#0000ff;">https://github.com/Schildkroet/Candle2/</span></a></p></body></html> + <html><head><title>About</title></head><body><p>Candle 2<br/>Version: 2.6<br/>License: GNU GENERAL PUBLIC LICENSE<br/>© 2015-2016 Hayrullin Denis Ravilevich<br/>© 2018-2024 Patrick F.</p><p>Visit: <a href="https://github.com/Schildkroet/Candle2/"><span style=" text-decoration: underline; color:#0000ff;">https://github.com/Schildkroet/Candle2/</span></a></p></body></html> + + + Qt::AutoText Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter diff --git a/src/frmmain.cpp b/src/frmmain.cpp index 584dbd0..5347399 100644 --- a/src/frmmain.cpp +++ b/src/frmmain.cpp @@ -61,7 +61,8 @@ frmMain::frmMain(QWidget *parent) : << "Door" // TODO: Update "Door" state << "Jog" << "Dwell" - << "Tool"; + << "Tool" + << "Busy"; m_statusCaptions << tr("Unknown") << tr("Idle") @@ -500,6 +501,7 @@ void frmMain::updateControlsState() ui->tabWidget->setTabEnabled(1, portOpened); ui->tabWidget->setTabEnabled(2, portOpened); ui->tabWidget->setTabEnabled(3, portOpened); + ui->tabWidget->setTabEnabled(4, portOpened); ui->chkTestMode->setEnabled(portOpened && !m_processingFile); ui->cmdHome->setEnabled(!m_processingFile); @@ -842,22 +844,33 @@ void frmMain::onTimerUpdateSpindleParser() void frmMain::onTimerStatusQuery() { - if (SerialIf_IsOpen() && m_resetCompleted && m_statusReceived) + static int Timeout = 4; + + if(SerialIf_IsOpen() && m_resetCompleted) { - // Status report: ? - if(m_Protocol == PROT_GRBL1_1) + if(m_statusReceived || (Timeout <= 0)) { - SerialIf_Write("?"); + Timeout = 4; + + // Status report: ? + if(m_Protocol == PROT_GRBL1_1) + { + SerialIf_Write("?"); + } + else if(m_Protocol == PROT_GRIP) + { + QByteArray data("?"); + //GrIP_Transmit(MSG_SYSTEM_CMD, 0, (const uint8_t*)data.constData(), data.length()); + Pdu_t p = {(uint8_t*)data.data(), (uint16_t)data.length()}; + GrIP_Transmit(MSG_SYSTEM_CMD, 0, &p); + } + + m_statusReceived = false; } - else if(m_Protocol == PROT_GRIP) + else { - QByteArray data("?"); - //GrIP_Transmit(MSG_SYSTEM_CMD, 0, (const uint8_t*)data.constData(), data.length()); - Pdu_t p = {(uint8_t*)data.data(), (uint16_t)data.length()}; - GrIP_Transmit(MSG_SYSTEM_CMD, 0, &p); + Timeout--; } - - m_statusReceived = false; } ui->glwVisualizer->setBufferState(QString(tr("Buffer: %1 / %2 / %3")).arg(BufferLength()).arg(mCommandsSent.size()).arg(mCommandsWait.size())); @@ -2248,3 +2261,27 @@ void frmMain::on_btnSaveCoord_clicked() sendCommand(cmd, -1, m_settings->showUICommands()); } + +void frmMain::on_btnClearCoord_clicked() +{ + sendCommand("$RST=C", -1, m_settings->showUICommands()); +} + + +void frmMain::on_btnCoolantFlood_clicked() +{ + sendCommand("M8", -1, m_settings->showUICommands()); +} + + +void frmMain::on_btnCoolantMist_clicked() +{ + sendCommand("M7", -1, m_settings->showUICommands()); +} + + +void frmMain::on_btnCoolantDisable_clicked() +{ + sendCommand("M9", -1, m_settings->showUICommands()); +} + diff --git a/src/frmmain.h b/src/frmmain.h index cfecee0..082f3e1 100644 --- a/src/frmmain.h +++ b/src/frmmain.h @@ -240,6 +240,14 @@ private slots: void on_btnSaveCoord_clicked(); + void on_btnClearCoord_clicked(); + + void on_btnCoolantFlood_clicked(); + + void on_btnCoolantMist_clicked(); + + void on_btnCoolantDisable_clicked(); + protected: void showEvent(QShowEvent *se); void hideEvent(QHideEvent *he); diff --git a/src/frmmain.ui b/src/frmmain.ui index dfb8b65..18e06d4 100644 --- a/src/frmmain.ui +++ b/src/frmmain.ui @@ -662,7 +662,7 @@ padding-right: 8; 5 - 10 + 16 QComboBox::InsertAtTop @@ -757,7 +757,7 @@ padding-right: 8; - 50 + 60 0 @@ -901,7 +901,7 @@ padding-right: 8; - 50 + 60 0 @@ -984,7 +984,7 @@ padding-right: 8; - 50 + 56 16777215 @@ -1034,7 +1034,7 @@ padding-right: 8; - 50 + 56 16777215 @@ -1075,7 +1075,7 @@ padding-right: 8; - 50 + 56 16777215 @@ -1124,6 +1124,58 @@ padding-right: 8; + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 40 + + + + + + + + 10 + + + 10 + + + 0 + + + + + Reset all coord systems + + + Reset + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + @@ -1438,6 +1490,86 @@ padding-right: 8; + + + Misc + + + + + 10 + 10 + 581 + 181 + + + + + 0 + + + 0 + + + + + 10 + + + 10 + + + + + + 75 + true + + + + Coolant: + + + + + + + Flood + + + + + + + Mist + + + + + + + Disable + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + @@ -3055,7 +3187,7 @@ padding-right: 8; 0 0 385 - 546 + 570 @@ -3869,7 +4001,7 @@ padding-right: 8; 0 0 1646 - 21 + 24 diff --git a/src/frmmain_processresponse.cpp b/src/frmmain_processresponse.cpp index d5b1db3..42ca5fb 100644 --- a/src/frmmain_processresponse.cpp +++ b/src/frmmain_processresponse.cpp @@ -34,7 +34,7 @@ void frmMain::ProcessGRBL1_1() { QString data = SerialIf_ReadLine().trimmed(); - //qDebug() << "<" << data << ">"; + qDebug() << "<" << data << ">"; // Filter prereset responses if(m_reseting) @@ -49,6 +49,11 @@ void frmMain::ProcessGRBL1_1() } } + if(data.length() == 0) + { + continue; + } + // Status response if(data[0] == '<') { @@ -870,6 +875,11 @@ void frmMain::ProcessGRBL_ETH(QString data) } } + if(data.length() == 0) + { + return; + } + // Status response if(data[0] == '<') {