Relacs
0.9.8
|
#include <spiketrace.h>
Public Slots | |
void | setSpike (bool on) |
void | setPause (bool pause) |
Public Member Functions | |
SpikeTrace (double spikewidth=1.0, int radius=6, int tracewidth=1, QWidget *parent=0) | |
SpikeTrace (QWidget *parent=0) | |
~SpikeTrace (void) | |
QSize | sizeHint (void) const |
QSize | minimumSizeHint (void) const |
QSizePolicy | sizePolicy (void) const |
Protected Member Functions | |
void | run (void) |
void | animate (void) |
int | trace (int x) |
void | resizeEvent (QResizeEvent *qre) |
void | paintEvent (QPaintEvent *qpe) |
void | customEvent (QEvent *qce) |
Protected Attributes | |
bool | Show |
bool | Pause |
int | Pos |
int | pPos |
int | dPos |
int | Radius |
int | TraceWidth |
double | SpikeSize |
double | SpikePos |
double | SpikeWidth |
QMutex | SMutex |
SpikeTraceThread * | Thread |
Friends | |
class | SpikeTraceThread |
A nice, almost useless widget, showing an animated trace of a spike.
Use setSpike() to toggle this animation completly on and off. With setPause() the animation can be stopped and restarted.
Reimplementate trace() to get a better trace.
SpikeTrace | ( | double | spikewidth = 1.0 , |
int | radius = 6 , |
||
int | tracewidth = 1 , |
||
QWidget * | parent = 0 |
||
) |
Constructs the SpikeTrace-widget with the width of the spike set to spikewidth pixels, the radius of the ball set to radius pixels, and the width of the trace set to linewidth pixels.
References SpikeTrace::dPos, SpikeTrace::Pause, SpikeTrace::Pos, SpikeTrace::Radius, SpikeTrace::Show, SpikeTrace::SpikePos, SpikeTrace::SpikeSize, SpikeTrace::SpikeTraceThread, SpikeTrace::SpikeWidth, SpikeTrace::Thread, and SpikeTrace::TraceWidth.
SpikeTrace | ( | QWidget * | parent = 0 | ) |
Constructs the SpikeTrace-widget with default parameters.
References SpikeTrace::dPos, SpikeTrace::Pause, SpikeTrace::Pos, SpikeTrace::pPos, SpikeTrace::Radius, SpikeTrace::Show, SpikeTrace::SpikePos, SpikeTrace::SpikeSize, SpikeTrace::SpikeTraceThread, SpikeTrace::SpikeWidth, SpikeTrace::Thread, and SpikeTrace::TraceWidth.
~SpikeTrace | ( | void | ) |
Destructs the SpikeTrace-widget.
QSize sizeHint | ( | void | ) | const |
Give a hint for the prefered size of this widget.
References SpikeTrace::Radius.
QSize minimumSizeHint | ( | void | ) | const |
Give a hint for the minimum size of this widget.
References SpikeTrace::Radius.
Referenced by SaveFiles::SaveFiles().
QSizePolicy sizePolicy | ( | void | ) | const |
Make this widget stretchable in both directions.
|
slot |
Switch the spike trace on or off.
References SpikeTrace::Pos, SpikeTrace::pPos, SpikeTrace::Radius, SpikeTrace::Show, SpikeTrace::SMutex, and SpikeTrace::Thread.
Referenced by SaveFiles::closeFiles(), and SaveFiles::openFiles().
|
slot |
Stop and start animation.
References SpikeTrace::Pause, and SpikeTrace::SMutex.
Referenced by SaveFiles::openFiles(), and SaveFiles::writeToggle().
|
protected |
References SpikeTraceThread::msleep(), SpikeTrace::Pause, SpikeTrace::Show, SpikeTrace::SMutex, and SpikeTrace::Thread.
Referenced by SpikeTraceThread::run().
|
protected |
Animates the spike trace by increasing the position of the ball and replace the spike on a new run.
References SpikeTrace::dPos, SpikeTrace::Pos, SpikeTrace::pPos, SpikeTrace::Radius, SpikeTrace::SpikePos, and SpikeTrace::SpikeWidth.
Referenced by SpikeTrace::paintEvent().
|
protected |
A function providing the shape of the trace. For a given position x in pixels it returns the corresponding y-value (in pixels).
References relacs::exp(), SpikeTrace::SpikePos, SpikeTrace::SpikeSize, and SpikeTrace::SpikeWidth.
Referenced by SpikeTrace::paintEvent().
|
protected |
Handles the resize event. It scales the position of the spike and its size appropriately.
References SpikeTrace::Radius, SpikeTrace::SMutex, SpikeTrace::SpikePos, and SpikeTrace::SpikeSize.
|
protected |
Paints the spike trace.
References SpikeTrace::animate(), SpikeTrace::Pos, SpikeTrace::Radius, SpikeTrace::Show, SpikeTrace::SMutex, SpikeTrace::trace(), and SpikeTrace::TraceWidth.
|
protected |
Post update() to the GUI thread.
|
friend |
Referenced by SpikeTrace::SpikeTrace().
|
protected |
If true, the trace is painted.
Referenced by SpikeTrace::paintEvent(), SpikeTrace::run(), SpikeTrace::setSpike(), and SpikeTrace::SpikeTrace().
|
protected |
If true, no animation is done.
Referenced by SpikeTrace::run(), SpikeTrace::setPause(), and SpikeTrace::SpikeTrace().
|
protected |
Position of the ball in pixel.
Referenced by SpikeTrace::animate(), SpikeTrace::paintEvent(), SpikeTrace::setSpike(), and SpikeTrace::SpikeTrace().
|
protected |
Previous position of the ball in pixel.
Referenced by SpikeTrace::animate(), SpikeTrace::setSpike(), and SpikeTrace::SpikeTrace().
|
protected |
Increment of the ball's position in pixel.
Referenced by SpikeTrace::animate(), and SpikeTrace::SpikeTrace().
|
protected |
Radius of the ball.
Referenced by SpikeTrace::animate(), SpikeTrace::minimumSizeHint(), SpikeTrace::paintEvent(), SpikeTrace::resizeEvent(), SpikeTrace::setSpike(), SpikeTrace::sizeHint(), and SpikeTrace::SpikeTrace().
|
protected |
Width of the trace line.
Referenced by SpikeTrace::paintEvent(), and SpikeTrace::SpikeTrace().
|
protected |
The current size of the spike in pixel.
Referenced by SpikeTrace::resizeEvent(), SpikeTrace::SpikeTrace(), and SpikeTrace::trace().
|
protected |
The position of the spike.
Referenced by SpikeTrace::animate(), SpikeTrace::resizeEvent(), SpikeTrace::SpikeTrace(), and SpikeTrace::trace().
|
protected |
The width of the spike.
Referenced by SpikeTrace::animate(), SpikeTrace::SpikeTrace(), and SpikeTrace::trace().
|
protected |
Locks the widget's variables.
Referenced by SpikeTrace::paintEvent(), SpikeTrace::resizeEvent(), SpikeTrace::run(), SpikeTrace::setPause(), and SpikeTrace::setSpike().
|
protected |
Referenced by SpikeTrace::run(), SpikeTrace::setSpike(), and SpikeTrace::SpikeTrace().