Ejemplo n.º 1
0
void KAstTopLevel::slotShipKilled()
{
    shipsRemain--;
    shipsLCD->display( shipsRemain-1 );

    playSound( "ShipDestroyed" );

    if ( shipsRemain )
    {
        waitShip = TRUE;
        view->showText( tr( "Ship Destroyed. Press L to launch."), Qt::yellow );
    }
    else
    {
        view->showText( tr("Game Over!"), Qt::red );
        view->endGame();
	doStats();
//        highscore->addEntry( score, level, showHiscores );
    }
}
Ejemplo n.º 2
0
void PPPStats::timerClick()
{
    enum IOStatus newStatus;

    doStats();

    if((ibytes != ibytes_last) && (obytes != obytes_last))
        newStatus = BytesBoth;
    else if(ibytes != ibytes_last)
        newStatus = BytesIn;
    else if(obytes != obytes_last)
        newStatus = BytesOut;
    else
        newStatus = BytesNone;

    if(newStatus != ioStatus)
        emit statsChanged(ioStatus = newStatus);

	//baud_speed = (double)((ibytes - ibytes_last) /1024.0 ) * 5;
	
    ibytes_last = ibytes;
    obytes_last = obytes;
}
Ejemplo n.º 3
0
int
main(int argc, char *argv[])
{
  int seedX=-1,seedY=-1; 
  char szWrap[MAXNAME], szUnwrap[MAXNAME];
  meta_parameters *meta;

  logflag=0;

  while (currArg < (argc-2)) {
    char *key = argv[currArg++];
    if (strmatch(key,"-log")) {
      CHECK_ARG(1);
      strcpy(logFile,GET_ARG(1));
      fLog = FOPEN(logFile, "a");
      logflag = 1;
    }
    else if (strmatch(key,"-x")) {
      CHECK_ARG(1);
      sscanf(GET_ARG(1), "%d", &seedX);
    }
    else if (strmatch(key,"-y")) {
      CHECK_ARG(1);
      sscanf(GET_ARG(1), "%d", &seedY);
    }
    else {
      printf("\n   ***Invalid option: %s\n", argv[currArg-1]);
      usage(argv[0]);
    }
  }
  create_name(szWrap, argv[currArg++], ".img");
  create_name(szUnwrap, argv[currArg], ".img");

  printf("%s\n",date_time_stamp());
  printf("Program: escher\n\n");
  if (logflag) {
    StartWatchLog(fLog);
    printLog("Program: escher\n\n");
  }

  meta = meta_read(szWrap);
  wid = meta->general->sample_count;
  len = meta->general->line_count;
  if ((seedX==-1)&&(seedY==-1))
  {
  	seedX=wid/2;
  	seedY=len/2;
  }
  
  meta_write(meta, szUnwrap);
  

  size = wid*len;
  mask  = (Uchar *)calloc(size, sizeof(Uchar));
  im    = (Uchar *)calloc(size, sizeof(Uchar));
  phase = (float *)MALLOC(sizeof(float)*size);
  /*coh   = (float *)MALLOC(sizeof(float)*size);*/

  /* perform steps*/
  printf("\n   begin unwrapping phase...\n");
  loadWrappedPhase(szWrap);
  groundBorder();
  makeMask();
  
  doStats("   after makeMask():");

  installCordon("cordon");
  cutMask();

  doStats("   after cutMask():");

#if DO_DEBUG_CHECKS
  saveMask((char *)mask, "test");

  verifyCuts();                                           
#endif

  checkSeed(&seedX, &seedY);

  integratePhase(seedX, seedY);

  doStats("   after integratePhase():");

  finishUwp();

  saveMask(mask, szUnwrap);

  saveUwp(szUnwrap);
  
  /* clean up & save*/
  free(mask);
  free(im);
  free(phase);
  return(0);
}