Changeset 252 in flair-src for trunk/lib/FlairCore
- Timestamp:
- Jul 5, 2018, 5:57:08 PM (6 years ago)
- Location:
- trunk/lib/FlairCore/src
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairCore/src/AhrsData.cpp
r167 r252 232 232 } 233 233 234 void AhrsData:: CopyDatas(char *dst) const {234 void AhrsData::RawRead(char *dst) const { 235 235 GetMutex(); 236 236 Queue(&dst, &quaternion.q0, sizeof(quaternion.q0)); -
trunk/lib/FlairCore/src/AhrsData.h
r167 r252 161 161 private: 162 162 /*! 163 * \brief Copydatas163 * \brief Raw read datas 164 164 * 165 165 * Reimplemented from io_data. \n 166 * See io_data:: CopyDatas.166 * See io_data::RawRead. 167 167 * 168 168 * \param dst destination buffer 169 169 */ 170 void CopyDatas(char *dst) const;170 void RawRead(char *dst) const; 171 171 172 172 void Queue(char **dst, const void *src, size_t size) const; -
trunk/lib/FlairCore/src/GeoCoordinate.cpp
r15 r252 69 69 } 70 70 71 void GeoCoordinate:: CopyDatas(char *ptr) const { Warn("a ecrire"); }71 void GeoCoordinate::RawRead(char *ptr) const { Warn("a ecrire"); } 72 72 73 73 } // end namespace core -
trunk/lib/FlairCore/src/GeoCoordinate.h
r15 r252 96 96 private: 97 97 /*! 98 * \brief Copydatas98 * \brief Raw read datas 99 99 * 100 100 * Reimplemented from io_data. \n 101 * See io_data:: CopyDatas.101 * See io_data::RawRead. 102 102 * 103 103 * \param dst destination buffer 104 104 */ 105 void CopyDatas(char *ptr) const;105 void RawRead(char *ptr) const; 106 106 107 107 double latitude; -
trunk/lib/FlairCore/src/GpsData.cpp
r180 r252 298 298 } 299 299 300 void GpsData:: CopyDatas(char *dst) const {300 void GpsData::RawRead(char *dst) const { 301 301 GetMutex(); 302 302 -
trunk/lib/FlairCore/src/GpsData.h
r180 r252 244 244 245 245 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; 246 256 247 257 private: 248 /*!249 * \brief Copy datas250 *251 * Reimplemented from io_data. \n252 * See io_data::CopyDatas.253 *254 * \param dst destination buffer255 */256 void CopyDatas(char *dst) const;257 258 258 void Queue(char **dst, const void *src, size_t size) const; 259 259 Type dataType; -
trunk/lib/FlairCore/src/IODevice_impl.cpp
r157 r252 204 204 for (size_t i = 0; i < datasToLog.size(); i++) { 205 205 // printf("copy %s\n",datasToLog.at(i)->ObjectName().c_str()); 206 datasToLog.at(i)-> CopyDatas(*ptr);206 datasToLog.at(i)->RawRead(*ptr); 207 207 (*ptr) += datasToLog.at(i)->GetDataType().GetSize(); 208 208 } -
trunk/lib/FlairCore/src/ImuData.cpp
r167 r252 226 226 } 227 227 228 void ImuData:: CopyDatas(char *dst) const {228 void ImuData::RawRead(char *dst) const { 229 229 GetMutex(); 230 230 -
trunk/lib/FlairCore/src/ImuData.h
r167 r252 186 186 private: 187 187 /*! 188 * \brief Copydatas188 * \brief Raw read datas 189 189 * 190 190 * Reimplemented from io_data. \n 191 * See io_data:: CopyDatas.191 * See io_data::RawRead. 192 192 * 193 193 * \param dst destination buffer 194 194 */ 195 void CopyDatas(char *dst) const;195 void RawRead(char *dst) const; 196 196 197 197 /*! -
trunk/lib/FlairCore/src/Matrix.cpp
r214 r252 188 188 } 189 189 190 void Matrix:: CopyDatas(char *dst) const {190 void Matrix::RawRead(char *dst) const { 191 191 GetMutex(); 192 192 memcpy(dst, pimpl_->datas, dataType.GetSize()); … … 194 194 } 195 195 196 void Matrix::RawWrite(char *src) { 197 GetMutex(); 198 memcpy(pimpl_->datas, src,dataType.GetSize()); 199 ReleaseMutex(); 200 } 201 196 202 uint32_t Matrix::Rows(void) const { return pimpl_->descriptor->Rows(); } 197 203 -
trunk/lib/FlairCore/src/Matrix.h
r214 r252 194 194 195 195 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 197 216 private: 198 /*!199 * \brief Copy datas200 *201 * Reimplemented from io_data. \n202 * See io_data::CopyDatas.203 *204 * \param dst destination buffer205 */206 //void CopyDatas(char *dst) const;207 208 217 class Matrix_impl *pimpl_; 209 218 Type dataType; -
trunk/lib/FlairCore/src/RangeFinderPlot.cpp
r221 r252 58 58 59 59 void RangeFinderPlot::CopyDatas(char *buf) const { 60 datas-> CopyDatas(buf);60 datas->RawRead(buf); 61 61 } 62 62 -
trunk/lib/FlairCore/src/Thread.cpp
r213 r252 107 107 if(nanosleep(&req,&rem)!=0) Err("error in nanosleep\n");//todo, handle EINTR 108 108 } 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)); 110 110 } 111 111 #endif -
trunk/lib/FlairCore/src/UsSensorPlot.cpp
r221 r252 63 63 64 64 void 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()); 67 67 } 68 68 -
trunk/lib/FlairCore/src/Vector3Ddata.h
r167 r252 78 78 * 79 79 * Reimplemented from io_data. \n 80 * See io_data:: CopyDatas.80 * See io_data::RawRead. 81 81 * 82 82 * \param dst destination buffer -
trunk/lib/FlairCore/src/Watchdog.cpp
r213 r252 43 43 Time current = GetTime(); 44 44 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); 47 46 if (!SuspendUntil(date)) { 47 //Printf("watchdog expired at %llu!!!!!!!!!!!!!!!!\n",GetTime()); 48 48 expired(); 49 49 } -
trunk/lib/FlairCore/src/cvimage.cpp
r124 r252 76 76 } 77 77 78 void cvimage:: CopyDatas(char *dst) const { Warn("non implementé\n"); }78 void cvimage::RawRead(char *dst) const { Warn("non implementé\n"); } 79 79 80 80 } // end namespace core -
trunk/lib/FlairCore/src/cvimage.h
r124 r252 108 108 private: 109 109 /*! 110 * \brief Copydatas110 * \brief Raw read datas 111 111 * 112 112 * Reimplemented from io_data. \n 113 * See io_data:: CopyDatas.113 * See io_data::RawRead. 114 114 * 115 115 * \param dst destination buffer 116 116 */ 117 void CopyDatas(char *dst) const;117 void RawRead(char *dst) const; 118 118 119 119 bool allocate_data; -
trunk/lib/FlairCore/src/cvmatrix.h
r148 r252 209 209 * 210 210 * Reimplemented from io_data. \n 211 * See io_data:: CopyDatas.211 * See io_data::RawRead. 212 212 * 213 213 * \param dst destination buffer -
trunk/lib/FlairCore/src/io_data.h
r223 r252 176 176 177 177 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 178 200 179 201 protected: … … 208 230 209 231 private: 210 /*!211 * \brief Copy datas212 *213 * This method is automatically called by IODevice::ProcessUpdate to log214 *io_data datas. \n215 * 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 buffer219 */220 virtual void CopyDatas(char *dst) const = 0;221 222 232 io_data_impl *pimpl_; 223 233 }; -
trunk/lib/FlairCore/src/ui_com.cpp
r247 r252 153 153 } 154 154 155 void ui_com::Send(char *buf, ssize_t size ) {155 void ui_com::Send(char *buf, ssize_t size,int ttl) { 156 156 if (connection_lost == true) 157 157 return; … … 188 188 if (compressBuffer(tosend, size, &out, &out_size, 9) == Z_OK) { 189 189 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); 191 191 free(out); 192 192 } else { … … 197 197 198 198 if (!sendItCompressed) { 199 nb_write = UDT::sendmsg(socket_fd, tosend, size, -1, true);199 nb_write = UDT::sendmsg(socket_fd, tosend, size, ttl, true); 200 200 } 201 201 202 202 #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); 204 204 #endif // COMPRESS_FRAMES 205 205 //Printf("write %i %i\n",nb_write,size); … … 295 295 if (offset != 3) { 296 296 memcpy(&send_buffer[1], &resume_period, sizeof(uint16_t)); 297 // 297 //printf("send %i %i %i %x %x\n",resume_period,offset,sizeof(uint16_t),send_buffer,&send_buffer[1]); 298 298 // for(int i=0;i<offset;i++) printf("%x ",send_buffer[i]); 299 299 // printf("\n"); 300 Send(send_buffer, offset );300 Send(send_buffer, offset,resume_period); 301 301 } 302 302 -
trunk/lib/FlairCore/src/unexported/ui_com.h
r234 r252 39 39 ui_com(const flair::core::Object *parent, UDTSOCKET sock); 40 40 ~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!) 42 42 ssize_t Receive(char *buf, ssize_t buf_size); 43 43 void AddSendData(const flair::gui::SendData *obj);
Note:
See TracChangeset
for help on using the changeset viewer.