From 637b24f43f1491cdf69289bbd19528ad83f75b56 Mon Sep 17 00:00:00 2001
From: David Hammer <dhammer@mailbox.org>
Date: Thu, 5 Sep 2024 14:28:24 +0200
Subject: [PATCH] Add option for LFF link on scene

---
 src/calng/scenes.py | 56 +++++++++++++++++++++++++--------------------
 1 file changed, 31 insertions(+), 25 deletions(-)

diff --git a/src/calng/scenes.py b/src/calng/scenes.py
index 5446b576..380710e5 100644
--- a/src/calng/scenes.py
+++ b/src/calng/scenes.py
@@ -249,7 +249,6 @@ class ProcessingDeviceStatus(VerticalLayout):
 class CompactArbiterOverview(VerticalLayout):
     def __init__(self, device_id, schema_hash):
         super().__init__(padding=0)
-        is_advanced = schema_hash.has("frameSelection.decision")
         self.children.append(
             HorizontalLayout(
                 DeviceSceneLinkModel(
@@ -268,31 +267,38 @@ class CompactArbiterOverview(VerticalLayout):
                 ),
             )
         )
-        if is_advanced:
-            self.children.extend(
-                [
-                    EditableRow(device_id, schema_hash, "frameSelection.decision"),
-                    TableElementModel(
-                        keys=[f"{device_id}.frameSelection.plan"],
-                        klass="EditableTableElement",
-                        width=20 * BASE_INC,
-                        height=10 * BASE_INC,
-                    ),
-                    DisplayTextLogModel(
-                        keys=[f"{device_id}.status"],
-                        width=20 * BASE_INC,
-                        height=8 * BASE_INC,
-                    ),
-                ]
-            )
-        else:
-            self.children.append(
-                recursive_editable(
-                    device_id,
-                    schema_hash,
-                    "frameSelection",
+        if schema_hash.has("frameSelection"):
+            # it's probably a frame selection arbiter
+            if schema_hash.has("frameSelection.decision"):
+                # it's the advanced version
+                self.children.extend(
+                    [
+                        EditableRow(device_id, schema_hash, "frameSelection.decision"),
+                        TableElementModel(
+                            keys=[f"{device_id}.frameSelection.plan"],
+                            klass="EditableTableElement",
+                            width=20 * BASE_INC,
+                            height=10 * BASE_INC,
+                        ),
+                        DisplayTextLogModel(
+                            keys=[f"{device_id}.status"],
+                            width=20 * BASE_INC,
+                            height=8 * BASE_INC,
+                        ),
+                    ]
                 )
-            )
+            else:
+                # it's the simple version
+                self.children.append(
+                    recursive_editable(
+                        device_id,
+                        schema_hash,
+                        "frameSelection",
+                    )
+                )
+        elif schema_hash.has("inputBunchPattern"):
+            # it's probably a lit frame finder
+            pass  # we don't actually have anything to add for now
 
 
 class CompactCorrectionDeviceOverview(HorizontalLayout):
-- 
GitLab