Beispiel #1
0
  void HCOD::
  downdate( stage_iter_t stageIter,const Index & rowDown )
  {
    assert(isInit);

    if( useDamp() )
      {
	Stage & s = **stageIter;
	ConstraintRef cst = s.which(rowDown);
	double Ju = s.getJrow(cst.row).transpose()*solution;
	const Bound& b = s.getBoundRow(cst.row);
	double b_Ju = b.getBound( cst.type ) - Ju;
	s.dampBoundValue( cst,b_Ju );
	sotDEBUG(5) << "Damp cst " << cst << " with " << b_Ju << std::endl;
      }

    sotDEBUG(5) << "Downdate " << (*stageIter)->name<<", row "<<rowDown
		<<" (cst="<<(*stageIter)->which(rowDown)<<")."<< std::endl;
    GivensSequence Ydown;
    bool propag=(*stageIter)->downdate(rowDown,Ydown);
    for( ++stageIter;stageIter!=stages.end();++stageIter )
      {
     	propag = (*stageIter)->propagateDowndate(Ydown,propag);
      }
    updateY(Ydown);
  }
Beispiel #2
0
void MoveEventMeta::update(
    ProcessModel& scenar,
    const Id<EventModel>& eventId,
    const TimeVal& newDate,
    double y,
    ExpandMode mode,
    LockMode lock,
    const Id<StateModel>& st)
{
  if (lock == m_lock)
  {
    m_moveEventImplementation->update(scenar, eventId, newDate, y, mode, lock);
  }
  else
  {
    static const auto& appctx = score::AppContext();
    static const auto& mevlist = appctx.interfaces<MoveEventList>();
    m_moveEventImplementation
        = mevlist.get(appctx, MoveEventFactoryInterface::Strategy::MOVE)
              .make(scenar, eventId, newDate, mode, lock);
    m_lock = lock;
  }
  m_newY = y;
  updateY(scenar, m_newY);
}
Beispiel #3
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()) );
}
	//Working for Sebastian
	void EnemySprite::update()
	{
		currGameTime = GameTime::totalTime();

		updateX();
		updateY();

		oldGameTime = currGameTime;

		SDL_RenderCopy(win->getRen(), picture->getPic(), NULL, &rect);
	}
Beispiel #5
0
 void HCOD::
 downdate( const Index & stageDown, const Index & rowDown )
 {
   assert(isInit);
   GivensSequence Ydown;
   bool propag=stages[stageDown]->downdate(rowDown,Ydown);
   for( stage_sequence_size_t i=stageDown+1;i<stages.size();++i )
     {
    	propag = stages[i]->propagateDowndate(Ydown,propag);
     }
   updateY(Ydown);
 }
Beispiel #6
0
  void HCOD::
  update( const Index & stageUp,const ConstraintRef & cst )
  {
    assert(isInit);
    GivensSequence Yup;
    Index rankDef = stages[stageUp]->update(cst,Yup);
    for( stage_sequence_size_t i=stageUp+1;i<stages.size();++i )
      {
	stages[i]->propagateUpdate(Yup,rankDef);
      }
    updateY(Yup);
  }
Beispiel #7
0
void Character::init(Ground *ground) {
  circle_vector_.push_back(Circle());
  circle_ = &circle_vector_[0];
  circle_->radius = 0.001f;
  drawer_.init(&circle_vector_);
  drawer_.setParent(Renderer::instance().rootNode());
  drawer_.setDisplayPriority(5.0f);
  drawer_.setIsVisible(true);
  ground_ = ground;
  position_.x = kPlayerWidth;
  updateY(0.0f);
  updateCircle();
}
Beispiel #8
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;
	}
Beispiel #10
0
void Character::update(float delta_time, GameState *state) {
  if (*state == WALKING) {
    // Update x position.
    if (left_down_) moveLeft(delta_time);
    if (right_down_) moveRight(delta_time);
    // Udpate y postion.
    if (space_pressed_) this->jump();
  }
  if (*state == TRIGGERING_JUMPING || *state == ENDING) {
    if (time_on_ground_ > time_till_next_jump_) {
      this->jump();
      time_till_next_jump_ = randomFloat(0.0f, 0.2f);
    }
  }
  updateY(delta_time);
  updateCircle();
}
Beispiel #11
0
  void HCOD::
  update( stage_iter_t stageIter,const ConstraintRef & cst )
  {
    assert(isInit);
    sotDEBUG(5) << "Update " << (*stageIter)->name <<", "
		<< cst << std::endl;
    GivensSequence Yup;
    Index rankDef = (*stageIter)->update(cst,Yup);
    for( ++stageIter;stageIter!=stages.end();++stageIter )
      {
        sotDEBUG(5) << "Y (updateY): " << (*stageIter)->name << ","
                    << Y.matrixExplicit << std::endl;
        (*stageIter)->propagateUpdate(Yup,rankDef);
        sotDEBUG(5) << "Y (after-updateY): " << (*stageIter)->name << ","
                    << Y.matrixExplicit << std::endl;

      }
    updateY(Yup);
  }
Beispiel #12
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;
		}
	}
}