Commit d467604b authored by Dirk Wilden's avatar Dirk Wilden

nogui protection / batch mode

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5555 383ad7c9-94d9-4d36-a494-682f7c89f535
parent e0d52426
...@@ -658,6 +658,9 @@ void Core::updateView() { ...@@ -658,6 +658,9 @@ void Core::updateView() {
} }
} }
if ( !OpenFlipper::Options::gui() )
return;
if ( OpenFlipper::Options::restrictFrameRate() ) { if ( OpenFlipper::Options::restrictFrameRate() ) {
int elapsed = redrawTime_->elapsed (); int elapsed = redrawTime_->elapsed ();
...@@ -682,7 +685,7 @@ void Core::updateView() { ...@@ -682,7 +685,7 @@ void Core::updateView() {
redrawTime_->restart (); redrawTime_->restart ();
if ( OpenFlipper::Options::gui() && !OpenFlipper::Options::loadingSettings() && !OpenFlipper::Options::redrawDisabled() ) { if ( !OpenFlipper::Options::loadingSettings() && !OpenFlipper::Options::redrawDisabled() ) {
for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i ) for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i )
coreWidget_->examiner_widgets_[i]->updateGL(); coreWidget_->examiner_widgets_[i]->updateGL();
......
...@@ -588,12 +588,12 @@ void Core::openIniFile( QString _filename, ...@@ -588,12 +588,12 @@ void Core::openIniFile( QString _filename,
resetScenegraph(); resetScenegraph();
if ( OpenFlipper::Options::gui() ){
for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i ) { for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i ) {
PluginFunctions::viewerProperties(i).drawMode( OpenFlipper::Options::standardDrawMode() ); PluginFunctions::viewerProperties(i).drawMode( OpenFlipper::Options::standardDrawMode() );
coreWidget_->examiner_widgets_[i]->viewAll(); coreWidget_->examiner_widgets_[i]->viewAll();
} }
if ( OpenFlipper::Options::gui() ) {
coreWidget_->statusMessage( "Loading ini File " + _filename + " ... Done", 4000); coreWidget_->statusMessage( "Loading ini File " + _filename + " ... Done", 4000);
coreWidget_->setStatus(ApplicationStatus::READY ); coreWidget_->setStatus(ApplicationStatus::READY );
} }
......
...@@ -59,6 +59,7 @@ void Core::resetScenegraph() { ...@@ -59,6 +59,7 @@ void Core::resetScenegraph() {
} }
// Update the draw Modes Menu // Update the draw Modes Menu
if ( OpenFlipper::Options::gui() )
coreWidget_->slotUpdateGlobalDrawMenu(); coreWidget_->slotUpdateGlobalDrawMenu();
} }
...@@ -104,6 +105,8 @@ void Core::slotCommandLineOpen() { ...@@ -104,6 +105,8 @@ void Core::slotCommandLineOpen() {
emit executeFileScript(commandLineScriptNames_[i]); emit executeFileScript(commandLineScriptNames_[i]);
} }
if ( !OpenFlipper::Options::gui() && !OpenFlipper::Options::remoteControl())
exitApplication();
} }
/// Load object by guessing DataType depending on the files extension /// Load object by guessing DataType depending on the files extension
......
...@@ -246,7 +246,7 @@ bool parseCommandLineOptions(CSimpleOpt& args){ ...@@ -246,7 +246,7 @@ bool parseCommandLineOptions(CSimpleOpt& args){
OpenFlipper::Options::splash(false); OpenFlipper::Options::splash(false);
break; break;
case OPT_REMOTE: case OPT_REMOTE:
remoteControl = true; OpenFlipper::Options::remoteControl(true);
break; break;
case OPT_HELP: case OPT_HELP:
showHelp(); showHelp();
...@@ -280,17 +280,15 @@ int main(int argc, char **argv) ...@@ -280,17 +280,15 @@ int main(int argc, char **argv)
OpenFlipper::Options::argc(&argc); OpenFlipper::Options::argc(&argc);
OpenFlipper::Options::argv(&argv); OpenFlipper::Options::argv(&argv);
//print arguments
std::fstream filestr ("/Users/moebius/param.log", std::fstream::out);
for (int i=0; i < argc; i++)
filestr << argv[i] << " ";
filestr << std::endl;
filestr.close();
CSimpleOpt args(argc, argv, g_rgOptions); CSimpleOpt args(argc, argv, g_rgOptions);
//check only batchMode before the core is created
while (args.Next())
if (args.OptionId() == OPT_BATCH ){
OpenFlipper::Options::nogui(true);
break;
}
// Only Install signal handler if not running in debug version, otherwise gdb will get confused // Only Install signal handler if not running in debug version, otherwise gdb will get confused
// #ifndef DEBUG // #ifndef DEBUG
// Set a handler for segfaults // Set a handler for segfaults
...@@ -349,7 +347,6 @@ int main(int argc, char **argv) ...@@ -349,7 +347,6 @@ int main(int argc, char **argv)
for ( int i = 0 ; i < args.FileCount(); ++i ) for ( int i = 0 ; i < args.FileCount(); ++i )
w->commandLineScript(args.File(i)); w->commandLineScript(args.File(i));
if ( remoteControl )
return app.exec(); return app.exec();
} }
......
...@@ -195,6 +195,8 @@ static int* argc_; ...@@ -195,6 +195,8 @@ static int* argc_;
static char *** argv_; static char *** argv_;
static bool remoteControl_ = false;
# if __WORDSIZE == 64 # if __WORDSIZE == 64
const bool is64 = true; const bool is64 = true;
#else #else
...@@ -680,6 +682,14 @@ void argv( char*** _argv) { ...@@ -680,6 +682,14 @@ void argv( char*** _argv) {
argv_ = _argv; argv_ = _argv;
} }
bool remoteControl(){
return remoteControl_;
}
void remoteControl(bool _remote){
remoteControl_ = _remote;
}
void doSlotDebugging( bool _debugging ) { void doSlotDebugging( bool _debugging ) {
doSlotDebugging_ = _debugging; doSlotDebugging_ = _debugging;
} }
......
...@@ -609,7 +609,13 @@ void argc( int* _argc ); ...@@ -609,7 +609,13 @@ void argc( int* _argc );
DLLEXPORT DLLEXPORT
void argv( char*** _argv); void argv( char*** _argv);
/// is the core remoteControlled?
DLLEXPORT
bool remoteControl();
/// is the core remoteControlled?
DLLEXPORT
void remoteControl( bool _remote );
//=========================================================================== //===========================================================================
/** @name Debugging Options /** @name Debugging Options
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment