From fc5d2aaeb1176afc1081e93ac0f8e1afc84dab87 Mon Sep 17 00:00:00 2001
From: Baptiste Mouginot <mouginot.baptiste@gmail.com>
Date: Thu, 24 Apr 2014 16:46:24 +0000
Subject: [PATCH] SaveAs fonctionnel ASCII XML

git-svn-id: svn+ssh://svn.in2p3.fr/class@243 0e7d625b-0364-4367-a6be-d5be4a48d228
---
 gui/trunk/CLASSRead.cxx | 26 +++++++++++++-------------
 gui/trunk/CLASSRead.hxx |  6 +++---
 gui/trunk/CLASSWin.cxx  |  4 ++--
 3 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/gui/trunk/CLASSRead.cxx b/gui/trunk/CLASSRead.cxx
index 550f91119..3de1545e0 100755
--- a/gui/trunk/CLASSRead.cxx
+++ b/gui/trunk/CLASSRead.cxx
@@ -1036,7 +1036,7 @@ void CLASSRead::ConvertxmlTTreeMass(vector<CLASSPlotElement> toplot, string file
 	else
 	{
 		f << "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" << endl;
-		f << "<file filename = \"test.xml\" created=\" \""<<endl;
+		f << "<file filename = \""<< filename << "\" created=\" \""<<endl;
 		f << "<unit time=\"years\"  Masse=\"kg\" power=\"MW\" />"<<endl;
                 f << "<material matid=\" \">"<<endl;
 		f << "\t<time>" << endl;
@@ -1452,43 +1452,43 @@ string CLASSRead::GetTittleOutName(CLASSPlotElement toplot)
 			switch (toplot.fFacylityNumber)
 		{
 			case 0:
-				name = "PARC "+ itoa(toplot.fTreeId) + "TOTAL " + itoa(toplot.fZAI.Z()) + " " + itoa(toplot.fZAI.A()) + " " + itoa(toplot.fZAI.I());
+				name = "PARC "+ itoa(toplot.fTreeId) + " TOTAL " + itoa(toplot.fZAI.Z()) + " " + itoa(toplot.fZAI.A()) + " " + itoa(toplot.fZAI.I());
 				return name;
 				break;
 				break;
 
 			case 1:
-				name = "PARC "+ itoa(toplot.fTreeId) +  "INCYCLE " + itoa(toplot.fZAI.Z()) + " " + itoa(toplot.fZAI.A()) + " " + itoa(toplot.fZAI.I());
+				name = "PARC "+ itoa(toplot.fTreeId) +  " INCYCLE " + itoa(toplot.fZAI.Z()) + " " + itoa(toplot.fZAI.A()) + " " + itoa(toplot.fZAI.I());
 				return name;
 				break;
 
 			case 2:
-				name = "PARC "+ itoa(toplot.fTreeId) +  "WASTE " + itoa(toplot.fZAI.Z()) + " " + itoa(toplot.fZAI.A()) + " " + itoa(toplot.fZAI.I());
+				name = "PARC "+ itoa(toplot.fTreeId) +  " WASTE " + itoa(toplot.fZAI.Z()) + " " + itoa(toplot.fZAI.A()) + " " + itoa(toplot.fZAI.I());
 				return name;
 				break;
 
 			case 3:
-				name = "PARC "+ itoa(toplot.fTreeId) +  "GOD " + itoa(toplot.fZAI.Z()) + " " + itoa(toplot.fZAI.A()) + " " + itoa(toplot.fZAI.I());
+				name = "PARC "+ itoa(toplot.fTreeId) +  " GOD " + itoa(toplot.fZAI.Z()) + " " + itoa(toplot.fZAI.A()) + " " + itoa(toplot.fZAI.I());
 				return name;
 				break;
 
 			case 4:
-				name = "PARC "+ itoa(toplot.fTreeId) +  "REACTOR " + itoa(toplot.fZAI.Z()) + " " + itoa(toplot.fZAI.A()) + " " + itoa(toplot.fZAI.I());
+				name = "PARC "+ itoa(toplot.fTreeId) +  " REACTOR " + itoa(toplot.fZAI.Z()) + " " + itoa(toplot.fZAI.A()) + " " + itoa(toplot.fZAI.I());
 				return name;
 				break;
 
 			case 5:
-				name = "PARC "+ itoa(toplot.fTreeId) +  "COOLING " + itoa(toplot.fZAI.Z()) + " " + itoa(toplot.fZAI.A()) + " " + itoa(toplot.fZAI.I());
+				name = "PARC "+ itoa(toplot.fTreeId) +  " COOLING " + itoa(toplot.fZAI.Z()) + " " + itoa(toplot.fZAI.A()) + " " + itoa(toplot.fZAI.I());
 				return name;
 				break;
 
 			case 6:
-				name = "PARC "+ itoa(toplot.fTreeId) +  "STOCK " + itoa(toplot.fZAI.Z()) + " " + itoa(toplot.fZAI.A()) + " " + itoa(toplot.fZAI.I());
+				name = "PARC "+ itoa(toplot.fTreeId) +  " STOCK " + itoa(toplot.fZAI.Z()) + " " + itoa(toplot.fZAI.A()) + " " + itoa(toplot.fZAI.I());
 				return name;
 				break;
 
 			case 7:
-				name = "PARC "+ itoa(toplot.fTreeId) +  "FUELFABRICATION " + itoa(toplot.fZAI.Z()) + " " + itoa(toplot.fZAI.A()) + " " + itoa(toplot.fZAI.I());
+				name = "PARC "+ itoa(toplot.fTreeId) +  " FUELFABRICATION " + itoa(toplot.fZAI.Z()) + " " + itoa(toplot.fZAI.A()) + " " + itoa(toplot.fZAI.I());
 				return name;
 				break;
 
@@ -1498,23 +1498,23 @@ string CLASSRead::GetTittleOutName(CLASSPlotElement toplot)
 			break;
 
 		case 1:
-			name = "PARC "+ itoa(toplot.fTreeId) +  "Reactor " + itoa(toplot.fFacylityNumber) + " " + itoa(toplot.fZAI.Z()) + " " + itoa(toplot.fZAI.A()) + " " + itoa(toplot.fZAI.I());
+			name = "PARC "+ itoa(toplot.fTreeId) +  " Reactor " + itoa(toplot.fFacylityNumber) + " " + itoa(toplot.fZAI.Z()) + " " + itoa(toplot.fZAI.A()) + " " + itoa(toplot.fZAI.I());
 			return name;
 			break;
 
 		case 2:
-			name = "PARC "+ itoa(toplot.fTreeId) +  "Storage " + itoa(toplot.fFacylityNumber) + " " + itoa(toplot.fZAI.Z()) + " " + itoa(toplot.fZAI.A()) + " " + itoa(toplot.fZAI.I());
+			name = "PARC "+ itoa(toplot.fTreeId) +  " Storage " + itoa(toplot.fFacylityNumber) + " " + itoa(toplot.fZAI.Z()) + " " + itoa(toplot.fZAI.A()) + " " + itoa(toplot.fZAI.I());
 			return name;
 			break;
 
 		case 3:
-			name = "PARC "+ itoa(toplot.fTreeId) +  "Cooling " + itoa(toplot.fFacylityNumber) + " " + itoa(toplot.fZAI.Z()) + " " + itoa(toplot.fZAI.A()) + " " + itoa(toplot.fZAI.I());
+			name = "PARC "+ itoa(toplot.fTreeId) +  " Cooling " + itoa(toplot.fFacylityNumber) + " " + itoa(toplot.fZAI.Z()) + " " + itoa(toplot.fZAI.A()) + " " + itoa(toplot.fZAI.I());
 			return name;
 
 			break;
 
 		case 4:
-			name = "PARC "+ itoa(toplot.fTreeId) +  "Fabrication " + itoa(toplot.fFacylityNumber) + " " + itoa(toplot.fZAI.Z()) + " " + itoa(toplot.fZAI.A()) + " " + itoa(toplot.fZAI.I());
+			name = "PARC "+ itoa(toplot.fTreeId) +  " Fabrication " + itoa(toplot.fFacylityNumber) + " " + itoa(toplot.fZAI.Z()) + " " + itoa(toplot.fZAI.A()) + " " + itoa(toplot.fZAI.I());
 			return name;
 			break;
 			
diff --git a/gui/trunk/CLASSRead.hxx b/gui/trunk/CLASSRead.hxx
index ef7e78994..73251e1ed 100755
--- a/gui/trunk/CLASSRead.hxx
+++ b/gui/trunk/CLASSRead.hxx
@@ -61,9 +61,9 @@ public :
 	void PlotTTreePower(vector<CLASSPlotElement> toplot, string opt = "L");
 
 	void ConvertxmlTTreeMass(vector<CLASSPlotElement> toplot, string filename);
-	void ConvertXmlMass(vector<CLASSPlotElement> toplot, string opt = "L");           
-	void ConvertxmlTTreePower(vector<CLASSPlotElement> toplotPower, string opt = "L");
-	void ConvertXmlPower(vector<CLASSPlotElement> toplotPower, string opt = "L");     
+	void ConvertXmlMass(vector<CLASSPlotElement> toplot, string opt);           
+	void ConvertxmlTTreePower(vector<CLASSPlotElement> toplotPower, string opt);
+	void ConvertXmlPower(vector<CLASSPlotElement> toplotPower, string opt );
 
 	void Write(string filename, string fileformat="ASCII");
 	void ASCIIWrite(string filename = "ASCII");
diff --git a/gui/trunk/CLASSWin.cxx b/gui/trunk/CLASSWin.cxx
index 5fa1bdffc..53c976073 100755
--- a/gui/trunk/CLASSWin.cxx
+++ b/gui/trunk/CLASSWin.cxx
@@ -515,7 +515,7 @@ void MainWin::Conversionxml()
 	}
 
 	if(toplot.size() != 0)
-		fDATA->ConvertXmlMass(toplot);
+		fDATA->ConvertXmlMass(toplot, fSaveFileName);
 	
 }
 
@@ -999,7 +999,7 @@ void SubWin::SaveAs()
  fSH1->AddFrame(TEName, fL0);
  TEName->Associate(this);
 
- fRadioASCIISave=new TGRadioButton(fSH1,"ASCII ou APIED (hihi)",M_RADIO_ASCII_SAVE);	
+ fRadioASCIISave=new TGRadioButton(fSH1,"ASCII",M_RADIO_ASCII_SAVE);	
  fRadioXMLSave=new TGRadioButton(fSH1,"XML",M_RADIO_XML_SAVE);
  fRadioASCIISave->SetState(kButtonDown);
  fRadioASCIISave->Associate(this); 
-- 
GitLab