00001 #ifndef _HHChannel_h
00002 #define _HHChannel_h
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00048 class HHChannel: public HHChannelBase, public ChanCommon
00049 {
00050 #ifdef DO_UNIT_TESTS
00051 friend void testHHChannel();
00052 friend void testHHGateCreation();
00053 #endif // DO_UNIT_TESTS
00054 public:
00055 HHChannel();
00056 ~HHChannel();
00057
00059
00061
00062 void vSetXpower( const Eref& e, double Xpower );
00063 void vSetYpower( const Eref& e, double Ypower );
00064 void vSetZpower( const Eref& e, double Zpower );
00065 void vSetInstant( const Eref& e, int Instant );
00066 int vGetInstant( const Eref& e ) const;
00067 void vSetX( const Eref& e, double X );
00068 double vGetX( const Eref& e ) const;
00069 void vSetY( const Eref& e, double Y );
00070 double vGetY( const Eref& e ) const;
00071 void vSetZ( const Eref& e, double Z );
00072 double vGetZ( const Eref& e ) const;
00073 void vSetUseConcentration( const Eref& e, int value );
00074 void vSetModulation( const Eref& e, double modulation );
00075 double vGetModulation( const Eref& e ) const;
00076
00077 void innerSetXpower( double Xpower );
00078 void innerSetYpower( double Ypower );
00079 void innerSetZpower( double Zpower );
00080
00082
00084
00097 void vProcess( const Eref& e, ProcPtr p );
00098
00106 void vReinit( const Eref& e, ProcPtr p );
00107
00119 void vHandleConc( const Eref& e, double conc );
00120
00122
00124
00127 HHGate* vGetXgate( unsigned int i ) const;
00128
00132 HHGate* vGetYgate( unsigned int i ) const;
00133
00137 HHGate* vGetZgate( unsigned int i ) const;
00138
00140 void innerCreateGate(
00141 const string& gateName,
00142 HHGate** gatePtr, Id chanId, Id gateId );
00143
00145 bool checkOriginal( Id chanId ) const;
00146
00147 void vCreateGate( const Eref& e, string gateType );
00154 void destroyGate( const Eref& e, string gateType );
00155
00159 void innerDestroyGate( const string& gateName,
00160 HHGate** gatePtr, Id chanId );
00161
00165 bool setGatePower( const Eref& e, double power,
00166 double* assignee, const string& gateType );
00167
00169 static const Cinfo* initCinfo();
00170
00171 private:
00173 double conc_;
00174
00175 double ( *takeXpower_ )( double, double );
00176 double ( *takeYpower_ )( double, double );
00177 double ( *takeZpower_ )( double, double );
00178
00180 int instant_;
00183 double X_;
00185 double Y_;
00187 double Z_;
00188
00189 bool xInited_, yInited_, zInited_;
00190
00191 double g_;
00192
00193 double integrate( double state, double dt, double A, double B );
00194
00200 HHGate* xGate_;
00201
00203 HHGate* yGate_;
00204
00206 HHGate* zGate_;
00207
00208 Id myId_;
00209
00210 static const double EPSILON;
00211 static const int INSTANT_X;
00212 static const int INSTANT_Y;
00213 static const int INSTANT_Z;
00214 };
00215
00216
00217 #endif // _HHChannel_h