コード例 #1
0
ファイル: ocean.cpp プロジェクト: 5432935/crossbridge
void Ocean::initCells(void) {
  addEmptyCells();
  addObstacles();
  addPredators();
  addPrey();
  displayStats(-1);
  displayBorder();
  Ocean1 = this;
}
コード例 #2
0
ファイル: ocean.cpp プロジェクト: 5432935/crossbridge
void Ocean::run(void) {
  unsigned numIterations = DefaultNumIterations; // instead of cin
  if (numIterations > 1000) numIterations = DefaultNumIterations;
  for (unsigned iteration = 0; iteration < numIterations; iteration++) {
    if (numPredators > 0 && numPrey > 0) {
      for (unsigned row = 0; row < numRows; row++)
	for (unsigned col = 0; col < numCols; col++)
	  cells[row][col]->process();
      displayStats(iteration);
      displayCells();
      displayBorder();
    }
  }
}
コード例 #3
0
ファイル: screenGraph.c プロジェクト: An00bIS47/gbMon2
void displayHumidityScreenLive(){
	displayBorder();
	int i;
	GLCDD_Rect r;
	
	r.w = 128 - 10;
	//r.h = -1;
	r.h = 5;
	
	// Humidity
	r.x = 20;
	r.y = 12;
	GLCDD_Printf(fnt_spaceLex_5, 0, &r, "HUMIDITY LIVE");
	
	for (i=0; i < 108; i++){
		Data data;
		data=bufferPop(buffer);
		drawPoint(data.humidity.current);
	}
}
コード例 #4
0
ファイル: screenGraph.c プロジェクト: An00bIS47/gbMon2
void displayECScreenLive(int sensorID){
	displayBorder();
	int i;
	
	GLCDD_Rect r;
	
	r.w = 128 - 10;
	//r.h = -1;
	r.h = 5;
	
	// Humidity
	r.x = 20;
	r.y = 12;
	GLCDD_Printf(fnt_spaceLex_5, 0, &r, "EC-LEVEL %d LIVE", sensorID);
	
	for (i=0; i < 108; i++){
		Data data;
		data=bufferPop(buffer);
		drawPoint(data.ecLevel[sensorID].current);
	}
}
コード例 #5
0
ファイル: screenGraph.c プロジェクト: An00bIS47/gbMon2
void displayTemperatureScreenLive(int sensorID){
	displayBorder();
	int i;
	
	GLCDD_Rect r;
	
	r.w = 128 - 10;
	//r.h = -1;
	r.h = 5;
	
	// Humidity
	r.x = 20;
	r.y = 12;
	GLCDD_Printf(fnt_spaceLex_5, 0, &r, "TEMPERATURE %d LIVE", sensorID);
	
	for (i=0; i < 108; i++){
		Data data;
		data=bufferPop(buffer);
		drawPoint(data.temperature[sensorID].current);
	}
}
コード例 #6
0
ファイル: ocean.cpp プロジェクト: 5432935/crossbridge
void Ocean::displayStats(int iteration) {
  // lots of cout stuff
  displayBorder();
}