Skip to content

Commit

Permalink
azs - replace COV labels with Dispersion
Browse files Browse the repository at this point in the history
  • Loading branch information
zsarnoczay committed Oct 1, 2022
1 parent 2dd7e40 commit a12250c
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 42 deletions.
32 changes: 16 additions & 16 deletions LossModel/PelicunComponentContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,11 +408,11 @@ PelicunComponentContainer::PelicunComponentContainer(QWidget *parent)
lblPOP_dist->setMinimumWidth(100);
loPGroup_header->addWidget(lblPOP_dist);
QLabel *lblPOP_cov = new QLabel();
lblPOP_cov->setText(" COV");
lblPOP_cov->setMaximumWidth(45);
lblPOP_cov->setMinimumWidth(45);
loPGroup_header->addWidget(lblPOP_cov);
QLabel *lblPOP_disp = new QLabel();
lblPOP_disp->setText(" Dispersion");
lblPOP_disp->setMaximumWidth(45);
lblPOP_disp->setMinimumWidth(45);
loPGroup_header->addWidget(lblPOP_disp);
QLabel *lblPOP_note = new QLabel();
lblPOP_note->setText(" Comment");
Expand Down Expand Up @@ -726,11 +726,11 @@ PelicunComponentContainer::PelicunComponentContainer(QWidget *parent)
lblQNT_dist->setMinimumWidth(100);
loCGroup_header->addWidget(lblQNT_dist);

QLabel *lblQNT_cov = new QLabel();
lblQNT_cov->setText(" COV");
lblQNT_cov->setMaximumWidth(45);
lblQNT_cov->setMinimumWidth(45);
loCGroup_header->addWidget(lblQNT_cov);
QLabel *lblQNT_disp = new QLabel();
lblQNT_disp->setText(" Disp.");
lblQNT_disp->setMaximumWidth(45);
lblQNT_disp->setMinimumWidth(45);
loCGroup_header->addWidget(lblQNT_disp);

QLabel *lblQNT_note = new QLabel();
lblQNT_note->setText(" Comment");
Expand Down Expand Up @@ -1559,10 +1559,10 @@ PelicunComponentContainer::loadComponentAssignment(QString filePath) {
CG_data -> insert("blocks", line_list[5]);
if (line_list.count() >= (8 + int(hasComment))) {
CG_data -> insert("family", line_list[6]);
CG_data -> insert("cov", line_list[7]);
CG_data -> insert("dispersion", line_list[7]);
} else {
CG_data -> insert("family", "");
CG_data -> insert("cov", "");
CG_data -> insert("dispersion", "");
}
CG_data -> insert("comment", line_list[line_list.count()-1]);
} else {
Expand Down Expand Up @@ -1636,7 +1636,7 @@ PelicunComponentContainer::saveComponentAssignment(QString filePath) {
stream << "\"" << CG_data -> value("median", tr("")) << "\",";
stream << "\"" << CG_data -> value("blocks", tr("")) << "\",";
stream << "\"" << CG_data -> value("family", tr("")) << "\",";
stream << "\"" << CG_data -> value("cov", tr("")) << "\",";
stream << "\"" << CG_data -> value("dispersion", tr("")) << "\",";
stream << "\"" << CG_data -> value("comment", tr("")) << "\"";
stream << "\n";
}
Expand Down Expand Up @@ -2001,10 +2001,10 @@ PelicunComponentContainer::inputFromJSON(QJsonObject &jsonObject)
CG_data -> insert("median", compInfo["median_quantity"].toString());
CG_data -> insert("unit", compInfo["unit"].toString());
CG_data -> insert("distribution", compInfo["distribution"].toString());
if (compInfo.contains("cov"))
CG_data -> insert("cov", compInfo["cov"].toString());
if (compInfo.contains("dispersion"))
CG_data -> insert("dispersion", compInfo["dispersion"].toString());
else
CG_data -> insert("cov", tr(""));
CG_data -> insert("dispersion", tr(""));
}
}
Expand Down
2 changes: 1 addition & 1 deletion LossModel/PelicunComponentContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public slots:
QLabel *compUnitType;

QComboBox *compQFamily;
QLineEdit *compQcov;
QLineEdit *compQDispersion;

QLineEdit *dir1Weights;
QLineEdit *dir2Weights;
Expand Down
22 changes: 11 additions & 11 deletions LossModel/PelicunComponentGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,16 @@ ComponentGroup::ComponentGroup(QWidget *parent, QMap<QString, QString> *CG_data_
this->storeCGDistribution();
connect(cgDistribution, SIGNAL(currentIndexChanged(int)), this, SLOT(storeCGDistribution()));

cgCOV = new QLineEdit();
cgCOV->setToolTip(tr("Coefficient of variation for the random distribution of \n"
"component quantities.\n"
cgDispersion = new QLineEdit();
cgDispersion->setToolTip(tr("Dispersion for the random distribution of component quantities\n"
"(cov for Normal, log std for Lognormal distribution)\n"
"If the distribution is set to N/A, this field will not \n"
"be considered and it can be left blank."));
cgCOV->setMaximumWidth(45);
cgCOV->setMinimumWidth(45);
cgCOV->setText(CG_data->value("cov", tr("")));
this->storeCGCOV();
connect(cgCOV, SIGNAL(editingFinished()), this, SLOT(storeCGCOV()));
cgDispersion->setMaximumWidth(45);
cgDispersion->setMinimumWidth(45);
cgDispersion->setText(CG_data->value("dispersion", tr("")));
this->storeCGDispersion();
connect(cgDispersion, SIGNAL(editingFinished()), this, SLOT(storeCGDispersion()));

cgComment = new QLineEdit();
cgComment->setToolTip(tr("Notes or comments about this entry.\n"
Expand All @@ -162,7 +162,7 @@ ComponentGroup::ComponentGroup(QWidget *parent, QMap<QString, QString> *CG_data_
mainLayout->addWidget(cgMedianQNT);
mainLayout->addWidget(cgBlocks);
mainLayout->addWidget(cgDistribution);
mainLayout->addWidget(cgCOV);
mainLayout->addWidget(cgDispersion);
mainLayout->addWidget(cgComment, 1);
//mainLayout->addWidget(button);
mainLayout->addStretch();
Expand Down Expand Up @@ -206,8 +206,8 @@ ComponentGroup::storeCGDistribution(){
}

void
ComponentGroup::storeCGCOV(){
CG_data -> insert("cov", cgCOV->text());
ComponentGroup::storeCGDispersion(){
CG_data -> insert("dispersion", cgDispersion->text());
}

void
Expand Down
4 changes: 2 additions & 2 deletions LossModel/PelicunComponentGroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public slots:
void storeCGBlocks(void);
void storeCGUnit(void);
void storeCGDistribution(void);
void storeCGCOV(void);
void storeCGDispersion(void);
void storeCGComment(void);

private:
Expand All @@ -119,7 +119,7 @@ public slots:
QLineEdit *cgBlocks;
QLineEdit *cgUnit;
QComboBox *cgDistribution;
QLineEdit *cgCOV;
QLineEdit *cgDispersion;
QLineEdit *cgComment;

QRadioButton *button; /*!< Button for selecting component */
Expand Down
20 changes: 10 additions & 10 deletions LossModel/PelicunPopulationGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,16 @@ PopulationGroup::PopulationGroup(QWidget *parent, QMap<QString, QString> *PG_dat
this->storePGDistribution();
connect(pgDistribution, SIGNAL(currentIndexChanged(int)), this, SLOT(storePGDistribution()));

pgCOV = new QLineEdit();
pgCOV->setToolTip(tr("Coefficient of variation for the random distribution of \n"
pgDispersion = new QLineEdit();
pgDispersion->setToolTip(tr("Coefficient of variation for the random distribution of \n"
"component quantities.\n"
"If the distribution is set to N/A, this field will not \n"
"be considered and it can be left blank."));
pgCOV->setMaximumWidth(45);
pgCOV->setMinimumWidth(45);
pgCOV->setText(PG_data->value("cov", tr("")));
this->storePGCOV();
connect(pgCOV, SIGNAL(editingFinished()), this, SLOT(storePGCOV()));
pgDispersion->setMaximumWidth(45);
pgDispersion->setMinimumWidth(45);
pgDispersion->setText(PG_data->value("dispersion", tr("")));
this->storePGDispersion();
connect(pgDispersion, SIGNAL(editingFinished()), this, SLOT(storePGDispersion()));

pgComment = new QLineEdit();
pgComment->setToolTip(tr("Notes or comments about this entry.\n"
Expand All @@ -120,7 +120,7 @@ PopulationGroup::PopulationGroup(QWidget *parent, QMap<QString, QString> *PG_dat
mainLayout->addWidget(pgLocation);
mainLayout->addWidget(pgMedianQNT);
mainLayout->addWidget(pgDistribution);
mainLayout->addWidget(pgCOV);
mainLayout->addWidget(pgDispersion);
mainLayout->addWidget(pgComment, 1);
mainLayout->addStretch();
mainLayout->setSpacing(10);
Expand Down Expand Up @@ -150,8 +150,8 @@ PopulationGroup::storePGDistribution(){
}

void
PopulationGroup::storePGCOV(){
PG_data -> insert("cov", pgCOV->text());
PopulationGroup::storePGDispersion(){
PG_data -> insert("dispersion", pgDispersion->text());
}

void
Expand Down
4 changes: 2 additions & 2 deletions LossModel/PelicunPopulationGroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public slots:
void storePGLocation(void);
void storePGMedian(void);
void storePGDistribution(void);
void storePGCOV(void);
void storePGDispersion(void);
void storePGComment(void);

private:
Expand All @@ -115,7 +115,7 @@ public slots:
QLineEdit *pgLocation;
QLineEdit *pgMedianQNT;
QComboBox *pgDistribution;
QLineEdit *pgCOV;
QLineEdit *pgDispersion;
QLineEdit *pgComment;

QHBoxLayout *mainLayout; /*!< Main layout for population */
Expand Down

0 comments on commit a12250c

Please sign in to comment.