| [1274] | 1 | //
|
|---|
| 2 | // ********************************************************************
|
|---|
| 3 | // * DISCLAIMER *
|
|---|
| 4 | // * *
|
|---|
| 5 | // * The following disclaimer summarizes all the specific disclaimers *
|
|---|
| 6 | // * of contributors to this software. The specific disclaimers,which *
|
|---|
| 7 | // * govern, are listed with their locations in: *
|
|---|
| 8 | // * http://cern.ch/geant4/license *
|
|---|
| 9 | // * *
|
|---|
| 10 | // * Neither the authors of this software system, nor their employing *
|
|---|
| 11 | // * institutes,nor the agencies providing financial support for this *
|
|---|
| 12 | // * work make any representation or warranty, express or implied, *
|
|---|
| 13 | // * regarding this software system or assume any liability for its *
|
|---|
| 14 | // * use. *
|
|---|
| 15 | // * *
|
|---|
| 16 | // * This code implementation is the intellectual property of the *
|
|---|
| 17 | // * GEANT4 collaboration. *
|
|---|
| 18 | // * By copying, distributing or modifying the Program (or any work *
|
|---|
| 19 | // * based on the Program) you indicate your acceptance of this *
|
|---|
| 20 | // * statement, and all its terms. *
|
|---|
| 21 | // ********************************************************************
|
|---|
| 22 | //
|
|---|
| 23 | //
|
|---|
| 24 | // $Id: G4UIxvtMessenger.cc,v 1.4 2001/07/11 10:01:19 gunter Exp $
|
|---|
| 25 | // GEANT4 tag $Name: $
|
|---|
| 26 | //
|
|---|
| 27 | #ifdef G4UI_BUILD_XVT_SESSION
|
|---|
| 28 |
|
|---|
| 29 | //////////////////////////////////////////////////////////////////////////////
|
|---|
| 30 | // //
|
|---|
| 31 | // The original code (written by Makoto Asai) has been adapted for use //
|
|---|
| 32 | // with the XVT Geant GUI //
|
|---|
| 33 | // //
|
|---|
| 34 | // By: Simon Prior 11/08/97 //
|
|---|
| 35 | // //
|
|---|
| 36 | //////////////////////////////////////////////////////////////////////////////
|
|---|
| 37 | #include "G4UIxvtMessenger.hh"
|
|---|
| 38 | #include "G4UIcommand.hh"
|
|---|
| 39 | #include "G4UIparameter.hh"
|
|---|
| 40 | #include "G4UIxvt.hh"
|
|---|
| 41 | #include "G4ios.hh"
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 | G4UIxvtMessenger::G4UIxvtMessenger(G4UIxvt* tempxvt)
|
|---|
| 45 | :xvtptr(tempxvt)
|
|---|
| 46 | {
|
|---|
| 47 | G4UIcommand * command;
|
|---|
| 48 | G4UIparameter * param;
|
|---|
| 49 |
|
|---|
| 50 | command = new G4UIcommand("/control/setBreakAt",this);
|
|---|
| 51 | command->SetGuidance("Set a break point at the begining or end of");
|
|---|
| 52 | command->SetGuidance("each run or event.");
|
|---|
| 53 | command->SetGuidance(" Available points :");
|
|---|
| 54 | command->SetGuidance(" beginOfRun, endOfRun, beginOfEvent, EndOfEvent");
|
|---|
| 55 | param = new G4UIparameter("point",'c',false);
|
|---|
| 56 | command->SetParameter(param);
|
|---|
| 57 | AddUIcommand( command );
|
|---|
| 58 |
|
|---|
| 59 | command = new G4UIcommand("/control/removeBreakPoint",this);
|
|---|
| 60 | command->SetGuidance("Reset all of assigned break.");
|
|---|
| 61 | AddUIcommand( command );
|
|---|
| 62 |
|
|---|
| 63 | command = new G4UIcommand("/control/noticeState",this);
|
|---|
| 64 | command->SetGuidance("Toggle Verbose flag of G4UIxvt for state change.");
|
|---|
| 65 | command->SetGuidance("If it is on, all state change will be displayed.");
|
|---|
| 66 | AddUIcommand( command );
|
|---|
| 67 | }
|
|---|
| 68 |
|
|---|
| 69 | void G4UIxvtMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
|
|---|
| 70 | {
|
|---|
| 71 | if(command->GetCommandName()=="setBreakAt")
|
|---|
| 72 | {
|
|---|
| 73 | int id = -1;
|
|---|
| 74 | if(newValue=="beginOfRun") id=0;
|
|---|
| 75 | if(newValue=="beginOfEvent") id=1;
|
|---|
| 76 | if(newValue=="EndOfEvent") id=2;
|
|---|
| 77 | if(newValue=="endOfRun") id=3;
|
|---|
| 78 | if(id<0)
|
|---|
| 79 | { G4cout << "Unknown break point <" << newValue << "> ignored." << G4endl; }
|
|---|
| 80 | else
|
|---|
| 81 | { xvtptr->set_breakPointAt(id,true); }
|
|---|
| 82 | }
|
|---|
| 83 | if(command->GetCommandName()=="removeBreakPoint")
|
|---|
| 84 | {
|
|---|
| 85 | for(int i=0;i<4;i++)
|
|---|
| 86 | { xvtptr->set_breakPointAt(i,false); }
|
|---|
| 87 | }
|
|---|
| 88 | if(command->GetCommandName()=="noticeState")
|
|---|
| 89 | {
|
|---|
| 90 | xvtptr->set_verbose();
|
|---|
| 91 | }
|
|---|
| 92 | }
|
|---|
| 93 |
|
|---|
| 94 | #endif
|
|---|