Exemplo n.º 1
0
/**
 * The Constructor for VStream takes the video_source, the roborealm host and a file location.
 * Both the host ip and the file loc aren't required.
 */
VStream::VStream (inputVars data)
{
  this->host = data.host;
  this->file_loc = data.file_location;
  this->cameraNumber = data.cameraID;
  _inputFormat = hashit(data.inputSource);
  this->ports = data.ports;

  switch(_inputFormat)
    {
      case VIDEO_FILE:
	  video();
        break;

      case VIDEO_CAMERA:
	  camera();
        break;

      case ROBOREALM:
	  roborealm(host);
        break;

      case STILL_IMAGE:
	  still();
        break;

      default:
        cout << "Invalid input source was provided." << endl;
        show_usage("METR4810.exe");
        break;
    }
}
Exemplo n.º 2
0
void loop() {
  checkSerialAPI();
  checkTimeout();      
  switch(toupper(CMD[0])){
    case 'R': runningLights(DEL, BRI);
    break;
    case 'F': flashingLights(DEL, BRI);
    break;
    case 'P': police(DEL, BRI);
    break;
    case 'S': still(BRI);
    break;
    case 'D': disco(DEL, BRI);
    break;
    case 'G': glow(DEL, BRI);
    break;
    case 'O': 
    default: off();
  }
}