|
|
@@ -29,12 +29,6 @@ MainWindow::MainWindow(QWidget *parent) : |
|
|
|
stylesheet_tac_unmarked = "QLabel {background-color: white;}"; |
|
|
|
|
|
|
|
logBCIData = true; |
|
|
|
tac1ON = false; |
|
|
|
tac2ON = false; |
|
|
|
tac3ON = false; |
|
|
|
tac4ON = false; |
|
|
|
tac5ON = false; |
|
|
|
tac6ON = false; |
|
|
|
|
|
|
|
lastBufferStr = "0"; |
|
|
|
|
|
|
@@ -53,12 +47,12 @@ void MainWindow::setupSignalsAndSlots() |
|
|
|
connect(ui->check_LogBCI, SIGNAL(toggled(bool)), this, SLOT(setLogBCIData(bool))); |
|
|
|
connect(ui->push_ClearLog, SIGNAL(clicked()), this, SLOT(clearLog())); |
|
|
|
|
|
|
|
connect(ui->push_Tac1, SIGNAL(clicked(bool)), this, SLOT(pushTac1(bool))); |
|
|
|
connect(ui->push_Tac2, SIGNAL(clicked(bool)), this, SLOT(pushTac2(bool))); |
|
|
|
connect(ui->push_Tac3, SIGNAL(clicked(bool)), this, SLOT(pushTac3(bool))); |
|
|
|
connect(ui->push_Tac4, SIGNAL(clicked(bool)), this, SLOT(pushTac4(bool))); |
|
|
|
connect(ui->push_Tac5, SIGNAL(clicked(bool)), this, SLOT(pushTac5(bool))); |
|
|
|
connect(ui->push_Tac6, SIGNAL(clicked(bool)), this, SLOT(pushTac6(bool))); |
|
|
|
connect(ui->push_Tac1, SIGNAL(clicked(bool)), this, SLOT(pushTac1())); |
|
|
|
connect(ui->push_Tac2, SIGNAL(clicked(bool)), this, SLOT(pushTac2())); |
|
|
|
connect(ui->push_Tac3, SIGNAL(clicked(bool)), this, SLOT(pushTac3())); |
|
|
|
connect(ui->push_Tac4, SIGNAL(clicked(bool)), this, SLOT(pushTac4())); |
|
|
|
connect(ui->push_Tac5, SIGNAL(clicked(bool)), this, SLOT(pushTac5())); |
|
|
|
connect(ui->push_Tac6, SIGNAL(clicked(bool)), this, SLOT(pushTac6())); |
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::log(QString logtext) |
|
|
@@ -241,6 +235,7 @@ void MainWindow::readPCSocketData() |
|
|
|
} |
|
|
|
|
|
|
|
if(bufferStr != lastBufferStr){ |
|
|
|
//TODO Buffer nur von 1-6 weiterschicken, andere hier schon rausfiltern! |
|
|
|
QByteArray data = bufferStr.toUtf8(); |
|
|
|
udpSocket_Feather->writeDatagram(data, FeatherIP_full, FeatherPort); |
|
|
|
lastBufferStr = bufferStr; |
|
|
@@ -255,6 +250,14 @@ void MainWindow::markDirectionTactile(const QString direction) |
|
|
|
//qDebug() << i_direction; |
|
|
|
|
|
|
|
switch (i_direction) { |
|
|
|
case 0: //all Low |
|
|
|
ui->label_Tac1->setStyleSheet(stylesheet_tac_unmarked); |
|
|
|
ui->label_Tac2->setStyleSheet(stylesheet_tac_unmarked); |
|
|
|
ui->label_Tac3->setStyleSheet(stylesheet_tac_unmarked); |
|
|
|
ui->label_Tac4->setStyleSheet(stylesheet_tac_unmarked); |
|
|
|
ui->label_Tac5->setStyleSheet(stylesheet_tac_unmarked); |
|
|
|
ui->label_Tac6->setStyleSheet(stylesheet_tac_unmarked); |
|
|
|
break; |
|
|
|
case 1: //Tac1 |
|
|
|
ui->label_Tac1->setStyleSheet(stylesheet_tac_marked); |
|
|
|
ui->label_Tac2->setStyleSheet(stylesheet_tac_unmarked); |
|
|
@@ -316,61 +319,32 @@ void MainWindow::clearLog() |
|
|
|
ui->plain_Log->clear(); |
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::pushTac1(const bool state) |
|
|
|
void MainWindow::pushTac1() |
|
|
|
{ |
|
|
|
tac1ON = state; |
|
|
|
pushDirection(); |
|
|
|
udpSocket_Feather->writeDatagram(QByteArray::number(1), FeatherIP_full, FeatherPort); |
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::pushTac2(const bool state) |
|
|
|
void MainWindow::pushTac2() |
|
|
|
{ |
|
|
|
tac2ON = state; |
|
|
|
pushDirection(); |
|
|
|
|
|
|
|
udpSocket_Feather->writeDatagram(QByteArray::number(2), FeatherIP_full, FeatherPort); |
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::pushTac3(const bool state) |
|
|
|
void MainWindow::pushTac3() |
|
|
|
{ |
|
|
|
tac3ON = state; |
|
|
|
pushDirection(); |
|
|
|
|
|
|
|
udpSocket_Feather->writeDatagram(QByteArray::number(3), FeatherIP_full, FeatherPort); |
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::pushTac4(const bool state) |
|
|
|
void MainWindow::pushTac4() |
|
|
|
{ |
|
|
|
tac4ON = state; |
|
|
|
pushDirection(); |
|
|
|
udpSocket_Feather->writeDatagram(QByteArray::number(4), FeatherIP_full, FeatherPort); |
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::pushTac5(const bool state) |
|
|
|
void MainWindow::pushTac5() |
|
|
|
{ |
|
|
|
tac5ON = state; |
|
|
|
pushDirection(); |
|
|
|
udpSocket_Feather->writeDatagram(QByteArray::number(5), FeatherIP_full, FeatherPort); |
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::pushTac6(const bool state) |
|
|
|
void MainWindow::pushTac6() |
|
|
|
{ |
|
|
|
tac6ON = state; |
|
|
|
pushDirection(); |
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::pushDirection() |
|
|
|
{ |
|
|
|
if(tac1ON) |
|
|
|
udpSocket_Feather->writeDatagram(QByteArray::number(1), FeatherIP_full, FeatherPort); |
|
|
|
|
|
|
|
if(tac2ON) |
|
|
|
udpSocket_Feather->writeDatagram(QByteArray::number(2), FeatherIP_full, FeatherPort); |
|
|
|
|
|
|
|
if(tac3ON) |
|
|
|
udpSocket_Feather->writeDatagram(QByteArray::number(3), FeatherIP_full, FeatherPort); |
|
|
|
|
|
|
|
if(tac4ON) |
|
|
|
udpSocket_Feather->writeDatagram(QByteArray::number(4), FeatherIP_full, FeatherPort); |
|
|
|
|
|
|
|
if(tac5ON) |
|
|
|
udpSocket_Feather->writeDatagram(QByteArray::number(5), FeatherIP_full, FeatherPort); |
|
|
|
|
|
|
|
if(tac6ON) |
|
|
|
udpSocket_Feather->writeDatagram(QByteArray::number(6), FeatherIP_full, FeatherPort); |
|
|
|
udpSocket_Feather->writeDatagram(QByteArray::number(6), FeatherIP_full, FeatherPort); |
|
|
|
} |