SLIC  6.1.1
Simulation for the Linear Collider (SLIC) - Geant4 simulation application
SlicApplicationMessenger.cc
Go to the documentation of this file.
2 
3 // slic
4 #include "SlicApplication.hh"
5 #include "PackageInfo.hh"
6 
7 namespace slic {
8 
10  m_app = app;
12 }
13 
15 }
16 
17 void SlicApplicationMessenger::SetNewValue(G4UIcommand* cmd, G4String) {
18  if (cmd == m_interactive) {
20  } else if (cmd == m_slicVersion) {
22  } else if (cmd == m_slicUsage) {
23  m_app->printUsage();
24  } else if (cmd == m_quietMode) {
25  std::cout << "Quiet mode is enabled!" << std::endl;
26  std::cout.setstate(std::ios_base::failbit);
27  //ofstream file("/dev/null");
28  //std::cout.rdbuf(file.rdbuf());
29  // No more messages will be printed to cout for the remainder of the job!
30  } else {
31  m_app->log() << LOG::error << "Unknown command to SlicApplicationMessenger." << LOG::done;
32  }
33 }
34 
36  // interactive mode
37  m_interactive = new G4UIcommand("/control/interactive", this);
38  m_interactive->SetGuidance("Set interactive mode to G4 UI session. [SLIC]");
39 
40  // SLIC dir
41  m_slicDir = new G4UIdirectory("/slic/");
42  m_slicDir->SetGuidance("SLIC simulator commands. [SLIC]");
43 
44  // print SLIC usage
45  m_slicUsage = new G4UIcommand("/slic/usage", this);
46  m_slicUsage->SetGuidance("Print SLIC usage instructions.");
47 
48  // print SLIC version
49  m_slicVersion = new G4UIcommand("/slic/version", this);
50  m_slicVersion->SetGuidance("Print SLIC version information.");
51 
52  // quiet mode
53  m_quietMode = new G4UIcommand("/slic/quiet", this);
54  m_quietMode->SetGuidance("Run in quiet mode, suppressing all stdout console output.");
55 }
56 }
LogStream & log()
Definition: Module.hh:99
virtual void SetNewValue(G4UIcommand *cmd, G4String newVals)
SlicApplicationMessenger(SlicApplication *app)
Singleton class for a Geant4 application.
void setMode(ERunMode rmode)
@ error
Definition: LogStream.hh:33
@ endl
Definition: LogStream.hh:26
@ done
Definition: LogStream.hh:26