Commit 9ed66037 authored by jcaceres's avatar jcaceres
Browse files

merge changes with trunk

parent 2ffddade
- add the option for 24 bit audio
- remove comments and cleanup code
- add a verbose mode, with more diagnostics (silent by default)
Check how to do this with a flag in cerr
- check if multithread is working correctly
- sourceforge
- Distribute without the FAUST dependency
- Always remove the debug mode for release
- remove at some point the qt3support
- remove the lasound dependency
- Replace all types by qt types, to make it more robost to multiprocessors.
-Check That the Ethernet is running in full duplex
/sbin/ethtool gives that info, but you have to be root for that
looking for other options...
......@@ -5,8 +17,4 @@
dmesg |grep eth0
gives the info
Check the FIFO Prioriy, now it is at 51, was at 99
=======
Add flag to name the client with more meaningfull names than go_1, etc..
-Check the FIFO Prioriy, now it is at 51, was at 99
- add the option for 24 bit audio
- remove comments and cleanup code
- add a verbose mode, with more diagnostics (silent by default)
Check how to do this with a flag in cerr
- check if multithread is working correctly
- sourceforge
- Distribute without the FAUST dependency
- Always remove the debug mode for release
- remove at some point the qt3support
- remove the lasound dependency
- Replace all types by qt types, to make it more robost to multiprocessors.
#include <stdlib.h>
#include <qapplication.h>
#include <qwt_plot.h>
#include <qwt_math.h>
#include "StripChart.h"
//
// Initialize main window
//
StripChart::StripChart (QWidget * parent, const char *name):
QwtPlot (parent, name)
{
// Initialize data
for (int i = 0; i < PLOT_SIZE; i++)
{
x[i] = 0.5 * double (i); // time axis
w[i] = 0.0;
y[i] = 0.0;
z[i] = 0.0;
}
v1State = 0.0;
v2State = 0.0;
v3State = 0.0;
_go = true;
// Assign a title
setTitle ("");
setAutoLegend (TRUE);
// Insert new curves
long crtt = insertCurve ("RTT");
long cstddev = insertCurve ("StdDev");
long cavg = insertCurve ("average");
// Set curve styles
setCurvePen (crtt, QPen (red));
setCurvePen (cstddev, QPen (blue));
setCurvePen (cavg, QPen (yellow));
// Attach (don't copy) data. Both curves use the same x array.
setCurveRawData (crtt, x, w, PLOT_SIZE);
setCurveRawData (cstddev, x, y, PLOT_SIZE);
setCurveRawData (cavg, x, z, PLOT_SIZE);
// Insert zero line at y = 0
long mY = insertLineMarker ("", QwtPlot::yLeft);
setMarkerYPos (mY, 0.0);
// Set axis titles
setAxisTitle (QwtPlot::xBottom, " Sequence");
setAxisTitle (QwtPlot::yLeft, "Seconds");
// Generate timer event every 50ms
// (void)startTimer(10);
}
StripChart::~StripChart ()
{
}
//
// Generate new values every 500ms.
//
void
StripChart::timerEvent (QTimerEvent *)
{
static double phase = 0.0;
if (phase > (M_PI - 0.0001))
phase = 0;
// y moves from left to right:
// Shift y array right and assign new value to y[0].
qwtShiftArray (w, PLOT_SIZE, 1);
// y[0] = sin(phase) * (-1.0 + 2.0 * double(rand()) / double(RAND_MAX));
w[0] = rtt;
// z moves from right to left:
// Shift z array left and assign new value to z[n-1].
/*
* qwtShiftArray(z, PLOT_SIZE, -1);
* z[PLOT_SIZE - 1] = 0.8 - (2.0 * phase/M_PI) + 0.4 *
* double(rand()) / double(RAND_MAX);
*/
// update the display
qwtShiftArray (y, PLOT_SIZE, 1);
y[0] = stddev;
qwtShiftArray (z, PLOT_SIZE, 1);
z[0] = avg;
replot ();
// phase += M_PI * 0.02;
}
void
StripChart::goPlot (bool go)
{
_go = go;
if (_go)
{
replot ();
show ();
}
else
hide ();
}
void
StripChart::setV1 (double v1)
{
v1State = v1;
}
void
StripChart::setV2 (double v2)
{
v2State = v2;
}
void
StripChart::setV3 (double v3)
{
v3State = v3;
}
void
StripChart::dpy ()
{
qwtShiftArray (w, PLOT_SIZE, 1);
w[0] = v1State;
qwtShiftArray (y, PLOT_SIZE, 1);
y[0] = v2State;
qwtShiftArray (z, PLOT_SIZE, 1);
z[0] = v3State;
if (_go)
replot ();
}
//
// File: PingDialog.h
// Created by: cc <cc@cmn42.Stanford.EDU>
// Created on: Sun Mar 2 10:20:41 2003
//
#ifndef _PINGSTRIPCHART_H_
#define _PINGSTRIPCHART_H_
#include <stdlib.h>
#include <qapplication.h>
#include <qwt_plot.h>
#include <qwt_math.h>
const int PLOT_SIZE = 101; // 0 to 200
//-----------------------------------------------------------------
// data_plot.cpp
//
// This example shows how to display time-varying data
// using QwtPlot.
//
//-----------------------------------------------------------------
class StripChart : public QwtPlot
{
Q_OBJECT public:
StripChart(QWidget * parent = 0, const char *name = 0);
virtual ~ StripChart ();
void dpy();
void setV1(double v1);
void setV2(double v2);
void setV3(double v3);
double v1State;
double v2State;
double v3State;
double rtt;
double stddev;
double avg;
bool _go;
protected:
virtual void timerEvent(QTimerEvent *e);
private:
double w[PLOT_SIZE], x[PLOT_SIZE], y[PLOT_SIZE], z[PLOT_SIZE];
public slots:void goPlot (bool);
};
#endif //_PINGSTRIPCHART_H_
#ifndef _STK_PLUGIN_H
#define _STK_PLUGIN_H
#include <math.h>
#include "process_plugin.h"
/**
* @brief Interface for ProcessPlugin to use STK library processing.
*/
typedef signed short INT16;
class STKProcess : public ProcessPlugin
{
private:
Filter *thisFilter;
public:
STKProcess(Filter *thisFilter) : thisFilter(thisFilter)
{ this->setName("anonymous STK plugin"); }
STKProcess(Filter *thisFilter, char *name) : thisFilter(thisFilter)
{ this->setName(name); }
virtual int process(char *sample)
{
// static MY_FLOAT f;
static double f;
static INT16 s;
s = *(INT16 *)sample;
// CURRENTLY ONLY WORKS FOR INT16!
f = s / 32768.0;
f = thisFilter->tick(f);
s = (INT16)floor(f * 32768.0);
*(INT16 *)sample = s;
return 0;
}
void plotVal (double v)
{
if(_rcvr!=NULL)
{
ThreadCommEvent *e = new ThreadCommEvent (v,
0.0,
0.0);
QApplication::postEvent (_rcvr, e); // to app event loop
}
}
};
#endif
Supports Markdown
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