Changeset 147 for snovis/trunk/applications
- Timestamp:
- Feb 9, 2007, 9:23:17 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
snovis/trunk/applications/snovis_session.cc
r98 r147 14 14 // G4Lab : 15 15 #include <G4Lab/UIOnX.h> //UIOnX 16 16 17 #include "Environment.h" 18 #include <Lib/Out.h> 19 #include <Lib/sout.h> 20 #include <Lib/fmanip.h> 21 #include <Lib/dirmanip.h> 22 #include <Lib/smanip.h> 17 23 18 24 using namespace snova; … … 24 30 virtual ~mgr(){} 25 31 public: 26 void run_sim(int argc , char** argv ) {32 void run_sim(int argc , char** argv,const std::string& aGUI = "") { 27 33 G4UImanager* UI = G4UImanager::GetUIpointer(); 28 34 … … 39 45 G4UIsession* session = 40 46 new G4Lab::UIOnX(*runManager,gui,argc,argv); //UIOnX 47 session->createUI(aGUI); 41 48 session->SessionStart(); 42 49 delete session; … … 50 57 if(!check_envs(argv[0])) return 1; 51 58 52 //std::string params_filename = snova::constants::DEF_PARAMS_FILENAME; 59 Lib::Printer printer; 60 Lib::Out out(printer); 61 53 62 std::string SNOVISROOT; 54 63 if(!Lib::System::getenv("SNOVISROOT",SNOVISROOT)) { 55 G4cout << "snovis_session :"56 57 << G4endl;64 out << "snovis_session :" 65 << " Environment variable SNOVISROOT not defined." 66 << Lib::endl; 58 67 return 1; 59 68 } 69 70 if(!Lib::dirmanip::goHome()) { 71 out << "snovis_session : can't go home." << Lib::endl; 72 return 1; 73 } else if(!Lib::dirmanip::mkcd("OpenScientist")) { 74 out << "snovis_session : can't mkcd OpenScientist." << Lib::endl; 75 return 1; 76 } else if(!Lib::dirmanip::mkcd("snovis")) { 77 out << "snovis_session : can't mkcd snovis." << Lib::endl; 78 return 1; 79 } else if(!Lib::dirmanip::mkcd("session")) { 80 out << "snovis_session : can't mkcd session." << Lib::endl; 81 return 1; 82 } else { 83 std::string fs = Lib::System::fileSeparator(); 84 std::string from = SNOVISROOT+fs+"scripts"+fs+"snova"; 85 if(!Lib::fmanip::copy(from+fs+"snova.par",".")) { 86 out << "snovis_session : can't copy snova.par." << Lib::endl; 87 return 1; 88 } else if(!Lib::fmanip::copy(from+fs+"snemo.geom",".")) { 89 out << "snovis_session : can't copy snemo.geom." << Lib::endl; 90 return 1; 91 } else if(!Lib::fmanip::copy(from+fs+"example_Mo100.txt",".")) { 92 out << "snovis_session : can't copy example_Mo100.txt." << Lib::endl; 93 return 1; 94 } else { 95 //std::string pwd; 96 //Lib::dirmanip::directory(pwd); 97 //out << pwd << Lib::endl; 98 } 99 } 100 101 bool is_Mac_app = Lib::main::isMacApp(aArgv[0]); 60 102 61 103 int error_code=EXIT_SUCCESS; … … 65 107 66 108 bool debug = false; 67 //std::string params_filename = snova::constants::DEF_PARAMS_FILENAME;68 std::string params_filename = SNOVISROOT+"/scripts/snova.par";109 std::string params_filename = snova::constants::DEF_PARAMS_FILENAME; 110 //std::string params_filename = SNOVISROOT+"/scripts/snova.par"; 69 111 //G4String geom_filename = SNOVISROOT+"/scripts/snemo.geom"; 70 112 std::string G4_macro = ""; … … 99 141 std::cerr << "prog_snova2: debug: " 100 142 << "Run the simulation" << std::endl; 101 my_snova_mgr.run_sim(argc,argv );143 my_snova_mgr.run_sim(argc,argv,is_Mac_app?"Qt":""); 102 144 103 145 // Clean the snova manager
Note: See TracChangeset
for help on using the changeset viewer.