dynamic-graph icon indicating copy to clipboard operation
dynamic-graph copied to clipboard

Incoherence between SignalBase::setReady and needUpdate

Open jmirabel opened this issue 5 years ago • 1 comments

SignalBase defines the following methods/

  const bool &getReady() const { return ready; }
  virtual bool needUpdate(const Time &) const { return ready; }
  inline void setReady(const bool sready = true) { ready = sready; }

It is very misleading that signal.getReady() == signal.needUpdate(). From the code, it seems this is only use in SignalTimeDependent and attribute ready is true when the signal is NOT up to date

jmirabel avatar Dec 18 '19 13:12 jmirabel

After having dig a bit more into this, and following an old discussion with @nmansard, the part of TimeDependent::needUpdate which is complex was needed to allow a signal value to change within one time frame. This happened in the MailBox class (in sot-core I think). This should be removed to makeTimeDependent::needUpdate simpler.

jmirabel avatar Dec 19 '19 15:12 jmirabel