Пример #1
0
void init_home_screen()
{
	//strcpy(CommandText, "connect to 192.168.2.14, Robot, show me the accuracy of your positioning. Show me a histogram for right leg positions.\
	// Lift your left leg.  Raise both arms.  Go to the bedroom and get my shoes." );	
	strcpy (CommandText, "what time?");
	ClientInputEdit.set_text			( CommandText );
	ClientInputEdit.set_text_size 		( 16.0 			);	
	ClientInputEdit.set_return_key_listener( send_to_viki, &ClientInputEdit );
	
	//printf("init_home_screen() ClientInput text setup\n");
	
	RobotResponse.set_text				( "Not Connected" );				// ConnectionStatus	
	if (ipc_memory_client) {
		//printf("init_home_screen() RobotResponse text %s\n", ipc_memory_client->Sentence );
		RobotResponse.set_text			( ipc_memory_client->Sentence );	// ConnectionStatus		
	}
	RobotResponse.set_text_size 		( 16.0 		 );
	RobotResponse.set_text_color		( 0xCFFF0000 );
	RobotResponse.set_background_color  ( 0xFFFFFf00 );
	
	// This should be hidden until asked for via voice.
	//AvailClients.move_to( 20, 75 );

	// Add to display manager:
	MainDisplay.remove_all_objects(		  );
	MainDisplay.add_object( &ClientInputEdit);
	MainDisplay.add_object( &RobotResponse 	);
	MainDisplay.add_object( &AvailClients 	);
//	MainDisplay.add_object( &adren_board_list );
//	MainDisplay.load_resources();
}
Пример #2
0
void send_to_viki( void* mEditBoxPtr )
{
	printf("send_to_viki() callback reached!\n");
	
	EditBox* eb = 	(EditBox*)mEditBoxPtr;
	char* str = eb->get_text();
	if (is_client_ipc_memory_available()==false)
		RobotResponse.set_text("Viki is down.");
		
	cli_ipc_write_sentence( str );
}