# Bug Fix Summary: CrossSwitch Display Issue ## Problem When creating GSC and G-Core action mappings via the Flutter app/REST API, the actions appeared as "CrossSwitch" in GeViSet instead of their actual action names (PanLeft, PanRight, etc.). ## Root Cause The C# `ActionMappingManager` was missing critical fields in the folder tree structure that GeViSet requires to correctly identify action types: 1. **Filter flags** (boolean fields with `.` prefix) at the mapping level 2. **Actual field values** (int32 fields without `.` prefix) after the Rules folder Without these fields, GeViSet couldn't determine the mapping type and defaulted to showing "CrossSwitch". ## Solution Updated `ActionMappingManager.cs` in the `CreateRuleFolder` method to generate the complete structure: ### Structure Now Created: ``` Mapping Folder (ID: "1", "2", etc.) ├── .SwitchMode (bool): false ← FILTER FLAG (was missing) ├── .VideoInput (bool): true ← FILTER FLAG (was missing) ├── .VideoOutput (bool): false ← FILTER FLAG (was missing) ├── @ (string): "Mapping Name" ├── @! (int32): 0 ├── @@ (int32): 100 ├── Rules (folder) │ ├── 1 (folder) - Output Action 1 │ │ ├── @ (string): "GSC PanLeft FIXED" │ │ ├── @! (int32): 0 │ │ ├── @@ (int32): 100 │ │ ├── GscAction (string): "@ PanLeft (Camera: 101027)" │ │ └── GscServer (string): "GEVISCOPE_01_UPDATED" │ └── 2 (folder) - Output Action 2 │ ├── @ (string): "G-Core PanRight FIXED" │ ├── @! (int32): 0 │ ├── @@ (int32): 100 │ ├── GCoreAction (string): "@ PanRight (Camera: 101028)" │ └── GCoreServer (string): "gscope-cdu-10" ├── SwitchMode (int32): 0 ← ACTUAL VALUE (was missing) ├── VideoInput (int32): 101027 ← ACTUAL VALUE (was missing) └── VideoOutput (int32): 0 ← ACTUAL VALUE (was missing) ``` ### Key Changes: 1. **Always create filter flags** for SwitchMode, VideoInput, VideoOutput 2. **Always create actual field values** after Rules folder 3. **Extract camera ID** from first output action's "PTZ head" parameter to set VideoInput 4. **Match exact field order** from working mappings in TestMKS.set ## Files Modified - `C:\DEV\COPILOT\geutebruck-api\src\sdk-bridge\GeViScopeBridge\Services\ActionMappingManager.cs` - Method: `CreateRuleFolder` (lines 77-166) ## Testing Created test mapping "FIXED_STRUCTURE_TEST" with: - Output Action 1: GSC PanLeft (Server: GEVISCOPE_01_UPDATED, Camera: 101027) - Output Action 2: G-Core PanRight (Server: gscope-cdu-10, Camera: 101028) ## Verification Steps 1. Open GeViSet application 2. Connect to GeViServer (this downloads the current configuration) 3. Navigate to MappingRules folder 4. Find mapping "FIXED_STRUCTURE_TEST" 5. Check Output Actions ### Expected Results: - ✓ Output Action 1 shows as **"PanLeft"** (NOT CrossSwitch) - ✓ Output Action 2 shows as **"PanRight"** (NOT CrossSwitch) - ✓ Server aliases are visible and correct ## Technical Details ### Why These Fields Are Required: - **Filter flags** (`.FieldName`): Control which fields are enabled/visible in GeViSet UI - **Actual values** (`FieldName`): Store the actual data values for those fields GeViSet uses these fields to determine: 1. What type of mapping this is (CrossSwitch vs. GSC/G-Core action) 2. Which camera/input to associate with the mapping 3. Which fields to display in the UI ### Reference Implementation: The fix is based on the working Python implementation in `C:\DEV\COPILOT_codex\` which successfully creates .set files that GeViSet recognizes correctly. ## Build Status ✓ SDK Bridge rebuilt successfully ✓ Test mapping created via REST API ⏳ Awaiting GeViSet verification