> ## Documentation Index
> Fetch the complete documentation index at: https://docs-unity.molca.id/llms.txt
> Use this file to discover all available pages before exploring further.

# Machine info & selection

> MachineInfo component, selection handlers, and the panel handler system for machine detail views.

**Namespace:** `MolcaDT.Handler`

The machine info and selection system is the core of DT twin interaction: defining machines as interactive objects, selecting them, and displaying detail panels (overview, data, working orders, documentation).

## MachineInfo

**File:** `Assets/_MolcaDT/Code/Scripts/Handler/MachineInfo.cs`

Attached to each machine GameObject in the twin scene. Defines the machine's identity, capabilities, and data bindings.

### Inspector fields

| Category      | Field                   | Type                   | Purpose                                                |
| ------------- | ----------------------- | ---------------------- | ------------------------------------------------------ |
| **Content**   | `hasContentStates`      | `List<bool>`           | Per-tab content availability flags                     |
|               | `hasData`               | `bool`                 | Enables the data sidebar tab and overview POI panel    |
|               | `canARMode`             | `bool`                 | Whether this machine supports AR mode                  |
|               | `canFocus`              | `bool`                 | Whether the camera can focus on this machine           |
|               | `useDemoTrends`         | `bool`                 | Generate demo trend charts when parameter data arrives |
| **Data**      | `parameterDataList`     | `List<ParameterDatum>` | Live parameter values from the network                 |
|               | `dataPublishList`       | `List<DataPublish>`    | Publisher configurations (on/off buttons, etc.)        |
|               | `documentInfos`         | `List<MediaInfo>`      | Documentation/media attached to this machine           |
| **Visual**    | `centerPointUsingPivot` | `bool`                 | Use pivot vs center for POI/camera targeting           |
|               | `blockDragInput`        | `bool`                 | Block drag input when this machine is selected         |
|               | `useCustomHighlight`    | `bool`                 | Use a custom highlight shader                          |
| **Hierarchy** | `machineHierarchyInfo`  | `MachineHierarchyInfo` | SO reference for hierarchy config                      |
|               | `childMachine`          | `ChildMachineInfo`     | Child machines for drill-down                          |

### Code

```csharp theme={null}
using MolcaDT.Handler;
using UnityEngine;

public class MachineHighlighter : MonoBehaviour
{
    [SerializeField] private MachineInfo targetMachine;

    private void OnEnable()
    {
        targetMachine.OnInfoClicked += HandleMachineClicked;
    }

    private void OnDisable()
    {
        targetMachine.OnInfoClicked -= HandleMachineClicked;
    }

    private void HandleMachineClicked()
    {
        Debug.Log($"Machine selected: {targetMachine.name}");
        Debug.Log($"Has data: {targetMachine.hasData}");
        Debug.Log($"Can AR: {targetMachine.canARMode}");
    }
}
```

## MachineSelectionHandler

**File:** `Assets/_MolcaDT/Code/Scripts/Handler/MachineSelectionHandler.cs`

Handles machine click/select flow. Coordinates with `POIManager` for POI display, `FactoryMenuManager` for panel toggles, and `CameraController` for focus transitions.

| Method                               | Description                               |
| ------------------------------------ | ----------------------------------------- |
| `SelectMachine(MachineInfo machine)` | Select a machine, show its panels and POI |
| `DeselectMachine()`                  | Deselect, hide panels                     |
| `GetSelectedMachine()`               | Get the currently selected machine        |

## Panel handlers

Each detail panel for a selected machine is managed by a dedicated handler, all under `Assets/_MolcaDT/Code/Scripts/Handler/Panel Handler/`.

### Overview panel

**File:** `Overview Panel/OverviewPanelHandler.cs`

Shows the machine's overview card: name, status, key metrics. Uses `OverviewParameterDataHandler` for parameter-driven display.

### Data panel

**File:** `Data Panel/DataPanelHandler.cs`

Displays live parameter data from `MachineInfo.parameterDataList`. `ParameterDataHandler` manages individual parameter rendering.

| Method                               | Signature                                 | Description                                   |
| ------------------------------------ | ----------------------------------------- | --------------------------------------------- |
| `BindToMachine(MachineInfo machine)` | `void BindToMachine(MachineInfo machine)` | Wire panel to a machine's data                |
| `RefreshData()`                      | `void RefreshData()`                      | Refresh displayed values from the data source |

### Working order panel

**File:** `Working Order Panel/WorkingOrderPanelHandler.cs`

Manages working order/work order display and flow. Uses `WorkingOrderManager` for state and `WorkingOrderDataHandler` for data.

### Documentation panel

**File:** `Documentation Panel/DocumentPanelHandler.cs`

Displays documents attached to the machine via `MachineInfo.documentInfos`. Each `DocumentButtonHandler` opens a specific document.

### Information panel

**File:** `Information Panel/InformationPanelHandler.cs`

Shows additional machine information groups. Uses `InformationGroupHandler` for sectioned content.

### Configuration panel

**File:** `Configuration Panel/ConfigurationPanelHandler.cs`

Manages machine configuration controls. `ControllerButtonHandler` provides individual button/dropdown/toggle controls.

### Children panel

**File:** `Children Panel/ChildrenPanelHandler.cs`

Shows child machines for drill-down navigation, populated from `MachineInfo.childMachine`.

### Base

**File:** `BasePanelHandler.cs`

Abstract base for all panel handlers:

```csharp theme={null}
public abstract class BasePanelHandler : MonoBehaviour
{
    public abstract void Open();
    public abstract void Close();
    public abstract void BindToMachine(MachineInfo machine);
}
```

## Plant selection

**File:** `PlantSelectionHandler.cs` — handles plant-level selection (vs. individual machine selection), coordinates `FloorManager` for floor filtering.

## CRUD handlers

| File                      | Purpose                         |
| ------------------------- | ------------------------------- |
| `FilterDataHandler.cs`    | Filter machine data by criteria |
| `FunctionDataHandler.cs`  | Execute machine functions       |
| `SummaryDataHandler.cs`   | Aggregate data summary display  |
| `TaskbarToggleHandler.cs` | Toggle taskbar visibility       |

## Code

```csharp theme={null}
using MolcaDT.Handler;
using UnityEngine;

public class MachineDetailView : MonoBehaviour
{
    [SerializeField] private OverviewPanelHandler overviewPanel;
    [SerializeField] private DataPanelHandler dataPanel;
    [SerializeField] private WorkingOrderPanelHandler woPanel;

    public void ShowMachineDetail(MachineInfo machine)
    {
        overviewPanel.BindToMachine(machine);
        overviewPanel.Open();

        if (machine.hasData)
        {
            dataPanel.BindToMachine(machine);
            dataPanel.Open();
        }
    }

    public void CloseAll()
    {
        overviewPanel.Close();
        dataPanel.Close();
        woPanel.Close();
    }
}
```

## Related

* [DT POI and panels](/dt/poi-and-panels) — POI integration with machine selection
* [DT factory menu](/dt/factory-menu) — menu bar invokes machine views
* [DT network and mapping](/dt/network-and-mapping) — data source for parameterDataList
