Message: /control/execute not working, patch needed on G4VBasicShell.cc Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Warning /control/execute not working, patch needed on G4VBasicShell.cc 

Forum: (Graphical) User Interfaces
Date: 10 Oct, 2009
From: Luis Cardoso <Luis Cardoso>

I'd like to report what I think to be a bug and, happily, how I solved it.

In the graphical interfaces (Xm, Qt) commands strings that match some shorter commands are trimmed and executed as those shorter commands. For example: "/control/execute some_macro.mac" does not work because anything starting with "cont" is understood as the short for "continue".
I don't understand why the terminal UI doesn't get this mess, but the culprit is
/Geant/geant4.9.2.p02/source/interfaces/common/src/G4VBasicShell.cc
which I corrected, based on
/Geant/geant4.9.2.p02/source/interfaces/basic/src/G4UIterminal.cc
by replacing:

  } else if( command(0,2) == "cd" ) {
with
  } else if( command == "cd" || command(0,3) == "cd ") { // "cd"

  } else if( command(0,4) == "help" ) {
with
  } else if( command == "help" || command(0,5) == "help ") { // "help"

  } else if( command(0,4) == "hist" ) {
with
  } else if( command == "hist" || command == "history") { // "hist/history"

  } else if( command(0,4) == "cont" ) {
with
  } else if( command == "cont" || command == "continue"){ // "cont/continue"


Hope this helps someone!

Luis

 Add Message Add Message
to: "/control/execute not working, patch needed on G4VBasicShell.cc"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]