Package ch.bfh.ti.kybernetik.engine.controller.observerCommands.model

Examples of ch.bfh.ti.kybernetik.engine.controller.observerCommands.model.LightSensorModelObserverCommand


                      rightLightSensorVector);

            }
            // Changed Left Sensor Intensity
            if (leftSensorIntensity != roboter.getLeftLightSensor().getSensorIntensity()) {
              notifyObservers(new LightSensorModelObserverCommand(roboter, LightSensorCommandState.SENSOR_INTENSITY_CHANGED,
                  roboter.getLeftLightSensor()));
              logger.debug("Changed Left Light Sensor Intensity to {}: " + leftSensorIntensity);
              roboter.getLeftLightSensor().setSensorIntensity(leftSensorIntensity);
            }
            if (leftSensorIntensity == 0) {
              notifyObservers(new LightSensorModelObserverCommand(roboter, LightSensorCommandState.SENSOR_INTENSITY_REMAINS,
                  roboter.getLeftLightSensor()));
            }
            // Changed Right Sensor Intensity
            if (rightSensorIntensity != roboter.getRightLightSensor().getSensorIntensity()) {
              notifyObservers(new LightSensorModelObserverCommand(roboter, LightSensorCommandState.SENSOR_INTENSITY_CHANGED,
                  roboter.getRightLightSensor()));
              logger.debug("Changed Right Light Sensor Intensity to {}: " + rightSensorIntensity);
              roboter.getRightLightSensor().setSensorIntensity(rightSensorIntensity);
            }
            if (rightSensorIntensity == 0) {
              notifyObservers(new LightSensorModelObserverCommand(roboter, LightSensorCommandState.SENSOR_INTENSITY_REMAINS,
                  roboter.getRightLightSensor()));
            }
            RoboterMove rm = roboterController.calculateNewRoboterPosition(leftSensorIntensity, rightSensorIntensity);

            calculateOutOfWindowAreaPosition(roboterController, rm);
View Full Code Here


      } else if (rmoc.getState() == RoboterModelCommandState.ROBOTER_REMOVED) {
        RoboterComponent rc = findOrAddRoboterComponent(rmoc.getModel());
        this.roboterComponents.remove(rc);
      }
    } else if (observerCommand instanceof LightSensorModelObserverCommand) {
      LightSensorModelObserverCommand lsmoc = (LightSensorModelObserverCommand) observerCommand;
      if (lsmoc.getState() == LightSensorCommandState.SENSOR_INTENSITY_CHANGED) {
        RoboterComponent rc = findOrAddRoboterComponent(lsmoc.getModel());
        rc.hightLightRoboterElement(lsmoc.getPayLoad());
      } else if (lsmoc.getState() == LightSensorCommandState.SENSOR_INTENSITY_REMAINS) {
        RoboterComponent rc = findOrAddRoboterComponent(lsmoc.getModel());
        rc.unHightLightRoboterElement(lsmoc.getPayLoad());
      }
    } else if (observerCommand instanceof RoboterMoveListModelObserverCommand) {
      RoboterMoveListModelObserverCommand rmlmoc = (RoboterMoveListModelObserverCommand) observerCommand;
      if (rmlmoc.getState() == RoboterMoveModelObserverCommandState.ROBOTER_MOVE_ADDED) {
        RoboterMoveListComponent rtc = findOrAddRoboterTraceComponent(rmlmoc.getModel());
View Full Code Here

TOP

Related Classes of ch.bfh.ti.kybernetik.engine.controller.observerCommands.model.LightSensorModelObserverCommand

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.