set mussa analysis name in MussaSetupWidget
authorDiane Trout <diane@caltech.edu>
Sat, 29 Jul 2006 00:17:22 +0000 (00:17 +0000)
committerDiane Trout <diane@caltech.edu>
Sat, 29 Jul 2006 00:17:22 +0000 (00:17 +0000)
Without an analysis name the save code wouldn't save anything. This
also throws an error message when there isn't an analysis name.

And as a hack one can put a filename in the analysis name and actually
have it save to that location.

alg/mussa.cpp
qui/mussa_setup_dialog/MussaSetupWidget.cpp

index 44f9adb47b0726fd10874febad5a9fc6b1fef65e..68e7324bea578bf7d41c6f7cf6b2ed2962261738 100644 (file)
@@ -570,6 +570,8 @@ Mussa::save()
         append_info <<  "_sp_" << i << "v" << i2;
         all_comps[i][i2].save(save_path/(save_name+append_info.str()+".flp"));
       }
+  } else {
+    throw mussa_error("Can't save analysis without an analysis name");
   }
 }
 
index 63e9845274c6ed9c43c8ff9064d662dff27a332c..e029b119284c42f0ef0c20e0a5877cbd104ccdb7 100644 (file)
@@ -126,9 +126,11 @@ Mussa* MussaSetupWidget::getMussaObject()
 
   int win_size = windowLineEdit.text().toInt();
   int threshold = thresholdLineEdit.text().toInt();
+  std::string name = analysisNameLineEdit.text().toStdString();
   if (win_size == 0 or threshold == 0) {
     throw mussa_load_error("must set analysis parameters");
   } else {
+    mussa->set_name(name);
     mussa->set_window(win_size);
     mussa->set_threshold(threshold);
     mussa->set_analysis_mode(Mussa::TransitiveNway);