Changeset 437 in flair-src for trunk/lib/FlairCore/src/SendData.cpp


Ignore:
Timestamp:
Aug 24, 2021, 5:33:19 PM (3 months ago)
Author:
Sanahuja Guillaume
Message:

prepare for graphs buffering

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/SendData.cpp

    r15 r437  
    3030
    3131SendData::SendData(const LayoutPosition *position, string name, string type,
    32                    uint16_t default_periodms, bool default_enabled)
     32                   uint16_t default_periodms, bool default_enabled, uint16_t default_nb_buffering)
    3333    : Widget(position->getLayout(), name, type) {
    3434  pimpl_ = new SendData_impl();
     
    3939  pimpl_->send_period = default_periodms;
    4040  pimpl_->is_enabled = default_enabled;
     41  pimpl_->nb_buffering = default_nb_buffering;
    4142
    4243  SetVolatileXmlProp("row", position->Row());
     
    4647  GetPersistentXmlProp("enabled", pimpl_->is_enabled);
    4748  SetPersistentXmlProp("enabled", pimpl_->is_enabled);
     49  GetPersistentXmlProp("nb_buf", pimpl_->nb_buffering);
     50  SetPersistentXmlProp("nb_buf", pimpl_->nb_buffering);
    4851
    4952  delete position;
     
    6770
    6871void SendData::XmlEvent(void) {
    69   uint16_t send_period;
     72  uint16_t send_period,nb_buffering;
    7073  bool is_enabled;
    7174  bool something_changed = false;
    7275
    73   if (GetPersistentXmlProp("period", send_period) &&
    74       GetPersistentXmlProp("enabled", is_enabled)) {
     76  if (GetPersistentXmlProp("period", send_period) && GetPersistentXmlProp("enabled", is_enabled) && GetPersistentXmlProp("nb_buf", nb_buffering)) {
    7577    if (send_period != SendPeriod())
    7678      something_changed = true;
    7779    if (is_enabled != IsEnabled())
     80      something_changed = true;
     81  }
     82 
     83  if (GetPersistentXmlProp("nb_buf", nb_buffering)) {
     84    if (nb_buffering != NbBuffering())
    7885      something_changed = true;
    7986  }
     
    8491    SetSendPeriod(send_period);
    8592    SetEnabled(is_enabled);
     93    SetNbBuffering(nb_buffering);
    8694
    8795    getFrameworkManager()->UpdateSendData(this);
     
    9199    SetVolatileXmlProp("period", send_period);
    92100    SetVolatileXmlProp("enabled", is_enabled);
     101    SetVolatileXmlProp("nb_buf", nb_buffering);
    93102    SendXml();
    94103
     
    102111
    103112uint16_t SendData::SendPeriod(void) const { return pimpl_->send_period; }
     113
     114uint16_t SendData::NbBuffering(void) const { return pimpl_->nb_buffering; }
    104115
    105116bool SendData::IsEnabled(void) const { return pimpl_->is_enabled; }
     
    116127void SendData::SetSendPeriod(uint16_t value) { pimpl_->send_period = value; }
    117128
     129void SendData::SetNbBuffering(uint16_t value) { pimpl_->nb_buffering = value; }
     130
    118131} // end namespace core
    119132} // end namespace flair
Note: See TracChangeset for help on using the changeset viewer.