From beea6b2f96209db14d257252ea410727c3b6c084 Mon Sep 17 00:00:00 2001
From: David Hammer <dhammer@mailbox.org>
Date: Tue, 5 Oct 2021 16:17:59 +0200
Subject: [PATCH] Eliminate assignmentMandatory for manager reasons

---
 src/calng/base_correction.py | 12 ++++++++----
 src/calng/calcat_utils.py    | 10 ++++++++--
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/src/calng/base_correction.py b/src/calng/base_correction.py
index 4a6a2e3e..fc6b5005 100644
--- a/src/calng/base_correction.py
+++ b/src/calng/base_correction.py
@@ -87,7 +87,8 @@ class BaseCorrection(PythonDevice):
                 "Sources to get data from. Only incoming hashes from these sources "
                 "will be processed."
             )
-            .assignmentMandatory()
+            .assignmentOptional()
+            .defaultValue([])
             .commit(),
             STRING_ELEMENT(expected)
             .key("pulseFilter")
@@ -144,19 +145,22 @@ class BaseCorrection(PythonDevice):
             .key("dataFormat.pixelsX")
             .displayedName("Pixels x")
             .description("Number of pixels of image data along X axis")
-            .assignmentMandatory()
+            .assignmentOptional()
+            .defaultValue(512)
             .commit(),
             UINT32_ELEMENT(expected)
             .key("dataFormat.pixelsY")
             .displayedName("Pixels y")
             .description("Number of pixels of image data along Y axis")
-            .assignmentMandatory()
+            .assignmentOptional()
+            .defaultValue(128)
             .commit(),
             UINT32_ELEMENT(expected)
             .key("dataFormat.memoryCells")
             .displayedName("Memory cells")
             .description("Full number of memory cells in incoming data")
-            .assignmentMandatory()
+            .assignmentOptional()
+            .defaultValue(352)
             .commit(),
             STRING_ELEMENT(expected)
             .key("dataFormat.outputAxisOrder")
diff --git a/src/calng/calcat_utils.py b/src/calng/calcat_utils.py
index 5d4c8c87..93040855 100644
--- a/src/calng/calcat_utils.py
+++ b/src/calng/calcat_utils.py
@@ -111,16 +111,22 @@ class BaseCalcatFriend:
         (
             STRING_ELEMENT(schema)
             .key(f"{prefix}.detectorType")
+            .displayedName("Detector type name")
+            .description(
+                "Name of detector type in CalCat; typically has suffix '-Type'"
+            )
             .readOnly()
             .initialValue(detector_type)
             .commit(),
             STRING_ELEMENT(schema)
             .key(f"{prefix}.detectorName")
-            .assignmentMandatory()
+            .assignmentOptional()
+            .defaultValue("")
             .commit(),
             STRING_ELEMENT(schema)
             .key(f"{prefix}.karaboDa")
-            .assignmentMandatory()
+            .assignmentOptional()
+            .defaultValue("")
             .commit(),
             DOUBLE_ELEMENT(schema)
             .key(f"{prefix}.memoryCells")
-- 
GitLab