Subversion Repositories Code-Repo

Compare Revisions

Ignore whitespace Rev 362 → Rev 364

/Misc Projects/PcMarlinInterface/SerialWidget.cpp
55,12 → 55,10
 
connect(this, SIGNAL(Connect(QString,QString,QString,QString,QString,QString)),
serialHelper, SLOT(Connect(QString,QString,QString,QString,QString,QString)));
connect(serialHelper, SIGNAL(Connected()), this, SIGNAL(Connected()));
connect(serialHelper, SIGNAL(Connected()), this, SLOT(LocalConnected()));
connect(serialHelper, SIGNAL(Connected(bool)), this, SIGNAL(Connected(bool)));
connect(serialHelper, SIGNAL(Connected(bool)), this, SLOT(LocalConnected(bool)));
 
connect(this, SIGNAL(Disconnect()), serialHelper, SLOT(Disconnect()));
connect(serialHelper, SIGNAL(Disconnected()), this, SIGNAL(Disconnected()));
connect(serialHelper, SIGNAL(Disconnected()), this, SLOT(LocalDisconnected()));
 
connect(this, SIGNAL(TransmitByteArray(QByteArray)), serialHelper, SLOT(TransmitByteArray(QByteArray)));
 
73,7 → 71,7
connect(btnRefresh, SIGNAL(clicked()), this, SIGNAL(QueryParameters()));
 
emit QueryParameters();
LocalDisconnected();
LocalConnected(false);
}
 
SerialWidget::~SerialWidget()
116,56 → 114,41
if (currFlow >= 0) cboxFlowControl->setCurrentIndex(currFlow);
}
 
void SerialWidget::LocalConnected()
void SerialWidget::LocalConnected(bool connected)
{
btnConnect->setText("&Disconnect");
// cboxSerialPort->setEnabled(false);
// cboxSerialSpeed->setEnabled(false);
// cboxSerialDataBits->setEnabled(false);
// cboxSerialStopBits->setEnabled(false);
// cboxSerialParity->setEnabled(false);
// cboxSerialFlowControl->setEnabled(false);
// btnSerialRefresh->setEnabled(false);
btnRefresh->hide();
labelPort->hide();
labelSpeed->hide();
labelDataBits->hide();
labelStopBits->hide();
labelParity->hide();
labelFlowControl->hide();
cboxPort->hide();
cboxSpeed->hide();
cboxDataBits->hide();
cboxStopBits->hide();
cboxParity->hide();
cboxFlowControl->hide();
if (connected) {
btnConnect->setText("&Disconnect");
btnRefresh->hide();
labelPort->hide();
labelSpeed->hide();
labelDataBits->hide();
labelStopBits->hide();
labelParity->hide();
labelFlowControl->hide();
cboxPort->hide();
cboxSpeed->hide();
cboxDataBits->hide();
cboxStopBits->hide();
cboxParity->hide();
cboxFlowControl->hide();
} else {
btnConnect->setText("&Connect");
btnRefresh->show();
labelPort->show();
labelSpeed->show();
labelDataBits->show();
labelStopBits->show();
labelParity->show();
labelFlowControl->show();
cboxPort->show();
cboxSpeed->show();
cboxDataBits->show();
cboxStopBits->show();
cboxParity->show();
cboxFlowControl->show();
}
}
 
void SerialWidget::LocalDisconnected()
{
btnConnect->setText("&Connect");
// cboxSerialPort->setEnabled(true);
// cboxSerialSpeed->setEnabled(true);
// cboxSerialDataBits->setEnabled(true);
// cboxSerialStopBits->setEnabled(true);
// cboxSerialParity->setEnabled(true);
// cboxSerialFlowControl->setEnabled(true);
// btnSerialRefresh->setEnabled(true);
btnRefresh->show();
labelPort->show();
labelSpeed->show();
labelDataBits->show();
labelStopBits->show();
labelParity->show();
labelFlowControl->show();
cboxPort->show();
cboxSpeed->show();
cboxDataBits->show();
cboxStopBits->show();
cboxParity->show();
cboxFlowControl->show();
}
 
void SerialWidget::ConnectToggleBtn()
{
if (serialHelper->connected) {