• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • superkaramba
 

superkaramba

  • superkaramba
  • src
sensor.cpp
1/***************************************************************************
2 * Copyright (C) 2003 by Hans Karlsson *
3 * karlsson.h@home.se *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 ***************************************************************************/
10#include "sensor.h"
11Sensor::Sensor(int iMsec)
12{
13 objList = new TQObjectList();
14 objList->setAutoDelete( true );
15 msec = iMsec;
16}
17
18void Sensor::start()
19{
20 if (!timer.isActive())
21 {
22 connect (&timer,TQ_SIGNAL(timeout()),this,TQ_SLOT(update()));
23 timer.start( (msec == 0)?1000:msec);
24 }
25}
26
27Sensor::~Sensor()
28{
29objList->clear();
30delete objList;
31}
32
33void Sensor::addMeter( SensorParams *sp )
34{
35 objList->append(sp);
36}
37
38SensorParams* Sensor::hasMeter( Meter *meter )
39{
40 TQObjectListIt it( *objList );
41 while ( it != 0 )
42 {
43 if (((SensorParams*) *it)->getMeter() == meter)
44 {
45 return (SensorParams*) *it;
46 }
47 ++it;
48 }
49 return NULL;
50}
51
52void Sensor::deleteMeter( Meter *meter )
53{
54 SensorParams* sp = hasMeter(meter);
55
56 if (sp)
57 objList->removeRef(sp);
58}
59
60void Sensor::setMaxValue( SensorParams* )
61{
62}
63
64#include "sensor.moc"
SensorParams
Hans Karlsson.
Definition: sensorparams.h:32

superkaramba

Skip menu "superkaramba"
  • Main Page
  • Alphabetical List
  • Class List
  • File List
  • Class Members

superkaramba

Skip menu "superkaramba"
  • kcalc
  •   knumber
  • superkaramba
Generated for superkaramba by doxygen 1.9.4
This website is maintained by Timothy Pearson.