/*******************************************************************************
* Copyright (c) 2010-2013, Embraer S.A., Budapest University of Technology and Economics
* 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:
* Marton Bur, Abel Hegedus, Akos Horvath - initial API and implementation
*******************************************************************************/
package hu.bme.mit.massif.simulink.api.adapter.block;
import hu.bme.mit.massif.simulink.Block;
import hu.bme.mit.massif.simulink.From;
import hu.bme.mit.massif.simulink.SimulinkFactory;
import hu.bme.mit.massif.simulink.SimulinkReference;
import hu.bme.mit.massif.simulink.api.Importer;
/**
* Adapter class for the from block
*/
public class FromAdapter extends DefaultBlockAdapter {
@Override
public Block getBlock(Importer traverser) {
return SimulinkFactory.eINSTANCE.createFrom();
}
@Override
public void process(Importer traverser, SimulinkReference parentSimRef, Block blockToProcess) {
super.process(traverser, parentSimRef, blockToProcess);
From fromBlock = (From) blockToProcess;
traverser.getFroms().put(fromBlock.getSimulinkRef().getFQN().replace('\n', ' '), fromBlock);
// This block is processed further during the creation of connections between blocks
}
}