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; filepath = &_filepath;
} }
try { try {
saveMessage(*filepath,_model); saveMessage<pb::Model>(*filepath,_model);
_filepath = *filepath; _filepath = *filepath;
changed(); changed();
} }
@ -252,6 +252,8 @@ void TaSMETMainWindow::changed() {
_window->removesegment->setEnabled(is_segment); _window->removesegment->setEnabled(is_segment);
_window->segmenttype->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) { 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->systemtype->setCurrentIndex((int) sys.systemtype());
_window->gastype->setCurrentIndex((int) sys.gastype()); _window->gastype->setCurrentIndex((int) sys.gastype());
_window->backlog->setPlainText(QString::fromStdString(model.backlog()));
_model = model; _model = model;
_system = *_model.mutable_system(); _system = *_model.mutable_system();
_init = false; _init = false;

View File

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

View File

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

View File

@ -6,10 +6,10 @@ import "solver.proto";
message Model { message Model {
required System system = 1; optional System system = 1;
required SolverParams sparams = 2; 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; repeated double solution = 4;