Esempio n. 1
0
    virtual void onRead(TestData &datum)
    {
        if (count==nframes)
            return;


        double now=Time::now();
        double origT=datum.get();
        unsigned int pl=datum.getPayloadSize();


#ifdef USE_PARALLEL_PORT
        static ppEventDebugger pp(0x378);
        pp.set();
        pp.reset();
#endif

        TestData &nd=outPort.prepare();
        nd.set(origT);
        nd.resize(pl);
        outPort.write(true);

        if (wait<=0)
            {

                double dT=(now-origT)*1000;
                delay+=dT;
                delaySq+=(dT*dT);
                count++;

                latencies.push_back(Report(dT, pl));
            }
        else
            wait--;
    }
Esempio n. 2
0
    void wakeUp(double t)
    {
#if USE_PARALLEL_PORT
        pp.set();
#endif
        stamp=t;
        mutex.unlock();
    }
Esempio n. 3
0
    void run()
    {

        //  printf("Sending frame %d\n", k);
        TestData &datum=port.prepare();
        datum.resize(payload);
        double time=Time::now();
        datum.set(time);

#ifdef USE_PARALLEL_PORT
        static ppEventDebugger pp(0x378);
        pp.set();
#endif
        port.write(true);
#ifdef USE_PARALLEL_PORT
        pp.reset();
#endif
    }
Esempio n. 4
0
    void run()
    {
        while(!isStopping())
            {
                static int count=0;
                mutex.lock();
                count++;
#ifdef USE_PARALLEL_PORT
                pp.reset();
#endif
                if (count<iterations)
                    {
                        double dT=(Time::now()-stamp)*1000; //ms
                        measures.push_back(dT);
                    }
            }
    }