Package cl.alejo.jcsim.csim.dom

Examples of cl.alejo.jcsim.csim.dom.Pin


    gr.setColor(Color.gray);
    gr.drawLine(x + 1, 0, x + 1, getSize().height);
    Iterator iter = listPin.iterator();
    int ndxVal = 0;
    while (iter.hasNext()) {
      Pin pin = (Pin) iter.next();
      gr.setColor(Color.green);
      int val = pin.getInValue();
      switch (val) {
      case 1:
        gr.drawLine(x, i - 10, x + 1, i - 10);
        break;
      case 0:
View Full Code Here


          // REcupero el gate y el pin
          Gate gateB = gates[connectTo[pinId][0]];

          // Si las compuertas son distintas
          if (gateA != gateB) {
            Pin pinB = gateB.getPin(connectTo[pinId][1]);
            Pin pinA = gateA.getPin(pinId);
            // Los conecto si no son los mismos
            if (pinA != pinB)
              pinA.connect(pinB);
          }
        }
      }
    }
View Full Code Here

    this._gateDescriptor = gatedesc;
    this._circuit = circ;
    this._parameters = params;
    _pin = new Pin[pinCount()];
    for (int i = 0; i < pinCount(); i++)
      _pin[i] = new Pin(this, circ, (byte) i);
  }
View Full Code Here

   */
  public void reconnect(List contactList) {

    List listPin = reconnectContactPins(contactList);

    Pin firstPin = null;

    if (listPin.size() > 0)
      firstPin = (Pin) listPin.get(0);

    setGuidePin(firstPin, contactList);
View Full Code Here

    List listPin = getAttachedPins(contactList);

    if (listPin.size() > 0) {
      Iterator iterPin = listPin.iterator();

      Pin pinFirst = (Pin) iterPin.next();
      pinFirst.disconnect();

      while (iterPin.hasNext()) {
        Pin pin = (Pin) iterPin.next();
        pin.disconnect();
        pinFirst.connect(pin);
      }
    }
    return listPin;
  }
View Full Code Here

      int[][] connectTo = gateData[currentGate].connectTo;

      // ahora por cada pin
      int pcount = gate.pinCount();
      for (int pinId = 0; pinId < pcount; pinId++) {
        Pin pin = gate.getPin(pinId);

        // Tomo el siguiente
        Pin nextPin = (Pin) pin.next();

        // Busco el indice del gate en la lista
        int ndxGate = getGateIndex(nextPin.getGate(), listGates);

        // Ahora tengo que saber que pin es ese
        // Dentro de la compuerta
        int ndxPin = getPinIndex(nextPin);
View Full Code Here

      // Busco los pines attachados a este contacto
      List listCttAux = _circuit.getProtoboard().findAttachedContacts(ctt);
      List listPin = ((ProtoboardPin) _circuit.getProtoboard()).getAttachedPins(listCttAux);
      if (listPin.size() > 0) {
        Pin pin = (Pin) listPin.get(0);
        int ndxPin = getPinIndex(pin);
        int ndxGate = getGateIndex(pin.getGate(), listGates);
        // Llenamos y aumentamos el indice
        connectOut[ndxTable][0] = ndxGate;
        connectOut[ndxTable][1] = ndxPin;
        ndxTable++;
      }
View Full Code Here

    /*
     * Pin pin = getPin(pinId); if (!listPin.contains(pin))
     * listPin.add(pin); //
     */

    Pin pinAux;

    // Rescato las tablas
    EncapsulatedDescriptor gateDesc = (EncapsulatedDescriptor) this._gateDescriptor;
    int[][] connectOut = gateDesc.connectOut;
    EncapsulatedGateData[] gateData = gateDesc.gateData;

    // Ahora tengo que recorrer la lista de tonteras
    // Agregando a la lista
    int ndx = pinId;
    int ndxGate = connectOut[ndx][0];
    int ndxPin = connectOut[ndx][1];

    // Rescato el primer gate
    Gate gate = gates[ndxGate];
    Pin pinFirst = gate.getPin(ndxPin);

    // Agrego sus pines
    gate.getPinsAt(ndxPin, listPin);
    do {
      // busco el siguiente
View Full Code Here

    this._parameters = params;
    this._gateDescriptor = gatedesc;

    // Creamos los pines
    _pin = new Pin[pinCount()];
    _pin[0] = new Pin(this, circ, (byte) 0);
    _pin[0].programOut((byte) ((ParamSwitch) params).state, 0);
    _pin[0].hasChanged();
    this._circuit = circ;
  }
View Full Code Here

    // 0 : entrada
    // 1 : salida
    // 2 : clock
    _pin = new Pin[pinCount()];
    for (int i = 0; i < pinCount(); i++)
      _pin[i] = new Pin(this, circ, (byte) i);

    // El pin que controla el valor del pin de salida
    _pin[2] = new TreeStatePin(this, circ, (byte) 2);
  }
View Full Code Here

TOP

Related Classes of cl.alejo.jcsim.csim.dom.Pin

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.