Skip to content
net.mjs 732 B
Newer Older
import { Wire } from "./wire.mjs";
import { Pin } from "./pin.mjs";

Manuel Kirzinger's avatar
Manuel Kirzinger committed
/**
 * Representation of a single potential/net.
Manuel Kirzinger's avatar
Manuel Kirzinger committed
 * 
 * @property {string} netname - the name of the net/potential
 * @property {Wire[]} wires - a list of corresponding wires
 * @property {Pin[]} pins - a list of corresponding pins
Manuel Kirzinger's avatar
Manuel Kirzinger committed
 */
class Net {
	netname;
	wires;
	pins;

	/**
	 * Generate a "network" / potential.
	 * 
	 * @param {string} netname - the name of the net/potential
	 * @param {Wire[]} [wires = []] - a list of corresponding wires
	 * @param {Pin[]} [pins = []] - a list of corresponding pins
	 */
	constructor(netname, wires = [], pins = []) {
		this.netname = netname;
		this.wires = wires || [];
		this.pins = pins || [];
	}
}
Manuel Kirzinger's avatar
Manuel Kirzinger committed