Import Geant4 9.0.0 source tree
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UIArrayString.cc,v 1.8 2006/06/29 19:09:43 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
|
||||
#include <iomanip>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UIWin32.cc,v 1.13 2006/06/29 19:09:45 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
// G.Barrand
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UIXaw.cc,v 1.6 2006/06/29 19:09:47 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
// G.Barrand
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UIXm.cc,v 1.14 2006/06/29 19:09:49 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
// G.Barrand
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UIcsh.cc,v 1.8 2006/06/29 19:09:51 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
|
||||
#include "G4UIcsh.hh"
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UItcsh.cc,v 1.12 2006/06/29 19:09:54 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4UItcsh.cc,v 1.14 2007/06/14 05:44:58 kmura Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
|
||||
#ifndef WIN32
|
||||
@@ -75,10 +75,10 @@ G4UItcsh::~G4UItcsh()
|
||||
/////////////////////
|
||||
{
|
||||
}
|
||||
|
||||
///////////////////////////
|
||||
|
||||
//////////////////////////////////////////
|
||||
void G4UItcsh::MakePrompt(const char* msg)
|
||||
///////////////////////////
|
||||
//////////////////////////////////////////
|
||||
{
|
||||
if(promptSetting.length()<=1) {
|
||||
promptString= promptSetting;
|
||||
@@ -129,6 +129,15 @@ void G4UItcsh::MakePrompt(const char* msg)
|
||||
promptString.append(G4String(promptSetting[i]));
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////
|
||||
void G4UItcsh::ResetTerminal()
|
||||
//////////////////////////////
|
||||
{
|
||||
RestoreTerm();
|
||||
}
|
||||
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// commad line operations
|
||||
// --------------------------------------------------------------------
|
||||
@@ -464,14 +473,14 @@ void G4UItcsh::CompleteCommand()
|
||||
else jhead++;
|
||||
|
||||
G4int jt= input.find_last_of('/');
|
||||
if(jt<jhead) jt=G4String::npos;
|
||||
if(jt<jhead) jt=G4int(G4String::npos);
|
||||
|
||||
if(jt==G4int(G4String::npos)) jt= jhead;
|
||||
else jt++;
|
||||
|
||||
G4String dspstr;
|
||||
G4int i;
|
||||
for(i=jt; i<=G4int(input.length())-1; i++) dspstr+= G4String(AsciiBS); // cleanup
|
||||
for(i=jt; i<=G4int(input.length())-1; i++) dspstr+= G4String(AsciiBS);
|
||||
for(i=jt; i<=G4int(input.length())-1; i++) dspstr+= G4String(' ');
|
||||
for(i=jt; i<=G4int(input.length())-1; i++) dspstr+= G4String(AsciiBS);
|
||||
|
||||
|
||||
@@ -24,10 +24,13 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UIterminal.cc,v 1.21 2006/06/29 19:09:56 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4UIterminal.cc,v 1.25 2007/06/19 10:38:29 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
|
||||
// ====================================================================
|
||||
// G4UIterminal.cc
|
||||
//
|
||||
// ====================================================================
|
||||
#include "G4Types.hh"
|
||||
#include "G4StateManager.hh"
|
||||
#include "G4UIcommandTree.hh"
|
||||
@@ -37,10 +40,53 @@
|
||||
#include "G4UIcsh.hh"
|
||||
#include <sstream>
|
||||
|
||||
#ifndef WIN32
|
||||
#include "G4RunManager.hh"
|
||||
#include <signal.h>
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////
|
||||
G4UIterminal::G4UIterminal(G4VUIshell* aShell)
|
||||
//////////////////////////////////////////////
|
||||
// ====================================================================
|
||||
// signal handler for soft-abort
|
||||
// ====================================================================
|
||||
|
||||
static G4VUIshell* theshell= 0;
|
||||
|
||||
#ifndef WIN32
|
||||
|
||||
////////////////////////////////
|
||||
static void SignalHandler(G4int)
|
||||
////////////////////////////////
|
||||
{
|
||||
G4RunManager* runManager= G4RunManager::GetRunManager();
|
||||
G4StateManager* stateManager= G4StateManager::GetStateManager();
|
||||
G4ApplicationState state= stateManager-> GetCurrentState();
|
||||
|
||||
if(state==G4State_GeomClosed || state==G4State_EventProc) {
|
||||
G4cout << "aborting Run ...";
|
||||
runManager-> AbortRun(true);
|
||||
G4cout << G4endl;
|
||||
} else {
|
||||
G4cout << G4endl
|
||||
<< "Session terminated." << G4endl;
|
||||
theshell-> ResetTerminal();
|
||||
delete runManager;
|
||||
exit(0);
|
||||
}
|
||||
|
||||
// for original Unix / System V
|
||||
signal(SIGINT, SignalHandler);
|
||||
}
|
||||
#endif
|
||||
|
||||
// ====================================================================
|
||||
//
|
||||
// class description
|
||||
//
|
||||
// ====================================================================
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
G4UIterminal::G4UIterminal(G4VUIshell* aShell, G4bool qsig)
|
||||
///////////////////////////////////////////////////////////
|
||||
{
|
||||
UI= G4UImanager::GetUIpointer();
|
||||
UI-> SetSession(this);
|
||||
@@ -51,6 +97,14 @@ G4UIterminal::G4UIterminal(G4VUIshell* aShell)
|
||||
|
||||
if(aShell) shell= aShell;
|
||||
else shell= new G4UIcsh;
|
||||
theshell= shell; // locally stored for the signal handler
|
||||
|
||||
// add signal handler
|
||||
if(qsig) {
|
||||
#ifndef WIN32
|
||||
signal(SIGINT, SignalHandler);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VUIshell.cc,v 1.9 2006/06/29 19:09:59 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4VUIshell.cc,v 1.10 2007/06/14 05:44:58 kmura Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
|
||||
#include "G4UImanager.hh"
|
||||
@@ -58,9 +58,9 @@ G4VUIshell::~G4VUIshell()
|
||||
{
|
||||
}
|
||||
|
||||
/////////////////////////////
|
||||
////////////////////////////////////////////
|
||||
void G4VUIshell::MakePrompt(const char* msg)
|
||||
/////////////////////////////
|
||||
////////////////////////////////////////////
|
||||
{
|
||||
if(promptSetting.length()<=1) {
|
||||
promptString= promptSetting;
|
||||
@@ -105,6 +105,13 @@ void G4VUIshell::MakePrompt(const char* msg)
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////
|
||||
void G4VUIshell::ResetTerminal()
|
||||
////////////////////////////////
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// G4command operations
|
||||
// --------------------------------------------------------------------
|
||||
@@ -307,3 +314,4 @@ void G4VUIshell::ListCommand(const G4String& dir,
|
||||
G4UIArrayString arrayString(stream);
|
||||
arrayString.Show(nColumn);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user