Changeset 452 in flair-src


Ignore:
Timestamp:
Oct 1, 2021, 3:42:02 PM (3 years ago)
Author:
Sanahuja Guillaume
Message:

resolve Jossue bug with mutli buffering and grpahs

File:
1 edited

Legend:

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

    r445 r452  
    553553//must be called with mutex locked
    554554void ui_com::UpdateSendData(const SendData *obj) {
     555   // Printf("UpdateSendData %s\n",obj->ObjectName().c_str());
    555556  // le mutex est deja pris par l'appellant
    556557  size_t id, i;
     
    615616      for (size_t i = 0; i < pushedDatas.size(); i++) {
    616617          if (pushedDatas.at(i).period==obj->SendPeriod() && pushedDatas.at(i).nb_buffering==obj->NbBuffering()) {
    617               //Printf("match item %i, period %i nb buff %i\n",i,obj->SendPeriod(),obj->NbBuffering());
     618              //Printf("match item %i, period %i nb buff %i, size %i\n",i,obj->SendPeriod(),obj->NbBuffering(),pushedDatas.at(i).final_size);
    618619              match=true;
    619620            }
     
    628629        tmp.final_size=0;
    629630        for (size_t i = 0; i < datasToSend.size(); i++) {
    630             //Printf("data %i/%i %i %i\n",i,datasToSend.size(),datasToSend.at(i)->SendPeriod() ,datasToSend.at(i)->NbBuffering());
     631            //Printf("data %s %i/%i %i %i\n",datasToSend.at(i)->ObjectName().c_str(),i,datasToSend.size(),datasToSend.at(i)->SendPeriod() ,datasToSend.at(i)->NbBuffering());
    631632            if (datasToSend.at(i)->IsEnabled() && datasToSend.at(i)->SendPeriod() == obj->SendPeriod() && datasToSend.at(i)->NbBuffering()==obj->NbBuffering()) {
    632633              tmp.final_size+=datasToSend.at(i)->SendSize();
     
    652653void ui_com::UpdateDataToSendBufferSize(const SendData *obj) {
    653654    if(!obj->IsEnabled()) return;
    654    
     655    //Printf("UpdateDataToSendBufferSize %s\n",obj->ObjectName().c_str());
    655656    send_mutex->GetMutex();
    656657   
     
    667668    }
    668669   
    669     ptr->final_size=sizeof(char)+sizeof(uint16_t);//header+period
     670    ptr->final_size=0;
     671    //Printf("actual %i\n",ptr->final_size);
     672    for (size_t i = 0; i < datasToSend.size(); i++) {
     673        //Printf("data %s %i/%i %i %i\n",datasToSend.at(i)->ObjectName().c_str(),i,datasToSend.size(),datasToSend.at(i)->SendPeriod() ,datasToSend.at(i)->NbBuffering());
     674        if (datasToSend.at(i)->IsEnabled() && datasToSend.at(i)->SendPeriod() == obj->SendPeriod() && datasToSend.at(i)->NbBuffering()==obj->NbBuffering()) {
     675          ptr->final_size+=datasToSend.at(i)->SendSize();
     676          //Printf("add %i\n",datasToSend.at(i)->SendSize());
     677        }
     678    }
     679    ptr->final_size*=obj->NbBuffering();
     680    ptr->final_size+=sizeof(char)+sizeof(uint16_t);//header+period
    670681    if(ptr->nb_buffering>1) ptr->final_size+=sizeof(uint16_t);//+nb_buffering
    671     ptr->final_size+=obj->SendSize()*obj->NbBuffering();
     682       
    672683    //Printf("final %i\n",ptr->final_size);
    673684    free(ptr->buf);
Note: See TracChangeset for help on using the changeset viewer.