Commit 670d7baa authored by Abdelali Elaazzouzi's avatar Abdelali Elaazzouzi
parents 4048daba 4b3476da
......@@ -20,6 +20,8 @@
#include "MpdaDef.h"
#include <cmath>
#include <boost/random.hpp>
#include <chrono>
#include <thread>
using namespace acquisition;
using namespace std;
......@@ -59,7 +61,8 @@ void SimulatedMpdaDriver::clear() {
owner()->counts2.update(0);
owner()->counts3.update(0);
int32* ldata = owner()->data();
for (int32 i = 0; i < owner()->dataSize(); i++) {
int32 datasize = owner()->dataSize();
for (int32 i = 0; i < datasize; i++) {
ldata[i] = 0;
}
}
......@@ -95,7 +98,8 @@ void SimulatedMpdaDriver::read() {
float64 rocarre = 64;
int32* ldata = owner()->data();
for (int32 i = 0; i < owner()->dataSize(); i++) {
int32 datasize = owner()->dataSize();
for (int32 i = 0; i < datasize; i++) {
int32 x = die();
float64 di = pow((i * 1. - (44. + 2 )), 2);
ldata[i] = ldata[i] + (int32) ( x + 90 * exp(-1. * di / (2 * rocarre)) ) ;
......@@ -279,7 +283,7 @@ void SimulatedMpdaDriver::timer() {
time = m_Times[i];
tottime += time;
while (m_TimeCounter.getTime() <= tottime) {
usleep(100);
this_thread::sleep_for(chrono::milliseconds(100));
owner()->time.update(m_TimeCounter.getTime());
if (m_Stop == true) {
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment