Files
geutebruck/BUG_FIX_SUMMARY.md
Administrator 14893e62a5 feat: Geutebruck GeViScope/GeViSoft Action Mapping System - MVP
This MVP release provides a complete full-stack solution for managing action mappings
in Geutebruck's GeViScope and GeViSoft video surveillance systems.

## Features

### Flutter Web Application (Port 8081)
- Modern, responsive UI for managing action mappings
- Action picker dialog with full parameter configuration
- Support for both GSC (GeViScope) and G-Core server actions
- Consistent UI for input and output actions with edit/delete capabilities
- Real-time action mapping creation, editing, and deletion
- Server categorization (GSC: prefix for GeViScope, G-Core: prefix for G-Core servers)

### FastAPI REST Backend (Port 8000)
- RESTful API for action mapping CRUD operations
- Action template service with comprehensive action catalog (247 actions)
- Server management (G-Core and GeViScope servers)
- Configuration tree reading and writing
- JWT authentication with role-based access control
- PostgreSQL database integration

### C# SDK Bridge (gRPC, Port 50051)
- Native integration with GeViSoft SDK (GeViProcAPINET_4_0.dll)
- Action mapping creation with correct binary format
- Support for GSC and G-Core action types
- Proper Camera parameter inclusion in action strings (fixes CrossSwitch bug)
- Action ID lookup table with server-specific action IDs
- Configuration reading/writing via SetupClient

## Bug Fixes
- **CrossSwitch Bug**: GSC and G-Core actions now correctly display camera/PTZ head parameters in GeViSet
- Action strings now include Camera parameter: `@ PanLeft (Comment: "", Camera: 101028)`
- Proper filter flags and VideoInput=0 for action mappings
- Correct action ID assignment (4198 for GSC, 9294 for G-Core PanLeft)

## Technical Stack
- **Frontend**: Flutter Web, Dart, Dio HTTP client
- **Backend**: Python FastAPI, PostgreSQL, Redis
- **SDK Bridge**: C# .NET 8.0, gRPC, GeViSoft SDK
- **Authentication**: JWT tokens
- **Configuration**: GeViSoft .set files (binary format)

## Credentials
- GeViSoft/GeViScope: username=sysadmin, password=masterkey
- Default admin: username=admin, password=admin123

## Deployment
All services run on localhost:
- Flutter Web: http://localhost:8081
- FastAPI: http://localhost:8000
- SDK Bridge gRPC: localhost:50051
- GeViServer: localhost (default port)

Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 18:10:54 +01:00

89 lines
3.8 KiB
Markdown

# 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