-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes to the ParameterView, so it now operates properly based off i…
…ncoming ConfigData rather than ConfigBlocks
- Loading branch information
1 parent
ae9404c
commit 01c6541
Showing
16 changed files
with
370 additions
and
43 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,44 @@ | ||
#include "comboparam.h" | ||
#include "ui_comboparam.h" | ||
|
||
ComboParam::ComboParam(QWidget *parent) : | ||
QWidget(parent), | ||
ui(new Ui::ComboParam) | ||
{ | ||
ui->setupUi(this); | ||
connect(ui->comboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(currentIndexChanged(int))); | ||
} | ||
|
||
ComboParam::~ComboParam() | ||
{ | ||
delete ui; | ||
} | ||
void ComboParam::setName(QString name) | ||
{ | ||
ui->label->setText(name); | ||
} | ||
|
||
void ComboParam::setConfig(ConfigData *data) | ||
{ | ||
disconnect(ui->comboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(currentIndexChanged(int))); | ||
ui->comboBox->addItems(data->getEnumValues()); | ||
ui->comboBox->setCurrentIndex(data->value().toInt()); | ||
m_data = data; | ||
connect(ui->comboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(currentIndexChanged(int))); | ||
} | ||
|
||
void ComboParam::saveValue() | ||
{ | ||
//m_data->setValue(ui->comboBox->currentIndex()); | ||
m_data->saveToFlash(); | ||
} | ||
void ComboParam::dataUpdate() | ||
{ | ||
disconnect(ui->comboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(currentIndexChanged(int))); | ||
ui->comboBox->setCurrentIndex(m_data->value().toInt()); | ||
connect(ui->comboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(currentIndexChanged(int))); | ||
} | ||
void ComboParam::currentIndexChanged(int index) | ||
{ | ||
m_data->setValue(index); | ||
} |
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 COMBOPARAM_H | ||
#define COMBOPARAM_H | ||
|
||
#include <QWidget> | ||
#include "configdata.h" | ||
|
||
namespace Ui { | ||
class ComboParam; | ||
} | ||
|
||
class ComboParam : public QWidget | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit ComboParam(QWidget *parent = 0); | ||
~ComboParam(); | ||
void setName(QString name); | ||
void setConfig(ConfigData *data); | ||
void saveValue(); | ||
private slots: | ||
void dataUpdate(); | ||
void currentIndexChanged(int index); | ||
private: | ||
Ui::ComboParam *ui; | ||
ConfigData *m_data; | ||
}; | ||
|
||
#endif // COMBOPARAM_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,31 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>ComboParam</class> | ||
<widget class="QWidget" name="ComboParam"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>354</width> | ||
<height>81</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Form</string> | ||
</property> | ||
<layout class="QHBoxLayout" name="horizontalLayout"> | ||
<item> | ||
<widget class="QLabel" name="label"> | ||
<property name="text"> | ||
<string>TextLabel</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QComboBox" name="comboBox"/> | ||
</item> | ||
</layout> | ||
</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
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.