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() );
}
} }
......
...@@ -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);
} }
} }
...@@ -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
//============================================================================ //============================================================================
......
...@@ -58,10 +58,19 @@ ...@@ -58,10 +58,19 @@
/** 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) {
if ( OpenFlipper::Options::doSlotDebugging() ) {
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 // just inform the plugins as we dont do anything else
emit ObjectListUpdated(_identifier); 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.
*/ */
...@@ -71,7 +80,7 @@ ...@@ -71,7 +80,7 @@
emit activeObjectChanged(); emit activeObjectChanged();
} }
//==================================================================================== //====================================================================================
// === Toolbox handling ================= // === Toolbox handling =================
//===================================================================================== //=====================================================================================
......
...@@ -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_;
...@@ -517,6 +520,14 @@ void argv( char*** _argv) { ...@@ -517,6 +520,14 @@ void argv( char*** _argv) {
argv_ = _argv; argv_ = _argv;
} }
void doSlotDebugging( bool _debugging ) {
doSlotDebugging_ = _debugging;
}
bool doSlotDebugging( ) {
return doSlotDebugging_;
}
} }
} }
......
...@@ -503,6 +503,24 @@ void argc( int* _argc ); ...@@ -503,6 +503,24 @@ void argc( int* _argc );
DLLEXPORT DLLEXPORT
void argv( char*** _argv); void argv( char*** _argv);
//===========================================================================
/** @name Debugging Options
* @{ */
//===========================================================================
/** If you enable slot debugging, for some slots will be displayed who called them.
* Currently supported slots are:\n
* - updateView()
* - updated_objects( objectId )
*/
DLLEXPORT
void doSlotDebugging( bool _debugging );
DLLEXPORT
bool doSlotDebugging( );
/** @} */ /** @} */
} }
......
...@@ -119,6 +119,9 @@ void OptionsWidget::showEvent ( QShowEvent * event ) { ...@@ -119,6 +119,9 @@ void OptionsWidget::showEvent ( QShowEvent * event ) {
restrictFPS->setChecked( OpenFlipper::Options::restrictFrameRate() ); restrictFPS->setChecked( OpenFlipper::Options::restrictFrameRate() );
FPS->setValue( OpenFlipper::Options::maxFrameRate() ); FPS->setValue( OpenFlipper::Options::maxFrameRate() );
// debugging
slotDebugging->setChecked(OpenFlipper::Options::doSlotDebugging());
//set drawmodes //set drawmodes
...@@ -202,6 +205,9 @@ void OptionsWidget::slotApply() { ...@@ -202,6 +205,9 @@ void OptionsWidget::slotApply() {
OpenFlipper::Options::restrictFrameRate( restrictFPS->isChecked() ); OpenFlipper::Options::restrictFrameRate( restrictFPS->isChecked() );
OpenFlipper::Options::maxFrameRate( FPS->value() ); OpenFlipper::Options::maxFrameRate( FPS->value() );
// Debugging
OpenFlipper::Options::doSlotDebugging(slotDebugging->isChecked());
//standardDrawMode //standardDrawMode
std::vector< QString > mode; std::vector< QString > mode;
...@@ -209,7 +215,8 @@ void OptionsWidget::slotApply() { ...@@ -209,7 +215,8 @@ void OptionsWidget::slotApply() {
if (availDrawModes->item(i)->checkState() == Qt::Checked) if (availDrawModes->item(i)->checkState() == Qt::Checked)
mode.push_back( availDrawModes->item(i)->text() ); mode.push_back( availDrawModes->item(i)->text() );
OpenFlipper::Options::standardDrawMode( ListToDrawMode(mode) ); std::cerr << "Optionswidget: standarddrawmode not set yet" << std::endl;
// OpenFlipper::Options::standardDrawMode( ListToDrawMode(mode) );
emit applyOptions(); emit applyOptions();
emit saveOptions(); emit saveOptions();
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<string/> <string/>
</property> </property>
<property name="currentIndex" > <property name="currentIndex" >
<number>2</number> <number>5</number>
</property> </property>
<property name="usesScrollButtons" > <property name="usesScrollButtons" >
<bool>true</bool> <bool>true</bool>
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>644</width> <width>479</width>
<height>606</height> <height>394</height>
</rect> </rect>
</property> </property>
<attribute name="title" > <attribute name="title" >
...@@ -132,8 +132,8 @@ ...@@ -132,8 +132,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>644</width> <width>479</width>
<height>606</height> <height>394</height>
</rect> </rect>
</property> </property>
<attribute name="title" > <attribute name="title" >
...@@ -165,7 +165,7 @@ ...@@ -165,7 +165,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>479</width> <width>479</width>
<height>402</height> <height>394</height>
</rect> </rect>
</property> </property>
<attribute name="title" > <attribute name="title" >
...@@ -374,7 +374,7 @@ ...@@ -374,7 +374,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>479</width> <width>479</width>
<height>402</height> <height>394</height>
</rect> </rect>
</property> </property>
<attribute name="title" > <attribute name="title" >
...@@ -397,8 +397,8 @@ ...@@ -397,8 +397,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>644</width> <width>479</width>
<height>606</height> <height>394</height>
</rect> </rect>
</property> </property>
<attribute name="title" > <attribute name="title" >
...@@ -510,6 +510,61 @@ ...@@ -510,6 +510,61 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="Debug" >
<attribute name="title" >
<string>Debug</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_12" >
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7" >
<item>
<widget class="QCheckBox" name="slotDebugging" >
<property name="toolTip" >
<string>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'Arial'; font-size:11pt; font-weight:400; font-style:normal;">
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Print information about plugins calling specific slots&lt;br />Currently supported slots:&lt;br />- updateView()&lt;/p>
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">- updated_objects( id )&lt;/p>&lt;/body>&lt;/html></string>
</property>
<property name="statusTip" >
<string>Print information about plugins calling specific slots</string>
</property>
<property name="text" >
<string>Enable slot debugging</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_3" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>340</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget> </widget>
</item> </item>
<item> <item>
......
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