BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
ProjectMessenger Class Reference

#include <ProjectMessenger.h>

Inheritance diagram for ProjectMessenger:

Public Member Functions

 ProjectMessenger (Goofy *v)
 ~ProjectMessenger ()
void SetNewValue (G4UIcommand *command, G4String newValues)
G4String GetCurrentValue (G4UIcommand *command)

Detailed Description

Definition at line 10 of file ProjectMessenger.h.

Constructor & Destructor Documentation

◆ ProjectMessenger()

ProjectMessenger::ProjectMessenger ( Goofy * v)

Definition at line 40 of file ProjectMessenger.cpp.

40 {
41 rm = v;
42
43 make = new G4UIcommand( "/Project/make", this );
44 make->SetGuidance( "Builds the specified project" );
45 G4UIparameter* parameter;
46 G4bool omitable;
47 parameter = new G4UIparameter( "Project", 's', omitable = false );
48 make->SetParameter( parameter );
49
50 create = new G4UIcommand( "/Project/create", this );
51 create->SetGuidance( "Creates an empty project" );
52 parameter = new G4UIparameter( "Project", 's', omitable = false );
53 create->SetParameter( parameter );
54
55 del = new G4UIcommand( "/Project/delete", this );
56 del->SetGuidance( "Deletes a project" );
57 parameter = new G4UIparameter( "Project", 's', omitable = false );
58 del->SetParameter( parameter );
59
60 geo = new G4UIcommand( "/Project/add/DetectorFacility", this );
61 geo->SetGuidance( "Generates sample code for a detector facility in a project" );
62 parameter = new G4UIparameter( "Project", 's', omitable = false );
63 geo->SetParameter( parameter );
64
65 G4UIparameter* parameter2;
66 parameter2 = new G4UIparameter( "DetectorFacilityName", 's', omitable = false );
67 geo->SetParameter( parameter2 );
68
69 act = new G4UIcommand( "/Project/add/UserAction", this );
70 act->SetGuidance( "Generates sample code for an user action in a project" );
71 parameter = new G4UIparameter( "Project", 's', omitable = false );
72 act->SetParameter( parameter );
73
74 G4UIparameter* parameter3;
75 parameter3 = new G4UIparameter( "UserAction Name", 's', omitable = false );
76 act->SetParameter( parameter3 );
77}
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition KarLud.h:35

◆ ~ProjectMessenger()

ProjectMessenger::~ProjectMessenger ( )

Definition at line 79 of file ProjectMessenger.cpp.

79 {
80 // delete make;
81 // delete create;
82 // delete del;
83 // delete geo;
84 // delete act;
85}

Member Function Documentation

◆ GetCurrentValue()

G4String ProjectMessenger::GetCurrentValue ( G4UIcommand * command)

Definition at line 154 of file ProjectMessenger.cpp.

154 {
155 G4String s = "Undefined";
156 return s;
157}
XmlRpcServer s

◆ SetNewValue()

void ProjectMessenger::SetNewValue ( G4UIcommand * command,
G4String newValues )

Definition at line 87 of file ProjectMessenger.cpp.

87 {
88 if ( command == make ) { Goofy::Shell( "cd " + newValues + "; gmake" ); }
89 else if ( command == create )
90 {
91 Goofy::Shell( "mkdir " + newValues );
92 Goofy::Shell( "mkdir " + newValues + "/src" );
93 Goofy::Shell( "mkdir " + newValues + "/include" );
94 Goofy::Shell( "touch " + newValues + "/src/dummy.cc" );
95 std::cout << "Looking for " << std::flush;
96 if ( Goofy::Shell( "find $FADS_CURRENT/config -name GNUmakefile_template" ) == 0 )
97 {
98 std::cout << " Found! " << std::endl;
99 Goofy::Shell( "cp $FADS_CURRENT/config/GNUmakefile_template " + newValues +
100 "/GNUmakefile" );
101 }
102 Goofy::Shell( "chmod -R 755 " + newValues );
103 }
104 else if ( command == del )
105 {
106 if ( Goofy::Shell( "find . -name " + newValues ) ) Goofy::Shell( "rm -rf " + newValues );
107 }
108 else if ( command == geo )
109 {
110 G4String detName, project;
111 const char* s = newValues;
112 std::istrstream is( (char*)s );
113 is >> project >> detName;
114
115 if ( Goofy::Shell( "find . -name " + project ) == 0 )
116 {
117 std::string where = "$FADS_CURRENT/config/";
118 std::string incl = project + "/include/";
119 std::string src = project + "/src/";
120 Goofy::Shell( "cp " + where + "DetectorFacilityTemplate.hh " + incl );
121 parseTemplate( incl, "DetectorFacilityTemplate.hh", detName );
122 Goofy::Shell( "mv " + incl + detName + ".temp " + incl + +detName + "Facility.hh" );
123 Goofy::Shell( "rm -f " + incl + "DetectorFacilityTemplate.hh" );
124 Goofy::Shell( "cp " + where + "DetectorFacilityTemplate.cc " + src );
125 parseTemplate( src, "DetectorFacilityTemplate.cc", detName );
126 Goofy::Shell( "mv " + src + detName + ".temp " + src + +detName + "Facility.cc" );
127 Goofy::Shell( "rm -f " + src + "DetectorFacilityTemplate.cc" );
128 }
129 }
130 else if ( command == act )
131 {
132 G4String actName, project;
133 const char* s = newValues;
134 std::istrstream is( (char*)s );
135 is >> project >> actName;
136
137 if ( Goofy::Shell( "find . -name " + project ) == 0 )
138 {
139 std::string where = "$FADS_CURRENT/config/";
140 std::string incl = project + "/include/";
141 std::string src = project + "/src/";
142 Goofy::Shell( "cp " + where + "UserActionTemplate.hh " + incl );
143 parseTemplate( incl, "UserActionTemplate.hh", actName );
144 Goofy::Shell( "mv " + incl + actName + ".temp " + incl + +actName + "Action.hh" );
145 Goofy::Shell( "rm -f " + incl + "UserActionTemplate.hh" );
146 Goofy::Shell( "cp " + where + "UserActionTemplate.cc " + src );
147 parseTemplate( src, "UserActionTemplate.cc", actName );
148 Goofy::Shell( "mv " + src + actName + ".temp " + src + +actName + "Action.cc" );
149 Goofy::Shell( "rm -f " + src + "UserActionTemplate.cc" );
150 }
151 }
152}
void parseTemplate(std::string dir, std::string filename, std::string dname)
static int Shell(std::string s)
Definition Goofy.cpp:58

The documentation for this class was generated from the following files: