-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added pilot page Need help from joão to fix it
- Loading branch information
1 parent
56e446c
commit 52e4cde
Showing
9 changed files
with
291 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/** | ||
* @file pilot.cpp | ||
* @brief This file contains the logic for the PilotWindow class | ||
* @see pilot.h | ||
* @see store.h | ||
* @see flabel.h | ||
* @author Bruno Vicente | ||
* This piece of software was developed for the T24e project belonging to the LART Team | ||
**/ | ||
|
||
#include "pilot.h" | ||
#include "./ui_voidsterdebugwindow.h" | ||
|
||
#include "./store.h" | ||
#include <cstddef> | ||
#include <qmainwindow.h> | ||
#include "flabel.h" | ||
#include "QLCDNumber" | ||
static store* store_ref; | ||
|
||
|
||
|
||
/** | ||
* @brief Constructor for the VoidsterdebugWindow Class. | ||
* @b Connects @b **most** variables from the store to the FLabels on the screen. | ||
**/ | ||
PilotWindow::PilotWindow(QWidget *parent, QString serialDev) | ||
: QMainWindow(parent) | ||
, ui(new Ui::~PilotWindow){ | ||
|
||
store_ref = new store(serialDev); | ||
|
||
ui->setupUi(this); | ||
//store_ref->setParent(this); | ||
//store_ref->requestSlotAttachment(); | ||
|
||
/** | ||
* @brief bellow is the spaggeti code thats preprocessed to permit portable use between vehicles | ||
* The magic occurs in qmake through the DEFINES variable. | ||
* @see bson_var.h | ||
**/ | ||
|
||
|
||
#ifdef __LART_T24__ | ||
QLCDNumber* SPEED_DISPLAY = this->findChild<QLCDNumber*>("SPEED_DISPLAY"); | ||
connect(store_ref, &store::rpmChanged, SPEED_DISPLAY, (void (QLCDNumber::*)(short, short))&QLCDNumber::setAveragedVisualChangeSec); | ||
|
||
} | ||
|
||
|
||
|
||
|
||
/** | ||
* @brief A getter for a store pointer. <b> use with caution, </b> | ||
* <em> with great power comes great *frickery... This function is by reference and should be used for startup stuff</em> | ||
* @returns a pointer to the store object | ||
**/ | ||
store* PilotWindow::getStore(){ | ||
return store_ref; | ||
} | ||
/** | ||
* @brief Destructor for the VoidsterdebugWindow Class. | ||
* @b Deletes the store object. which can cause some odd behaviour to happen | ||
**/ | ||
PilotWindow::~PilotWindow(){ | ||
store_ref->~store(); | ||
delete ui; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#ifndef PILOT_H | ||
#define PILOT_H | ||
|
||
|
||
|
||
#include <QMainWindow> | ||
#include "store.h" | ||
|
||
|
||
QT_BEGIN_NAMESPACE | ||
namespace Ui { class PilotWindow; } | ||
QT_END_NAMESPACE | ||
|
||
class PilotWindow : public QMainWindow | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
PilotWindow(QWidget *parent = nullptr, QString serialDev=nullptr); | ||
store* getStore(); | ||
~PilotWindow(); | ||
|
||
private: | ||
|
||
Ui::PilotWindow *ui; | ||
}; | ||
|
||
|
||
#endif // PILOT_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>Form</class> | ||
<widget class="QWidget" name="Form"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>672</width> | ||
<height>465</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Form</string> | ||
</property> | ||
<widget class="QLCDNumber" name="SPEED_DISPLAY"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>170</x> | ||
<y>260</y> | ||
<width>211</width> | ||
<height>171</height> | ||
</rect> | ||
</property> | ||
</widget> | ||
<widget class="QLabel" name="Km_H_LABEL"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>390</x> | ||
<y>290</y> | ||
<width>221</width> | ||
<height>161</height> | ||
</rect> | ||
</property> | ||
<property name="text"> | ||
<string>Km/h</string> | ||
</property> | ||
</widget> | ||
<widget class="QProgressBar" name="HV_SOC_BAR"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>80</x> | ||
<y>20</y> | ||
<width>118</width> | ||
<height>23</height> | ||
</rect> | ||
</property> | ||
<property name="value"> | ||
<number>24</number> | ||
</property> | ||
</widget> | ||
<widget class="QProgressBar" name="LV_SOC_BAR"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>240</x> | ||
<y>20</y> | ||
<width>118</width> | ||
<height>23</height> | ||
</rect> | ||
</property> | ||
<property name="value"> | ||
<number>24</number> | ||
</property> | ||
</widget> | ||
<widget class="QLabel" name="HV_SOC_LABEL"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>110</x> | ||
<y>0</y> | ||
<width>67</width> | ||
<height>17</height> | ||
</rect> | ||
</property> | ||
<property name="text"> | ||
<string>SOC HV</string> | ||
</property> | ||
</widget> | ||
<widget class="QLabel" name="LV_SOC_LABEL"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>270</x> | ||
<y>0</y> | ||
<width>67</width> | ||
<height>17</height> | ||
</rect> | ||
</property> | ||
<property name="text"> | ||
<string>SOC LV</string> | ||
</property> | ||
</widget> | ||
<widget class="QProgressBar" name="POWER_SOC_BAR"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>410</x> | ||
<y>20</y> | ||
<width>118</width> | ||
<height>23</height> | ||
</rect> | ||
</property> | ||
<property name="value"> | ||
<number>10</number> | ||
</property> | ||
</widget> | ||
<widget class="QLabel" name="MAXPOWER_LABEL"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>420</x> | ||
<y>0</y> | ||
<width>91</width> | ||
<height>17</height> | ||
</rect> | ||
</property> | ||
<property name="text"> | ||
<string>MAX POWER</string> | ||
</property> | ||
</widget> | ||
<widget class="QLCDNumber" name="TEMP_DISPLAY"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>40</x> | ||
<y>130</y> | ||
<width>201</width> | ||
<height>91</height> | ||
</rect> | ||
</property> | ||
<property name="intValue" stdset="0"> | ||
<number>0</number> | ||
</property> | ||
</widget> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#ifndef PILOT_H | ||
#define PILOT_H | ||
|
||
#endif // PILOT_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.