FACT++  1.0
void tcp_connection::SendDynamicData ( )
inlineprivate

Definition at line 161 of file ftm.cc.

References buffer, DynamicData(), FTM::Header::fDataSize, fRatePatch, FTM::DynamicData::fTempSensor, FTM::Header::fTimeStamp, FTM::Header::fTriggerCounter, FTM::Header::fType, FTM::Header::HtoN(), FTM::DynamicData::HtoN(), i, and FTM::kDynamicData.

162  {
163  if (fReportsDisabled)
164  return;
165 
166  //if (fHeader.fState == FTM::kFtmRunning)
167  // fDynamicData.fOnTimeCounter = lrint(Time().UnixTime()-fStartTime);
168 
169  fDynamicData.fTempSensor[0] = (23. + (6.*rand()/RAND_MAX-3))*10;
170  fDynamicData.fTempSensor[1] = (55. + (6.*rand()/RAND_MAX-3))*10;
171  fDynamicData.fTempSensor[2] = (39. + (6.*rand()/RAND_MAX-3))*10;
172  fDynamicData.fTempSensor[3] = (42. + (6.*rand()/RAND_MAX-3))*10;
173 
174  for (int i=0; i<40; i++)
175  for (int p=0; p<4; p++)
176  fDynamicData[i].fRatePatch[p] = (1000 + (float(rand())/RAND_MAX-0.5)*25*p);
177 
178  fHeader.fType=kDynamicData; // FtuList
179  fHeader.fDataSize=sizeof(FTM::DynamicData)/2+1;
180  fHeader.fTriggerCounter = fCounter;
181  fHeader.fTimeStamp = fTimeStamp++*1000000;//lrint(Time().UnixTime());
182 
183  fBufHeader = fHeader.HtoN();
185 
186  AsyncWrite(ba::buffer(ba::const_buffer(&fBufHeader[0], fBufHeader.size()*2)));
187  AsyncWrite(ba::buffer(ba::const_buffer(&fBufDynamicData[0], sizeof(FTM::DynamicData))));
188  AsyncWrite(ba::buffer(ba::const_buffer(&fDelimiter, 2)));
189  }
uint32_t fRatePatch[4]
Definition: HeadersFTM.h:186
Dynamic data (rates)
Definition: HeadersFTM.h:90
uint16_t fTimeStamp
Definition: ftm.cc:155
int i
Definition: db_dim_client.c:21
uint16_t fDelimiter
Definition: ftm.cc:151
uint16_t fTempSensor[4]
Definition: HeadersFTM.h:504
vector< uint16_t > fBufHeader
Definition: ftm.cc:138
vector< uint16_t > fBufDynamicData
Definition: ftm.cc:141
FTM::DynamicData fDynamicData
Definition: ftm.cc:147
std::vector< uint16_t > HtoN() const
Definition: HeadersFTM.h:510
bool fReportsDisabled
Definition: ftm.cc:157
int buffer[BUFFSIZE]
Definition: db_dim_client.c:14
void AsyncWrite(ba::ip::tcp::socket *socket, const ba::const_buffers_1 &buffers)
Definition: fad.cc:73
uint16_t fCounter
Definition: ftm.cc:154
DynamicData()
Definition: HeadersFTM.h:191
FAD::EventHeader fHeader
Definition: fad.cc:117

+ Here is the call graph for this function: