wire.h

00001 /***************************************************************************
00002  *   Copyright (C) 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 WIRE_H
00012 #define WIRE_H
00013 
00014 #include <qguardedptr.h>
00015 #include <qobject.h>
00016 
00017 class Pin;
00018 
00022 class Wire : public QObject
00023 {
00024         public:
00025                 Wire(Pin *startPin, Pin *endPin);
00026                 ~Wire();
00027 
00032                 bool calculateCurrent();
00036                 bool currentIsKnown() const { return m_bCurrentIsKnown; }
00042                 void setCurrentKnown(bool known);
00047                 double current() const { return m_current; } 
00052                 double voltage() const;
00053 
00054                 Pin *startPin() const { return m_pStartPin; }
00055                 Pin *endPin() const { return m_pEndPin; }
00056 
00057         protected:
00058                 double m_current;
00059                 bool m_bCurrentIsKnown;
00060                 QGuardedPtr<Pin> m_pStartPin;
00061                 QGuardedPtr<Pin> m_pEndPin;
00062 };
00063 
00064 #endif

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