Exemplo n.º 1
0
void move(particle_t* Particles){

	double Fold[N_SIMULATION][DIM_SIMULATION];

	for(int i=0;i<N_SIMULATION;i++){
		updateX(Particles+i);
	}

	glutPostRedisplay();

	for(int i=0;i<N_SIMULATION;i++){
		for(int d=0;d<DIM_SIMULATION;d++)
		Fold[i][d]=Particles[i].force[d];
	}
	
	

	computeForces(Particles);

	for(int i=0;i<N_SIMULATION;i++){
		updateV(Particles+i,Fold[i]);
		// check if we are at the walls and redirect the speed!
	}

}
Exemplo n.º 2
0
Debugger::Debugger(QWidget *parent)
	: QMainWindow( parent )
	, ui(new Ui::Debugger)
	, m_pItemAtPc( 0 )
	, m_autoStepping( false )
{
	ui->setupUi(this);

	connect( ui->tableWidgetCode, SIGNAL(cellDoubleClicked(int,int)), this, SLOT(setBreakpoint(int, int)) );

	connect( ui->actionStep_Into, SIGNAL(triggered()), this, SIGNAL(stepInto()) );
	connect( ui->actionStep_Over, SIGNAL(triggered()), this, SIGNAL(stepOver()) );
	connect( ui->actionStep_Skip, SIGNAL(triggered()), this, SIGNAL(stepSkip()) );
	connect( ui->actionContinue, SIGNAL(triggered()), this, SLOT(setupExecution()) );

	connect( ui->radioButtonP, SIGNAL(clicked()), this, SLOT(updateP()) );
	connect( ui->radioButtonX, SIGNAL(clicked()), this, SLOT(updateX()) );
	connect( ui->radioButtonY, SIGNAL(clicked()), this, SLOT(updateY()) );
	connect( ui->radioButtonL, SIGNAL(clicked()), this, SLOT(updateL()) );

	connect( ui->lineEditX0, SIGNAL(editingFinished()), this, SLOT(setRegisterX0()) );
	connect( ui->lineEditX1, SIGNAL(editingFinished()), this, SLOT(setRegisterX1()) );
	connect( ui->lineEditY0, SIGNAL(editingFinished()), this, SLOT(setRegisterY0()) );
	connect( ui->lineEditY1, SIGNAL(editingFinished()), this, SLOT(setRegisterY1()) );
	connect( ui->lineEditA0, SIGNAL(editingFinished()), this, SLOT(setRegisterA0()) );
	connect( ui->lineEditA1, SIGNAL(editingFinished()), this, SLOT(setRegisterA1()) );
	connect( ui->lineEditA2, SIGNAL(editingFinished()), this, SLOT(setRegisterA2()) );
	connect( ui->lineEditB0, SIGNAL(editingFinished()), this, SLOT(setRegisterB0()) );
	connect( ui->lineEditB1, SIGNAL(editingFinished()), this, SLOT(setRegisterB1()) );
	connect( ui->lineEditB2, SIGNAL(editingFinished()), this, SLOT(setRegisterB2()) );
	connect( ui->lineEditR0, SIGNAL(editingFinished()), this, SLOT(setRegisterR0()) );
	connect( ui->lineEditR1, SIGNAL(editingFinished()), this, SLOT(setRegisterR1()) );
	connect( ui->lineEditR2, SIGNAL(editingFinished()), this, SLOT(setRegisterR2()) );
	connect( ui->lineEditR3, SIGNAL(editingFinished()), this, SLOT(setRegisterR3()) );
	connect( ui->lineEditR4, SIGNAL(editingFinished()), this, SLOT(setRegisterR4()) );
	connect( ui->lineEditR5, SIGNAL(editingFinished()), this, SLOT(setRegisterR5()) );
	connect( ui->lineEditR6, SIGNAL(editingFinished()), this, SLOT(setRegisterR6()) );
	connect( ui->lineEditR7, SIGNAL(editingFinished()), this, SLOT(setRegisterR7()) );
	connect( ui->lineEditN0, SIGNAL(editingFinished()), this, SLOT(setRegisterN0()) );
	connect( ui->lineEditN1, SIGNAL(editingFinished()), this, SLOT(setRegisterN1()) );
	connect( ui->lineEditN2, SIGNAL(editingFinished()), this, SLOT(setRegisterN2()) );
	connect( ui->lineEditN3, SIGNAL(editingFinished()), this, SLOT(setRegisterN3()) );
	connect( ui->lineEditN4, SIGNAL(editingFinished()), this, SLOT(setRegisterN4()) );
	connect( ui->lineEditN5, SIGNAL(editingFinished()), this, SLOT(setRegisterN5()) );
	connect( ui->lineEditN6, SIGNAL(editingFinished()), this, SLOT(setRegisterN6()) );
	connect( ui->lineEditN7, SIGNAL(editingFinished()), this, SLOT(setRegisterN7()) );
	connect( ui->lineEditM0, SIGNAL(editingFinished()), this, SLOT(setRegisterM0()) );
	connect( ui->lineEditM1, SIGNAL(editingFinished()), this, SLOT(setRegisterM1()) );
	connect( ui->lineEditM2, SIGNAL(editingFinished()), this, SLOT(setRegisterM2()) );
	connect( ui->lineEditM3, SIGNAL(editingFinished()), this, SLOT(setRegisterM3()) );
	connect( ui->lineEditM4, SIGNAL(editingFinished()), this, SLOT(setRegisterM4()) );
	connect( ui->lineEditM5, SIGNAL(editingFinished()), this, SLOT(setRegisterM5()) );
	connect( ui->lineEditM6, SIGNAL(editingFinished()), this, SLOT(setRegisterM6()) );
	connect( ui->lineEditM7, SIGNAL(editingFinished()), this, SLOT(setRegisterM7()) );
	connect( ui->lineEditSR, SIGNAL(editingFinished()), this, SLOT(setRegisterSR()) );
	connect( ui->lineEditPC, SIGNAL(editingFinished()), this, SLOT(setRegisterPC()) );
	connect( ui->lineEditLC, SIGNAL(editingFinished()), this, SLOT(setRegisterLC()) );
}
Exemplo n.º 3
0
void XYPlot::setYData(QList<qreal> arg)
{
    if (m_yData == arg) return;
    m_yData = arg;
    m_treeDirty = true;
    emit yDataChanged(arg);
    updateX();
    updateDataLimits();
}
Exemplo n.º 4
0
void StateEstimatorKinematic::filterOneTimeStep_ss()
{
    predictX();
    computeAnkleRelated(); // Compute ankle position and velocity
    updateZ(6);
    computeInnovation(_y);
    updateX(6);
    // The following steps are additional step for next step measurement
    computeAnkleRelated(); // Compute ankle position and velocity
}
	//Working for Sebastian
	void EnemySprite::update()
	{
		currGameTime = GameTime::totalTime();

		updateX();
		updateY();

		oldGameTime = currGameTime;

		SDL_RenderCopy(win->getRen(), picture->getPic(), NULL, &rect);
	}
Exemplo n.º 6
0
void Player::update(const std::chrono::milliseconds elapsed_time,
                    const Map& map,
                    ParticleTools& particle_tools)
{
    sprites_[getSpriteState()]->update();

    health_.update();
    walking_animation_.update();

    polar_star_.updateProjectiles(elapsed_time, map);

    updateX(elapsed_time, map, particle_tools);
    updateY(elapsed_time, map, particle_tools);
}
	//Working for Sebastian
	void PlayerSprite::update()
	{
		currGameTime = GameTime::totalTime();
		
		updateX();
		updateY();

		std::cout << currGameTime - oldGameTime << std::endl;
		
		gravity();

		oldGameTime = currGameTime;

		SDL_RenderCopy(win->getRen(), picture->getPic(), NULL, &rect);

		//std::cout << isDead() << std::endl;
	}
Exemplo n.º 8
0
// This function is called by Path::apply and is therefore invoked for each contour in a glyph. This
// function models each contours as a straight line and calculates the intersections between each
// pseudo-contour and the vertical center of the underline found in GlyphIterationState::centerOfLine.
// It keeps track of the leftmost and rightmost intersection in  GlyphIterationState::minX and 
// GlyphIterationState::maxX.
static void findPathIntersections(GlyphIterationState& state, const PathElement& element)
{
    bool doIntersection = false;
    FloatPoint point = FloatPoint();
    switch (element.type) {
    case PathElementMoveToPoint:
        state.startingPoint = element.points[0];
        state.currentPoint = element.points[0];
        break;
    case PathElementAddLineToPoint:
        doIntersection = true;
        point = element.points[0];
        break;
    case PathElementAddQuadCurveToPoint:
        doIntersection = true;
        point = element.points[1];
        break;
    case PathElementAddCurveToPoint:
        doIntersection = true;
        point = element.points[2];
        break;
    case PathElementCloseSubpath:
        doIntersection = true;
        point = state.startingPoint;
        break;
    }

    if (!doIntersection)
        return;

    float x;
    if (findIntersectionPoint(state.centerOfLine, state.currentPoint, point, x))
        updateX(state, x);

    state.currentPoint = point;
}
Exemplo n.º 9
0
void Debugger::updateData( const dsp_core_t* pCore )
{
	int regs = sizeof( pCore->registers ) / sizeof( pCore->registers[0] );

	for( int i = 0; i < regs; ++i )
	{
		QString str = QString::number( pCore->registers[i], 16 );

		int justify;
		if( i == DSP_REG_X0 || i == DSP_REG_X1 || i == DSP_REG_Y0 || i == DSP_REG_Y1
		    || i == DSP_REG_A0 || i == DSP_REG_B0 || i == DSP_REG_A1 || i == DSP_REG_B1 )
		{
			justify = 6;
		}
		else if( i == DSP_REG_A2 || i == DSP_REG_B2 )
		{
			justify = 2;
		}
		else
		{
			justify = 4;
		}
		str = str.rightJustified( justify, '0' ).toUpper();

		switch( i )
		{
		case DSP_REG_X0:
			ui->lineEditX0->setText( str );
			break;
		case DSP_REG_X1:
			ui->lineEditX1->setText( str );
			break;
		case DSP_REG_Y0:
			ui->lineEditY0->setText( str );
			break;
		case DSP_REG_Y1:
			ui->lineEditY1->setText( str );
			break;
		case DSP_REG_A0:
			ui->lineEditA0->setText( str );
			break;
		case DSP_REG_B0:
			ui->lineEditB0->setText( str );
			break;
		case DSP_REG_A2:
			ui->lineEditA2->setText( str );
			break;
		case DSP_REG_B2:
			ui->lineEditB2->setText( str );
			break;
		case DSP_REG_A1:
			ui->lineEditA1->setText( str );
			break;
		case DSP_REG_B1:
			ui->lineEditB1->setText( str );
			break;

		case DSP_REG_R0:
			ui->lineEditR0->setText( str );
			break;
		case DSP_REG_R1:
			ui->lineEditR1->setText( str );
			break;
		case DSP_REG_R2:
			ui->lineEditR2->setText( str );
			break;
		case DSP_REG_R3:
			ui->lineEditR3->setText( str );
			break;
		case DSP_REG_R4:
			ui->lineEditR4->setText( str );
			break;
		case DSP_REG_R5:
			ui->lineEditR5->setText( str );
			break;
		case DSP_REG_R6:
			ui->lineEditR6->setText( str );
			break;
		case DSP_REG_R7:
			ui->lineEditR7->setText( str );
			break;

		case DSP_REG_N0:
			ui->lineEditN0->setText( str );
			break;
		case DSP_REG_N1:
			ui->lineEditN1->setText( str );
			break;
		case DSP_REG_N2:
			ui->lineEditN2->setText( str );
			break;
		case DSP_REG_N3:
			ui->lineEditN3->setText( str );
			break;
		case DSP_REG_N4:
			ui->lineEditN4->setText( str );
			break;
		case DSP_REG_N5:
			ui->lineEditN5->setText( str );
			break;
		case DSP_REG_N6:
			ui->lineEditN6->setText( str );
			break;
		case DSP_REG_N7:
			ui->lineEditN7->setText( str );
			break;

		case DSP_REG_M0:
			ui->lineEditM0->setText( str );
			break;
		case DSP_REG_M1:
			ui->lineEditM1->setText( str );
			break;
		case DSP_REG_M2:
			ui->lineEditM2->setText( str );
			break;
		case DSP_REG_M3:
			ui->lineEditM3->setText( str );
			break;
		case DSP_REG_M4:
			ui->lineEditM4->setText( str );
			break;
		case DSP_REG_M5:
			ui->lineEditM5->setText( str );
			break;
		case DSP_REG_M6:
			ui->lineEditM6->setText( str );
			break;
		case DSP_REG_M7:
			ui->lineEditM7->setText( str );
			break;

		case DSP_REG_SR:
			ui->lineEditSR->setText( str );
			break;
		case DSP_REG_LC:
			ui->lineEditLC->setText( str );
			break;
		}
	}

	QString str = QString::number( pCore->pc, 16 );
	str = str.rightJustified( 4, '0' ).toUpper();
	ui->lineEditPC->setText( str );

	scrollToPc();

	if( ui->radioButtonP->isChecked() )
	{
		updateP();
	}
	else if( ui->radioButtonX->isChecked() )
	{
		updateX();
	}
	else if( ui->radioButtonY->isChecked() )
	{
		updateY();
	}
	else if( ui->radioButtonL->isChecked() )
	{
		updateL();
	}

	// if waiting for another breakpoint
	if( m_autoStepping )
	{
		if( !m_breakpoints.contains( m_pCurrentDspCore->pc ) )
		{
			emit stepInto();
		}
		else
		{
			m_autoStepping = false;
		}
	}
}