|
simulink | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.tum.cs.simulink.util.SimulinkUtils
public class SimulinkUtils
Collection of utility methods for Simulink models.
Constructor Summary | |
---|---|
SimulinkUtils()
|
Method Summary | ||
---|---|---|
static java.util.Set<SimulinkBlock> |
calculateParentSet(java.util.Collection<SimulinkBlock> blocks)
Calculate the set of all parent blocks up to the model for the given blocks. |
|
static void |
copyParameters(ParameterizedElement source,
ParameterizedElement target)
Copy parameters from one parameterized element to another. |
|
static int |
countLines(SimulinkBlock block)
Recursively count lines. |
|
static int |
countStates(IStateflowNodeContainer<?> node)
Recursively count Stateflow states. |
|
static int |
countStates(StateflowMachine stateflowMachine)
Count states of all charts of the machine. |
|
static int |
countSubBlocks(SimulinkBlock block)
Recursively count sub blocks. |
|
static java.util.Map<java.lang.String,SimulinkBlock> |
createIdToNodeMap(SimulinkBlock block)
Create map that maps from id to block. |
|
static java.lang.String |
createSimulinkId(java.lang.Iterable<java.lang.String> names)
Create Simulink id from a iteration of names. |
|
static java.lang.String |
escape(java.lang.String string)
Replaces forward slashes by double forward slashes. |
|
static StateflowBlock |
getBlock(IStateflowElement<?> element)
Get the Stateflow block a Stateflow element belongs to. |
|
static StateflowChart |
getChart(IStateflowElement<?> element)
Get the Stateflow chart a Stateflow element belongs to. |
|
static java.lang.String |
getFQStateName(StateflowState state)
Get full qualified state name. |
|
static int[] |
getIntParameterArray(java.lang.String parameter)
Get Simulink array parameter as array. |
|
static SimulinkBlock |
getStateflowInport(SimulinkInPort inPort)
Obtain in port. |
|
static SimulinkBlock |
getStateflowOutport(SimulinkOutPort outPort)
Obtain out port block that is below the a Stateflow block and describes the output of a Stateflow chart. |
|
static java.lang.String |
getStateName(StateflowState state)
Get name of a Stateflow state as defined in the Stateflow manual. |
|
static java.lang.String[] |
getStringParameterArray(java.lang.String parameter)
Get Simulink array parameter as array. |
|
static boolean |
isTargetlinkBlock(SimulinkBlock node)
Checks if a block is a target link block. |
|
static java.util.List<SimulinkBlock> |
listBlocksDepthFirst(SimulinkBlock block)
Returns all recursively reachable subblocks of the given block. |
|
static java.util.List<java.lang.String> |
splitSimulinkId(java.lang.String string)
Split full qualified identifier. |
|
static
|
visitDepthFirst(SimulinkBlock block,
Visit blocks in a depth first manner. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimulinkUtils()
Method Detail |
---|
public static void copyParameters(ParameterizedElement source, ParameterizedElement target)
public static java.util.Map<java.lang.String,SimulinkBlock> createIdToNodeMap(SimulinkBlock block)
public static java.lang.String escape(java.lang.String string)
public static int[] getIntParameterArray(java.lang.String parameter)
NumberFormatException
if the elements of the array are not
integers.
public static java.lang.String[] getStringParameterArray(java.lang.String parameter)
public static boolean isTargetlinkBlock(SimulinkBlock node)
public static java.util.List<java.lang.String> splitSimulinkId(java.lang.String string)
public static java.lang.String createSimulinkId(java.lang.Iterable<java.lang.String> names)
PreconditionException
- if one of names starts or ends with a slashpublic static <X extends java.lang.Exception> void visitDepthFirst(SimulinkBlock block,visitor) throws X extends java.lang.Exception
X
- Type of exception thrown by the visitor.block
- block to start withvisitor
- the visitor
X
- exception thrown by the visitor.
X extends java.lang.Exception
public static java.util.List<SimulinkBlock> listBlocksDepthFirst(SimulinkBlock block)
public static java.util.Set<SimulinkBlock> calculateParentSet(java.util.Collection<SimulinkBlock> blocks)
public static int countSubBlocks(SimulinkBlock block)
public static int countLines(SimulinkBlock block)
public static int countStates(IStateflowNodeContainer<?> node)
public static int countStates(StateflowMachine stateflowMachine)
public static StateflowChart getChart(IStateflowElement<?> element)
null
if the element is
unconnected or not associated with a chart, e.g.
StateflowTarget
.public static StateflowBlock getBlock(IStateflowElement<?> element)
null
if the element is
unconnected or not associated with a chart, e.g.
StateflowTarget
.public static java.lang.String getStateName(StateflowState state)
StateflowState
.
public static java.lang.String getFQStateName(StateflowState state)
StateflowState
as names of Stateflow derives names from the state
labels.
public static SimulinkBlock getStateflowOutport(SimulinkOutPort outPort)
public static SimulinkBlock getStateflowInport(SimulinkInPort inPort)
getStateflowOutport(SimulinkOutPort)
for
details.
|
simulink | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |