@willow-dls/core
    Preparing search index...

    Class CircuitProject

    A Circuit Project is a collection of circuits which may or may not be interdependent on one onother. Projects may consist of a circuit and all of its subcircuits, or a collection of totally unrelated circuits.

    "Projects" are a concept which came from CircuitVerse, where a project is a file, and ciruits are tabs in the CircuitVerse UI when the file is loaded.

    This class will probably not be instantiated manually in end-user code; rather, the project loader (see loadProject and CircuitLoader) will parse circuit data and generate a project which compiles any circuits contained within that data.

    This class is simply a data class for managing circuits, it does not perform any logic of its own. The most commonly used methods will probably be getCircuitById and getCircuitByName, as these allow you to fetch circuits and then actually execute them.

    Note

    Not all CircuitLoaders may support fetching a circuit by name. In those cases, you will have to fetch circuits by ID or by index in the array returned by getCircuits, which will return circuits in the same order for the same file.

    Jordan Bancino

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    • Add a new circuit to this project. This will cause the project to re-index itself, allowing thte circuit to be identified by name and ID.

      Parameters

      • circuit: Circuit

        The circuit to add to this project.

      Returns void

    • Attach a logger to this loggable object so that messages logged with log will be send to this logger. Note that this can be called multiple times and multiple loggers can be attached to the same object. Log messages will be sent to all attached loggers.

      Parameters

      Returns void

    • Get a reference to a circuit by the internal ID used in the data file it was loaded from.

      Parameters

      • id: any

        The ID of the circuit to fetch.

      Returns Circuit

      A reference to the circuit.

      Error if a circuit with the given ID cannot be found.

    • Get a reference to a circuit by name.

      Parameters

      • name: string

        The name of the circuit to fetch.

      Returns Circuit

      A reference to the circuit.

      Error if a circuit with the given name cannot be found.

    • Get all of the ciruits in this project, making no consideration for which circuits are subcircuits or parent circuits.

      Returns Circuit[]

      An array of all the circuits in this project.

    • Everything that is loggable gets a unique ID, which can help identify instances of objects in logs when many such instances exist. This ID is normally generated automatically by CircuitLoggable when it is instantiated, unless this method has been by child classes.

      Returns string

      A unique ID among all loggable objects.

    • Log a message, sending it to all loggers associated with this loggable.

      Parameters

      • level: LogLevel

        The log level to log the message at.

      • msg: string

        The message to log.

      • Optionaldata: any

        Any additional data to associate with the message.

      Returns void

    • Propagate all registered loggers (present and future) to the given loggable. This function will register the loggable object with the object it is being called on, establishing a parent-child relationship where all changes to the parent loggers will be propagated to the children.

      Parameters

      • loggable: CircuitLoggable

        The loggable object to attach all registered loggers to.

      Returns void