Commit 54365bdc authored by Jan Möbius's avatar Jan Möbius

Added Slot debugging

Disabled standard draw mode setting via options widget as its not completed yet

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@2908 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 33561a97
...@@ -522,19 +522,30 @@ Core::slotAddHiddenPickMode( const std::string _mode , QCursor _cursor) { ...@@ -522,19 +522,30 @@ Core::slotAddHiddenPickMode( const std::string _mode , QCursor _cursor) {
/** Update the view in the examiner widget /** Update the view in the examiner widget
*/ */
void Core::updateView() { void Core::updateView() {
if ( OpenFlipper::Options::doSlotDebugging() ) {
if ( sender() != 0 ) {
if ( sender()->metaObject() != 0 ) {
emit log(LOGINFO,"updateView() called by " + QString( sender()->metaObject()->className() ) );
}
}
}
if ( OpenFlipper::Options::restrictFrameRate() ) { if ( OpenFlipper::Options::restrictFrameRate() ) {
// redraw time not reached ... waiting for timer event for next redraw // redraw time not reached ... waiting for timer event for next redraw
if ( redrawTimer_->isActive() ) { if ( redrawTimer_->isActive() ) {
// std::cerr << "Too early for redraw!" << std::endl; if ( OpenFlipper::Options::doSlotDebugging() )
emit log(LOGINFO,"Too early for redraw! Delaying request from " + QString( sender()->metaObject()->className() ) );
return; return;
} }
// std::cerr << "Redraw" << std::endl; // std::cerr << "Redraw" << std::endl;
// Start the timer if we are not called by the timer // Start the timer if we are not called by the timer
if ( sender() != redrawTimer_ ) if ( sender() != redrawTimer_ ) {
redrawTimer_->start( 1000 / OpenFlipper::Options::maxFrameRate() ); redrawTimer_->start( 1000 / OpenFlipper::Options::maxFrameRate() );
}
} }
......
...@@ -118,7 +118,7 @@ void Core::readApplicationOptions(INIFile& _ini) { ...@@ -118,7 +118,7 @@ void Core::readApplicationOptions(INIFile& _ini) {
QString type; QString type;
if (_ini.get_entry(type, "Options" , "default_DataType" )) if (_ini.get_entry(type, "Options" , "default_DataType" ))
OpenFlipper::Options::lastDataType(type); OpenFlipper::Options::lastDataType(type);
//============================================================================ //============================================================================
// Splash Screen // Splash Screen
//============================================================================ //============================================================================
...@@ -237,6 +237,14 @@ void Core::readApplicationOptions(INIFile& _ini) { ...@@ -237,6 +237,14 @@ void Core::readApplicationOptions(INIFile& _ini) {
int maxFrameRate = 35; int maxFrameRate = 35;
if( _ini.get_entry(maxFrameRate, "Options", "MaxFrameRate") ) if( _ini.get_entry(maxFrameRate, "Options", "MaxFrameRate") )
OpenFlipper::Options::maxFrameRate(maxFrameRate); OpenFlipper::Options::maxFrameRate(maxFrameRate);
//============================================================================
// Load slotDebugging state
//============================================================================
bool doSlotDebugging = false;
if( _ini.get_entry(doSlotDebugging, "Options", "SlotDebugging") )
OpenFlipper::Options::doSlotDebugging(doSlotDebugging);
} }
} }
...@@ -286,7 +294,7 @@ void Core::writeApplicationOptions(INIFile& _ini) { ...@@ -286,7 +294,7 @@ void Core::writeApplicationOptions(INIFile& _ini) {
// Splash Screen // Splash Screen
//============================================================================ //============================================================================
_ini.add_entry( "Options" , "Splash" , OpenFlipper::Options::splash() ); _ini.add_entry( "Options" , "Splash" , OpenFlipper::Options::splash() );
//write default dataType to INI //write default dataType to INI
_ini.add_entry( "Options" , "default_DataType" , OpenFlipper::Options::lastDataType() ); _ini.add_entry( "Options" , "default_DataType" , OpenFlipper::Options::lastDataType() );
...@@ -309,6 +317,12 @@ void Core::writeApplicationOptions(INIFile& _ini) { ...@@ -309,6 +317,12 @@ void Core::writeApplicationOptions(INIFile& _ini) {
// max Framerate // max Framerate
_ini.add_entry("Options","MaxFrameRate",OpenFlipper::Options::maxFrameRate() ); _ini.add_entry("Options","MaxFrameRate",OpenFlipper::Options::maxFrameRate() );
//============================================================================
// Debugging
//============================================================================
// max Framerate
_ini.add_entry("Options","SlotDebugging",OpenFlipper::Options::doSlotDebugging() );
//============================================================================ //============================================================================
//dontLoad Plugins //dontLoad Plugins
//============================================================================ //============================================================================
...@@ -364,7 +378,7 @@ void Core::openIniFile(QString _filename) { ...@@ -364,7 +378,7 @@ void Core::openIniFile(QString _filename) {
emit log(LOGERR,"Failed to connect to ini file" + _filename); emit log(LOGERR,"Failed to connect to ini file" + _filename);
return; return;
} }
if ( OpenFlipper::Options::gui() ) { if ( OpenFlipper::Options::gui() ) {
coreWidget_->statusMessage( "Loading ini File " + _filename + " ..."); coreWidget_->statusMessage( "Loading ini File " + _filename + " ...");
coreWidget_->setStatus(ApplicationStatus::BLOCKED ); coreWidget_->setStatus(ApplicationStatus::BLOCKED );
...@@ -438,7 +452,7 @@ void Core::openIniFile(QString _filename) { ...@@ -438,7 +452,7 @@ void Core::openIniFile(QString _filename) {
OpenFlipper::Options::openingIni(false); OpenFlipper::Options::openingIni(false);
resetScenegraph(); resetScenegraph();
if ( OpenFlipper::Options::gui() ) { 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 );
...@@ -453,7 +467,7 @@ void Core::writeIniFile(QString _filename, bool _relativePaths) { ...@@ -453,7 +467,7 @@ void Core::writeIniFile(QString _filename, bool _relativePaths) {
emit log(LOGERR,"Failed to connect to _ini file" + _filename); emit log(LOGERR,"Failed to connect to _ini file" + _filename);
return; return;
} }
if ( OpenFlipper::Options::gui() ) { if ( OpenFlipper::Options::gui() ) {
coreWidget_->statusMessage( "Saving ini File " + _filename + " ..."); coreWidget_->statusMessage( "Saving ini File " + _filename + " ...");
coreWidget_->setStatus(ApplicationStatus::BLOCKED ); coreWidget_->setStatus(ApplicationStatus::BLOCKED );
...@@ -503,7 +517,7 @@ void Core::writeIniFile(QString _filename, bool _relativePaths) { ...@@ -503,7 +517,7 @@ void Core::writeIniFile(QString _filename, bool _relativePaths) {
emit iniSaveOptions( ini ); emit iniSaveOptions( ini );
ini.disconnect(); ini.disconnect();
if ( OpenFlipper::Options::gui() ) { if ( OpenFlipper::Options::gui() ) {
coreWidget_->statusMessage( "Saving ini File " + _filename + " ... Done", 4000); coreWidget_->statusMessage( "Saving ini File " + _filename + " ... Done", 4000);
coreWidget_->setStatus(ApplicationStatus::READY ); coreWidget_->setStatus(ApplicationStatus::READY );
......
...@@ -12,12 +12,12 @@ ...@@ -12,12 +12,12 @@
// it under the terms of the GNU Lesser General Public License as published by // it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// OpenFlipper is distributed in the hope that it will be useful, // OpenFlipper is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details. // GNU Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public License // You should have received a copy of the GNU Lesser General Public License
// along with OpenFlipper. If not, see <http://www.gnu.org/licenses/>. // along with OpenFlipper. If not, see <http://www.gnu.org/licenses/>.
// //
...@@ -49,20 +49,29 @@ ...@@ -49,20 +49,29 @@
#include "OpenFlipper/BasePlugin/ToolboxInterface.hh" #include "OpenFlipper/BasePlugin/ToolboxInterface.hh"
#include "OpenFlipper/BasePlugin/TextureInterface.hh" #include "OpenFlipper/BasePlugin/TextureInterface.hh"
//== IMPLEMENTATION ========================================================== //== IMPLEMENTATION ==========================================================
//======================================================================================== //========================================================================================
// === Object List Communication ======================= // === Object List Communication =======================
//======================================================================================== //========================================================================================
/** This function is called by a plugin if it changed something in the object list (source,target,...). The information is passed to all plugins. /** This function is called by a plugin if it changed something in the object list (source,target,...). The information is passed to all plugins.
* @param _identifier Id of the updated object * @param _identifier Id of the updated object
*/ */
void Core::slotObjectsListUpdated(int _identifier) { void Core::slotObjectsListUpdated(int _identifier) {
// just inform the plugins as we dont do anything else if ( OpenFlipper::Options::doSlotDebugging() ) {
emit ObjectListUpdated(_identifier); if ( sender() != 0 ) {
} if ( sender()->metaObject() != 0 ) {
emit log(LOGINFO,"updated_objects( " + QString::number(_identifier) + " ) called by " +
QString( sender()->metaObject()->className() ) );
}
}
}
// just inform the plugins as we dont do anything else
emit ObjectListUpdated(_identifier);
}
/** This function is called if the active object has changed. The information is passed to all plugins. /** This function is called if the active object has changed. The information is passed to all plugins.
*/ */
void Core::slotActiveObjectChanged() void Core::slotActiveObjectChanged()
...@@ -71,10 +80,10 @@ ...@@ -71,10 +80,10 @@
emit activeObjectChanged(); emit activeObjectChanged();
} }
//==================================================================================== //====================================================================================
// === Toolbox handling ================= // === Toolbox handling =================
//===================================================================================== //=====================================================================================
/** If the Toolbox is switched the toolboxActivated function of the each plugin that has a toolbox is called by this function. /** If the Toolbox is switched the toolboxActivated function of the each plugin that has a toolbox is called by this function.
*/ */
// void // void
...@@ -82,18 +91,18 @@ ...@@ -82,18 +91,18 @@
// { // {
// // Check all plugins // // Check all plugins
// for ( uint i = 0 ; i < plugins.size(); ++i) { // for ( uint i = 0 ; i < plugins.size(); ++i) {
// if (plugins[i].toolboxindex == -1) // if (plugins[i].toolboxindex == -1)
// continue; // continue;
// //
// ToolboxInterface* toolboxPlugin = qobject_cast< ToolboxInterface * >(plugins[i].plugin); // ToolboxInterface* toolboxPlugin = qobject_cast< ToolboxInterface * >(plugins[i].plugin);
// if (! toolboxPlugin) // if (! toolboxPlugin)
// continue; // continue;
// //
// // Call the corresponding function of the plugins // // Call the corresponding function of the plugins
// if ( _index == plugins[i].toolboxindex ) { // if ( _index == plugins[i].toolboxindex ) {
// toolboxPlugin->toolboxActivated(true); // toolboxPlugin->toolboxActivated(true);
// } else { // } else {
// toolboxPlugin->toolboxActivated(false); // toolboxPlugin->toolboxActivated(false);
// } // }
// } // }
// } // }
...@@ -107,35 +116,35 @@ ...@@ -107,35 +116,35 @@
* See in the documentation of the texture plugin interfaces for further detail. * See in the documentation of the texture plugin interfaces for further detail.
*/ */
void Core::slotAddTexture( QString _textureName , QString _filename, uint _dimension) { void Core::slotAddTexture( QString _textureName , QString _filename, uint _dimension) {
emit addTexture(_textureName , _filename,_dimension); emit addTexture(_textureName , _filename,_dimension);
} }
/** Called by a plugin if a texture has to be updated. The information is passed to all plugins. The Plugin providing the given Texture should react on this event.\n /** Called by a plugin if a texture has to be updated. The information is passed to all plugins. The Plugin providing the given Texture should react on this event.\n
* See in the documentation of the texture plugin interfaces for further detail. * See in the documentation of the texture plugin interfaces for further detail.
*/ */
void Core::slotUpdateTexture( QString _name , int _identifier){ void Core::slotUpdateTexture( QString _name , int _identifier){
emit updateTexture(_name, _identifier); emit updateTexture(_name, _identifier);
} }
/** Called by a plugin if all textures should be updated. The information is passed to all plugins. All plugins providing textures should react on this event.\n /** Called by a plugin if all textures should be updated. The information is passed to all plugins. All plugins providing textures should react on this event.\n
* See in the documentation of the texture plugin interfaces for further detail. * See in the documentation of the texture plugin interfaces for further detail.
*/ */
void Core::slotUpdateAllTextures( ){ void Core::slotUpdateAllTextures( ){
emit updateAllTextures(); emit updateAllTextures();
} }
/** Called by a plugin if the parameters of a texture should be changed. The information is passed to all plugins. A Texturecontrol plugin should react on this event.\n /** Called by a plugin if the parameters of a texture should be changed. The information is passed to all plugins. A Texturecontrol plugin should react on this event.\n
* See in the documentation of the texture plugin interfaces for further detail. * See in the documentation of the texture plugin interfaces for further detail.
*/ */
void Core::slotSetTextureMode(QString _textureName ,QString _mode) { void Core::slotSetTextureMode(QString _textureName ,QString _mode) {
emit setTextureMode(_textureName,_mode); emit setTextureMode(_textureName,_mode);
} }
/** Called by a plugin if it updated a texture. The information is passed to all plugins. If a texture control plugin is available it has to react on the signal and update the visualization of the texture.\n /** Called by a plugin if it updated a texture. The information is passed to all plugins. If a texture control plugin is available it has to react on the signal and update the visualization of the texture.\n
* See in the documentation of the texture plugin interfaces for further detail. * See in the documentation of the texture plugin interfaces for further detail.
*/ */
void Core::slotTextureUpdated( QString _textureName , int _identifier ) { void Core::slotTextureUpdated( QString _textureName , int _identifier ) {
emit updatedTextures(_textureName,_identifier); emit updatedTextures(_textureName,_identifier);
} }
/** Called by plugins if texture mode should be switched /** Called by plugins if texture mode should be switched
...@@ -150,8 +159,8 @@ void Core::slotSwitchTexture( QString _textureName ) { ...@@ -150,8 +159,8 @@ void Core::slotSwitchTexture( QString _textureName ) {
/// Called if a backup is requested by the plugins /// Called if a backup is requested by the plugins
void Core::backupRequest( int _id , QString _name ) { void Core::backupRequest( int _id , QString _name ) {
emit createBackup( _id , _name , nextBackupId_); emit createBackup( _id , _name , nextBackupId_);
++nextBackupId_; ++nextBackupId_;
} }
......
...@@ -12,12 +12,12 @@ ...@@ -12,12 +12,12 @@
// it under the terms of the GNU Lesser General Public License as published by // it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// OpenFlipper is distributed in the hope that it will be useful, // OpenFlipper is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details. // GNU Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public License // You should have received a copy of the GNU Lesser General Public License
// along with OpenFlipper. If not, see <http://www.gnu.org/licenses/>. // along with OpenFlipper. If not, see <http://www.gnu.org/licenses/>.
// //
...@@ -47,11 +47,11 @@ ...@@ -47,11 +47,11 @@
namespace OpenFlipper { namespace OpenFlipper {
namespace Options { namespace Options {
/// Stores the base Path of the application /// Stores the base Path of the application
static QDir applicationDir_; static QDir applicationDir_;
/// Stores the base Path of the application /// Stores the base Path of the application
static QDir configDir_; static QDir configDir_;
/// Stores the Path to the Standard Plugins /// Stores the Path to the Standard Plugins
...@@ -127,6 +127,9 @@ static bool logToConsole_ = false; ...@@ -127,6 +127,9 @@ static bool logToConsole_ = false;
/// Extra debug info /// Extra debug info
static bool debug_ = false; static bool debug_ = false;
/// Slot Debugging
static bool doSlotDebugging_ = false;
/// enable logging to file /// enable logging to file
static bool logFileEnabled_; static bool logFileEnabled_;
...@@ -150,8 +153,8 @@ static char *** argv_; ...@@ -150,8 +153,8 @@ static char *** argv_;
const bool is64 = true; const bool is64 = true;
#else #else
const bool is64 = false; const bool is64 = false;
#endif #endif
#ifdef WIN32 #ifdef WIN32
const bool linux_ = false; const bool linux_ = false;
const bool windows_ = true; const bool windows_ = true;
...@@ -164,16 +167,16 @@ bool is64bit() { return is64; }; ...@@ -164,16 +167,16 @@ bool is64bit() { return is64; };
bool is32bit() { return !is64; }; bool is32bit() { return !is64; };
bool isLinux() { bool isLinux() {
return linux_; return linux_;
} }
bool isWindows() { bool isWindows() {
return windows_; return windows_;
} }
QString lang() { QString lang() {
QString lang = getenv( "LANG" ) ; QString lang = getenv( "LANG" ) ;
return lang; return lang;
} }
...@@ -183,10 +186,10 @@ QString dirSeparator() { ...@@ -183,10 +186,10 @@ QString dirSeparator() {
// return QString("\\"); // return QString("\\");
// if (linux_) // if (linux_)
// return QString("/"); // return QString("/");
return QString("/"); return QString("/");
} }
QDir applicationDir() { return applicationDir_; } QDir applicationDir() { return applicationDir_; }
QDir configDir() { return configDir_; } QDir configDir() { return configDir_; }
QDir pluginDir() { return pluginDir_; } QDir pluginDir() { return pluginDir_; }
...@@ -215,19 +218,19 @@ void currentDir(QDir _dir) { currentDir_ = _dir; } ...@@ -215,19 +218,19 @@ void currentDir(QDir _dir) { currentDir_ = _dir; }
void optionFiles(QStringList _list) { optionFiles_ = _list; } void optionFiles(QStringList _list) { optionFiles_ = _list; }
bool applicationDir(QString _dir) { bool applicationDir(QString _dir) {
QDir tmp(_dir); QDir tmp(_dir);
if (tmp.exists()) { if (tmp.exists()) {
applicationDir_ = tmp; applicationDir_ = tmp;
return true; return true;
} }
return false; return false;
} }
bool pluginDir(QString _dir) { bool pluginDir(QString _dir) {
QDir tmp(_dir); QDir tmp(_dir);
if (tmp.exists()) { if (tmp.exists()) {
pluginDir_ = tmp; pluginDir_ = tmp;
return true; return true;
} }
return false; return false;
...@@ -236,43 +239,43 @@ bool pluginDir(QString _dir) { ...@@ -236,43 +239,43 @@ bool pluginDir(QString _dir) {
bool shaderDir(QString _dir) { bool shaderDir(QString _dir) {
QDir tmp(_dir); QDir tmp(_dir);
if (tmp.exists()) { if (tmp.exists()) {
shaderDir_ = tmp; shaderDir_ = tmp;
return true; return true;
} }
return false; return false;
} }
bool textureDir(QString _dir) { bool textureDir(QString _dir) {
QDir tmp(_dir); QDir tmp(_dir);
if (tmp.exists()) { if (tmp.exists()) {
textureDir_ = tmp; textureDir_ = tmp;
return true; return true;
} }
return false; return false;
} }
bool iconDir(QString _dir) { bool iconDir(QString _dir) {
QDir tmp(_dir); QDir tmp(_dir);
if (tmp.exists()) { if (tmp.exists()) {
iconDir_ = tmp; iconDir_ = tmp;
return true; return true;
} }
return false; return false;
} }
bool configDir(QString _dir) { bool configDir(QString _dir) {
QDir tmp(_dir); QDir tmp(_dir);
if (tmp.exists()) { if (tmp.exists()) {
configDir_ = tmp; configDir_ = tmp;
return true; return true;
} }
return false; return false;
} }
bool currentDir(QString _dir) { bool currentDir(QString _dir) {
QDir tmp(_dir); QDir tmp(_dir);
if (tmp.exists()) { if (tmp.exists()) {
currentDir_ = tmp; currentDir_ = tmp;
return true; return true;
} }
return false; return false;
...@@ -280,77 +283,77 @@ bool currentDir(QString _dir) { ...@@ -280,77 +283,77 @@ bool currentDir(QString _dir) {
/// Get experience level /// Get experience level
Experience getExperience() { Experience getExperience() {
return experienceLevel_; return experienceLevel_;
} }
/// Set experience level /// Set experience level
void setExperience( Experience _exp) { void setExperience( Experience _exp) {
experienceLevel_ = _exp; experienceLevel_ = _exp;
} }
/// Store if a gui should be visible or not /// Store if a gui should be visible or not
void nogui( bool _nogui ) { void nogui( bool _nogui ) {
nogui_ = _nogui; nogui_ = _nogui;
} }
/// get if a gui should be visible or not /// get if a gui should be visible or not
bool nogui( ) { bool nogui( ) {
return nogui_; return nogui_;
} }
/// get if a gui should be visible or not /// get if a gui should be visible or not
bool gui( ) { bool gui( ) {
return !nogui_; return !nogui_;
} }
/// Store stereo mode setting /// Store stereo mode setting
void stereo( bool _stereo ) { void stereo( bool _stereo ) {
stereo_ = _stereo; stereo_ = _stereo;
} }
/// get current stereo setting /// get current stereo setting
bool stereo( ) { bool stereo( ) {
return stereo_;