QGpCoreTools/Leds.h
Go to the documentation of this file.
00001 /***************************************************************************
00002 **
00003 **  This file is part of QGpCoreTools.
00004 **
00005 **  This library is free software; you can redistribute it and/or
00006 **  modify it under the terms of the GNU Lesser General Public
00007 **  License as published by the Free Software Foundation; either
00008 **  version 2.1 of the License, or (at your option) any later version.
00009 **
00010 **  This file is distributed in the hope that it will be useful, but WITHOUT
00011 **  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 **  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
00013 **  License for more details.
00014 **
00015 **  You should have received a copy of the GNU Lesser General Public
00016 **  License along with this library; if not, write to the Free Software
00017 **  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00018 **
00019 **  See http://www.geopsy.org for more information.
00020 **
00021 **  Created : 2009-08-31
00022 **  Authors :
00023 **    Marc Wathelet
00024 **    Marc Wathelet (LGIT, Grenoble, France)
00025 **
00026 ***************************************************************************/
00027 
00028 #ifndef LEDS_H
00029 #define LEDS_H
00030 
00031 #include <QtCore>
00032 
00033 #include "QGpCoreToolsDLLExport.h"
00034 
00035 namespace QGpCoreTools {
00036 
00037 class QGPCORETOOLS_EXPORT Leds : public QObject
00038 {
00039   Q_OBJECT
00040 public:
00041   Leds(QObject * parent=0);
00042   ~Leds() {_self=0;}
00043 
00044   static void timer(int index, int msecOn, int msecOff);
00045   static void power(int index, bool on);
00046   static void flash(int index, int msec, bool on);
00047 private slots:
00048   void execTimer0();
00049   void execTimer1();
00050   void execTimer2();
00051 private:
00052   bool test(int index);
00053   void setTrigger(int index, const char * type);
00054   void powerInternal(int index, bool on);
00055   void setDelayOn(int index, int msec);
00056   void setDelayOff(int index, int msec);
00057 
00058   static Leds * _self;
00059   QTimer _timer[3];
00060   bool _defaultOn[3];
00061 };
00062 
00063 } // namespace QGpCoreTools
00064 
00065 #endif // LEDS_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines