Skip to content
Snippets Groups Projects
Commit b851e789 authored by Jake's avatar Jake
Browse files

Work on GUI

parent 235a3fb3
No related branches found
No related tags found
No related merge requests found
......@@ -26,9 +26,6 @@ MainWindow::MainWindow(QWidget *parent) :
/* Set up environment variables */
findChild<QLineEdit *>("socketPath")->setText(QProcessEnvironment::systemEnvironment().value("UCART_SOCKET"));
/* Idiot lights */
findChild<QLabel *>("noGraphWarning1")->setStyleSheet("QLabel {color : red; }");
/* Create a thread for workers */
QThread* workerThread = new QThread(this);
......@@ -119,6 +116,7 @@ void MainWindow::updateTracker(float x, float y, float z, float p, float r, floa
void MainWindow::on_pbStart_clicked()
{
QProcessEnvironment::systemEnvironment().insert("UCART_SOCKET", findChild<QLineEdit *>("socketPath")->text());
this->backendPid = startBackend(findChild<QLineEdit *>("backendPath")->text().toStdString().c_str(), &backendPipe);
findChild<QPushButton *>("pbStart")->setEnabled(false);
findChild<QPushButton *>("pbStop")->setEnabled(true);
......@@ -127,6 +125,7 @@ void MainWindow::on_pbStart_clicked()
void MainWindow::on_pbConnect_clicked()
{
QProcessEnvironment::systemEnvironment().insert("UCART_SOCKET", findChild<QLineEdit *>("socketPath")->text());
findChild<QPushButton *>("pbStart")->setEnabled(false);
findChild<QPushButton *>("pbConnect")->setEnabled(false);
findChild<QPushButton *>("pbStop")->setEnabled(true);
......@@ -299,8 +298,3 @@ void MainWindow::newControlGraph(QString graph)
{
findChild<QLabel *>("graphImage")->setPixmap(QPixmap(graph));
}
void MainWindow::on_socketPath_returnPressed()
{
QProcessEnvironment::systemEnvironment().insert("UCART_SOCKET", findChild<QLineEdit *>("socketPath")->text());
}
......@@ -57,8 +57,6 @@ private slots:
void on_pbDeleteSetpoint_clicked();
void on_socketPath_returnPressed();
private:
Ui::MainWindow *ui;
pid_t backendPid;
......
......@@ -37,7 +37,7 @@
<item row="0" column="1">
<widget class="QLineEdit" name="socketPath">
<property name="enabled">
<bool>true</bool>
<bool>false</bool>
</property>
</widget>
</item>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment