Changeset 252 in flair-src for trunk/lib


Ignore:
Timestamp:
Jul 5, 2018, 5:57:08 PM (6 years ago)
Author:
Sanahuja Guillaume
Message:

change io_data CopyDate to RawRead

Location:
trunk/lib
Files:
24 edited

Legend:

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

    r167 r252  
    232232}
    233233
    234 void AhrsData::CopyDatas(char *dst) const {
     234void AhrsData::RawRead(char *dst) const {
    235235  GetMutex();
    236236  Queue(&dst, &quaternion.q0, sizeof(quaternion.q0));
  • trunk/lib/FlairCore/src/AhrsData.h

    r167 r252  
    161161private:
    162162  /*!
    163   * \brief Copy datas
     163  * \brief Raw read datas
    164164  *
    165165  * Reimplemented from io_data. \n
    166   * See io_data::CopyDatas.
     166  * See io_data::RawRead.
    167167  *
    168168  * \param dst destination buffer
    169169  */
    170   void CopyDatas(char *dst) const;
     170  void RawRead(char *dst) const;
    171171
    172172  void Queue(char **dst, const void *src, size_t size) const;
  • trunk/lib/FlairCore/src/GeoCoordinate.cpp

    r15 r252  
    6969}
    7070
    71 void GeoCoordinate::CopyDatas(char *ptr) const { Warn("a ecrire"); }
     71void GeoCoordinate::RawRead(char *ptr) const { Warn("a ecrire"); }
    7272
    7373} // end namespace core
  • trunk/lib/FlairCore/src/GeoCoordinate.h

    r15 r252  
    9696private:
    9797  /*!
    98   * \brief Copy datas
     98  * \brief Raw read datas
    9999  *
    100100  * Reimplemented from io_data. \n
    101   * See io_data::CopyDatas.
     101  * See io_data::RawRead.
    102102  *
    103103  * \param dst destination buffer
    104104  */
    105   void CopyDatas(char *ptr) const;
     105  void RawRead(char *ptr) const;
    106106
    107107  double latitude;
  • trunk/lib/FlairCore/src/GpsData.cpp

    r180 r252  
    298298}
    299299
    300 void GpsData::CopyDatas(char *dst) const {
     300void GpsData::RawRead(char *dst) const {
    301301  GetMutex();
    302302
  • trunk/lib/FlairCore/src/GpsData.h

    r180 r252  
    244244
    245245  Type const &GetDataType() const { return dataType; }
     246 
     247  /*!
     248  * \brief Raw read datas
     249  *
     250  * Reimplemented from io_data. \n
     251  * See io_data::RawRead.
     252  *
     253  * \param dst destination buffer
     254  */
     255  void RawRead(char *dst) const;
    246256
    247257private:
    248   /*!
    249   * \brief Copy datas
    250   *
    251   * Reimplemented from io_data. \n
    252   * See io_data::CopyDatas.
    253   *
    254   * \param dst destination buffer
    255   */
    256   void CopyDatas(char *dst) const;
    257 
    258258  void Queue(char **dst, const void *src, size_t size) const;
    259259  Type dataType;
  • trunk/lib/FlairCore/src/IODevice_impl.cpp

    r157 r252  
    204204  for (size_t i = 0; i < datasToLog.size(); i++) {
    205205    // printf("copy %s\n",datasToLog.at(i)->ObjectName().c_str());
    206     datasToLog.at(i)->CopyDatas(*ptr);
     206    datasToLog.at(i)->RawRead(*ptr);
    207207    (*ptr) += datasToLog.at(i)->GetDataType().GetSize();
    208208  }
  • trunk/lib/FlairCore/src/ImuData.cpp

    r167 r252  
    226226}
    227227
    228 void ImuData::CopyDatas(char *dst) const {
     228void ImuData::RawRead(char *dst) const {
    229229  GetMutex();
    230230
  • trunk/lib/FlairCore/src/ImuData.h

    r167 r252  
    186186private:
    187187  /*!
    188   * \brief Copy datas
     188  * \brief Raw read datas
    189189  *
    190190  * Reimplemented from io_data. \n
    191   * See io_data::CopyDatas.
     191  * See io_data::RawRead.
    192192  *
    193193  * \param dst destination buffer
    194194  */
    195   void CopyDatas(char *dst) const;
     195  void RawRead(char *dst) const;
    196196
    197197  /*!
  • trunk/lib/FlairCore/src/Matrix.cpp

    r214 r252  
    188188}
    189189
    190 void Matrix::CopyDatas(char *dst) const {
     190void Matrix::RawRead(char *dst) const {
    191191  GetMutex();
    192192  memcpy(dst, pimpl_->datas, dataType.GetSize());
     
    194194}
    195195
     196void Matrix::RawWrite(char *src) {
     197  GetMutex();
     198  memcpy(pimpl_->datas, src,dataType.GetSize());
     199  ReleaseMutex();
     200}
     201
    196202uint32_t Matrix::Rows(void) const { return pimpl_->descriptor->Rows(); }
    197203
  • trunk/lib/FlairCore/src/Matrix.h

    r214 r252  
    194194
    195195  Type const &GetDataType() const { return dataType; };
    196 void CopyDatas(char *dst) const;
     196 
     197  /*!
     198  * \brief Raw read datas
     199  *
     200  * Reimplemented from io_data. \n
     201  * See io_data::RawRead.
     202  *
     203  * \param dst destination buffer
     204  */
     205  void RawRead(char *dst) const;
     206
     207  /*!
     208  * \brief Raw write datas
     209  *
     210  * Copy the source to the internal datas. Source must be of the corresponding size.
     211  *
     212  * \param src source buffer
     213  */
     214  void RawWrite(char *src);
     215 
    197216private:
    198   /*!
    199   * \brief Copy datas
    200   *
    201   * Reimplemented from io_data. \n
    202   * See io_data::CopyDatas.
    203   *
    204   * \param dst destination buffer
    205   */
    206   //void CopyDatas(char *dst) const;
    207 
    208217  class Matrix_impl *pimpl_;
    209218  Type dataType;
  • trunk/lib/FlairCore/src/RangeFinderPlot.cpp

    r221 r252  
    5858
    5959void RangeFinderPlot::CopyDatas(char *buf) const {
    60   datas->CopyDatas(buf);
     60  datas->RawRead(buf);
    6161}
    6262
  • trunk/lib/FlairCore/src/Thread.cpp

    r213 r252  
    107107    if(nanosleep(&req,&rem)!=0) Err("error in nanosleep\n");//todo, handle EINTR
    108108  } else {
    109     Err("error resume time is passed by %lldns\n", ( current-time));
     109    Err("error resume time (%lldns) is passed by %lldns\n",time, ( current-time));
    110110  }
    111111#endif
  • trunk/lib/FlairCore/src/UsSensorPlot.cpp

    r221 r252  
    6363
    6464void UsSensorPlot::CopyDatas(char *buf) const {
    65   datas->CopyDatas(buf);
    66   peakInfos->CopyDatas(buf+datas->GetDataType().GetSize());
     65  datas->RawRead(buf);
     66  peakInfos->RawRead(buf+datas->GetDataType().GetSize());
    6767}
    6868
  • trunk/lib/FlairCore/src/Vector3Ddata.h

    r167 r252  
    7878  *
    7979  * Reimplemented from io_data. \n
    80   * See io_data::CopyDatas.
     80  * See io_data::RawRead.
    8181  *
    8282  * \param dst destination buffer
  • trunk/lib/FlairCore/src/Watchdog.cpp

    r213 r252  
    4343    Time current = GetTime();
    4444    Time date = current + timer;
    45     // Printf("watchdog goes to sleep at %llu, scheduled to wake up at
    46     // %llu\n",current,date);
     45    //Printf("watchdog goes to sleep at %llu, scheduled to wake up at %llu\n",current,date);
    4746    if (!SuspendUntil(date)) {
     47      //Printf("watchdog expired at %llu!!!!!!!!!!!!!!!!\n",GetTime());
    4848      expired();
    4949    }
  • trunk/lib/FlairCore/src/cvimage.cpp

    r124 r252  
    7676}
    7777
    78 void cvimage::CopyDatas(char *dst) const { Warn("non implementé\n"); }
     78void cvimage::RawRead(char *dst) const { Warn("non implementé\n"); }
    7979
    8080} // end namespace core
  • trunk/lib/FlairCore/src/cvimage.h

    r124 r252  
    108108private:
    109109  /*!
    110   * \brief Copy datas
     110  * \brief Raw read datas
    111111  *
    112112  * Reimplemented from io_data. \n
    113   * See io_data::CopyDatas.
     113  * See io_data::RawRead.
    114114  *
    115115  * \param dst destination buffer
    116116  */
    117   void CopyDatas(char *dst) const;
     117  void RawRead(char *dst) const;
    118118
    119119  bool allocate_data;
  • trunk/lib/FlairCore/src/cvmatrix.h

    r148 r252  
    209209  *
    210210  * Reimplemented from io_data. \n
    211   * See io_data::CopyDatas.
     211  * See io_data::RawRead.
    212212  *
    213213  * \param dst destination buffer
  • trunk/lib/FlairCore/src/io_data.h

    r223 r252  
    176176
    177177  virtual DataType const &GetDataType() const = 0;
     178 
     179  /*!
     180  * \brief Raw write datas
     181  *
     182  * Copy the source to the internal datas. Source must be of the corresponding size.
     183  *
     184  * \param src source buffer
     185  */
     186  virtual void RawWrite(char *src)  {};//todo put pure virtual
     187 
     188  /*!
     189  * \brief Raw read datas
     190  *
     191  * This method is automatically called by IODevice::ProcessUpdate to log
     192  * io_data datas. \n
     193  * This method must be reimplemented, in order to copy the datas to the logs.
     194  * Copy the internal datas to destination. Destination must be of the corresponding size.
     195  *
     196  * \param dst destination buffer
     197  */
     198  virtual void RawRead(char *dst) const = 0;
     199
    178200
    179201protected:
     
    208230
    209231private:
    210   /*!
    211   * \brief Copy datas
    212   *
    213   * This method is automatically called by IODevice::ProcessUpdate to log
    214   *io_data datas. \n
    215   * This method must be reimplemented, in order to copy the datas to the logs.
    216   * Copied datas must be of size io_data::Size.
    217   *
    218   * \param dst destination buffer
    219   */
    220   virtual void CopyDatas(char *dst) const = 0;
    221 
    222232  io_data_impl *pimpl_;
    223233};
  • trunk/lib/FlairCore/src/ui_com.cpp

    r247 r252  
    153153}
    154154
    155 void ui_com::Send(char *buf, ssize_t size) {
     155void ui_com::Send(char *buf, ssize_t size,int ttl) {
    156156  if (connection_lost == true)
    157157    return;
     
    188188    if (compressBuffer(tosend, size, &out, &out_size, 9) == Z_OK) {
    189189      size = out_size;
    190       nb_write = UDT::sendmsg(socket_fd, out, size, -1, true);
     190      nb_write = UDT::sendmsg(socket_fd, out, size,ttl, true);
    191191      free(out);
    192192    } else {
     
    197197
    198198  if (!sendItCompressed) {
    199     nb_write = UDT::sendmsg(socket_fd, tosend, size, -1, true);
     199    nb_write = UDT::sendmsg(socket_fd, tosend, size, ttl, true);
    200200  }
    201201
    202202#else // COMPRESS_FRAMES
    203   nb_write = UDT::sendmsg(socket_fd, tosend, size, -1, true);
     203  nb_write = UDT::sendmsg(socket_fd, tosend, size, ttl, true);
    204204#endif // COMPRESS_FRAMES
    205205   //Printf("write %i %i\n",nb_write,size);
     
    295295      if (offset != 3) {
    296296        memcpy(&send_buffer[1], &resume_period, sizeof(uint16_t));
    297         // printf("send %i %i %i %x %x\n",resume_period,offset,sizeof(uint16_t),send_buffer,&send_buffer[1]);
     297        //printf("send %i %i %i %x %x\n",resume_period,offset,sizeof(uint16_t),send_buffer,&send_buffer[1]);
    298298        // for(int i=0;i<offset;i++) printf("%x ",send_buffer[i]);
    299299        // printf("\n");
    300         Send(send_buffer, offset);
     300        Send(send_buffer, offset,resume_period);
    301301      }
    302302
  • trunk/lib/FlairCore/src/unexported/ui_com.h

    r234 r252  
    3939  ui_com(const flair::core::Object *parent, UDTSOCKET sock);
    4040  ~ui_com();
    41   void Send(char *buf, ssize_t size);
     41  void Send(char *buf, ssize_t size,int ttl = -1);//ttl in ms, -1 for infinite; not used in RT (todo!)
    4242  ssize_t Receive(char *buf, ssize_t buf_size);
    4343  void AddSendData(const flair::gui::SendData *obj);
  • trunk/lib/FlairVisionFilter/src/OpticalFlowData.cpp

    r122 r252  
    103103}
    104104
    105 void OpticalFlowData::CopyDatas(char* dst) const
     105void OpticalFlowData::RawRead(char* dst) const
    106106{
    107107    Warn("non implementé\n");
  • trunk/lib/FlairVisionFilter/src/OpticalFlowData.h

    r122 r252  
    129129
    130130        OpticalFlowData::Type const &GetDataType() const {return dataType;}
     131       
     132        /*!
     133        * \brief Raw read datas
     134        *
     135        * Reimplemented from io_data. \n
     136        * See io_data::RawRead.
     137        *
     138        * \param dst destination buffer
     139        */
     140        void RawRead(char *dst) const;
    131141
    132142    private:
     
    137147        char *found_features;
    138148        uint32_t *features_error;
    139         void CopyDatas(char* dst) const;
    140149        Type dataType;
    141150    };
Note: See TracChangeset for help on using the changeset viewer.