beffroi-tools/docs/midra-layout/guide/device.md

129 lines
8.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Midra connection and transfers
[Midra Layout](../README.md) · [Guide contents](README.md) · [Starter files](../../templates/midra-layout/README.md)
## Use folders as local Midra layouts
The Midra **Apply to** selector is shared by the status bar, Export menu, and
send/import windows. It starts at **All layers**, regardless of canvas selection.
Choose **Only selected layers** for an explicit selection filter, or **Folder: …**
for a complete folder. The choice lasts for the session; it is not a project setting.
It affects Midra transfers, not clipboard/file import or geometry export scopes.
To prepare several layouts that reuse the same device layers:
1. Put each layout in a folder and configure its saved screen/layer links through
**Midra mapping & transfer…**. Every row can still be remapped or unlinked.
2. Choose **Folder: …** in the status selector, or right-click a folder and choose
**Use folder for Midra transfers**.
3. Click **Send folder links**. Then click another folder name and send again:
Folder mode follows the clicked folder. Clicking a folder never sends by itself.
4. **Load folder links** reads fresh Preview geometry/cropping into that folder.
Loading requires visible, unlocked destinations and supports Undo.
Multiple editor layers may link to the same device destination, within or across
folders. Mapping shows a warning listing the other linked layers and their folders.
Sending is disabled when the chosen scope contains overlapping **screen + layer**
destinations, with a list of the conflicts. Choose a conflict-free folder or selection,
or remap/skip rows; links outside that send scope do not block it.
Linked send/load skip unlinked layers. An empty selection or missing folder never
falls back to All. Transfers already started retain the links captured at click time.
These are local geometry layouts, not device preset recalls or source-routing memories.
**Import layers from Midra** proposes unambiguous saved links within the scope.
Each row offers Skip or a scoped existing layer; All/Folder scopes also allow New layer. **Use saved links**
restores those suggestions; **Import unmapped as new layers** fills unused rows.
New layers join the chosen folder, and importing saves their reviewed screen/layer
links with the geometry as one Undo step. Existing layers keep their folder. Multiple
local copies of the same device layer can be updated together with linked Load;
the manual import dialog requires one unambiguous destination per device row.
## Midra connection and sending
Open **Midra connection…** in the main menu (also in **Settings → Midra integration**), enter the device IP, then **Connect**. The address saves automatically in the application config and survives project loads and restarts; startup connects automatically only if **Try autoconnecting at startup** is enabled in Settings → Midra integration.
Open **Import → Midra layers…** for the separate layer import window. **Refresh layers** reads a fresh snapshot; **Connection settings…** opens the connection window.
Choose a destination beside each device layer: existing layer, new layer, or skip.
Centered crops import visible bounds and framing; unsupported aspect/mask cases
are explained in the review. Imports are one undoable edit.
After connecting, open **Export → Midra mapping & transfer…**. Choose editor layers,
map each to a Midra layer, select **Preview** or **Program**, and select a container
strategy: **Output-sized** or **Source aspect**. Expand **Exact device changes** to
review sizes, centers, crop values and aspect, then click **Send mapped layers**.
The button is disabled while a send is in progress. Matching stored values can still be sent to apply staged geometry to hardware.
The source's native dimensions must match the destination's current content.
The target bank is fixed when configured. Sending starts immediately without a stale-state check. Writes are sequential;
partial failures require refreshing, not automatic retries or rollback. Success
means all changed fields matched device readback. There are no automatic sends
from edits, imports or undo. Closing the connection window does not cancel a send
already started; wait for its result before loading another project.
See [hardware checks and limitations](../device-check.md) and the
[device exchange contract](../../interfaces/midra-device-send.md). The footer's ONLINE
status reflects the last successful read, not continuous polling.
## Capture an input still from Midra
For a layer, open **Layer properties → Preview** (or right-click → **Input preview
& crop guides**):
1. Check **Enable input preview**.
2. Choose the physical input to preview. Inputs without signal are hidden by
default; **Show inputs without signal** inside the dropdown reveals them with
a **No signal** label. The same filter applies to the snapshot-import picker.
Signal indicators reflect the last connection refresh. This only chooses an image source; it
does not change Midra input routing or the editor's source-format identity.
3. Selecting an input captures a first still automatically and loads it straight
into this layer. It waits only for the shared five-second request throttle, not
the auto-refresh interval. Click **Capture still**, directly below the input
selector, to replace the still. Selecting a different input queues its first
capture too; rapid changes keep only the latest choice. The snapshot-import
picker also captures on selection, but still requires an explicit import.
4. Alternatively, enable **Auto-refresh this preview** below Capture. It fetches
the first image automatically and then updates it on the timer.
Auto-refresh is per layer. **Request interval** is shared across automatic
previews, defaults to 10 seconds and accepts 5–300 seconds. Visible automatic
previews refresh one input at a time; automatic previews sharing an input share
one fetched image. First captures queued for that same input also share the
result, even when selected while a request is running. One fetch serves all
waiting layers; existing stills with auto-refresh off remain unchanged.
Requests are serialized with a minimum five-second gap, including manual captures.
A failed refresh retains the last image; changing the input clears the previous
input's image. Disabling the preview hides it and pauses its refreshes.
**Crop guide opacity** defaults to 35% with an image; without an enabled image,
guides remain fully opaque and the slider is disabled. Selection handles stay
fully visible. Layer previews and timer settings are session-only. The timer
pauses offline and while the separate capture/import dialog is open. Reduced
snapshot resolution and freshness are controlled by the device. If snapshots
are disabled for an input, enable them in WebRCS and refresh the connection.
**Import → Import input snapshot…** opens a capture/import window (also available
from the reference-images context menu). Choose the physical input and a
**Destination**: any editor layer, or **Reference image**. No layer selection is
required. Capture and inspect the still, then click **Import into layer** or
**Add as reference**. Layer destinations offer **Keep refreshing this layer**
and the shared refresh interval. This starts timed updates after import; leaving
it off imports a fixed layer still. Selection and layer geometry are unchanged.
Reference images never offer auto-refresh: they are fixed screen guides embedded
in the project, with the usual size/aspect warnings. Cancel/close discards a pending
dialog capture; another request waits for completion or the 20-second timeout.
No capture action changes device settings or routing. See the
[input preview contract](../../interfaces/midra-input-preview.md).
Opening a project or restoring recovery now reads, validates and decodes embedded
references in a worker. The current editor stays intact until the whole project
is ready. Manual loading has a Cancel button; errors keep the old project.
Recovery autosave pauses while loading, including on exit.
In the opt-in **Layer properties → Source** section, **Editor input** offers Inputs 1–8 separately
from Midra screen/layer destinations. Use **New editor input** for additional
local identities, then **Apply source changes**. Layers sharing an editor input
share its source format and input crop. Assignments are saved in projects and
undoable; they do not change physical input routing.