[GME-commit] GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep Dumper.cpp,1.19,1.20

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Wed Jun 30 13:55:22 CDT 2004


Update of /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep
In directory braindrain:/tmp/cvs-serv23547/Rep

Modified Files:
	Dumper.cpp 
Log Message:
Interpreter silent running mode introduced.


CVS User: zolmol

Index: Dumper.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/Dumper.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** Dumper.cpp	22 Jun 2004 21:07:52 -0000	1.19
--- Dumper.cpp	30 Jun 2004 17:55:19 -0000	1.20
***************
*** 632,636 ****
  	}
  
! 	if ( i != 0 && theAspectDlg->DoModal() == IDOK) 
  	{
  		CWaitCursor wait;
--- 632,645 ----
  	}
  
! 	int dlg_res = IDOK;
! #ifdef NOUSERINPUT
! 	{ }
! #else
! 	if( global_vars.silent_mode)
! 	{ }
! 	else
! 		dlg_res = theAspectDlg->DoModal();
! #endif
! 	if ( i != 0 && dlg_res == IDOK) 
  	{
  		CWaitCursor wait;
***************
*** 799,803 ****
  	std::string mmm= "<?xml version=\"1.0\"?>\n<!DOCTYPE paradigm SYSTEM \"edf.dtd\">"
  	"\n\n<paradigm name =\"" + m_projName + "\">\n\n"
!    + "   <comment> Generated by the MetaGME2004 interpreter </comment>\n\n";
  
  	DMP( mmm); mmm = "";
--- 808,812 ----
  	std::string mmm= "<?xml version=\"1.0\"?>\n<!DOCTYPE paradigm SYSTEM \"edf.dtd\">"
  	"\n\n<paradigm name =\"" + m_projName + "\">\n\n"
! 	+ "\t<comment> Generated by the MetaGME2004 interpreter </comment>\n\n";
  
  	DMP( mmm); mmm = "";
***************
*** 1350,1354 ****
  	g.addAspects( dlg_aspects_init_order );
  
! 	if ( g.DoModal() == IDOK)
  	{
  		const std::string path( "/" + AspectRep::m_aspectRegistryRoot + aspect_order_registry_token);
--- 1359,1376 ----
  	g.addAspects( dlg_aspects_init_order );
  
! 	int dlg_res;// = IDCANCEL; // use the metamodel values (since the OnInitDialog and OnOk make some important jobs
! #ifdef NOUSERINPUT
! 	g.m_resultAspects = dlg_aspects_init_order;
! 	dlg_res = IDOK;
! #else
! 	if( global_vars.silent_mode)
! 	{
! 		g.m_resultAspects = dlg_aspects_init_order;
! 		dlg_res = IDOK;
! 	}
! 	else
! 		dlg_res = g.DoModal();
! #endif
! 	if ( dlg_res == IDOK)
  	{
  		const std::string path( "/" + AspectRep::m_aspectRegistryRoot + aspect_order_registry_token);
***************
*** 1466,1470 ****
  			else {
  				if (multip < 0) {
- 					//AfxMessageBox("Multiplicity is negative: " + contextDesc, MB_ICONEXCLAMATION);
  					global_vars.err << "Error: Multiplicity is negative: " << contextDesc << "\n";
  				}
--- 1488,1491 ----
***************
*** 1490,1494 ****
  			else {
  				if (multipmin < 0) {
- 					//AfxMessageBox("Minimum multiplicity is negative: " + contextDesc, MB_ICONEXCLAMATION);
  					global_vars.err << "Error: Minimum multiplicity is negative: " << contextDesc << "\n";
  				}
--- 1511,1514 ----
***************
*** 1518,1526 ****
  				andexpr2 += ")";
  				if (multipmax < 0) {
- 					//AfxMessageBox("Maximum multiplicity is negative: " + contextDesc, MB_ICONEXCLAMATION);
  					global_vars.err << "Error: Maximum multiplicity is negative: " << contextDesc << "\n";
  				}
  				if (multipmax < multipmin) {
- 					//AfxMessageBox("Minimum multiplicity > Maximum multiplicity : " + contextDesc, MB_ICONEXCLAMATION);
  					global_vars.err << "Error: Minimum multiplicity > Maximum multiplicity : " << contextDesc << "\n";
  				}
--- 1538,1544 ----
***************
*** 1567,1585 ****
  		global_vars.err_file_name = global_vars.xmp_file_name + ".log";
  		CString def_name = global_vars.xmp_file_name.c_str();
! 		CWaitCursor w;
! 		CFileDialog dlg(FALSE, "xmp", def_name,
! 			OFN_EXPLORER | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
! 			"XML Paradigm Files (*.xmp)|*.xmp|");
! 		if( dlg.DoModal() == IDOK) 
  		{
! 			CString filename = dlg.GetPathName();
! 			global_vars.xmp_file_name = (LPCTSTR) filename;
! 			global_vars.err_file_name = global_vars.xmp_file_name + ".log";
  		}
! 		else  // IDCANCEL , using default name
  		{
! 			//global_vars.xmp_file_name = 
! 			return 4;
  		}
  	}	catch (...)	{
  		global_vars.err << "Exception caught! Using default filenames.\n";
--- 1585,1618 ----
  		global_vars.err_file_name = global_vars.xmp_file_name + ".log";
  		CString def_name = global_vars.xmp_file_name.c_str();
! #ifdef NOUSERINPUT
! 		global_vars.xmp_file_name = "c:\\temp\\" + global_vars.xmp_file_name;
! 		global_vars.err_file_name = "c:\\temp\\" + global_vars.err_file_name;
! #else
! 		if( global_vars.silent_mode)
  		{
! 			global_vars.xmp_file_name = "c:\\temp\\" + global_vars.xmp_file_name;
! 			global_vars.err_file_name = "c:\\temp\\" + global_vars.err_file_name;
  		}
! 		else
  		{
! 			CWaitCursor w;
! 			CFileDialog dlg(FALSE, "xmp", def_name,
! 				OFN_EXPLORER | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
! 				"XML Paradigm Files (*.xmp)|*.xmp|");
! 			int dlg_res = IDOK;
! 			dlg_res = dlg.DoModal();
! 			if( dlg_res == IDOK) 
! 			{
! 				CString filename = dlg.GetPathName();
! 				global_vars.xmp_file_name = (LPCTSTR) filename;
! 				global_vars.err_file_name = global_vars.xmp_file_name + ".log";
! 			}
! 			else  // IDCANCEL , using default name
! 			{
! 				//global_vars.xmp_file_name = 
! 				return 4;
! 			}
  		}
+ #endif
  	}	catch (...)	{
  		global_vars.err << "Exception caught! Using default filenames.\n";
***************
*** 1592,1596 ****
  /*static*/ void Dumper::registerIt( const std::string& f_name)
  {
! 	if ( AfxMessageBox( "Successfully generated " + CString(f_name.c_str()) + "\n\nWould you like to register your new paradigm ?", MB_YESNO | MB_ICONINFORMATION) == IDYES) 
  	{
  		CWaitCursor wait;
--- 1625,1640 ----
  /*static*/ void Dumper::registerIt( const std::string& f_name)
  {
! 	int res = IDYES;
! 
! #ifdef NOUSERINPUT
! 	TO( "Successfully generated " + CString(f_name.c_str()));
! #else
! 	if( global_vars.silent_mode)
! 		TO( "Successfully generated " + CString(f_name.c_str()));
! 	else
! 		res = AfxMessageBox( "Successfully generated " + CString(f_name.c_str()) + "\n\nWould you like to register your new paradigm ?", MB_YESNO | MB_ICONINFORMATION);
! #endif
! 
! 	if ( res == IDYES) 
  	{
  		CWaitCursor wait;
***************
*** 1602,1606 ****
  		}
  		if (FAILED(hr)) {
! 			AfxMessageBox("Error occured while registering new paradigm.", MB_ICONSTOP | MB_OK);
  		}
  	}
--- 1646,1658 ----
  		}
  		if (FAILED(hr)) {
! 
! #ifdef NOUSERINPUT
! 			TO("Error occured while registering new paradigm.");
! #else
! 			if( global_vars.silent_mode)
! 				TO("Error occured while registering new paradigm.");
! 			else
! 				AfxMessageBox("Error occured while registering new paradigm.", MB_ICONSTOP | MB_OK);
! #endif
  		}
  	}



More information about the GME-commit mailing list