Files
geutebruck/geutebruck-api/docs/architecture-sequence.puml
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

139 lines
3.6 KiB
Plaintext

@startuml Configuration Management Sequence
!theme plain
skinparam backgroundColor #FEFEFE
title Configuration Management - Create G-Core Server Flow
actor "Client\n(Browser/API)" as client
participant "FastAPI\nREST API\n:8000" as api
participant "gRPC\nSDK Bridge\n:50051" as bridge
participant "SetupClient" as setup
participant "FolderTree\nParser" as parser
participant "FolderTree\nWriter" as writer
participant "GeViServer\n:7700-7703" as server
database "TestMKS.set" as config
== Server Creation Request ==
client -> api : POST /api/v1/configuration/servers\n{"alias": "New Server", "host": "192.168.1.100", ...}
activate api
api -> api : Validate request\n(check required fields)
api -> bridge : gRPC: CreateServer(request)
activate bridge
bridge -> setup : DownloadConfiguration()
activate setup
setup -> server : Connect to SetupClient port\n(Request configuration)
activate server
server -> setup : Return binary .set file
deactivate server
setup --> bridge : Binary config data
deactivate setup
bridge -> parser : ParseConfiguration(binaryData)
activate parser
parser -> parser : Parse binary format\nBuild folder tree structure
parser --> bridge : FolderTree object
deactivate parser
== Configuration Modification ==
bridge -> bridge : Navigate to GeViGCoreServer folder
bridge -> bridge : Find highest server ID\n(e.g., max = 13)
bridge -> bridge : Generate new ID = 14
bridge -> writer : CreateServerNode(\nid="14",\nalias="New Server",\nhost="192.168.1.100",\n...)
activate writer
writer -> writer : Create folder node\nAdd child nodes:\n- Alias\n- DeactivateEcho\n- DeactivateLiveCheck\n- Enabled (bool type!)\n- Host\n- Password\n- User
writer -> writer : Insert into GeViGCoreServer\nfolder in alphabetical order
writer --> bridge : Updated FolderTree
deactivate writer
== Upload Modified Configuration ==
bridge -> setup : UploadConfiguration(modifiedTree)
activate setup
setup -> setup : Serialize FolderTree\nto binary format
setup -> server : Upload modified .set file\nvia SetupClient protocol
activate server
server -> config : Save TestMKS.set
server -> server : Reload configuration\n(batch import)
server --> setup : Upload success
deactivate server
setup --> bridge : Configuration updated
deactivate setup
bridge --> api : CreateServerResponse\n{id: "14", ...}
deactivate bridge
api --> client : HTTP 201 Created\n{"id": "14", "alias": "New Server", ...}
deactivate api
== Verification (Optional) ==
client -> api : GET /api/v1/configuration/servers
activate api
api -> bridge : gRPC: GetAllServers()
activate bridge
bridge -> setup : DownloadConfiguration()
activate setup
setup -> server : Request current config
activate server
server --> setup : Current .set file
deactivate server
setup --> bridge : Binary data
deactivate setup
bridge -> parser : ParseConfiguration()
activate parser
parser --> bridge : FolderTree
deactivate parser
bridge -> bridge : Extract all servers from\nGeViGCoreServer folder
bridge --> api : List of servers\n(including new server #14)
deactivate bridge
api --> client : HTTP 200 OK\n[{id:"1",...}, {id:"14",...}]
deactivate api
note over bridge, server
**Critical Implementation Details:**
1. **Bool Type Handling**:
- Must write Enabled as type code 1 (bool)
- GeViServer stores as int32 but reads bool correctly
2. **Field Order**:
- Must be: Alias, DeactivateEcho, DeactivateLiveCheck,
Enabled, Host, Password, User
3. **Auto-increment ID**:
- Find max numeric ID in existing servers
- Increment by 1 for new server
4. **SetupClient Port**:
- Only one client can connect at a time
- GeViSet blocks SDK Bridge connection (and vice versa)
end note
@enduml