ProbeTemp class

This class implements the management of a temperature probe based on LM35 component. It is called to actually add a working channel.
[ back to index ]

ProbeTemp(SerialPort *externalPort, int ch, TTree *datatree, TPad* externalPad);

Constructor. Pointer to global variables are required: communication port, assignment channel, data tree, drawing pad.

virtual ~ProbeTemp();

Destructor.

void Reset();

Resets graph.

static void *Acquire(void *ptr);

This method is called in Start() as a thread function, and performs the acquisition.

void Start(time_t tstart);

Starts acquisition thread. The timestamp tstart is for thread timing coordination.

void Stop();

Deletes acquisition thread.

void Refresh();

Refresh graphics.

Usage example

ProbeTemp *probe[7];

probe[1] = new ProbeTemp(&USBport, 1, dataTree, tpad[1]);

probe[1]->Reset();

probe[1]->Start(time(NULL));

refresh_Timer = new TTimer(this, 950, kTRUE);
refresh_Timer->Connect("Timeout()", "ProbeTemp", ProbeTemp, "Refresh()");
refresh_Timer->Reset();
refresh_Timer->TurnOn();

usleep(10 * 1000); // waits 10 seconds

probe[1]->Stop();