fix: update usb connection; fix: added missing start lights
This commit is contained in:
@@ -59,6 +59,7 @@ set(helloworld_SRCS
|
|||||||
racelistgenerator.cpp
|
racelistgenerator.cpp
|
||||||
datahelper.cpp
|
datahelper.cpp
|
||||||
colorwidget.cpp
|
colorwidget.cpp
|
||||||
|
qrc_resource.cpp
|
||||||
|
|
||||||
mainwindow.ui
|
mainwindow.ui
|
||||||
windowrace.ui
|
windowrace.ui
|
||||||
@@ -69,7 +70,7 @@ set(helloworld_SRCS
|
|||||||
evaluation.ui
|
evaluation.ui
|
||||||
)
|
)
|
||||||
# Tell CMake to create the helloworld executable
|
# Tell CMake to create the helloworld executable
|
||||||
add_executable(Rennbahn ${helloworld_SRCS})
|
add_executable(Rennbahn ${helloworld_SRCS} )
|
||||||
|
|
||||||
# Use the Widgets module from Qt 5
|
# Use the Widgets module from Qt 5
|
||||||
target_link_libraries(Rennbahn Qt5::Widgets Qt5::Core Qt5::Sql)
|
target_link_libraries(Rennbahn Qt5::Widgets Qt5::Core Qt5::Sql)
|
||||||
|
|||||||
@@ -324,7 +324,7 @@ void HardwareSetup::run() {
|
|||||||
|
|
||||||
// prepare buffer
|
// prepare buffer
|
||||||
struct TransCheck * received;
|
struct TransCheck * received;
|
||||||
uint8_t uintBuf[4 * 6 + 2];
|
uint8_t uintBuf[sizeof(struct TransCheck)];
|
||||||
void * voidBuf;
|
void * voidBuf;
|
||||||
|
|
||||||
// configure among others non-canonical mode (important)
|
// configure among others non-canonical mode (important)
|
||||||
@@ -334,10 +334,10 @@ void HardwareSetup::run() {
|
|||||||
tcsetattr(fd, TCSANOW, &config);
|
tcsetattr(fd, TCSANOW, &config);
|
||||||
|
|
||||||
// read raw data to buffer
|
// read raw data to buffer
|
||||||
ssize_t length = read(fd, uintBuf, 24 + 2);
|
ssize_t length = read(fd, uintBuf, sizeof(struct TransCheck));
|
||||||
|
|
||||||
// flush existing data
|
// flush existing data
|
||||||
if (length < 24) {
|
if (static_cast<unsigned long>(length) < sizeof(struct TransCheck)) {
|
||||||
tcflush(fd, TCIFLUSH);
|
tcflush(fd, TCIFLUSH);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -345,7 +345,7 @@ void HardwareSetup::run() {
|
|||||||
|
|
||||||
// read data
|
// read data
|
||||||
cout << "try to read data" << endl;
|
cout << "try to read data" << endl;
|
||||||
read(this->fd, uintBuf, 4 * 6 + 2);
|
read(this->fd, uintBuf, sizeof(struct TransCheck));
|
||||||
cout << "data read" << endl;
|
cout << "data read" << endl;
|
||||||
voidBuf = static_cast<void *>(uintBuf);
|
voidBuf = static_cast<void *>(uintBuf);
|
||||||
received = static_cast<struct TransCheck *>(voidBuf);
|
received = static_cast<struct TransCheck *>(voidBuf);
|
||||||
@@ -354,7 +354,10 @@ void HardwareSetup::run() {
|
|||||||
|
|
||||||
for (int i = 0; i < 6; i++) {
|
for (int i = 0; i < 6; i++) {
|
||||||
if (received->begin == '#' && received->end == '!') {
|
if (received->begin == '#' && received->end == '!') {
|
||||||
|
cout << "i: " << i << " time: "
|
||||||
|
<< static_cast<int>(received->data[i].time)
|
||||||
|
<< " update: "
|
||||||
|
<< static_cast<int>(received->data[i].update) << endl;
|
||||||
if (received->data[i].update != 0) {
|
if (received->data[i].update != 0) {
|
||||||
switch (received->data[i].id) {
|
switch (received->data[i].id) {
|
||||||
case 0:
|
case 0:
|
||||||
@@ -386,7 +389,7 @@ void HardwareSetup::run() {
|
|||||||
2);
|
2);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
cout << "Shell Zeit 2: "
|
cout << "Shell Zeit 3: "
|
||||||
<< static_cast<int>(received->data[i].time)
|
<< static_cast<int>(received->data[i].time)
|
||||||
<< endl;
|
<< endl;
|
||||||
emit Shell(static_cast<int>(received->data[i].time),
|
emit Shell(static_cast<int>(received->data[i].time),
|
||||||
|
|||||||
Reference in New Issue
Block a user