Просмотр исходного кода

Reset simple parameter values when the frontend is run.

Sascha Zelzer лет назад: 12
Родитель
Сommit
dde2adf42a
1 измененных файлов с 9 добавлено и 0 удалено
  1. 9 0
      Libs/CommandLineModules/Core/ctkCmdLineModuleFrontend.cpp

+ 9 - 0
Libs/CommandLineModules/Core/ctkCmdLineModuleFrontend.cpp

@@ -67,6 +67,15 @@ ctkCmdLineModuleFrontend::ctkCmdLineModuleFrontend(const ctkCmdLineModuleReferen
 void ctkCmdLineModuleFrontend::setFuture(const ctkCmdLineModuleFuture &future)
 {
   d->Future = future;
+  // Reset all simple output (return) parameter values
+  foreach(const ctkCmdLineModuleParameter& param, this->parameters(QString(), Output))
+  {
+    if (param.index() == 1000)
+    {
+      this->setValue(param.name(), param.defaultValue());
+    }
+  }
+
   d->FutureWatcher.setFuture(d->Future);
 }