示例#1
0
void CDsi::DSI_Left_View (int *_dsi_right, int *_dsi_left)
{
	dsi_right = _dsi_right;
	dsi_left = _dsi_left;

	#define PARALLEL_VIEW_CHANGE
	#ifdef PARALLEL_VIEW_CHANGE
//		omp_set_num_threads(numthreads);
//		#pragma omp parallel for
		for (int i = 0; i < numthreads; i++)
		{
			// partition the scanlines
			int num_sl = imgH / numthreads;
			int y_start = i * num_sl;
			int y_end = y_start + num_sl - 1;
			if (i == numthreads - 1)
				y_end = imgH - 1;			

			// run parallel dsi computation
			change_view (y_start, y_end);
			//FillDSI_right_reference (col_conv_right, col_conv_left, HMI_Scores_Lookup, y_start, y_end, dsi);
		}
//		#pragma omp barrier
	#else
		change_view (0, imgH - 1);
	#endif
}
示例#2
0
void change_view_zoom(long val)
#endif
{
#if defined(SGI_GL) && defined(GL_NASA)
    long val = g_get_slide_val( ap ) ;
#endif

    /* Save current zoom value */
    disp_crnt_zoom = (float)val / 10.0 ;
    change_view() ;
}
示例#3
0
void change_view_y(long val )
#endif
{
#if defined(SGI_GL) && defined(GL_NASA)
    long val = g_get_slide_val( ap ) ;
#endif

    /* Save current rot-Y value */
    disp_crnt_view_y = val ;
    change_view() ;
}
示例#4
0
void PatsTest_kick2()
{
  fflush(stdout);

  if (Mem->ViewWidth != VW_Wide)
    change_view(VW_Wide);
	  
  static int WasBallKickable;
  DebugKick(printf("Time: %d\n", Mem->CurrentTime.t));
  //DebugKick(printf(" Ball Distance: %f\n", Mem->BallDistance() ));
  //DebugKick(cout << " MyPos: " << Mem->MyPos() << endl));
  if (!Mem->BallPositionValid() || !Mem->BallKickable()) {
    WasBallKickable = FALSE;
    
    DebugKick(printf("chasing ball\n"));
    if (Mem->BallPositionValid()) {
      if (fabs(Mem->BallAngleFromBody()) > Mem->CP_KickTo_err) {
	DebugKick(printf("turning to face ball\n"));
	DebugKick(printf("the angle is: %f\n", Mem->BallAngle()));
	turn(Mem->BallAngleFromBody());
      } else {
	DebugKick(printf("dashing\n"));
	float power=Mem->BallDistance()*40;
	if (power>40) power = 40;
	dash(power);
      } 
    } else {
      DebugKick(printf("turning randomly\n"));
      turn(60);
    } 
    return;
  } 


  //DebugKick(printf("the (simulated) ball velocity is: %g\n",) 
	   //	 Mem->BallAbsoluteVelocity().mod());

  if (Mem->BallKickable()) {
    if (!smart_kick_hard_abs(0, KM_HardestKick))
      printf("test_kick_hard: UhOh, something bad happened\n");
    return;
  } 

  return;
}
示例#5
0
int		key_hook_2(int keycode, t_env *e)
{
	if (keycode == 69)
	{
		if (e->w > 0.2)
			e->w -= 0.2;
	}
	if (keycode == 78)
		e->w += 0.2;
	if (keycode == 6)
		e->h -= 0.1;
	if (keycode == 7)
		e->h += 0.1;
	if (keycode == 8)
		e->h -= 0.5;
	if (keycode == 9)
		e->h += 0.5;
	change_view(keycode, e);
	return (0);
}
示例#6
0
文件: popups.c 项目: Tonyxu82/TFX8051
void emu_exception(struct em8051 *aCPU, int aCode)
{
    WINDOW * exc;

    switch (aCode)
    {
    case EXCEPTION_IRET_SP_MISMATCH:
        if (opt_exception_iret_sp) return;
        break;
    case EXCEPTION_IRET_ACC_MISMATCH:
        if (opt_exception_iret_acc) return;
        break;
    case EXCEPTION_IRET_PSW_MISMATCH:
        if (opt_exception_iret_psw) return;
        break;
    case EXCEPTION_ACC_TO_A:
        if (!opt_exception_acc_to_a) return;
        break;
    case EXCEPTION_STACK:
        if (!opt_exception_stack) return;
        break;
    case EXCEPTION_ILLEGAL_OPCODE:
        if (!opt_exception_invalid) return;
        break;
    }

    nocbreak();
    cbreak();
    nodelay(stdscr, FALSE);
    halfdelay(1);
    while (getch() > 0) {}


    runmode = 0;
    setSpeed(speed, runmode);
    exc = subwin(stdscr, 7, 50, (LINES-6)/2, (COLS-50)/2);
    wattron(exc,A_REVERSE);
    werase(exc);
    box(exc,ACS_VLINE,ACS_HLINE);
    mvwaddstr(exc, 0, 2, "Exception");
    wattroff(exc,A_REVERSE);
    wmove(exc, 2, 2);

    switch (aCode)
    {
    case -1: waddstr(exc,"Breakpoint reached");
             break;
    case EXCEPTION_STACK: waddstr(exc,"SP exception: stack address > 127");
                          wmove(exc, 3, 2);
                          waddstr(exc,"with no upper memory, or SP roll over."); 
                          break;
    case EXCEPTION_ACC_TO_A: waddstr(exc,"Invalid operation: acc-to-a move operation"); 
                             break;
    case EXCEPTION_IRET_PSW_MISMATCH: waddstr(exc,"PSW not preserved over interrupt call"); 
                                      break;
    case EXCEPTION_IRET_SP_MISMATCH: waddstr(exc,"SP not preserved over interrupt call"); 
                                     break;
    case EXCEPTION_IRET_ACC_MISMATCH: waddstr(exc,"ACC not preserved over interrupt call"); 
                                     break;
    case EXCEPTION_ILLEGAL_OPCODE: waddstr(exc,"Invalid opcode: 0xA5 encountered"); 
                                   break;
    default:
        waddstr(exc,"Unknown exception"); 
    }
    wmove(exc, 6, 12);
    wattron(exc,A_REVERSE);
    waddstr(exc, "Press any key to continue");
    wattroff(exc,A_REVERSE);

    wrefresh(exc);

    getch();
    delwin(exc);
    change_view(aCPU, MAIN_VIEW);
}
示例#7
0
void PatsTest_kick()
{
  if (!strcmp(Mem->MyTeamName, "CMUnited")) {
    //float targ_vel;
    Vector pass_targ;
  
    fflush(stdout);

    change_view(VW_Narrow);
    
    if (!Mem->BallKickable()) {
      //scan_field();
      return;
    } 

    /*    if((int)(Mem->CurrentTime.t) % 50 < 5 ) {
      return; 
    }*/

  DebugKick(printf("\nTime: %d\n", Mem->CurrentTime.t));  

  /*
  targ_vel = 1.0 + (Mem->CurrentTime.t / 50)*.1;
  printf("Target vel is: %f\n", targ_vel);*/
    pass_targ = Vector(-20, -20 + (Mem->CurrentTime.t / 50)*5);
    //cout << "Pass Target: " << pass_targ << endl;
  
  //DebugKick(printf("the (simulated) ball velocity is: %g\n",) 
	   //	 Mem->BallAbsoluteVelocity().mod());
  /*
  DebugKick(printf("My angle: %f\n", Mem->MyAng()));
  if (fabs(Mem->MyAng() - 90) > 5) {
    DebugKick(printf("Turning to 90\n"));
    //turn(90-Mem->MyAng());
    turn(Mem->MarkerAngle(Mem->RM_RC_Flag));
    return;
  }
  */
    if (Mem->BallKickable()) {
      /*if (step == 4)
	if (step == 3) {
	step = 0; 
	turn(90 - Mem->MyAng());
	} 	*/
      smart_kick_hard_abs(180, KM_Moderate);
      //smart_kick_hard_abs(180, KM_HardestKick);
      //smart_kick_hard_abs(180, KM_Moderate, targ_vel);
      //smart_pass(pass_targ);
    } 
  } else {
    static int FirstTime = TRUE;
    const int ydist = 2;
    //    if (Mem->MyNumber == 1)
    //      test_go_to_point(Vector(-.2, -1), .5, 50);
    if (!FirstTime)
      return;
    switch (Mem->MyNumber) {
    case 1: move(-.2, -1); break;
    case 2: move(-20,  ydist); break;
    case 3: move(-30, -ydist); break;
    case 4: move(-40,  ydist); break;
    case 5: move(-50, -ydist); break;
    }
    FirstTime = FALSE;
  }
  
  return;
}