> ## Documentation Index
> Fetch the complete documentation index at: https://dcc-5ccd5152.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Creating and Managing BigFred Layouts and Sessions

> Create and manage BigFred layouts. Assign command stations and interlockings, set per-user vehicle caps, and lock layouts between sessions.

A **layout** is the top-level container that operators select when they log in to BigFred. Each layout has its own roster of vehicles, its own set of command stations, and its own collection of interlockings. Think of a layout as a named running session or physical location — you might have one for the club workbench, one for the exhibition hall, and one for a member's home setup.

## The System layout

<Note>
  BigFred automatically creates a **System layout** (shown as *Default (workshop)*) the first time it boots. This layout is always available as a last-resort login target — even when every other layout is locked, operators can still choose the System layout at the login screen.

  The System layout's name is fixed and cannot be changed or deleted. For a real installation you should create one or more named layouts and reserve the System layout as a fallback.
</Note>

## The Layouts table

Open **Admin → Layouts** to see all layouts. Each row shows the layout name, its type (System or Custom), and its current status (Active or Locked). Use the action buttons on each row to edit, lock/unlock, or delete.

## Creating a layout

<Steps>
  <Step title="Open the create dialog">
    Navigate to **Admin → Layouts** and click **New Layout**.
  </Step>

  <Step title="Name the layout">
    Enter a descriptive **Name** — for example `Exhibition Hall 2025` or `Member A – Home Layout`. The name appears in the login dropdown that operators see.
  </Step>

  <Step title="Assign command stations">
    Use the **Command Stations** multi-select to choose which command stations this layout will use. At least one command station is required before the form can be saved. Command stations must already exist in the catalogue — if you have not added any yet, open **Admin → Command Stations** first and return here.

    A layout can share a command station with other layouts (useful when one Z21 serves multiple sessions).
  </Step>

  <Step title="Assign interlockings (optional)">
    Use the **Interlockings** multi-select to attach signal boxes to this layout. Interlockings must already exist — create them at **Admin → Interlockings** before assigning here. Layouts with no interlockings are fine if you do not use signalman roles.
  </Step>

  <Step title="Set additional options (optional)">
    * **Max vehicles per user** — caps how many vehicles each operator can drive simultaneously. Defaults to 8. Raise or lower this to match your track capacity.
    * **Radio chat** — toggles the walkie-talkie phrase chat feature between drivers and signalmen. Enabled by default. The radio stop command is always available regardless of this setting.
    * **Admin PIN** — sets a numeric PIN that grants temporary admin/signalman elevation from inside the running session (the "sudo" flow). If left blank, a PIN is generated automatically. Operators can use this PIN at the layout prompt to request elevated access.
  </Step>

  <Step title="Save">
    Click **Create**. The layout appears in the table and immediately becomes available in the operator login dropdown.
  </Step>
</Steps>

## Editing a layout

Click the **pencil icon** on any layout row to reopen the edit dialog. You can rename the layout, add or remove command stations and interlockings, adjust the vehicle cap, toggle radio chat, and rotate the admin PIN.

<Note>
  The System layout's name is read-only in the edit dialog. You can still update its interlockings, vehicle cap, radio chat setting, and admin PIN.
</Note>

## Locking and unlocking a layout

Locking a layout hides it from the operator login dropdown and prevents new logins to that layout. Use this when you want to close a session to new entrants while any operators already logged in continue running normally until their sessions end.

* **To lock:** click the **lock icon** on the layout's row and confirm. The status badge changes to **Locked** (amber). The layout disappears from the login dropdown immediately, but existing sessions are unaffected and continue running until they close on their own.
* **To unlock:** click the **unlock icon** on a locked layout's row and confirm. The status returns to **Active** (green) and the layout reappears in the login dropdown.

<Note>
  When all layouts are locked, the System layout remains visible in the login dropdown as a last resort.
</Note>

## Managing interlockings

Interlockings are created and maintained on their own page before being assigned to layouts.

<Steps>
  <Step title="Navigate to Interlockings">
    Go to **Admin → Interlockings**.
  </Step>

  <Step title="Create an interlocking">
    Click **New Interlocking**. Enter a **Name** (required) and an optional **Location** — a free-text description of where the signal box sits on the layout (for example, `North throat junction`). Click **Create**.
  </Step>

  <Step title="Assign to a layout">
    Go back to **Admin → Layouts**, edit the relevant layout, and add the interlocking from the **Interlockings** multi-select.
  </Step>
</Steps>

You can edit an interlocking's name and location at any time from **Admin → Interlockings** without affecting the layouts it is assigned to.

## Deleting a layout

Click the **red trash icon** on a layout's row and confirm. Deleting a layout removes its roster associations but does **not** delete the command stations, user vehicles, or interlockings themselves — those remain in their respective catalogues and can be assigned to other layouts.

The System layout cannot be deleted; its trash button is permanently disabled.
