Changeset 437 in flair-src for trunk/lib


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

prepare for graphs buffering

Location:
trunk/lib/FlairCore/src
Files:
7 edited

Legend:

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

    r15 r437  
    2424
    2525DoubleSpinBox::DoubleSpinBox(const LayoutPosition *position, string name,
    26                              double min, double max, double step, int decimals,
     26                             double min, double max, double step, uint16_t decimals,
    2727                             double default_value)
    2828    : Box(position, name, "DoubleSpinBox") {
     
    4646DoubleSpinBox::DoubleSpinBox(const LayoutPosition *position, string name,
    4747                             string suffix, double min, double max, double step,
    48                              int decimals, double default_value)
     48                             uint16_t decimals, double default_value)
    4949    : Box(position, name, "DoubleSpinBox") {
    5050  // update value from xml file
  • trunk/lib/FlairCore/src/DoubleSpinBox.h

    r15 r437  
    4343  */
    4444  DoubleSpinBox(const LayoutPosition *position, std::string name, double min,
    45                 double max, double step, int decimals = 2,
     45                double max, double step, uint16_t decimals = 2,
    4646                double default_value = 0);
    4747
     
    6363  DoubleSpinBox(const LayoutPosition *position, std::string name,
    6464                std::string suffix, double min, double max, double step,
    65                 int decimals = 2, double default_value = 0);
     65                uint16_t decimals = 2, double default_value = 0);
    6666
    6767  /*!
  • 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
  • trunk/lib/FlairCore/src/SendData.h

    r15 r437  
    3434  */
    3535  SendData(const LayoutPosition *position, std::string name, std::string type,
    36            uint16_t default_periodms = 100, bool default_enabled = false);
     36           uint16_t default_periodms = 100, bool default_enabled = false, uint16_t default_nb_buffering=1);
    3737
    3838  /*!
     
    5454  uint16_t SendPeriod(void) const; // in ms
    5555  bool IsEnabled(void) const;
     56  uint16_t NbBuffering(void) const;
    5657
    5758protected:
     
    8889
    8990  void SetSendPeriod(uint16_t value);
     91  void SetNbBuffering(uint16_t value);
    9092  void SetEnabled(bool value);
    9193
  • trunk/lib/FlairCore/src/Vector3DSpinBox.cpp

    r167 r437  
    2626Vector3DSpinBox::Vector3DSpinBox(const LayoutPosition *position, string name,
    2727                                 double min, double max, double step,
    28                                  int decimals, core::Vector3Df default_value)
     28                                 uint16_t decimals, core::Vector3Df default_value)
    2929    : Box(position, name, "Vector3DSpinBox") {
    3030  // update value from xml file
  • trunk/lib/FlairCore/src/Vector3DSpinBox.h

    r199 r437  
    4343  */
    4444  Vector3DSpinBox(const LayoutPosition *position, std::string name, double min,
    45                   double max, double step, int decimals = 2,
     45                  double max, double step, uint16_t decimals = 2,
    4646                  core::Vector3Df default_value = core::Vector3Df(0, 0, 0));
    4747
  • trunk/lib/FlairCore/src/unexported/SendData_impl.h

    r15 r437  
    3030  size_t send_size;
    3131  uint16_t send_period;
     32  uint16_t nb_buffering;
    3233};
    3334
Note: See TracChangeset for help on using the changeset viewer.