Package ptolemy.data.expr

Examples of ptolemy.data.expr.Parameter


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

        fileNameOrURL = new FileParameter(this, "fileNameOrURL");

        synchronizedPlay = new Parameter(this, "synchronizedPlay");
        synchronizedPlay.setTypeEquals(BaseType.BOOLEAN);
        synchronizedPlay.setToken(BooleanToken.TRUE);

        onOff = new TypedIOPort(this, "onOff", true, false);
        onOff.setTypeEquals(BaseType.BOOLEAN);
View Full Code Here


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

        // Create port and parameters.
        output = new TypedIOPort(this, "output", false, true);
        new Parameter(output, "signalType", new StringToken("DISCRETE"));

        period = new Parameter(this, "period");
        period.setExpression("2.0");
        period.setTypeEquals(BaseType.DOUBLE);

        offsets = new Parameter(this, "offsets");
        offsets.setExpression("{0.0, 1.0}");
        offsets.setTypeEquals(new ArrayType(BaseType.DOUBLE));

        // Call this so that we don't have to copy its code here...
        attributeChanged(offsets);

        // set the values parameter
        values = new Parameter(this, "values");
        values.setExpression("{1, 0}");

        // Set type constraints.
        output.setTypeAtLeast(ArrayType.elementType(values));
View Full Code Here

        trigger = new TypedIOPort(this, "trigger", true, false);
        trigger.setTypeEquals(BaseType.GENERAL);
        trigger.setMultiport(true);

        // parameters - Ordering here sets the order they show up in Vergil
        localSocketNumber = new Parameter(this, "localSocketNumber");
        localSocketNumber.setTypeEquals(BaseType.INT);
        localSocketNumber.setToken(new IntToken(4004));

        actorBufferLength = new Parameter(this, "actorBufferLength");
        actorBufferLength.setTypeEquals(BaseType.INT);
        actorBufferLength.setToken(new IntToken(440));

        platformBufferLength = new Parameter(this, "platformBufferLength");
        platformBufferLength.setTypeEquals(BaseType.INT);
        platformBufferLength.setToken(new IntToken(64));

        setPlatformBufferLength = new Parameter(this,
                "setPlatformBufferLength", new BooleanToken(false));
        setPlatformBufferLength.setTypeEquals(BaseType.BOOLEAN);

        overwrite = new Parameter(this, "overwrite", new BooleanToken(true));
        overwrite.setTypeEquals(BaseType.BOOLEAN);

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

        defaultReturnAddress = new Parameter(this, "defaultReturnAddress");
        defaultReturnAddress.setTypeEquals(BaseType.STRING);
        defaultReturnAddress.setToken(new StringToken("localhost"));

        defaultReturnSocketNumber = new Parameter(this,
                "defaultReturnSocketNumber");
        defaultReturnSocketNumber.setTypeEquals(BaseType.INT);
        defaultReturnSocketNumber.setExpression("0");

        defaultOutput = new Parameter(this, "defaultOutput");
        defaultOutput.setTypeEquals(new ArrayType(BaseType.UNSIGNED_BYTE));
        defaultOutput.setExpression("{0ub}");

        // Repeat has not been implemented.  However, I'd place it
        // here so that it would show up in Vergil below
View Full Code Here

     *   actor with this name.
     */
    public TimedSource(CompositeEntity container, String name)
            throws NameDuplicationException, IllegalActionException {
        super(container, name);
        stopTime = new Parameter(this, "stopTime");
        stopTime.setExpression("Infinity");
        stopTime.setTypeEquals(BaseType.DOUBLE);

        _attachText("_iconDescription", "<svg>\n"
                + "<rect x=\"-20\" y=\"-20\" " + "width=\"40\" height=\"40\" "
View Full Code Here

            throws NameDuplicationException, IllegalActionException {
        super(container, name);
        input.setTypeEquals(BaseType.DOUBLE);
        output.setTypeEquals(BaseType.DOUBLE);

        risingSlewRate = new Parameter(this, "risingSlewRate", new DoubleToken(
                1.0));
        fallingSlewRate = new Parameter(this, "fallingSlewRate",
                new DoubleToken(-1.0));
    }
View Full Code Here

     */
    public FirstOrderHold(CompositeEntity container, String name)
            throws IllegalActionException, NameDuplicationException {
        super(container, name);
        derivative = new TypedIOPort(this, "derivative", true, false);
        defaultValue = new Parameter(this, "defaultValue");
        defaultValue.setExpression("0.0");
        defaultDerivative = new Parameter(this, "defaultDerivative");
        defaultDerivative.setExpression("0.0");

        input.setTypeEquals(BaseType.DOUBLE);
        derivative.setTypeEquals(BaseType.DOUBLE);
        output.setTypeEquals(BaseType.DOUBLE);
        new Parameter(input, "signalType", new StringToken("DISCRETE"));
        new Parameter(derivative, "signalType", new StringToken("DISCRETE"));
        new Parameter(output, "signalType", new StringToken("CONTINUOUS"));
    }
View Full Code Here

     *   actor with this name.
     */
    public ContinuousClock(CompositeEntity container, String name)
            throws NameDuplicationException, IllegalActionException {
        super(container, name);
        defaultValue = new Parameter(this, "defaultValue");
        defaultValue.setExpression("0");

        // Override the signal type to be CONTINUOUS to indicate
        // that this actor produce outputs with state semantics.
        ((Parameter) output.getAttribute("signalType"))
View Full Code Here

     */
    public CTTriggeredSampler(CompositeEntity container, String name)
            throws IllegalActionException, NameDuplicationException {
        super(container, name);
        input.setMultiport(true);
        new Parameter(input, "signalType", new StringToken("CONTINUOUS"));
        output.setMultiport(true);
        output.setTypeAtLeast(input);
        new Parameter(output, "signalType", new StringToken("DISCRETE"));
        trigger = new TypedIOPort(this, "trigger", true, false);
        trigger.setMultiport(false);
        new Parameter(trigger, "signalType", new StringToken("DISCRETE"));

        // The trigger input has a generic type.
        _attachText("_iconDescription", "<svg>\n"
                + "<rect x=\"-30\" y=\"-20\" " + "width=\"60\" height=\"40\" "
                + "style=\"fill:white\"/>\n"
View Full Code Here

     *   actor with this name.
     */
    public VariableSleep(CompositeEntity container, String name)
            throws NameDuplicationException, IllegalActionException {
        super(container, name);
        defaultSleepTime = new Parameter(this, "defaultSleepTime",
                new LongToken(0));
        defaultSleepTime.setTypeEquals(BaseType.LONG);

        // Data type polymorphic, multiports.
        input.setMultiport(true);
View Full Code Here

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

        period = new Parameter(this, "period");
        period.setExpression("2.0");
        period.setTypeEquals(BaseType.DOUBLE);

        offsets = new Parameter(this, "offsets");
        offsets.setExpression("{0.0, 1.0}");
        offsets.setTypeEquals(new ArrayType(BaseType.DOUBLE));

        // Call this so that we don't have to copy its code here...
        attributeChanged(offsets);

        // Set the values parameter.
        values = new Parameter(this, "values");
        values.setExpression("{1, 0}");

        // Set type constraint on the output.
        output.setTypeAtLeast(ArrayType.elementType(values));

        // Call this so that we don't have to copy its code here...
        attributeChanged(values);

        // Set the numberOfCycles parameter.
        numberOfCycles = new Parameter(this, "numberOfCycles");
        numberOfCycles.setTypeEquals(BaseType.INT);
        numberOfCycles.setExpression("-1");

        // Set the output signal type as DISCRETE to indicate
        // that the outputs of this actor are discrete events.
        // NOTE: ContinuousClock, a subclass of this class overrides
        // the signal type to CONTINUOUS.
        new Parameter(output, "signalType", new StringToken("DISCRETE"));

        // Set the trigger signal type as DISCRETE.
        new Parameter(trigger, "signalType", new StringToken("DISCRETE"));
    }
View Full Code Here

TOP

Related Classes of ptolemy.data.expr.Parameter

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.