00001 /*************************************************************************** 00002 * Copyright (C) 2003-2005 by David Saxton * 00003 * david@bluehaze.org * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 ***************************************************************************/ 00010 00011 #ifndef ECSEVENSEGMENT_H 00012 #define ECSEVENSEGMENT_H 00013 00014 #include "component.h" 00015 00016 class Diode; 00017 class ECNode; 00018 00023 class ECSevenSegment : public Component 00024 { 00025 public: 00026 ECSevenSegment( ICNDocument *icnDocument, bool newItem, const char *id = 0 ); 00027 ~ECSevenSegment(); 00028 00029 static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id ); 00030 static LibraryItem *libraryItem(); 00031 00032 virtual void stepNonLogic(); 00033 virtual bool doesStepNonLogic() const { return true; } 00034 virtual void dataChanged(); 00035 virtual bool canFlip() const { return true; } 00036 00037 private: 00038 virtual void drawShape( QPainter &p ); 00039 00040 bool m_bCommonCathode; 00041 double lastUpdatePeriod; 00042 double avg_brightness[8]; 00043 uint last_brightness[8]; 00044 Diode *m_diodes[8]; 00045 ECNode *m_nodes[8]; 00046 ECNode *m_nNode; 00047 double r, g, b; 00048 }; 00049 00050 #endif
1.5.1