-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(Incomplete) code for battery-backed memory display
- Loading branch information
1 parent
15a395b
commit e3ffac9
Showing
9 changed files
with
253 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include "ui_batterybackeddisplay.h" | ||
#include "batterybackeddisplay.h" | ||
|
||
/** | ||
* Constructor | ||
*/ | ||
BatteryBackedDisplay::BatteryBackedDisplay(QString title, QByteArray *batteryBackedMemory, uint16_t startOffset, QWidget* parent) : QDialog(parent), | ||
m_ui(new Ui::BatteryBackedDisplay) | ||
{ | ||
m_ui->setupUi(this); | ||
this->setLayout(m_ui->m_mainLayout); | ||
|
||
this->setWindowTitle(title); | ||
|
||
QTableWidgetItem* item; | ||
|
||
for (unsigned int idx = 0; idx < batteryBackedMemory->size(); ++idx) | ||
{ | ||
m_ui->m_batteryBackedTable->insertRow(idx); | ||
|
||
item = new QTableWidgetItem(QString("%1").arg(startOffset + idx, 0, 16).toUpper()); | ||
m_ui->m_batteryBackedTable->setItem(idx, 0, item); | ||
item = new QTableWidgetItem(QString("%1").arg(batteryBackedMemory->at(idx), 0, 16).toUpper()); | ||
m_ui->m_batteryBackedTable->setItem(idx, 1, item); | ||
} | ||
} | ||
|
||
void BatteryBackedDisplay::refresh() | ||
{ | ||
//TODO | ||
} |
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,27 @@ | ||
#ifndef BATTERYBACKEDDISPLAY_H | ||
#define BATTERYBACKEDDISPLAY_H | ||
|
||
#include <QDialog> | ||
#include <QByteArray> | ||
|
||
namespace Ui | ||
{ | ||
class BatteryBackedDisplay; | ||
} | ||
|
||
class BatteryBackedDisplay : public QDialog | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
BatteryBackedDisplay(QString title, QByteArray* batteryBackedMemory, uint16_t startOffset, QWidget* parent = 0); | ||
|
||
private slots: | ||
void refresh(); | ||
|
||
private: | ||
Ui::BatteryBackedDisplay* m_ui; | ||
}; | ||
|
||
#endif // BATTERYBACKEDDISPLAY_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,91 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>BatteryBackedDisplay</class> | ||
<widget class="QDialog" name="BatteryBackedDisplay"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>350</width> | ||
<height>300</height> | ||
</rect> | ||
</property> | ||
<property name="sizePolicy"> | ||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> | ||
<horstretch>0</horstretch> | ||
<verstretch>0</verstretch> | ||
</sizepolicy> | ||
</property> | ||
<property name="maximumSize"> | ||
<size> | ||
<width>350</width> | ||
<height>300</height> | ||
</size> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Options</string> | ||
</property> | ||
<widget class="QWidget" name="layoutWidget"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>10</x> | ||
<y>10</y> | ||
<width>331</width> | ||
<height>302</height> | ||
</rect> | ||
</property> | ||
<layout class="QGridLayout" name="m_mainLayout"> | ||
<property name="leftMargin"> | ||
<number>20</number> | ||
</property> | ||
<property name="topMargin"> | ||
<number>20</number> | ||
</property> | ||
<property name="rightMargin"> | ||
<number>20</number> | ||
</property> | ||
<property name="bottomMargin"> | ||
<number>20</number> | ||
</property> | ||
<item row="1" column="0" colspan="2"> | ||
<widget class="Line" name="m_horizontalLineC"> | ||
<property name="orientation"> | ||
<enum>Qt::Horizontal</enum> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="2" column="1"> | ||
<widget class="QPushButton" name="m_closeButton"> | ||
<property name="text"> | ||
<string>Close</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="2" column="0"> | ||
<widget class="QPushButton" name="m_refreshButton"> | ||
<property name="text"> | ||
<string>Refresh</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="0" column="0" colspan="2"> | ||
<widget class="QTableWidget" name="m_batteryBackedTable"> | ||
<column> | ||
<property name="text"> | ||
<string>Offset</string> | ||
</property> | ||
</column> | ||
<column> | ||
<property name="text"> | ||
<string>Value</string> | ||
</property> | ||
</column> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
</widget> | ||
<layoutdefault spacing="6" margin="11"/> | ||
<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
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
Oops, something went wrong.