Пример #1
0
dev_test_state HVS_B0307::Test(void)
{
	dev_test_state dt = dev_test_to_intermediate( Base::Test() );
    int rc=AF(afClearLAM);
	if (dt!=DEV_TEST_OK) return dt;
	if (rc&CAMAC_CC_ERRORS) return dfcamac_rc2test(rc);

	if( (dt=dfcamac_rc2test(SetVoltage(0)|AF(afOff)))!=DEV_TEST_OK ) return dt;

	bool on;
	if( (dt=dfcamac_rc2test(AF(afOn)|ReadState(&on)))!=DEV_TEST_OK ) return dt;
	if ( !on )
	{
		printf("%s: Test error: Channel 0 unable to turn on \n", Type);
		return DEV_TEST_BROKEN;
	}

	if( (dt=dfcamac_rc2test(AF(afOff)|ReadState(&on)))!=DEV_TEST_OK ) return dt;
	if ( on )
	{
		printf("%s: Test error: Channel 0 unable to turn off \n", Type);
		return DEV_TEST_BROKEN;
	}

	for(__u8 shift=0; shift<nVoltageBits; shift++)
	{
		__u16 w, r;
		w = 1<<shift;
		if( (dt=dfcamac_rc2test(AF(afWrite,&w)))!=DEV_TEST_OK )	return dt;
		if( (dt=dfcamac_rc2test(ReadVoltage(&r)))!=DEV_TEST_OK) return dt;
		if (w!=r)
		{
			printf("%s: Test error: Channel 0  W=%2d  R=%2d\n", Type, w, r);
			return DEV_TEST_BROKEN;
		}
	}
	if( (dt=dfcamac_rc2test(SetVoltage(0)|AF(afOn)))!=DEV_TEST_OK )	return dt;

	rc = AF(afCheckLAM);
	if ( rc & (CAMAC_CC_ERRORS & ~CAMAC_CC_NOT_Q) )
		return dfcamac_rc2test(rc & ~CAMAC_CC_NOT_Q);
	if ( !(rc & CAMAC_CC_NOT_Q) )
		return DEV_TEST_BROKEN;

	return DEV_TEST_OK;
}
void AbstractCardiacCell::ComputeExceptVoltage(double tStart, double tEnd)
{
    double saved_voltage = GetVoltage();

    SetVoltageDerivativeToZero(true);
    mpOdeSolver->SolveAndUpdateStateVariable(this, tStart, tEnd, mDt);
    SetVoltageDerivativeToZero(false);

    SetVoltage(saved_voltage); // In case of naughty models

#ifndef NDEBUG
    // Note that tests which rely on this throwing  (e.g. such-and-such a variable is out of range)
    // ought to be annotated with the NDEBUG macro
    VerifyStateVariables();
#endif // NDEBUG
}
Пример #3
0
static int dvbfe_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t arg)
{
        DECLARE_DEV;
        DBG_fCDVBFE("calling \n");
        return SetVoltage(p->context, arg);
}
Пример #4
0
TVoltageOutputModule::TVoltageOutputModule( TBoard *b ) :
	TOutputModule( b )
{
	SetVoltage( 0 );
}