blob: b6c3e942f0bc468f5adb60a56401b164392fb66f [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2018 Agence spatiale canadienne / Canadian Space Agency
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Pierre Allard,
* Regent L'Archeveque - initial API and implementation
*
* SPDX-License-Identifier: EPL-1.0
*******************************************************************************/
package org.eclipse.apogy.examples.rover.impl;
import org.eclipse.apogy.examples.rover.ApogyExamplesRoverFactory;
import org.eclipse.apogy.examples.rover.PowerSystem;
public abstract class RoverCustomImpl extends RoverImpl {
@Override
public PowerSystem getPowerSystem() {
if (this.powerSystem == null) {
PowerSystem newPowerSystem = ApogyExamplesRoverFactory.eINSTANCE.createPowerSystem();
// Add six batteries
newPowerSystem.getBatteries().add(ApogyExamplesRoverFactory.eINSTANCE.createBattery());
newPowerSystem.getBatteries().add(ApogyExamplesRoverFactory.eINSTANCE.createBattery());
newPowerSystem.getBatteries().add(ApogyExamplesRoverFactory.eINSTANCE.createBattery());
newPowerSystem.getBatteries().add(ApogyExamplesRoverFactory.eINSTANCE.createBattery());
newPowerSystem.getBatteries().add(ApogyExamplesRoverFactory.eINSTANCE.createBattery());
newPowerSystem.getBatteries().add(ApogyExamplesRoverFactory.eINSTANCE.createBattery());
// Set the active one to the first one
newPowerSystem.changeActiveBatteryTo(0);
// Set the power system accordingly
this.setPowerSystem(newPowerSystem);
}
return this.powerSystem;
}
@Override
abstract public boolean init();
@Override
abstract public void cmdChangeName(String name);
@Override
abstract public void dispose();
@Override
abstract public void cmdLinearVelocity(double linearVelocity);
@Override
abstract public void cmdAngularVelocity(double angularVelocity);
@Override
abstract public void cmdVelocities(double linearVelocity, double angularVelocity);
} // RoverImpl