Examples of ChangeRequest


Examples of ptolemy.kernel.util.ChangeRequest

        // making a change request, which invalidates this HDF's schedule.
        // So we need to get the schedule of this HDFDirector also in a
        // change request.
        if (!isScheduleValid() || (getContainer() != toplevel())) {
            CompositeActor container = (CompositeActor) getContainer();
            ChangeRequest request = new ChangeRequest(this, "reschedule") {
                protected void _execute() throws KernelException {
                    getScheduler().getSchedule();
                }
            };

            request.setPersistent(false);
            container.requestChange(request);
        }

        return super.postfire();
    }
View Full Code Here

Examples of ptolemy.kernel.util.ChangeRequest

            // Increment the workspace version such that the
            // function dependencies will be reconstructed.
            // FIXME: Replace this with conservative approximation.
            if (_mutationEnabled) {
                ChangeRequest request = new ChangeRequest(this,
                        "increment workspace version to force recalculation of function dependencies") {
                    protected void _execute() throws KernelException {
                        getContainer().workspace().incrVersion();
                    }
                };
                request.setPersistent(false);
                getContainer().requestChange(request);
            }
        }

        // If a transition was taken, then request a refiring at the current time
View Full Code Here

Examples of ptolemy.kernel.util.ChangeRequest

                        String chg = newEntity.exportMoML();
                        System.out.println("the moml description of the "
                                + "new object is: \n" + chg + "\n");

                        ChangeRequest request = new MoMLChangeRequest(this, // originator
                                this, // context
                                chg, // MoML code
                                null); // base
                        requestChange(request);

                        ChangeRequest request2 = new MoMLChangeRequest(this, // originator
                                _cachedLib, // context
                                chg, // MoML code
                                null); // base

                        _cachedLib.requestChange(request2);
View Full Code Here

Examples of ptolemy.kernel.util.ChangeRequest

     *  it.  This overrides the base class to queue a change request to do
     *  the printing, because otherwise, printing will cause a deadlock.
     */
    protected void _print() {
        if (_model != null) {
            ChangeRequest request = new ChangeRequest(this, "Print") {
                protected void _execute() throws Exception {
                    PtolemyFrame.super._print();
                }
            };

View Full Code Here

Examples of ptolemy.kernel.util.ChangeRequest

                + lineName
                + "\" class=\"ptolemy.vergil.kernel.attributes.LineAttribute\">"
                + senderLocation.exportMoML() + "<property name=\"x\" value=\""
                + x + "\"/>" + "<property name=\"y\" value=\"" + y + "\"/>"
                + "</property>";
        ChangeRequest request = new MoMLChangeRequest(this, getContainer(),
                moml) {
            protected void _execute() throws Exception {
                try {
                    super._execute();
                    LineAttribute line = (LineAttribute) getContainer()
View Full Code Here

Examples of ptolemy.kernel.util.ChangeRequest

     *
     * @param lineName Name of line previously created.
     */
    protected void _removeLine(String lineName) {
        String moml = "<deleteProperty name=\"" + lineName + "\"/>";
        ChangeRequest request = new MoMLChangeRequest(this, getContainer(),
                moml) {
            protected void _execute() throws Exception {
                try {
                    super._execute();
                } catch (Exception e) {
View Full Code Here

Examples of ptolemy.kernel.util.ChangeRequest

                // requests.
                if (_changeRequests != null) {
                    Iterator requests = _changeRequests.iterator();

                    while (requests.hasNext()) {
                        ChangeRequest request = (ChangeRequest) requests.next();
                        container.requestChange(request);
                    }

                    _changeRequests = null;
                }
View Full Code Here

Examples of ptolemy.kernel.util.ChangeRequest

        }

        _readOutputsFromRefinement();

        if (_sendRequest) {
            ChangeRequest request = new ChangeRequest(this,
                    "choose a transition") {
                protected void _execute() throws KernelException,
                        IllegalActionException {
                    FSMActor controller = getController();
                    State currentState = controller.currentState();
                    chooseNextNonTransientState(currentState);
                }
            };

            request.setPersistent(false);
            container.requestChange(request);
        }
    }
View Full Code Here

Examples of ptolemy.kernel.util.ChangeRequest

        CompositeActor container = (CompositeActor) getContainer();

        if (_sendRequest) {
            _sendRequest = false;

            ChangeRequest request = new ChangeRequest(this, "make a transition") {
                protected void _execute() throws KernelException {
                    _sendRequest = true;

                    // The super.postfire() method is called here.
                    makeStateTransition();
                }
            };

            request.setPersistent(false);
            container.requestChange(request);
        }

        return _refinementPostfire;
    }
View Full Code Here

Examples of ptolemy.kernel.util.ChangeRequest

        final CompositeActor container = (CompositeActor) director
                .getContainer();

        // FIXME: These buffer sizes should be properties of input ports,
        // not properties of relations.
        ChangeRequest request = new ChangeRequest(this, "Record buffer sizes") {
            protected void _execute() throws KernelException {
                Iterator relations = container.relationList().iterator();

                while (relations.hasNext()) {
                    Relation relation = (Relation) relations.next();
                    Object bufferSizeObject = minimumBufferSizes.get(relation);

                    if (bufferSizeObject instanceof Integer) {
                        int bufferSize = ((Integer) bufferSizeObject)
                                .intValue();
                        DFUtilities.setOrCreate(relation, "bufferSize",
                                bufferSize);

                        if (_debugging) {
                            _debug("Adding bufferSize parameter to "
                                    + relation.getName() + " with value "
                                    + bufferSize);
                        }
                    } else if (bufferSizeObject instanceof String) {
                        String bufferSizeExpression = (String) bufferSizeObject;
                        DFUtilities.setOrCreate(relation, "bufferSize", "\""
                                + bufferSizeExpression + "\"");

                        if (_debugging) {
                            _debug("Adding bufferSize parameter to "
                                    + relation.getName() + " with expression "
                                    + bufferSizeExpression);
                        }
                    } else if (bufferSizeObject == null) {
                    } else {
                        throw new InternalErrorException(
                                "Invalid value found "
                                        + "in buffer size map.\nValue is of type "
                                        + bufferSizeObject.getClass().getName()
                                        + ".\nIt should be of type Integer or String.\n");
                    }
                }
            }
        };

        // Indicate that the change is non-persistent, so that
        // the UI doesn't prompt to save.
        request.setPersistent(false);
        container.requestChange(request);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.