ecclockinput.h

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 ECCLOCKINPUT_H
00012 #define ECCLOCKINPUT_H
00013 
00014 #include <list>
00015 #include "component.h"
00016 
00017 using namespace std;
00018 
00019 class ComponentCallback;
00020 class Simulator;
00021 
00026 class ECClockInput : public Component
00027 {
00028 public:
00029         ECClockInput( ICNDocument *icnDocument, bool newItem, const char *id = 0 );
00030         ~ECClockInput();
00031         
00032         static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
00033         static LibraryItem *libraryItem();
00034         
00035         void stepCallback();
00036         void stepLogic();
00037         virtual void stepNonLogic();
00038         virtual bool doesStepNonLogic() const { return true; }
00039         
00040 protected:
00041         virtual void drawShape( QPainter &p );
00042         void dataChanged();
00043         
00044         uint m_time;  // TODO: Link to global clock. 
00045         uint m_high_time;
00046         uint m_low_time;
00047         uint m_period;
00048         long long m_lastSetTime;
00049         LogicOut * m_pOut;
00050         bool m_bSetStepCallbacks;
00051         bool m_bLastStepCallbackOut;
00052         Simulator * m_pSimulator;
00053         list<ComponentCallback> * m_pComponentCallback[1000];
00054 };
00055 
00056 #endif

Generated on Tue May 8 17:05:29 2007 for KTechLab by  doxygen 1.5.1