[DEV] update signal interface to remove periodic signal in debug log level

This commit is contained in:
Edouard DUPIN 2015-09-29 21:12:20 +02:00
parent 0abe3cfdfc
commit 6d8c375365
5 changed files with 47 additions and 28 deletions

View File

@ -17,7 +17,7 @@
ewol::object::Manager::Manager(ewol::Context& _context) : ewol::object::Manager::Manager(ewol::Context& _context) :
m_context(_context), m_context(_context),
periodicCall(*this, "periodic", "Call every time system render"), periodicCall(*this, "periodic", "Call every time system render", true),
m_applWakeUpTime(0), m_applWakeUpTime(0),
m_lastPeriodicCallTime(0) { m_lastPeriodicCallTime(0) {
EWOL_DEBUG(" == > init Object-Manager"); EWOL_DEBUG(" == > init Object-Manager");

View File

@ -18,12 +18,14 @@
ewol::signal::Base::Base(ewol::signal::Interface& _signalInterfaceLink, ewol::signal::Base::Base(ewol::signal::Interface& _signalInterfaceLink,
const std::string& _name, const std::string& _name,
const std::string& _description) : const std::string& _description,
bool _periodic) :
m_signalInterfaceLink(_signalInterfaceLink), m_signalInterfaceLink(_signalInterfaceLink),
m_name(_name), m_name(_name),
m_description(_description), m_description(_description),
m_callInProgress(0), m_callInProgress(0),
m_someOneRemoveInCall(false) { m_someOneRemoveInCall(false),
m_periodic(_periodic) {
// add a reference on the current signal ... // add a reference on the current signal ...
m_signalInterfaceLink.signalAdd(this); m_signalInterfaceLink.signalAdd(this);
} }

View File

@ -25,16 +25,19 @@ namespace ewol {
std::string m_description; std::string m_description;
int32_t m_callInProgress; int32_t m_callInProgress;
bool m_someOneRemoveInCall; bool m_someOneRemoveInCall;
bool m_periodic;
public: public:
/** /**
* @brief Create a parameter with a specific type. * @brief Create a parameter with a specific type.
* @param[in] _signalInterfaceLink reference on the signal list. * @param[in] _signalInterfaceLink reference on the signal list.
* @param[in] _name Static name of the parameter. * @param[in] _name Static name of the parameter.
* @param[in] _description description of the parameter. * @param[in] _description description of the parameter.
* @param[in] _periodic Customisation of the log display tag at true to down debug lebel at verbose.
*/ */
Base(ewol::signal::Interface& _signalInterfaceLink, Base(ewol::signal::Interface& _signalInterfaceLink,
const std::string& _name, const std::string& _name,
const std::string& _description = ""); const std::string& _description = "",
bool _periodic = false);
/** /**
* @brief Destructor. * @brief Destructor.
*/ */

View File

@ -23,18 +23,17 @@ namespace ewol {
std::function<void(const T&)>>> m_callerListInCallback; // temporaty list (when add one in call process) std::function<void(const T&)>>> m_callerListInCallback; // temporaty list (when add one in call process)
public: public:
/** /**
* @brief Create a parameter with a specific type. * @brief Create a signal with a specific type.
* @param[in] _signalInterfaceLink reference on the parameter lister. * @param[in] _signalInterfaceLink reference on the signal lister.
* @param[in] _name Static name of the parameter. * @param[in] _name Static name of the signal.
* @param[in] _defaultValue Default value of the parameter. * @param[in] _description Description of the signal.
* @param[in] _min Minumum value. * @param[in] _periodic Customisation of the log display tag at true to down debug lebel at verbose.
* @param[in] _max Maximum value.
* @param[in] _description description of the parameter.
*/ */
Signal(ewol::signal::Interface& _signalInterfaceLink, Signal(ewol::signal::Interface& _signalInterfaceLink,
const std::string& _name, const std::string& _name,
const std::string& _description = "") : const std::string& _description = "",
signal::Base(_signalInterfaceLink, _name, _description) { bool _periodic = false) :
signal::Base(_signalInterfaceLink, _name, _description, _periodic) {
}; };
/** /**
@ -144,7 +143,11 @@ namespace ewol {
int32_t tmpID = m_uidSignal++; int32_t tmpID = m_uidSignal++;
#endif #endif
m_callInProgress++; m_callInProgress++;
EWOL_DEBUG(ewol::signal::logIndent(m_signalCallLevel-1) << "emit signal{" << tmpID << "} : signal='" << m_name << "' data='" << etk::to_string(_data) << "' to: " << m_callerList.size() << " element(s)"); if (m_periodic == true) {
EWOL_VERBOSE(ewol::signal::logIndent(m_signalCallLevel-1) << "emit signal{" << tmpID << "} : signal='" << m_name << "' data='" << etk::to_string(_data) << "' to: " << m_callerList.size() << " element(s)");
} else {
EWOL_DEBUG(ewol::signal::logIndent(m_signalCallLevel-1) << "emit signal{" << tmpID << "} : signal='" << m_name << "' data='" << etk::to_string(_data) << "' to: " << m_callerList.size() << " element(s)");
}
auto it(m_callerList.begin()); auto it(m_callerList.begin());
while (it != m_callerList.end()) { while (it != m_callerList.end()) {
std::shared_ptr<void> destObject = it->first.lock(); std::shared_ptr<void> destObject = it->first.lock();
@ -153,7 +156,11 @@ namespace ewol {
EWOL_DEBUG(ewol::signal::logIndent(m_signalCallLevel-1) << " nullptr dest"); EWOL_DEBUG(ewol::signal::logIndent(m_signalCallLevel-1) << " nullptr dest");
continue; continue;
} }
EWOL_DEBUG(ewol::signal::logIndent(m_signalCallLevel-1) << " signal{" << tmpID << "} :");// [" << destObject->getId() << "]" << destObject->getObjectType()); if (m_periodic == true) {
EWOL_VERBOSE(ewol::signal::logIndent(m_signalCallLevel-1) << " signal{" << tmpID << "} :");// [" << destObject->getId() << "]" << destObject->getObjectType());
} else {
EWOL_DEBUG(ewol::signal::logIndent(m_signalCallLevel-1) << " signal{" << tmpID << "} :");// [" << destObject->getId() << "]" << destObject->getObjectType());
}
it->second(_data); it->second(_data);
++it; ++it;
} }
@ -194,18 +201,17 @@ namespace ewol {
std::vector<std::pair<std::weak_ptr<void>, std::function<void()>>> m_callerListInCallback; std::vector<std::pair<std::weak_ptr<void>, std::function<void()>>> m_callerListInCallback;
public: public:
/** /**
* @brief Create a parameter with a specific type. * @brief Create a signal with a specific 'void' type.
* @param[in] _signalInterfaceLink reference on the parameter lister. * @param[in] _signalInterfaceLink reference on the signal lister.
* @param[in] _name Static name of the parameter. * @param[in] _name Static name of the signal.
* @param[in] _defaultValue Default value of the parameter. * @param[in] _description Description of the signal.
* @param[in] _min Minumum value. * @param[in] _periodic Customisation of the log display tag at true to down debug lebel at verbose.
* @param[in] _max Maximum value.
* @param[in] _description description of the parameter.
*/ */
Signal(ewol::signal::Interface& _signalInterfaceLink, Signal(ewol::signal::Interface& _signalInterfaceLink,
const std::string& _name, const std::string& _name,
const std::string& _description = "") : const std::string& _description = "",
signal::Base(_signalInterfaceLink, _name, _description) { bool _periodic = false) :
signal::Base(_signalInterfaceLink, _name, _description, _periodic) {
}; };
/** /**
@ -277,7 +283,11 @@ namespace ewol {
int32_t tmpID = m_uidSignal++; int32_t tmpID = m_uidSignal++;
#endif #endif
m_callInProgress++; m_callInProgress++;
EWOL_DEBUG(ewol::signal::logIndent(m_signalCallLevel-1) << "emit signal{" << tmpID << "} : signal='" << m_name << "' to: " << m_callerList.size() << " element(s)"); if (m_periodic == true) {
EWOL_VERBOSE(ewol::signal::logIndent(m_signalCallLevel-1) << "emit signal{" << tmpID << "} : signal='" << m_name << "' to: " << m_callerList.size() << " element(s)");
} else {
EWOL_DEBUG(ewol::signal::logIndent(m_signalCallLevel-1) << "emit signal{" << tmpID << "} : signal='" << m_name << "' to: " << m_callerList.size() << " element(s)");
}
auto it(m_callerList.begin()); auto it(m_callerList.begin());
while (it != m_callerList.end()) { while (it != m_callerList.end()) {
std::shared_ptr<void> destObject = it->first.lock(); std::shared_ptr<void> destObject = it->first.lock();
@ -286,7 +296,11 @@ namespace ewol {
EWOL_DEBUG(ewol::signal::logIndent(m_signalCallLevel-1) << " nullptr dest"); EWOL_DEBUG(ewol::signal::logIndent(m_signalCallLevel-1) << " nullptr dest");
continue; continue;
} }
EWOL_DEBUG(ewol::signal::logIndent(m_signalCallLevel-1) << " signal{" << tmpID << "} :");// [" << destObject->getId() << "]" << destObject->getObjectType()); if (m_periodic == true) {
EWOL_VERBOSE(ewol::signal::logIndent(m_signalCallLevel-1) << " signal{" << tmpID << "} :");// [" << destObject->getId() << "]" << destObject->getObjectType());
} else {
EWOL_DEBUG(ewol::signal::logIndent(m_signalCallLevel-1) << " signal{" << tmpID << "} :");// [" << destObject->getId() << "]" << destObject->getObjectType());
}
it->second(); it->second();
++it; ++it;
} }

View File

@ -73,7 +73,7 @@ std::shared_ptr<ewol::Widget> ewol::widget::Windows::getWidgetAtPos(const vec2&
} }
void ewol::widget::Windows::sysDraw() { void ewol::widget::Windows::sysDraw() {
EWOL_DEBUG("Drow on " << m_size); EWOL_VERBOSE("Draw on " << m_size);
// set the size of the open GL system // set the size of the open GL system
gale::openGL::setViewPort(vec2(0,0), m_size); gale::openGL::setViewPort(vec2(0,0), m_size);
gale::openGL::disable(gale::openGL::flag_dither); gale::openGL::disable(gale::openGL::flag_dither);