| /** |
| ******************************************************************************** |
| * Copyright (c) 2020-2021 Robert Bosch GmbH. |
| * |
| * This program and the accompanying materials are made |
| * available under the terms of the Eclipse Public License 2.0 |
| * which is available at https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * Robert Bosch GmbH - initial API and implementation |
| * ******************************************************************************* |
| */ |
| |
| package org.eclipse.app4mc.slg.ros2.transformers.stimuli; |
| |
| import java.util.ArrayList; |
| import java.util.Map; |
| |
| import org.eclipse.app4mc.amalthea.model.InterProcessStimulus; |
| import org.eclipse.app4mc.slg.commons.m2t.SLGBaseTransformer; |
| import org.eclipse.app4mc.slg.commons.m2t.generators.TranslationUnit; |
| import org.eclipse.app4mc.slg.ros2.generators.RosInterProcessStimulusGenerator; |
| import org.eclipse.app4mc.slg.ros2.generators.RosIpStimulusTranslationunit; |
| import org.eclipse.app4mc.transformation.util.OutputBuffer; |
| |
| import com.google.inject.Inject; |
| import com.google.inject.Singleton; |
| |
| @Singleton |
| public class RosInterProcessStimulusTransformer extends SLGBaseTransformer { |
| |
| @Inject private OutputBuffer outputBuffer; |
| |
| private RosIpStimulusTranslationunit ipUnit; |
| |
| public RosIpStimulusTranslationunit transform(final InterProcessStimulus ip) { |
| RosIpStimulusTranslationunit tu = new RosIpStimulusTranslationunit(this.outputBuffer, |
| ip); |
| this.ipUnit = tu; |
| this.outputBuffer.appendTo("OTHER", this.ipUnit.getMakeFilePath().toString(), "CMakeLists.txt"); |
| this.outputBuffer.appendTo("OTHER", (("services/" + this.ipUnit.getModuleName()) + "/CMakeLists.txt"), RosInterProcessStimulusGenerator.toCMake()); |
| this.outputBuffer.appendTo("OTHER", (("services/" + this.ipUnit.getModuleName()) + "/package.xml"), RosInterProcessStimulusGenerator.toPackageXML(ipUnit)); |
| return this.ipUnit; |
| } |
| |
| @Override |
| public Map<ArrayList<?>, ? extends TranslationUnit> getCache() { |
| throw new UnsupportedOperationException("TODO: auto-generated method stub"); |
| } |
| } |