Skip to content

Commit

Permalink
adds TEST-GPIO check
Browse files Browse the repository at this point in the history
  • Loading branch information
bytecod3 committed Jan 7, 2025
1 parent a67b2e3 commit ac7476e
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 59 deletions.
63 changes: 27 additions & 36 deletions app/NaFCSE/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,11 @@ void MainWindow::setStaticUI() {
ui->FLASH_subsys_label->setAutoFillBackground(true);
ui->FLASH_subsys_label->setStyleSheet( "QLabel { padding: 2px; background-color : #958d93; color : #ffffff; border-radius: 2px; }" );

ui->TESTFLASH_subsys_label->setAutoFillBackground(true);
ui->TESTFLASH_subsys_label->setStyleSheet( "QLabel { padding: 2px; background-color : #958d93; color : #ffffff; border-radius: 2px; }" );
ui->SD_subsys_label->setAutoFillBackground(true);
ui->SD_subsys_label->setStyleSheet( "QLabel { padding: 2px; background-color : #958d93; color : #ffffff; border-radius: 2px; }" );

ui->POWER_subsys_label->setAutoFillBackground(true);
ui->POWER_subsys_label->setStyleSheet( "QLabel { padding: 2px; background-color : #958d93; color : #ffffff; border-radius: 2px; }" );
ui->SPIFFS_subsys_label->setAutoFillBackground(true);
ui->SPIFFS_subsys_label->setStyleSheet( "QLabel { padding: 2px; background-color : #958d93; color : #ffffff; border-radius: 2px; }" );

// flight systems groupbox styles
ui->flightSystemsGroupBox->setAutoFillBackground(true);
Expand Down Expand Up @@ -498,15 +498,17 @@ void MainWindow::setStaticUI() {
* Display the status of the subsystems on the UI
*/
void MainWindow::updateSystemDiagnosticsUI(QString st) {
// get the susbsytems labels
// get the subsystems labels
QLabel* sub_system_labels[this->num_sub_systems] = {
ui->IMU_subsys_label,
ui->ALT_subsys_label,
ui->TESTFLASH_subsys_label, // sd card
ui->POWER_subsys_label,
ui->IMU_subsys_label,
ui->FLASH_subsys_label,
ui->GPS_subsys_label,
ui->COMMS_subsys_label,
ui->FLASH_subsys_label
ui->SD_subsys_label, // sd card
ui->SPIFFS_subsys_label, // SPIFFS
ui->TESTGPIO_subsys_label, // TEST GPIO
ui->COMMS_subsys_label, // No way of testing comms at the moment

};

// loop each susbsytem label
Expand All @@ -515,18 +517,18 @@ void MainWindow::updateSystemDiagnosticsUI(QString st) {

// set the subsytems init UI
/** bit assignment
* bit0 -> IMU (LSB)
* bit1 -> ALTIMETER
* bit2 -> SD CARD
* bit3 -> POWER
* bit4 -> GPS
* bit5 -> COMMS
* bit6 -> FLASH
* bit7 -> X (unused) (MSB)
* bit0 -> ALTIMETER (LSB)
* bit1 -> IMU
* bit2 -> FLASH
* bit3 -> GPS
* bit4 -> SD CARD
* bit5 -> SPIFFS
* bit6 -> TESTGPIO
* bit7 -> X (unused) (MSB) // reserved for COMMS (xbee)
*
*/

// check IMU
// check ALTIMETER
if(QString::compare("1", st[7]) == 0) {
sub_system_labels[0]->setAutoFillBackground(true);
sub_system_labels[0]->setStyleSheet(" QLabel { border: 1px solid gray; border-radius: 4px; color: black; background: green } ");
Expand All @@ -535,7 +537,7 @@ void MainWindow::updateSystemDiagnosticsUI(QString st) {
sub_system_labels[0]->setStyleSheet(" QLabel { border: 1px solid gray; border-radius: 4px; color: black; background: red } ");
}

// check ALTIMETER
// check IMU
if(QString::compare("1", st[6]) == 0) {
sub_system_labels[1]->setAutoFillBackground(true);
sub_system_labels[1]->setStyleSheet(" QLabel { border: 1px solid gray; border-radius: 4px; color: black; background: green } ");
Expand All @@ -544,7 +546,7 @@ void MainWindow::updateSystemDiagnosticsUI(QString st) {
sub_system_labels[1]->setStyleSheet(" QLabel { border: 1px solid gray; border-radius: 4px; color: black; background: red } ");
}

// check SD CARD
// check FLASH
if(QString::compare("1", st[5]) == 0) {
sub_system_labels[2]->setAutoFillBackground(true);
sub_system_labels[2]->setStyleSheet(" QLabel { border: 1px solid gray; border-radius: 4px; color: black; background: green } ");
Expand All @@ -553,7 +555,7 @@ void MainWindow::updateSystemDiagnosticsUI(QString st) {
sub_system_labels[2]->setStyleSheet(" QLabel { border: 1px solid gray; border-radius: 4px; color: black; background: red } ");
}

// check POWER
// check GPS
if(QString::compare("1", st[4]) == 0) {
sub_system_labels[3]->setAutoFillBackground(true);
sub_system_labels[3]->setStyleSheet(" QLabel { border: 1px solid gray; border-radius: 4px; color: black; background: green } ");
Expand All @@ -562,7 +564,7 @@ void MainWindow::updateSystemDiagnosticsUI(QString st) {
sub_system_labels[3]->setStyleSheet(" QLabel { border: 1px solid gray; border-radius: 4px; color: black; background: red } ");
}

// check GPS
// check SD CARD
if(QString::compare("1", st[3]) == 0) {
sub_system_labels[4]->setAutoFillBackground(true);
sub_system_labels[4]->setStyleSheet(" QLabel { border: 1px solid gray; border-radius: 4px; color: black; background: green } ");
Expand All @@ -571,7 +573,7 @@ void MainWindow::updateSystemDiagnosticsUI(QString st) {
sub_system_labels[4]->setStyleSheet(" QLabel { border: 1px solid gray; border-radius: 4px; color: black; background: red } ");
}

// check COMMS
// check SPIFFS
if(QString::compare("1", st[2]) == 0) {
sub_system_labels[5]->setAutoFillBackground(true);
sub_system_labels[5]->setStyleSheet(" QLabel { border: 1px solid gray; border-radius: 4px; color: black; background: green } ");
Expand All @@ -580,7 +582,7 @@ void MainWindow::updateSystemDiagnosticsUI(QString st) {
sub_system_labels[5]->setStyleSheet(" QLabel { border: 1px solid gray; border-radius: 4px; color: black; background: red } ");
}

// check FLASH
// check TEST-GPIO
if(QString::compare("1", st[1]) == 0) {
sub_system_labels[6]->setAutoFillBackground(true);
sub_system_labels[6]->setStyleSheet(" QLabel { border: 1px solid gray; border-radius: 4px; color: black; background: green } ");
Expand All @@ -589,17 +591,6 @@ void MainWindow::updateSystemDiagnosticsUI(QString st) {
sub_system_labels[6]->setStyleSheet(" QLabel { border: 1px solid gray; border-radius: 4px; color: black; background: red } ");
}

// for(int j = 0; j < this->num_sub_systems; j++) {
// if(sys_diag[j] == 1) {
// sub_system_labels[j]->setAutoFillBackground(true);
// sub_system_labels[j]->setStyleSheet(" QLabel { border: 1px solid gray; border-radius: 4px; color: black; background: green } ");
// } else {
// sub_system_labels[j]->setAutoFillBackground(true);
// sub_system_labels[j]->setStyleSheet(" QLabel { border: 1px solid gray; border-radius: 4px; color: black; background: red } ");
// }
// }


}

void MainWindow::updateFlightStateUI(QString state) {
Expand Down
2 changes: 1 addition & 1 deletion app/NaFCSE/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private slots:

// test
// order -> imu, altimeter, gps, comms, flash, test-flash, power
static constexpr int num_sub_systems = 7;
static constexpr int num_sub_systems = 8;
int sys_diag[num_sub_systems] = {1,1,1,1,0,1,0};

};
Expand Down
56 changes: 34 additions & 22 deletions app/NaFCSE/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -357,87 +357,99 @@ padding-bottom: 4px;
</property>
<item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="IMU_subsys_label">
<item row="2" column="0">
<widget class="QLabel" name="SD_subsys_label">
<property name="styleSheet">
<string notr="true">border: 1px solid gray;
border-radius: 2px;
color: black;</string>
</property>
<property name="text">
<string>IMU</string>
<string>SD-CARD</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="ALT_subsys_label">
<item row="3" column="0">
<widget class="QLabel" name="SPIFFS_subsys_label">
<property name="styleSheet">
<string notr="true">border: 1px solid gray;
border-radius: 2px;
color: black;</string>
</property>
<property name="text">
<string>ALTIMETER</string>
<string>SPIFFS</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="TESTFLASH_subsys_label">
<item row="2" column="1">
<widget class="QLabel" name="FLASH_subsys_label">
<property name="styleSheet">
<string notr="true">border: 1px solid gray;
border-radius: 2px;
color: black;</string>
</property>
<property name="text">
<string>TEST-FLASH</string>
<string>FLASH</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="GPS_subsys_label">
<item row="3" column="1">
<widget class="QLabel" name="TESTGPIO_subsys_label">
<property name="styleSheet">
<string notr="true">border: 1px solid gray;
border-radius: 2px;
color: black;</string>
</property>
<property name="text">
<string>GPS</string>
<string>TEST-GPIO</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="COMMS_subsys_label">
<item row="0" column="0">
<widget class="QLabel" name="IMU_subsys_label">
<property name="styleSheet">
<string notr="true">border: 1px solid gray;
border-radius: 2px;
color: black;</string>
</property>
<property name="text">
<string>COMMS</string>
<string>IMU</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="POWER_subsys_label">
<item row="1" column="0">
<widget class="QLabel" name="ALT_subsys_label">
<property name="styleSheet">
<string notr="true">border: 1px solid gray;
border-radius: 2px;
color: black;</string>
</property>
<property name="text">
<string>POWER</string>
<string>ALTIMETER</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="FLASH_subsys_label">
<item row="0" column="1">
<widget class="QLabel" name="GPS_subsys_label">
<property name="styleSheet">
<string notr="true">border: 1px solid gray;
border-radius: 2px;
color: black;</string>
</property>
<property name="text">
<string>FLASH</string>
<string>GPS</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="COMMS_subsys_label">
<property name="styleSheet">
<string notr="true">border: 1px solid gray;
border-radius: 2px;
color: black;</string>
</property>
<property name="text">
<string>COMMS</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -787,8 +799,8 @@ font: {
<widget class="QStatusBar" name="statusbar"/>
</widget>
<resources>
<include location="play-icon.qrc"/>
<include location="serial-icon.qrc"/>
<include location="play-icon.qrc"/>
</resources>
<connections/>
</ui>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<mxfile host="Electron" modified="2025-01-02T19:44:02.500Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/20.8.16 Chrome/106.0.5249.199 Electron/21.4.0 Safari/537.36" etag="Zz6q5OWLefKR4aeaq_RT" version="20.8.16" type="device"><diagram name="Page-1" id="mBe-X2XpHbBjMXoWEPuQ">jZNNb4MwDIZ/DcdKQDraXmm77bITk6adpgxcEi0QlroF9utnloQPVZV2wnn8Eee1Cdi+6p4Mb8SLLkAFcVh0ATsEcRyFuy19BtJbkuwSC0ojCxc0gUz+gM909CILOC8CUWuFslnCXNc15Lhg3BjdLsNOWi1vbXgJNyDLubqlb7JAYen2IZz4M8hS+Juj0Hkq7oMdOAte6HaG2DFge6M1Wqvq9qAG8bwuNu/xjndszECN/0lgH+v+87B5P2G6+Vqtr7U4v65clStXF/fgIE4U1UtPmspS134iyfdl6DSNJpOscvhmyA36PGrAplqfezv2XlBqimZHh7QVEiFreD54WlofYgIrRadozLyCQejuPjkahaQNBF0Bmp5CfAJz2rvl81NrZ5N0SMyG6Bl3u1OOhSd5yXAK++M0yT/f7H9gx18=</diagram></mxfile>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<mxfile host="Electron" modified="2025-01-03T06:31:39.962Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/20.8.16 Chrome/106.0.5249.199 Electron/21.4.0 Safari/537.36" etag="2uZgxsmxNJXgpzUWPmhK" version="20.8.16" type="device"><diagram name="Page-1" id="mBe-X2XpHbBjMXoWEPuQ">7V1bb+M2Fv41fkwgiro+TjKddoHpYtApsNungrEZWxvZciV6Es+vX1IidSHpmIll0VaUAh2LupjmOd/huXykZvB+/fJrjrar37MFTmeus3iZwc8z1wWOF9B/WMu+agkCWDUs82TBL2oavic/sbiTt+6SBS46F5IsS0my7TbOs80Gz0mnDeV59ty97DFLu9+6RUusN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utAy+2grORk31j0zVesdWcQGySoB+70TWWFd/GxZqw1PBqJGxfZf9E6wuGYjU8mti+F6Aqvpz0iEzJdOB8uqLZW2Fi+14mk+7QdHspbN9YDTcntu9165R1tm+sWUM5sX2vVp+ss31jNXwfNdv3iDyM2b7yO0Z6E0i9veTo6L6ytxdr3t8+aIkLiO14J76vsRBD6Z0PvmOZ7wvEC94nwm+/mRTgmJIAgHNgO7yBKL+SYYHOe9/9IK9IaF4t1TflV7GF3hHKr3yD7w1A+a1VYFRsVFnIsSZQHJSNyvEz8mH2oWXSL3CmDevYKJhuFgSAq5fwMBnyuqNj4zhCz/YrRYAzbT/H9PvUCtABL0J+O3E48Ht/6rdcj48XCX1NxmRY7AA1aPyI2HGNZxGrdda6ozpu5HLLBm10rEjoW3+TKQDTrnOz3okoAJgu2eLStoe6iQD4NnFZZQ7VHR09G4W63tZNo6t6ZxMd5QJ0RaajeI5uGh2WjgJc1duc+CgXWus9OOleCiEFiFl4YqSMR6usU1KAq1YJJk7KFWuUdVIKcNWCyKhZKcckcgG0FFf36r0R0lI8oJmmh80wuioHeaKlvC5EiZYCA882LcU1KTZOtJS3J1Vc4/qle2ABph1aigfe+xJ5uZQOA9n2nImW4jnx22gptGe+BJ1z0FJck+zitc1DgTz2GnrksHwJ16RKfOXDDIPQNi1F8GIslUr4fFDb+CP23XJKXRic49YfHlCEgVLqoqOdlHqelDEL+oGStPK+rq8i77q3krMVavKkYs1lG0Lx+SA0bcJSa7wRNly72FCT2mIflrLotMDzbNEU6AsWzmzmo9gjAka6UH7YAhS0W5u/sgnHNQUVsLq3Ud3R9kYsLyRHc+avsx5U26xwiKXZZjmajVegbtvmvkBFD/MsI+0Qhg7D6ndqodgV/wc=</diagram></mxfile>

0 comments on commit ac7476e

Please sign in to comment.