Package jsynoptic.plugins.circuit

Examples of jsynoptic.plugins.circuit.CircuitGate



    public AndComponent(int ox, int oy, int width, int height) {
        super(ox, oy, width, height);

        addGate(in1 = new CircuitGate(this, Gate.EAST, "IN 1"true));
        addGate(in2 = new CircuitGate(this, Gate.EAST, "IN 2",true));
        addGate(out = new CircuitGate(this, Gate.WEST, "OUT", false));
    }
View Full Code Here


    protected CircuitGate out;


    public LogicalEmiter(int ox, int oy, int width, int height) {
        super(ox, oy, width, height);
        addGate(out = new CircuitGate(this, Gate.WEST, "OUT", false));
    }
View Full Code Here

    protected CircuitGate in1, in2, out;
       
   
    public OrComponent(int ox, int oy, int width, int height) {
        super(ox, oy, width, height);
        addGate(in1 = new CircuitGate(this, Gate.EAST, "IN 1"true));
        addGate(in2 = new CircuitGate(this, Gate.EAST, "IN 2",true));
        addGate(out = new CircuitGate(this, Gate.WEST, "OUT", false));
    }
View Full Code Here

     */
    public SwitchBox2Pos(int ox, int oy, int width, int height) {
        super(ox, oy, width, height, POS_1, 1, 2);

        // Add gates
        addGate(j01 = new CircuitGate(this, Gate.WEST, "J01", true));
        addGate(j02 = new CircuitGate(this, Gate.EAST, "J02", true));
        addGate(j03 = new CircuitGate(this, Gate.EAST, "J03", true));
    }
View Full Code Here

    /* (non-Javadoc)
     * @see net.eads.astrium.jsynoptic.cuircuit.Switch#getTargetGate(jsynoptic.plugins.circuit.Gate)
     */
    protected CircuitGate getTargetGate(CircuitGate sourceGate) {
        CircuitGate res = null;

        if (sourceGate == j01){
            if (currentPosition == POS_1){
                res = j02;

View Full Code Here

    protected CircuitGate in;

   
    public Receiver(int ox, int oy, int width, int height) {
        super(ox, oy, width, height);
        addGate(in = new CircuitGate(this, Gate.WEST,  "In", true));
        this.receivedColor = null;
    }
View Full Code Here

            // 2- Propagate signal

            // All output gates forward a null signal 
            Iterator it = getGates().iterator();
            while (it.hasNext()){
                CircuitGate gate = (CircuitGate)it.next();
                if (gate!=null && !gate.isInput()){
                    gate.sendSignal(null,Signal.getNewSignalEventId());
                }
            }

            // All input gates forward their signal to output gates
            it = getGates().iterator();
            while (it.hasNext()){
                CircuitGate gate = (CircuitGate)it.next();
                if (gate!=null &&  gate.isInput() && gate.hasSignal()){
                    signalHasBeenReceived(gate);
                }
            }
        }
        return res;
View Full Code Here

        if (sourceGate != null){

            // The source gate is an input
            sourceGate.setInput(true);

            CircuitGate targetGate = getTargetGate(sourceGate);
            if (targetGate != null){

                //  The source gate is an output
                targetGate.setInput(false);

                // Forward signal to target gate
                targetGate.sendSignal(sourceGate.getCurrentSignal(), sourceGate.getCurrentSignalEventId());
            }
        }
    }
View Full Code Here

     */
    public SwitchBox3Pos(int ox, int oy, int width, int height) {
        super(ox, oy, width, height, POS_1, 1, 3);

        // Add gates
        addGate(j01 = new CircuitGate(this, Gate.WEST, "J01", true));
        addGate(j02 = new CircuitGate(this, Gate.EAST, "J02", true));
        addGate(j03 = new CircuitGate(this, Gate.EAST, "J03", true));
        addGate(j04 = new CircuitGate(this, Gate.EAST, "J04", true));
    }
View Full Code Here

    /* (non-Javadoc)
     * @see net.eads.astrium.jsynoptic.cuircuit.Switch#getTargetGate(jsynoptic.plugins.circuit.Gate)
     */
    protected CircuitGate getTargetGate(CircuitGate sourceGate) {
        CircuitGate res = null;

        if (sourceGate == j01){
            if (currentPosition == POS_1){
                res = j02;

View Full Code Here

TOP

Related Classes of jsynoptic.plugins.circuit.CircuitGate

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.