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>
97 lines
3.2 KiB
Python
97 lines
3.2 KiB
Python
"""
|
|
Create a test mapping using the Python parser (working implementation)
|
|
Then import it into GeViSet to verify it works
|
|
"""
|
|
import sys
|
|
sys.path.append(r'C:\DEV\COPILOT_codex')
|
|
|
|
from geviset_parser import load_set, save_set
|
|
from pathlib import Path
|
|
|
|
# Load the current configuration
|
|
set_file = Path(r"C:\DEV\COPILOT_codex\TestMKS.set")
|
|
tree = load_set(set_file)
|
|
|
|
# Navigate to MappingRules
|
|
mapping_rules = None
|
|
for child in tree.get("children", []):
|
|
if child.get("name") == "MappingRules" and child.get("type") == "folder":
|
|
mapping_rules = child
|
|
break
|
|
|
|
if not mapping_rules:
|
|
print("ERROR: MappingRules folder not found!")
|
|
sys.exit(1)
|
|
|
|
print(f"Found MappingRules with {len(mapping_rules.get('children', []))} existing rules")
|
|
|
|
# Find the highest rule ID
|
|
max_id = 0
|
|
for child in mapping_rules.get("children", []):
|
|
if child.get("type") == "folder":
|
|
try:
|
|
rule_id = int(child.get("name", "0"))
|
|
if rule_id > max_id:
|
|
max_id = rule_id
|
|
except:
|
|
pass
|
|
|
|
new_id = str(max_id + 1)
|
|
print(f"Creating new rule with ID: {new_id}")
|
|
|
|
# Create a new mapping rule with COMPLETE structure (matching working mappings)
|
|
new_rule = {
|
|
"type": "folder",
|
|
"name": new_id,
|
|
"children": [
|
|
# FILTERS (boolean fields starting with '.')
|
|
{"type": "bool", "name": ".SwitchMode", "value": False},
|
|
{"type": "bool", "name": ".VideoInput", "value": True}, # Enable VideoInput
|
|
{"type": "bool", "name": ".VideoOutput", "value": False},
|
|
|
|
# Caption and flags
|
|
{"type": "string", "name": "@", "value": "PYTHON_TEST_MAPPING"},
|
|
{"type": "int32", "name": "@!", "value": 0},
|
|
{"type": "int32", "name": "@@", "value": 0},
|
|
|
|
# Rules folder (output actions)
|
|
{
|
|
"type": "folder",
|
|
"name": "Rules",
|
|
"children": [
|
|
# Output action 1
|
|
{
|
|
"type": "folder",
|
|
"name": "0",
|
|
"children": [
|
|
{"type": "string", "name": "@", "value": "Test GCoreDataBase"},
|
|
{"type": "int32", "name": "@!", "value": 0},
|
|
{"type": "int32", "name": "@@", "value": 0},
|
|
{"type": "string", "name": "GCoreAction", "value": "GCoreDataBase"},
|
|
{"type": "string", "name": "GCoreServer", "value": ""}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
|
|
# ACTUAL FIELD VALUES (after Rules)
|
|
{"type": "int32", "name": "SwitchMode", "value": 0},
|
|
{"type": "int32", "name": "VideoInput", "value": 101027},
|
|
{"type": "int32", "name": "VideoOutput", "value": 0}
|
|
]
|
|
}
|
|
|
|
# Add to MappingRules
|
|
mapping_rules["children"].append(new_rule)
|
|
|
|
# Save to a new file
|
|
output_file = Path(r"C:\DEV\COPILOT\TestMKS_with_python_test.set")
|
|
save_set(tree, output_file)
|
|
|
|
print(f"\nSUCCESS! Created new .set file with test mapping:")
|
|
print(f" Output file: {output_file}")
|
|
print(f" Rule ID: {new_id}")
|
|
print(f" Caption: PYTHON_TEST_MAPPING")
|
|
print(f" VideoInput: 101027")
|
|
print(f"\nNow import this .set file into GeViSet and check if you can see 'PYTHON_TEST_MAPPING'")
|