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>
This commit is contained in:
118
dump_folder_tree_structure.py
Normal file
118
dump_folder_tree_structure.py
Normal file
@@ -0,0 +1,118 @@
|
||||
"""
|
||||
Read configuration as binary, parse as folder tree, and dump working mapping structure
|
||||
"""
|
||||
import grpc
|
||||
import sys
|
||||
import io
|
||||
|
||||
sys.path.append(r'C:\DEV\COPILOT\geutebruck-api\src\api')
|
||||
|
||||
if sys.platform == 'win32':
|
||||
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
|
||||
sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8')
|
||||
|
||||
from protos import configuration_pb2
|
||||
from protos import configuration_pb2_grpc
|
||||
|
||||
def print_folder_tree(node, indent=0, max_depth=10):
|
||||
"""Print folder tree structure recursively"""
|
||||
if indent > max_depth:
|
||||
return
|
||||
|
||||
prefix = " " * indent
|
||||
|
||||
# Print this node
|
||||
if node.type == "folder":
|
||||
print(f"{prefix}{node.name}/ (folder)")
|
||||
if node.children:
|
||||
for child in node.children:
|
||||
print_folder_tree(child, indent + 1, max_depth)
|
||||
elif node.type == "string":
|
||||
# Truncate long strings
|
||||
value = node.string_value if len(node.string_value) < 80 else node.string_value[:77] + "..."
|
||||
print(f"{prefix}{node.name} = \"{value}\" (string)")
|
||||
elif node.type == "int32":
|
||||
print(f"{prefix}{node.name} = {node.int_value} (int32)")
|
||||
elif node.type == "int64":
|
||||
print(f"{prefix}{node.name} = {node.int_value} (int64)")
|
||||
elif node.type == "int16":
|
||||
print(f"{prefix}{node.name} = {node.int_value} (int16)")
|
||||
elif node.type == "byte":
|
||||
print(f"{prefix}{node.name} = {node.int_value} (byte)")
|
||||
elif node.type == "boolean":
|
||||
print(f"{prefix}{node.name} = {bool(node.int_value)} (boolean)")
|
||||
else:
|
||||
print(f"{prefix}{node.name} ({node.type})")
|
||||
|
||||
print("="*70)
|
||||
print("DUMPING FOLDER TREE STRUCTURE OF WORKING MAPPING")
|
||||
print("="*70)
|
||||
|
||||
channel = grpc.insecure_channel('localhost:50051')
|
||||
stub = configuration_pb2_grpc.ConfigurationServiceStub(channel)
|
||||
|
||||
# Use ReadConfiguration to get the parsed folder tree
|
||||
print("\n1. Reading configuration...")
|
||||
request = configuration_pb2.ReadConfigurationRequest()
|
||||
response = stub.ReadConfiguration(request)
|
||||
|
||||
if not response.success:
|
||||
print(f" [ERROR] {response.error_message}")
|
||||
sys.exit(1)
|
||||
|
||||
print(f" File size: {response.file_size} bytes")
|
||||
print(f" Total nodes: {response.statistics.total_nodes}")
|
||||
|
||||
# The nodes list is flat - we need to search for MappingRules marker
|
||||
print("\n2. Searching for MappingRules marker...")
|
||||
|
||||
mapping_rules_nodes = []
|
||||
in_mapping_rules = False
|
||||
current_mapping_nodes = []
|
||||
current_mapping_name = None
|
||||
|
||||
for i, node in enumerate(response.nodes):
|
||||
# Look for marker nodes
|
||||
if node.node_type == "marker":
|
||||
if node.name == "MappingRules":
|
||||
in_mapping_rules = True
|
||||
print(f" Found MappingRules at node {i}")
|
||||
elif in_mapping_rules:
|
||||
# Another marker means we've left MappingRules
|
||||
in_mapping_rules = False
|
||||
break
|
||||
|
||||
if in_mapping_rules:
|
||||
mapping_rules_nodes.append(node)
|
||||
|
||||
# Track individual mappings (they're separated by property markers)
|
||||
if node.node_type == "property":
|
||||
# Save previous mapping if any
|
||||
if current_mapping_nodes and current_mapping_name:
|
||||
# Check if this is a working mapping
|
||||
if "CrossSwitch" in current_mapping_name or "C_" in current_mapping_name:
|
||||
print(f"\n3. Found working mapping: '{current_mapping_name}'")
|
||||
print(f" Total nodes in mapping: {len(current_mapping_nodes)}")
|
||||
|
||||
print(f"\n4. Node details:")
|
||||
for j, mnode in enumerate(current_mapping_nodes[:50]): # First 50 nodes
|
||||
print(f" [{j}] {mnode.node_type:10} | offset {mnode.start_offset:6}-{mnode.end_offset:6} | name: '{mnode.name}' | value: '{mnode.value[:50] if len(mnode.value) < 50 else mnode.value[:47] + '...'}'")
|
||||
|
||||
print("\n" + "="*70)
|
||||
print("DONE - Found working mapping structure above")
|
||||
print("="*70)
|
||||
sys.exit(0)
|
||||
|
||||
# Start new mapping
|
||||
current_mapping_nodes = [node]
|
||||
# The caption should be in the next string node
|
||||
current_mapping_name = None
|
||||
else:
|
||||
current_mapping_nodes.append(node)
|
||||
|
||||
# Capture the mapping name (first string node is usually the caption)
|
||||
if node.node_type == "string" and current_mapping_name is None:
|
||||
current_mapping_name = node.value
|
||||
|
||||
print("\n[ERROR] No working mapping found")
|
||||
print(f"Total nodes in MappingRules: {len(mapping_rules_nodes)}")
|
||||
Reference in New Issue
Block a user