diff --git a/app/HGProductionTool/dialog_userinput.cpp b/app/HGProductionTool/dialog_userinput.cpp index a83e524..8fcdbf3 100644 --- a/app/HGProductionTool/dialog_userinput.cpp +++ b/app/HGProductionTool/dialog_userinput.cpp @@ -7,8 +7,7 @@ Dialog_UserInput::Dialog_UserInput(ui_helper::value_type type, const QString &ti QDialog(parent), ui(new Ui::Dialog_UserInput), m_type(type), - m_title(title), - m_desc(desc) + m_title(title) { ui->setupUi(this); @@ -18,23 +17,25 @@ Dialog_UserInput::Dialog_UserInput(ui_helper::value_type type, const QString &ti ui->comboBox->setVisible(false); if (type == ui_helper::VAL_TYPE_BOOL) { - ui->label->setText(QString::fromStdWString(m_desc)); + ui->label->setText(QString::fromStdWString(desc)); ui->radioButton_yes->setVisible(true); ui->radioButton_no->setVisible(true); } else if (type == ui_helper::VAL_TYPE_INT || type == ui_helper::VAL_TYPE_FLOAT || type == ui_helper::VAL_TYPE_STRING) { - ui->label->setText(QString::fromStdWString(m_desc)); + ui->label->setText(QString::fromStdWString(desc)); ui->lineEdit->setVisible(true); } - else if (type == ui_helper::VAL_TYPE_RANGE) + else if (type == ui_helper::VAL_TYPE_TIPS_VAL) { - while(*m_desc != '\0') + ui_helper::PINFOTIPS p = (ui_helper::PINFOTIPS)desc; + while(*(p->desc) != '\0') { - ui->comboBox->addItem(QString::number(*m_desc)); - m_desc++; + ui->comboBox->addItem(QString::number(*(p->desc))); + p->desc++; } + ui->label->setText(QString::fromStdWString(p->info)); ui->comboBox->setVisible(true); } @@ -75,7 +76,7 @@ parameter *Dialog_UserInput::getParam() { param->m_sData = ui->lineEdit->text().toStdWString(); } - else if (m_type == ui_helper::VAL_TYPE_RANGE) + else if (m_type == ui_helper::VAL_TYPE_TIPS_VAL) { param->m_iData = ui->comboBox->currentText().toInt(); } @@ -115,7 +116,7 @@ size_t UserInputParams::get_size() { if (m_type == ui_helper::VAL_TYPE_BOOL) return sizeof(bool); - if (m_type == ui_helper::VAL_TYPE_INT || m_type == ui_helper::VAL_TYPE_RANGE) + if (m_type == ui_helper::VAL_TYPE_INT || m_type == ui_helper::VAL_TYPE_TIPS_VAL) return sizeof(int); if (m_type == ui_helper::VAL_TYPE_FLOAT) return sizeof(double); @@ -128,7 +129,7 @@ void *UserInputParams::get_data() { if (m_type == ui_helper::VAL_TYPE_BOOL) return &m_bData; - if (m_type == ui_helper::VAL_TYPE_INT || m_type == ui_helper::VAL_TYPE_RANGE) + if (m_type == ui_helper::VAL_TYPE_INT || m_type == ui_helper::VAL_TYPE_TIPS_VAL) return &m_iData; if (m_type == ui_helper::VAL_TYPE_FLOAT) return &m_fData; diff --git a/app/HGProductionTool/dialog_userinput.h b/app/HGProductionTool/dialog_userinput.h index 52a156f..65609c0 100644 --- a/app/HGProductionTool/dialog_userinput.h +++ b/app/HGProductionTool/dialog_userinput.h @@ -45,7 +45,6 @@ private: ui_helper::value_type m_type; QString m_title; - const wchar_t *m_desc; }; #endif // DIALOG_USERINPUT_H diff --git a/app/HGProductionTool/ui_helper.h b/app/HGProductionTool/ui_helper.h index cd4fc3d..d2862e0 100644 --- a/app/HGProductionTool/ui_helper.h +++ b/app/HGProductionTool/ui_helper.h @@ -68,15 +68,14 @@ public: VAL_TYPE_BOOL = 0, VAL_TYPE_INT, VAL_TYPE_FLOAT, - VAL_TYPE_STRING, - VAL_TYPE_RANGE, + VAL_TYPE_STRING, VAL_TYPE_CUSTOM, // custom data, such as gamma table ... VAL_TYPE_TIPS_VAL, // status info tips and data info }; typedef struct _info// value_type == VAL_TUPE_TIPS { - const wchar_t* desc; // desc is int + const wchar_t* desc; //data const wchar_t* info; //info tips }_INFOTIPS, * PINFOTIPS; // get testing parameter ...