A first Try on Serial.

This commit is contained in:
Hiro Protagonist 2017-03-30 19:32:11 +13:00
parent 798e908d86
commit b006f9b80a
3 changed files with 22 additions and 7 deletions

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>614</width>
<height>750</height>
<height>767</height>
</rect>
</property>
<property name="sizePolicy">
@ -253,6 +253,13 @@
</property>
</widget>
</item>
<item>
<widget class="QPlainTextEdit" name="serialMon">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View file

@ -77,6 +77,11 @@ MainWindow::MainWindow( QWidget * parent ) :
connect( ui->sHalt, &QPushButton::clicked, &comm, &SerialCommunicator::sendHalt );
connect( ui->sFast, &QPushButton::clicked, &comm, &SerialCommunicator::sendFast );
// Serial Monitor
connect( &comm, &SerialCommunicator::dataRead, this, [this] ( QByteArray data ) {
ui->serialMon->appendPlainText( data );
} );
// Camera selected
connect( ui->cameraSelector, static_cast<void( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &MainWindow::cameraSelected );
@ -99,11 +104,6 @@ MainWindow::MainWindow( QWidget * parent ) :
// Start recording
connect( ui->startButton, &QPushButton::clicked, this, &MainWindow::startStopRecording );
// Serial Selected
connect( &comm, &SerialCommunicator::dataRead, this, [this] ( QByteArray data ) {
qDebug() << data;
} );
}
// TODO: Proper wait please! EVENT

View file

@ -23,6 +23,7 @@
#include <QtWidgets/QLabel>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QMainWindow>
#include <QtWidgets/QPlainTextEdit>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QSpacerItem>
#include <QtWidgets/QSpinBox>
@ -62,6 +63,7 @@ public:
QCheckBox *saveFrames;
QPushButton *startButton;
QPushButton *preview_button;
QPlainTextEdit *serialMon;
QGroupBox *groupBox_2;
QVBoxLayout *verticalLayout_2;
QLabel *statusLabel;
@ -79,7 +81,7 @@ public:
{
if (MainWindow->objectName().isEmpty())
MainWindow->setObjectName(QStringLiteral("MainWindow"));
MainWindow->resize(614, 750);
MainWindow->resize(614, 767);
QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
@ -248,6 +250,12 @@ public:
verticalLayout_4->addWidget(preview_button);
serialMon = new QPlainTextEdit(recOptions);
serialMon->setObjectName(QStringLiteral("serialMon"));
serialMon->setReadOnly(true);
verticalLayout_4->addWidget(serialMon);
verticalLayout->addWidget(recOptions);