Package ptolemy.actor.parameters

Examples of ptolemy.actor.parameters.PortParameter


            throws NameDuplicationException, IllegalActionException {
        super(container, name);

        // Create new parameters and ports.
        // Set default values of the parameters and type constraints.
        pattern = new PortParameter(this, "pattern");
        pattern.setStringMode(true);
        pattern.setExpression("");
        (new SingletonParameter(pattern.getPort(), "_showName"))
                .setToken(BooleanToken.TRUE);

        replaceAll = new Parameter(this, "replaceAll");
        replaceAll.setExpression("true");
        replaceAll.setTypeEquals(BaseType.BOOLEAN);

        replacement = new PortParameter(this, "replacement");
        replacement.setStringMode(true);
        replacement.setExpression("");
        (new SingletonParameter(replacement.getPort(), "_showName"))
                .setToken(BooleanToken.TRUE);

        stringToEdit = new PortParameter(this, "stringToEdit");
        stringToEdit.setStringMode(true);
        stringToEdit.setExpression("");
        (new SingletonParameter(stringToEdit.getPort(), "_showName"))
                .setToken(BooleanToken.TRUE);
View Full Code Here


        StringBuffer tempCode = new StringBuffer();
        while (inputPorts.hasNext()) {
            IOPort inputPort = (IOPort) inputPorts.next();
            if (inputPort instanceof ParameterPort && inputPort.getWidth() > 0) {

                PortParameter portParameter = ((ParameterPort) inputPort)
                        .getParameter();
                tempCode.append(CodeStream.indent(_codeGenerator
                        .generateVariableName(portParameter)));
                // FIXME: The = sign is language specific.
                tempCode.append(" = ");
View Full Code Here

     */
    public SubMatrix(CompositeEntity container, String name)
            throws NameDuplicationException, IllegalActionException {
        super(container, name);

        row = new PortParameter(this, "row");
        row.setTypeEquals(BaseType.INT);
        row.setExpression("0");

        column = new PortParameter(this, "column");
        column.setTypeEquals(BaseType.INT);
        column.setExpression("0");

        rowSpan = new PortParameter(this, "rowSpan");
        rowSpan.setTypeEquals(BaseType.INT);
        rowSpan.setExpression("1");

        columnSpan = new PortParameter(this, "columnSpan");
        columnSpan.setTypeEquals(BaseType.INT);
        columnSpan.setExpression("1");
    }
View Full Code Here

        // Set the type of the output port.
        //output.setMultiport(true);
        output.setTypeEquals(BaseType.STRING);

        styleSheetParameters = new PortParameter(this, "styleSheetParameters");
        styleSheetParameters.setTypeAtMost(new RecordType(new String[0],
                new Type[0]));
        styleSheetParameters.setExpression("emptyRecord()");
        styleSheetFile = new FileParameter(this, "styleSheetFile");
View Full Code Here

        // Input port is a multiport.
        input.setTypeEquals(new ArrayType(BaseType.XMLTOKEN));
        input.setMultiport(true);

        // FIXME: what is the initial value of this parameter?
        template = new PortParameter(this, "template");
        template.setStringMode(true);

        headerParameter = new StringParameter(this, "headerParameter");
        headerParameter
                .setExpression("<?xml version=\"1.0\" standalone=\"no\"?>");
View Full Code Here

        output.setTypeAtLeast(input);
        // FIXME: correct type constraint for length
        output.setTypeAtLeast(ArrayType.ARRAY_UNSIZED_BOTTOM);

        // Set parameters.
        sourcePosition = new PortParameter(this, "sourcePosition");
        sourcePosition.setExpression("0");
        extractLength = new PortParameter(this, "extractLength");
        extractLength.setExpression("1");
        destinationPosition = new PortParameter(this, "destinationPosition");
        destinationPosition.setExpression("0");
        outputArrayLength = new PortParameter(this, "outputArrayLength");
        outputArrayLength.setExpression("1");
    }
View Full Code Here

        StringBuffer tempCode = new StringBuffer();
        while (inputPorts.hasNext()) {
            IOPort inputPort = (IOPort) inputPorts.next();
            if (inputPort instanceof ParameterPort && inputPort.getWidth() > 0) {

                PortParameter portParameter = ((ParameterPort) inputPort)
                        .getParameter();
                tempCode.append(CodeStream.indent(_codeGenerator
                        .generateVariableName(portParameter)));
                // FIXME: The = sign is language specific.
                tempCode.append(" = ");
View Full Code Here

            body.getLocals().add(tokenLocal);

            // Update PortParameters.
            for (Iterator parameters = model.attributeList(PortParameter.class)
                    .iterator(); parameters.hasNext();) {
                PortParameter parameter = (PortParameter) parameters.next();
                String fieldName = ModelTransformer.getFieldNameForAttribute(
                        parameter, model);
                SootField field = modelClass.getFieldByName(fieldName);
                RefType fieldType = (RefType) field.getType();
                Local parameterLocal = Jimple.v().newLocal("parameter",
View Full Code Here

            DependencyDeclaration declaration = (DependencyDeclaration) container;
            _addDependencyDeclaration(declaration);
        }

        if (container instanceof PortParameter) {
            PortParameter parameter = (PortParameter) container;
            ParameterPort port = parameter.getPort();

            // Under what conditions is a PortParameter not associated
            // with a port?
            if ((port != null) && (port.getWidth() > 0)) {
                _updateChangeContext(parameter, (Entity) parameter
                        .getContainer());
            }
        }

        if (container instanceof ExplicitChangeContext) {
View Full Code Here

     */
    public ArrayLevelCrossing(CompositeEntity container, String name)
            throws NameDuplicationException, IllegalActionException {
        super(container, name);

        start = new PortParameter(this, "start");
        start.setExpression("0");
        start.setTypeEquals(BaseType.INT);
        (new SingletonParameter(start.getPort(), "_showName"))
                .setToken(BooleanToken.TRUE);

View Full Code Here

TOP

Related Classes of ptolemy.actor.parameters.PortParameter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.