78 package adInterfaceMCC.actor;
79 import java.util.ArrayList;
83 import ptolemy.actor.TypedIOPort;
84 import ptolemy.data.ArrayToken;
85 import ptolemy.data.DoubleMatrixToken;
86 import ptolemy.data.DoubleToken;
87 import ptolemy.data.MatrixToken;
88 import ptolemy.data.expr.Token;
89 import ptolemy.data.type.ArrayType;
90 import ptolemy.data.type.BaseType;
91 import ptolemy.kernel.CompositeEntity;
92 import ptolemy.kernel.util.IllegalActionException;
93 import ptolemy.kernel.util.NameDuplicationException;
94 import ptolemy.kernel.util.Workspace;
115 throws IllegalActionException, NameDuplicationException {
116 super(container, name);
117 proVal =
new TypedIOPort(
this,
"propertyValue",
false,
true);
119 proVal.setTypeEquals(BaseType.DOUBLE_MATRIX);
124 trigger =
new TypedIOPort(
this,
"trigger",
true,
false);
125 trigger.setMultiport(
true);
143 public Object
clone(Workspace workspace)
throws CloneNotSupportedException {
147 newObject.proVal.setTypeEquals(BaseType.DOUBLE_MATRIX);
159 public ArrayList<ADInterfaceMCCObjectType>
propertyValueReader(ArrayList<ADInterfaceMCCObjectType> propValArray)
throws IllegalActionException
161 ArrayList<ADInterfaceMCCObjectType> proparr =
new ArrayList<ADInterfaceMCCObjectType>();
163 for (
int i = 0;
i < propValArray.size();
i++)
165 if (propValArray.get(
i).getApplicationTag().equals(
"READ")){
166 proparr.add(propValArray.get(
i));
219 public void fire() throws IllegalActionException {
250 bcvtbhome +
FS +
"lib" +
FS +
"ptII" +
FS +
"adInterfaceMCC" +
FS +
"ADInterfaceMCC.xsd";
259 if(
trigger.numberOfSources()>0)
void setSchemaFileName()
Sets the schema file name.
This class reads the XML configuration file and stores the data in the ADInterfaceMCCObjectType data ...
static final String bcvtbhome
String that points to root directory of the BCVTB.
ArrayList< ProcessBuilder > proc_arr
Arraylist containing processes to be executed in console.
void prepareTokensToSend()
Get tokens to send for the next timestep.
void sendToken()
Sends the error signal to the errorSignal port, the error message to the errorMessage port...
ADInterfaceMCCReader(CompositeEntity container, String name)
Construct an actor with the given container and name.
boolean fireReader
Boolean state to trigger ADInterfaceMCCReader.
ArrayList< ADInterfaceMCCObjectType > prop_arr
Arraylist containing ADInterfaceMCCObjectType read from configuration file.
Token[] propval_tok
Token array of property values.
TypedIOPort proVal
The port that sends the array of property value.
static final String FS
File seperator.
void setTriggerState()
Set trigger state.
Object clone(Workspace workspace)
Override base class defined in ADInterfaceMCC.java.
TypedIOPort trigger
The port that fires ADInterfaceMCCReader.
static ArrayList< ADInterfaceMCCObjectType > prop_arr_reader
ADInterfaceMCCObjectType after considering just the reader objects from Ptolemy.
void fire()
Read ADInterfaceMCC property based on the configuration file or If Plattform is Mac or Linux or If I/...
String schemaFileName
Schema file path.
void validateAttributes()
Validate application tag.
void initialize()
Initialize section, initialize variables, check possible errors.
ArrayList< ADInterfaceMCCObjectType > propertyValueReader(ArrayList< ADInterfaceMCCObjectType > propValArray)
Create a new array with only the elements of the configuration that are for the reader.
void removeToken()
Remove tokens in previous time step.
This is an abstract base class for actors that generates an output stream.
This actor reads from ADInterfaceMCC devices.