void wgt_polycrank_int::on_pushButton_7r_clicked()
{
	get_desired_position();
	robot->desired_pos[6] += ui.doubleSpinBox_step->value();
	move_it();
}
Exemple #2
0
void wgt_spkm_int::on_pushButton_5r_clicked()
{
	get_desired_position();
	robot->desired_pos[5] += ui.doubleSpinBox_step->value();
	move_it();
}
void wgt_polycrank_int::on_pushButton_execute_clicked()
{
	get_desired_position();
	move_it();
}
void WgtAbsoluteBase::execute_button_clicked()
{
	get_desired_position();
	move_it();
}
void WgtAbsoluteBase::inc_move_right_button_clicked(int button)
{
	get_desired_position();
	robot->desired_pos[button] += step_spinbox->value();
	move_it();
}
Exemple #6
0
void wgt_irp6_m_motors::on_pushButton_execute_clicked()
{
	get_desired_position();
	move_it();
}
Exemple #7
0
void wgt_irp6_m_motors::on_pushButton_7r_clicked()
{
	get_desired_position();
	robot.desired_pos[6] += ui.doubleSpinBox_step->value();
	move_it();
}
Exemple #8
0
WORD gen_dea( VOID )
{
	/* Hier wird nun aus den NEAen DEAen. */
	REG LONG	i;
/*
	/* Alle SCs */
	for( i = 0; i < ss_str_count; i++ )
	{
*/

#ifndef NO_MIN_DEA

		/* Die Zustandsminimierung durchf�hren */
		if( gen_d( &ss_str[0] ) < 0 )
			/* Fehler */
			return( -1 );
#endif

		/* Die NEAen in DEAen wandeln */
		if( gen_dtran( &ss_str[0] ) < 0 )
			/* Fehler */
			return( -1 );

#ifndef NO_MIN_DEA

		/* Die Zustandsmenge des DEA minimieren */
		if( min_dfa() < 0 )
			/* Fehler */
			return( -1 );
#endif

		output_dstates();

/*
		/* Die Zustandsminimierung durchf�hren */
		if( gen_d( &ss_str[0] ) < 0 )
			/* Fehler */
			return( -1 );

		/* Die Zustandsmenge des DEA minimieren */
		if( min_dfa() < 0 )
			/* Fehler */
			return( -1 );

		/* Den Zeiger auf DTRAN in die SS_STR eintragen */
		ss_str[i].dtran = dtran;

		/* Speicher freigeben */
		free( ( VOID * ) dtran );
*/

#ifdef DUMP3
		push_tab();
#endif

/*	}
*/
	/* Alles OK */
	return( 0 );
}


WORD init( VOID )
{
	/* Hier werden ein paar wichtige Datenstrukturen initialisiert. */

	/* Array f�r die Zust�nde */
	if( ( e_cls.states = ( LONG * ) malloc( sizeof( LONG ) * nea_count ) ) == NULL )
		/* Fehler */
		return( -1 );

	/* Array f�r die Zust�nde */
	if( ( e_stack.states = ( LONG * ) malloc( sizeof( LONG ) * nea_count ) ) == NULL )
		/* Fehler */
		return( -1 );

	/* Array f�r die Zust�nde */
	if( ( move.states = ( LONG * ) malloc( sizeof( LONG ) * nea_count ) ) == NULL )
		/* Fehler */
		return( -1 );

	/* Alles OK */
	return( 0 );
}


WORD gen_dtran( SS_STR *ss )
{
	/* Hier werden die NEAen in der SC ss zu DEAen. */
	REG WORD	i;
	WORD		pos, ind = 0;

	/* Anzahl der Zust�nde dieses NEAs festlegen */
	nea_states = nea_str[ss->nea_all].state_arr_count;

	/* Ersteinmal ein bi�chen initialisieren */
	if( init() < 0 )
		/* Fehler */
		return( -1 );

	/* Den Startzustand des NEA eintragen, der alle die beinhaltet, die am Zeilenanfang stehen d�rfen */
	insert_state( &move, nea_str[ss->nea_all].start_state );

	/* e_closure(0) */
	if( ( pos = e_clos( &move, ss ) ) < 0 )
		/* Fehler */
		return( -1 );

	/* Solange es einen unmarkierten Zustand in DSTATES gibt */
	while( ( ind < dstates_count ) && !dstates[ind].marked )
	{
		/* Zustand markieren */
		dstates[ind].marked++;

		/* Nun alle Eingabezeichen, move etc. */
		for( i = 0; i < all_char_count; i++ )
		{
			/* Die Zust�nde bestimmen, die aus e_cls einen Sprung�bergang mit i haben */
			if( !( move_it( ind, all_char[i] ) ) )
			{
				/* Nun die e_closure-Menge berechnen */
				if( ( pos = e_clos( &move, ss ) ) < 0 )
					/* Fehler */
					return( -1 );

				/* Zu Zustandsmenge in DTRAN eintragen */
				insert_dtran( ind, pos, all_char[i] );
			}
		}

		/* N�chsten Eintrag in DSTATES untersuchen */
		ind++;
	}

	/* Alles OK */
	return( 0 );
}
Exemple #9
0
void wgt_spkm_inc::on_pushButton_execute_clicked()
{
	get_desired_position();
	move_it();
}
Exemple #10
0
void wgt_smb_command::on_pushButton_m_execute_clicked()
{
	get_desired_position();
	move_it();
}
Exemple #11
0
void wgt_smb_command::on_pushButton_ms_rigth_clicked()
{
	get_desired_position();
	robot->desired_pos[1] += doubleSpinBox_m_relative_Vector[1]->value();
	move_it();
}
void wgt_shead_command::on_pushButton_ml_left_clicked()
{
	get_desired_position();
	robot->desired_pos[0] -= doubleSpinBox_m_relative_Vector[0]->value();
	move_it();
}
Exemple #13
0
//hlavni funkce starajici se o chod aplikace
int main(int argc, char **argv )
{
	unsigned int cnt = 0,old_score=1;
	char_cnt = 0;
	last_ch = 0;
	//iniciaizace HW
	initialize_hardware();
	keyboard_init();
	
	int random_number,i,j;
	Tshape myshape;
	Tmatrix matrix,pane,pom;
	int pom_matrix[8][8] = {0};
	char c=0;
	int latest_line;

	//srand(2);
	//vytvoreni noveho utvaru
	myshape = create_shape(rand()%8);
	//posun na zacatek
	matrix = move_it(myshape,pom_matrix);
	//ulozeni noveho utvaru
	pane = save_it(matrix,pom_matrix);


	set_led_d6(1);                       // rozsviceni D6
	set_led_d5(1);                       // rozsviceni D5

	//inicializace LED displeje
	P6DIR=0xff;
	P4DIR=0x0f;
	P2DIR=0xf0;
	P4OUT=0x00;
	P2OUT=0x00;
	P6OUT=0xff;
	while (1)
	{
		delay_ms(1);
		cnt++;
		//pri zmacknuti klavesy
		if (c!=last_ch){
			c=last_ch;
			//pokud byla zmacknuta 6
			if (c=='6'){
				//posunu se
				x++;
				//pokusim se ulozit na to misto utvar
				matrix = move_it(myshape,pom_matrix);
				//pokud nelze ulozit	
				if (matrix.count!=4){
					//vratim se
					x--;
					//a ulozim
					matrix = move_it(myshape,pom_matrix);				
				}
			}
			//pri zmacknuti 4  
			else if (c=='4'){
				//posunu se
				x--;
				//pokusim se ulozit
				matrix = move_it(myshape,pom_matrix);
				//pokud bych vypsal mene jak 4 znaky z utvaru
				if (matrix.count!=4){
					//posouvam se zpatky
					x++;
					matrix = move_it(myshape,pom_matrix);
				}
			}
			//pokud nactu 8
			else if (c=='8'){
				//posunu se
				y++;
				//pokusim se ulozit
				matrix = move_it(myshape,pom_matrix);
				if (matrix.count!=4){
					//pokud nelze posun, posunu se nazpet
					y--;
					matrix = move_it(myshape,pom_matrix);
					matrix.last_line = 1;
				}			
			}
			//rotace
			else if (c=='5'){
				//pouzivam prvne rotate_back kvuli "hezci" rotaci
				myshape = rotate_back(myshape);
				//pokusim se ulozit dany utvar
				matrix = move_it(myshape,pom_matrix);
				//pokud pri posunu nelze vypsat vsechny 4 prvky daneho utvaru
				if (matrix.count!=4){
					//posunu se zpatky
					myshape = rotate(myshape);
					matrix = move_it(myshape,pom_matrix);
				}		
			}
			else
			{
				continue;
			}
			//ulozim do vysledneho hraciho pole
			pane = save_it(matrix,pom_matrix);
			//pokud jsem nacetl posledni radek
			if (matrix.last_line==1)
			{
				//ulozim si hraci pole do pomocne matice
				for (i=0;i<8;i++)
				{
					for (j=0;j<8;j++)
					{
						pom_matrix[i][j] = pane.shape[i][j];
					}
				}
				matrix.last_line=0;
				//smazu radky
				pane=delete_rows(pane);

				x=0;
				y=0;
				//vygeneruji novy utvar
				myshape = create_shape(rand()%8);
				int i,t;
				//ulozim do pomocne matice hraci pole
				for (i=0;i<8;i++)
					for (t=0;t<8;t++)
						pom_matrix[i][t]=pane.shape[i][t];
				//posunu nove vygenerovany utvar na zacatek hraciho pole
				matrix = move_it(myshape,pom_matrix);
				//ulozim tento stav
				pane = save_it(matrix,pom_matrix);
				
			}
			c=last_ch;
		}
		//tisknuti skore
		if (old_score!=score && (cnt%100)==0){
			old_score=score;
			print_score("Score: ");
		}
		
		if (cnt > 1000)
		{
			cnt = 0;
			flip_led_d6();                   // negace portu na ktere je LED
		}
		
		print_it(pane.shape);
		keyboard_idle();                   // obsluha klavesnice
		terminal_idle();                   // obsluha terminalu
  } 
	
	return 0;
}
Exemple #14
0
void wgt_spkm_ext::on_pushButton_4r_clicked()
{
	get_desired_position();
	robot.desired_pos[4] += ui.doubleSpinBox_step->value();
	move_it();
}
void wgt_irp6_m_tool_euler::on_pushButton_set_clicked()
{
	get_desired_position();
	move_it();
}
Exemple #16
0
void wgt_irp6_m_joints::on_pushButton_6l_clicked()
{
	get_desired_position();
	robot.desired_pos[5] -= ui.doubleSpinBox_step->value();
	move_it();
}