| /******************************************************************************* |
| * 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.lidar.impl; |
| |
| import org.eclipse.apogy.examples.lidar.ApogyExamplesLidarFactory; |
| import org.eclipse.apogy.examples.lidar.Lidar; |
| import org.eclipse.apogy.examples.lidar.LidarSimulated; |
| import org.eclipse.apogy.examples.lidar.LidarStub; |
| |
| public class ApogyExampleLidarCustomImpl extends ApogyExampleLidarImpl { |
| @Override |
| public Lidar makeLidarSameType(Lidar lidar) { |
| // Used to keep track of the new Lidar unit instance |
| Lidar newLidar = null; |
| |
| // If the given Lidar object has a simulated implementation |
| if (lidar instanceof LidarSimulated) { |
| // Create a simulated Lidar object |
| newLidar = ApogyExamplesLidarFactory.eINSTANCE.createLidarSimulated(); |
| } |
| // Else if the given Lidar object has a stub implementation |
| else if (lidar instanceof LidarStub) { |
| // Create a stub Lidar object |
| newLidar = ApogyExamplesLidarFactory.eINSTANCE.createLidarStub(); |
| } |
| |
| // Return the new Lidar instance |
| return newLidar; |
| } |
| |
| } |