Package de.nordakademie.cerca.sensorport

Examples of de.nordakademie.cerca.sensorport.NativeSensorPort


   * resets variables hasExpectedParams and isCalled prior to every
   * test.
   */
  @Before
  public void setUp() {
    NativeSensorPort sensorPort = NativeSensorPort.getInstance();
    sensorPort.setBehaviour(this);
    this.hasExpectedParams = false;
    this.isCalled = false;
  }
View Full Code Here


    nb.setBehaviour(new MyBattery());
   
    MySensorPort mySensorPort = new MySensorPort();
    mySensorPort.setISensorPort(0, new LightSensorStub());
   
    NativeSensorPort sensorPort = NativeSensorPort.getInstance();
    sensorPort.setBehaviour(mySensorPort);
   
    NativeButton nBtn = NativeButton.getInstance();
    nBtn.setBehaviour(new MyButton());
   
    // calling native LeJOS methods
View Full Code Here

  @Test
  public void testCercaContext() {
    NativeSensorPortStub nativeSensorPortStub = new NativeSensorPortStub();
    nativeSensorPortStub.setISensorPort(0, lightSensorStub);
    NativeSensorPort nativeSensorPort = NativeSensorPort.getInstance();
    nativeSensorPort.setBehaviour(nativeSensorPortStub);
    LightSensor lightSensor = new LightSensor(SensorPort.S1);

    lightSensorStub.setImage(new Image(Display.getDefault(),
        "src/de/nordakademie/nxtsimulation/"
            + "test/LightSensorTestImage_white.png"));
View Full Code Here

  final ISensorPort sensorPortMockB = context.mock(ISensorPort.class, "PortB");

  @Before
  public void setUp() {
    nativeSensorPortStub = new NativeSensorPortStub();
    NativeSensorPort nativeSensorPort = NativeSensorPort.getInstance();
    nativeSensorPort.setBehaviour(nativeSensorPortStub);
  }
View Full Code Here

    System.out.println("CercaContext SoundSensor-Test mit "
        + anzahlMessungen + " Messungen. Bitte ins Mikrofon br�llen!");

    NativeSensorPortStub nativeSensorPortStub = new NativeSensorPortStub();
    nativeSensorPortStub.setISensorPort(0, soundSensorStub);
    NativeSensorPort nativeSensorPort = NativeSensorPort.getInstance();
    nativeSensorPort.setBehaviour(nativeSensorPortStub);
    SoundSensor soundSensor = new SoundSensor(SensorPort.S1);
   
    int sensorValue;
    for (int i = 1; i <= anzahlMessungen; i++) {
      long startTime = System.currentTimeMillis();
View Full Code Here

  @Test
  public void testCercaContextNoObstacle() {
    NativeSensorPortStub nativeSensorPortStub = new NativeSensorPortStub();
    nativeSensorPortStub.setISensorPort(0, sensorStub);
    NativeSensorPort nativeSensorPort = NativeSensorPort.getInstance();
    nativeSensorPort.setBehaviour(nativeSensorPortStub);
    UltrasonicSensor sensor = new UltrasonicSensor(SensorPort.S1);
    sensorStub.setPosX(0);
    sensorStub.setPosY(0);
    sensorStub.setHeading(0);
View Full Code Here

 
  @Test
  public void testCercaContextConfig() {
    NativeSensorPortStub nativeSensorPortStub = new NativeSensorPortStub();
    nativeSensorPortStub.setISensorPort(0, sensorStub);
    NativeSensorPort nativeSensorPort = NativeSensorPort.getInstance();
    nativeSensorPort.setBehaviour(nativeSensorPortStub);
    UltrasonicSensor sensor = new UltrasonicSensor(SensorPort.S1);
    sensorStub.setPosX(0);
    sensorStub.setPosY(0);
    sensorStub.setHeading(90);
   
View Full Code Here

  @Test
  public void testCercaContextWithObstacles() {
    NativeSensorPortStub nativeSensorPortStub = new NativeSensorPortStub();
    nativeSensorPortStub.setISensorPort(0, sensorStub);
    NativeSensorPort nativeSensorPort = NativeSensorPort.getInstance();
    nativeSensorPort.setBehaviour(nativeSensorPortStub);
    UltrasonicSensor sensor = new UltrasonicSensor(SensorPort.S1);
    sensorStub.setPosX(0);
    sensorStub.setPosY(0);
    sensorStub.setHeading(90);
View Full Code Here

   
    NativeMotorPort nativeMotorPort = NativeMotorPort.getInstance();
    NativeBattery nativeBattery = NativeBattery.getInstance();
    NativeButton nativeButton = NativeButton.getInstance();
    NativeLCD nativeLcd = NativeLCD.getInstance();
    NativeSensorPort nativeSensor = NativeSensorPort.getInstance();
   
    //Verhalten f�r die Cerca Instanzen setzen
    NativeMotorPortStub motorportStub = new NativeMotorPortStub();
    nativeMotorPort.setBehaviour(motorportStub);   
    NativeBatteryStub batteryStub = new NativeBatteryStub();
    nativeBattery.setBehaviour(batteryStub);   
    NativeButtonStub btnStub = new NativeButtonStub();
    nativeButton.setBehaviour(btnStub);     
    NativeLcdStub lcdStub = new NativeLcdStub();
    nativeLcd.setBehaviour(lcdStub);   
    NativeSensorPortStub sensorPortStub = new NativeSensorPortStub();
    nativeSensor.setBehaviour(sensorPortStub);
   
    // Initialsetzung der angeschlossenen Elemente des SimPilots   
    simPilot.setTrackWidth(11.6f);
    simPilot.setWheelDiameter(5.6f);
    simPilot.setMotorPort(motorportStub);
View Full Code Here

TOP

Related Classes of de.nordakademie.cerca.sensorport.NativeSensorPort

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.