#include "BeamlineConstructionMessenger.hh" #include "BeamlineConstruction.hh" #include "G4UIdirectory.hh" #include "G4UIcmdWithAnInteger.hh" #include "G4UIcmdWithADoubleAndUnit.hh" #include "G4UIcmdWithAString.hh" #include "G4UIcmdWithoutParameter.hh" #include "G4UIcmdWith3VectorAndUnit.hh" ///////////////////////////////////////////////////////////////////////////// BeamlineConstructionMessenger::BeamlineConstructionMessenger(BeamlineConstruction* bl) : pBeamline(bl) { beamlineDir = new G4UIdirectory("/Beamline/"); beamlineDir->SetGuidance("Beamline construction commands"); constructBhamCmd = new G4UIcmdWithoutParameter("/Beamline/Birmingham/Construct",this); constructBhamCmd->SetGuidance("This command constructs the Birmingham Beamline Model"); constructBhamCmd->AvailableForStates(G4State_PreInit,G4State_Idle); constructIThembaCmd = new G4UIcmdWithoutParameter("/Beamline/iThemba/Construct",this); constructIThembaCmd->SetGuidance("This command constructs the iThemba Beamline Model"); constructIThembaCmd->AvailableForStates(G4State_PreInit,G4State_Idle); updateCmd = new G4UIcmdWithoutParameter("/Beamline/Update",this); updateCmd->SetGuidance("Update geometry."); updateCmd->SetGuidance("This command MUST be applied before \"beamOn\" "); updateCmd->SetGuidance("if you changed geometrical value(s)."); updateCmd->AvailableForStates(G4State_PreInit,G4State_Idle); } ///////////////////////////////////////////////////////////////////////////// BeamlineConstructionMessenger::~BeamlineConstructionMessenger() { delete beamlineDir; delete constructBhamCmd; delete constructIThembaCmd; delete updateCmd; } ///////////////////////////////////////////////////////////////////////////// void BeamlineConstructionMessenger::SetNewValue(G4UIcommand* command, G4String newValue) { newValue = ""; // to temporaroly stop "not used" as we do not actually use it... if( command == constructBhamCmd ) pBeamline->ConstructBeamline("Birmingham"); else if ( command == constructIThembaCmd ) pBeamline->ConstructBeamline("iThemba"); if( command == updateCmd ) pBeamline->UpdateGeometry(); }