Package ptolemy.actor

Examples of ptolemy.actor.TypedIOPort$TypeTerm


        algorithm.setPersistent(false);

        // Hide the algorithm parameter.
        algorithm.setVisibility(Settable.EXPERT);

        key = new TypedIOPort(this, "key", true, false);
        key.setTypeEquals(KeyToken.KEY);

        // Hide the keySize parameter, it is not used.
        keySize.setVisibility(Settable.EXPERT);
    }
View Full Code Here


     *   actor with this name.
     */
    public Source(CompositeEntity container, String name)
            throws NameDuplicationException, IllegalActionException {
        super(container, name);
        output = new TypedIOPort(this, "output", false, true);
        trigger = new TypedIOPort(this, "trigger", true, false);

        // NOTE: It used to be that trigger was set to GENERAL, but this
        // isn't really what we want.  What we want is an undeclared type
        // that can resolve to anything.  EAL 12/31/02
        // trigger.setTypeEquals(BaseType.GENERAL);
View Full Code Here

        holdLastOutput = new Parameter(this, "holdLastOutput",
                BooleanToken.FALSE);
        holdLastOutput.setTypeEquals(BaseType.BOOLEAN);

        enable = new TypedIOPort(this, "enable", true, false);
        enable.setTypeEquals(BaseType.BOOLEAN);

        output = new TypedIOPort(this, "output", false, true);

        // set type constraint
        output.setTypeAtLeast(ArrayType.elementType(values));
    }
View Full Code Here

     *   actor with this name.
     */
    public ColorFinder(CompositeEntity container, String name)
            throws IllegalActionException, NameDuplicationException {
        super(container, name);
        input = new TypedIOPort(this, "input", true, false);
        outputX = new TypedIOPort(this, "outputX", false, true);
        outputY = new TypedIOPort(this, "outputY", false, true);
        input.setTypeEquals(BaseType.OBJECT);
        outputX.setTypeEquals(BaseType.DOUBLE);
        outputY.setTypeEquals(BaseType.DOUBLE);

        /** The default values correspond to the color green */
 
View Full Code Here

        super(container, name);

        trials = new PortParameter(this, "trials", new IntToken(1));
        trials.setTypeEquals(BaseType.INT);

        populations = new TypedIOPort(this, "populations", true, false);
        populations.setMultiport(true);
        populations.setTypeEquals(BaseType.LONG);

        output.setMultiport(true);
        output.setTypeEquals(BaseType.INT);
View Full Code Here

     *   an actor already in the container.
     */
    public StaticALU(CompositeEntity container, String name)
            throws IllegalActionException, NameDuplicationException {
        super(container, name);
        A = new TypedIOPort(this, "A", true, false);
        A.setTypeEquals(BaseType.INT);
        B = new TypedIOPort(this, "B", true, false);
        B.setTypeEquals(BaseType.INT);

        operation = new StringParameter(this, "operation");
        operation.setExpression("0 : (NOP)");
        operation.addChoice("0 : (NOP)");
        operation.addChoice("1 : (A + B)");
        operation.addChoice("2 : (A - B)");
        operation.addChoice("3 : (A * B)");
        operation.addChoice("4 : (A / B)");

        output = new TypedIOPort(this, "output", false, true);
        output.setTypeEquals(BaseType.INT);

    }
View Full Code Here

     *   an actor already in the container.
     */
    public SimpleALU(CompositeEntity container, String name)
            throws IllegalActionException, NameDuplicationException {
        super(container, name);
        A = new TypedIOPort(this, "A", true, false);
        A.setTypeEquals(BaseType.INT);
        B = new TypedIOPort(this, "B", true, false);
        B.setTypeEquals(BaseType.INT);

        operation = new TypedIOPort(this, "operation", true, false);
        operation.setTypeEquals(BaseType.INT);

        output = new TypedIOPort(this, "output", false, true);
        output.setTypeEquals(BaseType.INT);

    }
View Full Code Here

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

        input = new TypedIOPort(this, "input", true, false);

        _attachText("_iconDescription", "<svg>\n"
                + "<rect x=\"0\" y=\"0\" width=\"6\" "
                + "height=\"40\" style=\"fill:red\"/>\n" + "</svg>\n");
    }
View Full Code Here

        // get the type from the input port.
        //   RecordType inputTypes = (RecordType)input.getType();
        Iterator outputPorts = outputPortList().iterator();

        while (outputPorts.hasNext()) {
            TypedIOPort outputPort = (TypedIOPort) outputPorts.next();
            String label = outputPort.getName();
            Inequality inequality = new Inequality(new PortFunction(label),
                    outputPort.getTypeTerm());
            constraints.add(inequality);
        }

        return constraints;
    }
View Full Code Here

    public DatagramWriter(CompositeEntity container, String name)
            throws NameDuplicationException, IllegalActionException {
        super(container, name);

        // Ports
        remoteAddress = new TypedIOPort(this, "remoteAddress");
        remoteAddress.setInput(true);
        remoteAddress.setMultiport(true);
        remoteAddress.setTypeEquals(BaseType.STRING);

        remoteSocketNumber = new TypedIOPort(this, "remoteSocketNumber");
        remoteSocketNumber.setInput(true);
        remoteSocketNumber.setMultiport(true);
        remoteSocketNumber.setTypeEquals(BaseType.INT);

        data = new TypedIOPort(this, "data");
        data.setInput(true);
        data.setTypeEquals(new ArrayType(BaseType.UNSIGNED_BYTE));

        // Parameters that are default values for ports
        //defaultRemoteAddress =
        //        new StringAttribute(this, "defaultRemoteAddress");
        //defaultRemoteAddress.setExpression("localhost");
        // Above way was set w/o quotes vs constant which is set with them.
        // This has been confusing, so I've switched to the approach below.
        defaultRemoteAddress = new Parameter(this, "defaultRemoteAddress");
        defaultRemoteAddress.setTypeEquals(BaseType.STRING);
        defaultRemoteAddress.setToken(new StringToken("localhost"));

        defaultRemoteSocketNumber = new Parameter(this,
                "defaultRemoteSocketNumber");
        defaultRemoteSocketNumber.setTypeEquals(BaseType.INT);
        defaultRemoteSocketNumber.setExpression("4004"); //setExpression works

        // Pure parameters
        localSocketNumber = new Parameter(this, "localSocketNumber");
        localSocketNumber.setTypeEquals(BaseType.INT);
        localSocketNumber.setToken(new IntToken(4003)); //setToken works too

        // Added for SDF usability.  Empty Token() is output, just a trigger.
        triggerOutput = new TypedIOPort(this, "triggerOutput");
        triggerOutput.setTypeEquals(BaseType.GENERAL);

        // 'INT' works too in place of 'GENERAL'.
        triggerOutput.setOutput(true);
    }
View Full Code Here

TOP

Related Classes of ptolemy.actor.TypedIOPort$TypeTerm

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.