Coupled backlog

This commit is contained in:
Anne de Jong 2017-01-05 16:37:15 +01:00
parent e255b9e2c9
commit 7edd65fa0d
4 changed files with 12 additions and 5 deletions

View File

@ -165,7 +165,7 @@ void TaSMETMainWindow::saveModel(string* filepath) {
filepath = &_filepath;
}
try {
saveMessage(*filepath,_model);
saveMessage<pb::Model>(*filepath,_model);
_filepath = *filepath;
changed();
}
@ -252,6 +252,8 @@ void TaSMETMainWindow::changed() {
_window->removesegment->setEnabled(is_segment);
_window->segmenttype->setEnabled(!is_segment);
QString backlog = _window->backlog->toPlainText();
*_model.mutable_backlog() = backlog.toStdString();
}
void TaSMETMainWindow::set(const pb::Model& model) {
@ -266,6 +268,8 @@ void TaSMETMainWindow::set(const pb::Model& model) {
_window->systemtype->setCurrentIndex((int) sys.systemtype());
_window->gastype->setCurrentIndex((int) sys.gastype());
_window->backlog->setPlainText(QString::fromStdString(model.backlog()));
_model = model;
_system = *_model.mutable_system();
_init = false;

View File

@ -72,6 +72,9 @@ private slots:
void on_T0_textEdited() {changed();}
void on_p0_textEdited() {changed();}
void on_systemtype_currentIndexChanged(int) {changed();}
void on_backlog_textChanged() {changed();}
};

View File

@ -272,7 +272,7 @@
</property>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QPlainTextEdit" name="plainTextEdit_3">
<widget class="QPlainTextEdit" name="backlog">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Maximum">
<horstretch>0</horstretch>

View File

@ -6,10 +6,10 @@ import "solver.proto";
message Model {
required System system = 1;
required SolverParams sparams = 2;
optional System system = 1;
optional SolverParams sparams = 2;
optional string backlog = 3 [default="Type your info here"];
optional string backlog = 3 [default="Type your info here..."];
repeated double solution = 4;