at.lcm.x2c.scilab.xcos.xcosAdapter
Class XcosExprs

java.lang.Object
  extended by at.lcm.x2c.scilab.xcos.xcosAdapter.XcosExprs

public class XcosExprs
extends java.lang.Object

Utility class to handle Xcos block's "graphics.exprs" field which is used to identify X2C blocks and to store X2C specific properties.

Author:
Martin Hochwallner, Markus Aigner

Field Summary
static java.lang.String x2cIdentificationString
           
 
Constructor Summary
XcosExprs(org.scilab.modules.types.ScilabType stExprs)
          Creates new XcosExprs.
XcosExprs(java.lang.String[][] exprs)
          Creates new XcosExprs.
XcosExprs(X2cBlock block)
          Creates new XcosExprs.
 
Method Summary
 void addParameter(java.lang.String name, java.lang.String value, java.lang.String expression, java.lang.String format)
          Add a parameter at the end of the list.
 void clearStaticParamId()
           
 boolean equalsParameters(java.lang.String[] maskParamNames)
          Checks if expression contains the same Mask Parameter names list.
 java.lang.String getBlockLabel()
          Get the BlockLabel of the block.
 java.lang.String getBlockLabelFull()
          Get the full BlockLabel of the block.
 java.lang.String getComponentName()
          Get the ComponentName of the block.
 java.lang.String[][] getExprs()
          Get Content of the block's "graphics.exprs" field.
 java.lang.String getImplementation()
          Get the modelIdentification of the block.
 java.lang.String getLibraryName()
          Get the library name of the block.
 java.lang.String getModelIdentification()
          Get the modelIdentification of the block.
 X2cBlockParameterSimple getParameter(java.lang.String name)
           
 java.util.List<java.lang.String> getParameterNames()
           
 int getParamId()
          Deprecated. Use getStaticParamId() instead.
 java.lang.Integer getSampleTimeFactor()
           
 org.scilab.modules.types.ScilabString getScilabTypeExprs()
          Get Content of the block's "graphics.exprs" field.
 StaticParamIdExpr getStaticParamId()
          Returns Static Parameter ID.
 boolean hasExactlyThisParamaeters(java.lang.String[] maskParamNames)
          Deprecated. Use equalsParameters(String[]) instead.
 boolean hasParameter(java.lang.String name)
           
 boolean isCoT()
           
 boolean isFromX2cBlock()
          Returns whether the exprs was from an X2C block.
 boolean isStaticParamId()
           
 void setBlockLabel(java.lang.String blockLabel)
          Set the BlockLabel of the block.
 void setBlockLabelFull(java.lang.String blockLabelFull)
          Set the full BlockLabel of the block.
 void setComponentName(java.lang.String componentName)
          Set the ComponentName of the block.
 void setCoT(boolean cotEnabled)
           
 void setImplementation(java.lang.String implementation)
          Set the modelIdentification of the block.
 void setLibName(java.lang.String libraryName)
          Set the library name of the block.
 void setModelIdentification(java.lang.String modelIdentification)
          Set the modelIdentification of the block.
 void setSampleTimeFactor(java.lang.Integer sampleTimeFactor)
           
 void setStaticParamId(int paramId)
          Deprecated. Use setStaticParamId(StaticParamIdExpr) instead.
 void setStaticParamId(StaticParamIdExpr id)
          Sets new Static Parameter ID.
 java.lang.String toString()
           
 void updateParameter(java.lang.String name, java.lang.String value, java.lang.String expression, java.lang.String format)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x2cIdentificationString

public static final java.lang.String x2cIdentificationString
See Also:
Constant Field Values
Constructor Detail

XcosExprs

public XcosExprs(java.lang.String[][] exprs)
          throws java.lang.Exception
Creates new XcosExprs.
This constructor can be called directly from Scilab using JIMS.

Parameters:
exprs - Content of the block's "graphics.exprs" field.
Throws:
java.lang.Exception

XcosExprs

public XcosExprs(X2cBlock block)
          throws java.lang.Exception
Creates new XcosExprs.

Parameters:
block - Block
Throws:
java.lang.Exception

XcosExprs

public XcosExprs(org.scilab.modules.types.ScilabType stExprs)
          throws java.lang.Exception
Creates new XcosExprs.
This constructor can be used when working from java on the java representation of Xcos blocks.

Parameters:
stExprs - BasicBlock.getExprs()
Throws:
java.lang.Exception
Method Detail

isFromX2cBlock

public boolean isFromX2cBlock()
Returns whether the exprs was from an X2C block.

Returns:
true if the exprs was from an X2C block

getLibraryName

public java.lang.String getLibraryName()
Get the library name of the block.

Returns:
the library name of the block.

setLibName

public void setLibName(java.lang.String libraryName)
Set the library name of the block.

Parameters:
libraryName - the library name of the block.

getComponentName

public java.lang.String getComponentName()
Get the ComponentName of the block.

Returns:
the componentName

setComponentName

public void setComponentName(java.lang.String componentName)
Set the ComponentName of the block.

Parameters:
componentName - the componentName to set

getBlockLabel

public java.lang.String getBlockLabel()
Get the BlockLabel of the block. BlockLabel is an alias to MaskName.

Returns:
the blockLabel

setBlockLabel

public void setBlockLabel(java.lang.String blockLabel)
Set the BlockLabel of the block. BlockLabel is an alias to MaskName.

Parameters:
blockLabel - the blockLabel to set

getBlockLabelFull

public java.lang.String getBlockLabelFull()
Get the full BlockLabel of the block. BlockLabel is an alias to MaskName with superblock prefix.

Returns:
the blockLabel

setBlockLabelFull

public void setBlockLabelFull(java.lang.String blockLabelFull)
Set the full BlockLabel of the block. BlockLabel is an alias to MaskName with super block prefix.


getModelIdentification

public java.lang.String getModelIdentification()
Get the modelIdentification of the block.

Returns:
the modelIdentification

setModelIdentification

public void setModelIdentification(java.lang.String modelIdentification)
Set the modelIdentification of the block.

Parameters:
modelIdentification - the modelIdentification to set

getImplementation

public java.lang.String getImplementation()
Get the modelIdentification of the block.

Returns:
the implementation

setImplementation

public void setImplementation(java.lang.String implementation)
Set the modelIdentification of the block.

Parameters:
implementation - the implementation to set

addParameter

public void addParameter(java.lang.String name,
                         java.lang.String value,
                         java.lang.String expression,
                         java.lang.String format)
Add a parameter at the end of the list.

Parameters:
name -
value -

getParameter

public X2cBlockParameterSimple getParameter(java.lang.String name)

hasParameter

public boolean hasParameter(java.lang.String name)

getParameterNames

public java.util.List<java.lang.String> getParameterNames()

updateParameter

public void updateParameter(java.lang.String name,
                            java.lang.String value,
                            java.lang.String expression,
                            java.lang.String format)
                     throws java.lang.Exception
Throws:
java.lang.Exception

getExprs

public java.lang.String[][] getExprs()
Get Content of the block's "graphics.exprs" field.

Returns:
Content of the block's "graphics.exprs" field.

getScilabTypeExprs

public org.scilab.modules.types.ScilabString getScilabTypeExprs()
Get Content of the block's "graphics.exprs" field. This can be called directly from Scilab using JIMS and the result can be assigned the block's "graphics.exprs" field.

Returns:
Content of the block's "graphics.exprs" field.

hasExactlyThisParamaeters

@Deprecated
public boolean hasExactlyThisParamaeters(java.lang.String[] maskParamNames)
Deprecated. Use equalsParameters(String[]) instead.

Checks if expression contains the same Mask Parameter names list.
This means: Same number of elements and same order.

Parameters:
maskParamNames - Mask Parameter name list
Returns:
true if equal list of Mask Parameter names, otherwise false

equalsParameters

public boolean equalsParameters(java.lang.String[] maskParamNames)
Checks if expression contains the same Mask Parameter names list.
This means: Same number of elements and same order.

Parameters:
maskParamNames - Mask Parameter name list
Returns:
true if equal list of Mask Parameter names, otherwise false

setSampleTimeFactor

public void setSampleTimeFactor(java.lang.Integer sampleTimeFactor)

getSampleTimeFactor

public java.lang.Integer getSampleTimeFactor()

isStaticParamId

public boolean isStaticParamId()

getParamId

@Deprecated
public int getParamId()
Deprecated. Use getStaticParamId() instead.

Returns Static Parameter ID.

Returns:
Static Parameter ID.

getStaticParamId

public StaticParamIdExpr getStaticParamId()
Returns Static Parameter ID.

Returns:
Static Parameter ID.

isCoT

public boolean isCoT()

setStaticParamId

@Deprecated
public void setStaticParamId(int paramId)
Deprecated. Use setStaticParamId(StaticParamIdExpr) instead.

Sets new Static Parameter ID.

Parameters:
paramId - Static Parameter ID

setStaticParamId

public void setStaticParamId(StaticParamIdExpr id)
Sets new Static Parameter ID.

Parameters:
id - Static Parameter ID

clearStaticParamId

public void clearStaticParamId()

setCoT

public void setCoT(boolean cotEnabled)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright 2019 LCM. All rights reserved.