Package ptolemy.kernel.util

Examples of ptolemy.kernel.util.NamedObj


    public static String moveContextStart(NamedObj context, NamedObj containee) {
        if ((context == null) || (containee == null)) {
            return "";
        }

        NamedObj container = containee.getContainer();

        if ((container == null) || (container == context)) {
            return "";
        }

        String entityContext = container.getName(context);
        String elemName = container.getElementName();
        return "<" + elemName + " name=\"" + entityContext + "\" >\n";
    }
View Full Code Here


    public void put(Token token, Time time) throws NoRoomException {
        double timeValue = time.getDoubleValue();

        if ((time.compareTo(_lastTime) < 0) && (timeValue != INACTIVE)
                && (timeValue != IGNORE)) {
            NamedObj actor = getContainer().getContainer();
            throw new IllegalArgumentException(actor.getName()
                    + " - Attempt to set current time to the past; time = "
                    + time + ". The _lastTime was " + _lastTime);
        } else if ((timeValue < 0.0) && (timeValue != INACTIVE)
                && (timeValue != IGNORE)) {
            NamedObj actor = getContainer().getContainer();
            throw new IllegalArgumentException(actor.getName()
                    + " - Attempt to set current time to a"
                    + " a negative value = " + time);
        }

        /*
 
View Full Code Here

     *  size always.
     *  @return The next time of interest.
     *  @see #getModelTime()
     */
    public Time getModelNextIterationTime() {
        NamedObj container = getContainer();
        // NOTE: the container may not be a composite actor.
        // For example, the container may be an entity as a library,
        // where the director is already at the top level.
        if (container instanceof CompositeActor) {
            Director executiveDirector = ((CompositeActor) container)
View Full Code Here

     */
    private ContinuousDirector _enclosingContinuousDirector() {
        if (_enclosingContinuousDirectorVersion != _workspace.getVersion()) {
            // Update the cache.
            _enclosingContinuousDirector = null;
            NamedObj container = getContainer().getContainer();
            while (container != null) {
                if (container instanceof Actor) {
                    Director director = ((Actor) container).getDirector();
                    if (director instanceof ContinuousDirector) {
                        _enclosingContinuousDirector = (ContinuousDirector) director;
                        break;
                    }
                    if (!(director instanceof QuasiTransparentDirector)) {
                        break;
                    }
                }
                container = container.getContainer();
            }
            _enclosingContinuousDirectorVersion = _workspace.getVersion();
        }
        return _enclosingContinuousDirector;
    }
View Full Code Here

        super.attributeChanged(attribute);

        if (attribute == refinementName) {
            _refinementVersion = -1;
        } else if (attribute == isInitialState) {
            NamedObj container = getContainer();
            // Container might not be an FSMActor if, for example,
            // the state is in a library.
            if (container instanceof FSMActor) {
                if (((BooleanToken) isInitialState.getToken()).booleanValue()) {
                    // If there is a previous initial state, unset its
View Full Code Here

     */
    public void initialize() throws IllegalActionException {
        super.initialize();

        if (((BooleanToken) simulate.getToken()).booleanValue()) {
            NamedObj toplevel = _toplevelNC();
            String toplevelName = _sanitizedFullName(toplevel);

            // Add the destinationDirectory to the classpath.
            String fileSeparator = StringUtilities
                .getProperty("file.separator");
View Full Code Here

        // FIXME: test this code to make sure it works even if this
        // director is embedded more deeply.

        //Create file name relative to the toplevel NCCompositeActor.
        NamedObj toplevel = _toplevelNC(); //container.toplevel();
        String filename = _sanitizedFullName(toplevel);
        if (container != toplevel) {
            filename = filename + "_" + container.getName(toplevel);
            filename = StringUtilities.sanitizeName(filename);
        }
View Full Code Here

     @exception IllegalActionException If thrown when confirming
     *  overwrite, or if writing to the file fails.
     */
    private void _generateLoader() throws IllegalActionException {
        // Use filename relative to toplevel PtinyOSDirector.
        NamedObj toplevel = _toplevelNC();
        String toplevelName = _sanitizedFullName(toplevel);

        // We use _CodeString as a wrapper for a StringBuffer instead
        // of creating a giant string so that it easy to add a newline
        // character at the end of each string and to add intermediate
View Full Code Here

        // FIXME use pathseparator?
        // FIXME: this will not work if TOSROOT has spaces in it.
        text.addLine("TOSMAKE_PATH += "
                + "$(TOSROOT)/contrib/ptII/ptinyos/tools/make");
        // Use full filename.
        NamedObj toplevel = _toplevelNC();
        String toplevelName = _sanitizedFullName(toplevel);
        text.addLine("COMPONENT=" + toplevelName);

        text.addLine("PFLAGS += " + pflags.stringValue());

        text.addLine("PFLAGS +=" + " -DCOMMAND_PORT=" + commandPort.getToken()
                + " -DEVENT_PORT=" + eventPort.getToken());

        // If the value of <i>baseStation</i> is the same as the
        // Ptolemy II name of the node, then make this node a base
        // station by setting _PTII_NODEID in the makefile to 0.  A
        // non-zero value of the nodeID parameter will be ignored.  If
        // the values are not equal, use the regular node ID value.
        String baseStationValue = ((StringToken)baseStation.getToken()).stringValue();
        NamedObj obj = this.getContainer();
        if (obj != null) {
            NamedObj temp = obj.getContainer();
            if (temp != null) {
                obj = temp;
            }
        }
        if (obj == null) {
View Full Code Here

     *  PtinyOSDirector.
     */

    // FIXME rename?
    private boolean _isTopLevelNC() {
        NamedObj container = getContainer();

        if (container instanceof CompositeActor) {
            Director director = ((CompositeActor) container)
                    .getExecutiveDirector();

View Full Code Here

TOP

Related Classes of ptolemy.kernel.util.NamedObj

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.