All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Member Functions | Static Public Member Functions
QGpCoreTools::Leds Class Reference

Brief description of class still missing. More...

#include <Leds.h>

List of all members.

Public Member Functions

 Leds (QObject *parent=0)
 ~Leds ()

Static Public Member Functions

static void flash (int index, int msec, bool on)
static void power (int index, bool on)
static void timer (int index, int msecOn, int msecOff)

Detailed Description

Brief description of class still missing.

Full description of class still missing


Constructor & Destructor Documentation

QGpCoreTools::Leds::Leds ( QObject *  parent = 0)

Description of constructor still missing

References QGpCoreTools::endl(), QGpCoreTools::App::stream(), QGpCoreTools::tr(), and TRACE.

    : QObject(parent)
{
  TRACE;

  ASSERT(!_self);

  // Test all 3 lights
  if(!test(0) || !test(1) || !test(2)) {
    App::stream() << tr("no led available") << endl;
    // Do not initialize _self, leds are not available
    return;
  }

  _self=this;
  connect(&_timer[0], SIGNAL(timeout()), this, SLOT(execTimer0()));
  connect(&_timer[1], SIGNAL(timeout()), this, SLOT(execTimer1()));
  connect(&_timer[2], SIGNAL(timeout()), this, SLOT(execTimer2()));
  _defaultOn[0]=false;
  _defaultOn[1]=false;
  _defaultOn[2]=false;
}
{_self=0;}

Member Function Documentation

void QGpCoreTools::Leds::flash ( int  index,
int  msec,
bool  on 
) [static]

References power().

{
  if(_self) {
    QTimer& t=_self->_timer[index];
    _self->_defaultOn[index]=!on;
    t.setInterval(msec);
    t.start();
    _self->setTrigger(index, "default-on");
    power(index, on);
  }
}
void QGpCoreTools::Leds::power ( int  index,
bool  on 
) [static]

Referenced by flash().

{
  if(_self) {
    _self->setTrigger(index, "default-on");
    _self->powerInternal(index, on);
  }
}
void QGpCoreTools::Leds::timer ( int  index,
int  msecOn,
int  msecOff 
) [static]
{
  if(_self) {
    _self->setTrigger(index, "timer");
    _self->powerInternal(index, true);
    _self->setDelayOn(index, msecOn);
    _self->setDelayOff(index, msecOff);
  }
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines