// ------------------------------------------------------------------------
void CInputDevice::CDebugPressedButtons::Add( const SInputSymbol* pSymbol )
{
	if (g_pInputCVars->i_debugDigitalButtons && pSymbol) 
	{
		if (pSymbol->state != eIS_Changed || ((g_pInputCVars->i_debugDigitalButtons & eDF_LogChangeState) != 0))
		{
			m_history.insert(m_history.begin(), SData(pSymbol, m_frameCnt));
			if (m_history.size() > e_MaxNumEntries)
			{
				m_history.resize(e_MaxNumEntries);
			}
		}
	}
}
Ejemplo n.º 2
0
/*
**** This test is designed to test the validity of the Evaluate member of the PolyFit class
**** This particular test only involves using Evaluate for a gpstk::Vectors of data with
**** a blank, singular, and a normal PolyFit.

**** The Evaluate is tested by using the solution to a + b*x = d

*/
void xPolyFit :: evalTestVector (void)
{
	gpstk::PolyFit<double> Blank;
	gpstk::PolyFit<double> Single(2);
	gpstk::PolyFit<double> Eval(2);
	
	gpstk::Vector<double> SData(4,0.);
	SData[0] = 1.;
	SData[1] = 1.;
	SData[2] = 1.;
	SData[3] = 1.;
	gpstk::Vector<double> STime(4,0.);
	STime[0] = 0.;
	STime[1] = 0.;
	STime[2] = 0.;
	STime[3] = 1.;
	
	gpstk::Vector<double> EData(4,0.);
	EData[0] = 0.;
	EData[1] = 2.;
	EData[2] = 4.;
	EData[3] = -1.;
	gpstk::Vector<double> ETime(4,0.);
	ETime[0] = 3.;
	ETime[1] = 3.;
	ETime[2] = 4.;
	ETime[3] = 2.;
	
	Single.Add(STime,SData);
	Eval.Add(ETime,EData);
	
	gpstk::Vector<double> EvalSolution = Eval.Solution();
	
	CPPUNIT_ASSERT_EQUAL(0.,Blank.Evaluate(3.));
	CPPUNIT_ASSERT_EQUAL(0.,Single.Evaluate(10.));
	CPPUNIT_ASSERT_DOUBLES_EQUAL(EvalSolution[0]+3.*EvalSolution[1], Eval.Evaluate(3.),1e-6);
}