QwGeant4
QweakSimWShuttersMessenger.cc
Go to the documentation of this file.
1 //=============================================================================
2 //
3 // File QweakSimWShuttersMessenger.cc
4 // Revision 1.0
5 // Date 02/06/2012
6 // Author Kurtis Bartlett
7 //
8 //=============================================================================
9 
10 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
11 
13 
14 // user includes
15 #include "QweakSimWShutters.hh"
17 
18 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
19 
21 :myWShutters(theWShutters)
22 {
23  //WShuttersDir = new G4UIdirectory("/WShutters/");
24 
25  G4String wshutters = "/WShutters" + G4UIcommand::ConvertToString(n);
26  WShuttersDir = new G4UIdirectory(G4String("/WShutters"+ wshutters + "/"));
27  WShuttersDir -> SetGuidance("Tungsten Shutters control.");
28 
29  //--------------------------------------------------
30 
31  //WShutters_SetThicknessInZ_Cmd = new G4UIcmdWithADoubleAndUnit("/WShutters/SetThicknessInZ",this);
32  //WShutters_SetThicknessInZ_Cmd->SetGuidance("Set the thickness of the WShutters in the Z direction");
33  //WShutters_SetThicknessInZ_Cmd->SetParameterName("Size",true);
34  //WShutters_SetThicknessInZ_Cmd->SetUnitCategory("Length");
35  //WShutters_SetThicknessInZ_Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
36 
37  //-------------------------------------------------
38 
39  WShutters_SetEnabled_Cmd = new G4UIcmdWithoutParameter(G4String("/WShutters" + wshutters + "/Enable"),this);
40  WShutters_SetEnabled_Cmd->SetGuidance("Enables the WShutters");
41  WShutters_SetEnabled_Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
42 
43  //-------------------------------------------------
44 
45  WShutters_SetDisabled_Cmd = new G4UIcmdWithoutParameter(G4String("/WShutters" + wshutters + "/Disable"),this);
46  WShutters_SetDisabled_Cmd->SetGuidance("Disables the WShutters");
47  WShutters_SetDisabled_Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
48 
49 
50 }
51 
53 {
54 
55  //if (WShutters_SetThicknessInZ_Cmd) delete WShutters_SetThicknessInZ_Cmd;
58 
59  if (WShuttersDir) delete WShuttersDir;
60 }
61 
62 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
63 
64 void QweakSimWShuttersMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
65 {
66  G4cout << "#### Messenger: QweakSimWShuttersMessenger::SetNewValue() " << newValue << G4endl;
67 
68  //if ( command == WShutters_SetThicknessInZ_Cmd )
69  //{
70  // G4cout << "#### Messenger: Setting WShutters Z thickness to " << newValue << G4endl;
71 
72  // myWShutters->SetWShutters_LengthInZ(WShutters_SetThicknessInZ_Cmd->GetNewDoubleValue(newValue));
73  //}
74 
75  //---------------------------------------------------------------
76 
77  if ( command == WShutters_SetEnabled_Cmd )
78  {
79  G4cout << "#### Messenger: WShutters ENABLED" << G4endl;
80 
82  }
83 
84  if ( command == WShutters_SetDisabled_Cmd )
85  {
86  G4cout << "#### Messenger: WShutters DISABLED" << G4endl;
87 
89  }
90 
91  //---------------------------------------------------------------
92 }
93 
void SetNewValue(G4UIcommand *, G4String)
G4UIcmdWithoutParameter * WShutters_SetDisabled_Cmd
G4UIcmdWithoutParameter * WShutters_SetEnabled_Cmd
QweakSimWShuttersMessenger(QweakSimWShutters *, G4int n)