| /** |
| * ******************************************************************************* |
| * Copyright (c) 2019 Robert Bosch GmbH and others. |
| * |
| * 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 templates.m2m.hw |
| |
| import com.google.inject.Inject |
| import com.inchron.realtime.root.model.Model |
| import org.eclipse.app4mc.amalthea.model.FrequencyDomain |
| import org.eclipse.app4mc.amalthea.model.HWModel |
| import templates.AbstractAmaltheaInchronTransformer |
| import com.google.inject.Singleton |
| |
| @Singleton |
| class HWTransformer extends AbstractAmaltheaInchronTransformer { |
| |
| @Inject HWStructure_SystemTransformer hwStructure_SystemTransformer |
| |
| @Inject FrequencyDomainTransformer frequencyDomainTransformer |
| |
| def transfromHWModel(HWModel amltHWModel, Model inchronModel) { |
| |
| amltHWModel.domains.forEach [ domain | |
| if (domain instanceof FrequencyDomain) { |
| var inchronClock = frequencyDomainTransformer.createClock(domain as FrequencyDomain) |
| |
| inchronModel.clocks.add(inchronClock) |
| } |
| ] |
| |
| hwStructure_SystemTransformer.transformHWSystem(amltHWModel, inchronModel) |
| } |
| |
| } |