function switchCircuit(id) {
    if (layoutModeGet()) { toggleLayoutMode(); }
    if (verilogModeGet()) { verilogModeSet(false);}

    // globalScope.fixLayout();
    scheduleBackup();
    if (id === globalScope.id) return;
    $('.circuits').removeClass('current');
    simulationArea.lastSelected = undefined;
    simulationArea.multipleObjectSelections = [];
    simulationArea.copyList = [];
    globalScope = scopeList[id];
    if (globalScope.verilogMetadata.isVerilogCircuit) {
        verilogModeSet(true);
    }
    if (globalScope.isVisible()) {
        $(`#${id}`).addClass('current');
    }
    updateSimulationSet(true);
    updateSubcircuitSet(true);
    forceResetNodesSet(true);
    dots(false);
    simulationArea.lastSelected = globalScope.root;
    if (!embed) {
        showProperties(simulationArea.lastSelected);
        updateTestbenchUI();
        plotArea.reset();
    }
    updateCanvasSet(true);
    scheduleUpdate();

    // to update the restricted elements information
    updateRestrictedElementsList();
}
Function used to change the current focusedCircuit
Disables layoutMode if enabled
Changes UI tab etc
Sets flags to make updates, resets most of the things
@param {string} id - identifier for circuit
@category circuit