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>
7.7 KiB
Quick Start Guide - GeViScope Configuration Reader
What Was Created
A complete C# solution that reads GeViScope configuration from the server and exports it to JSON - no binary .set file parsing needed!
Files Created
C:\DEV\COPILOT\geutebruck-api\GeViScopeConfigReader\
├── GeViScopeConfigReader.csproj - Project file
├── Program.cs - Main application code
├── README.md - Detailed documentation
└── QUICK_START.md - This file
How It Works
Instead of parsing the binary .set files, this tool:
- Connects to the GeViScope server using the official SDK
- Reads the configuration registry (like Windows Registry)
- Converts the tree structure to JSON
- Exports to a human-readable file
Building the Project
Prerequisites
Install one of these:
- Option A: Visual Studio 2019/2022 with .NET desktop development
- Option B: .NET SDK 6.0+ with .NET Framework 4.8 targeting pack
Build Steps
Using Visual Studio:
- Install Visual Studio if not already installed
- Open solution:
C:\DEV\COPILOT\geutebruck-api\geutebruck-api.sln - Right-click
GeViScopeConfigReaderproject → Build
Using Command Line:
# Install .NET SDK first if needed
cd C:\DEV\COPILOT\geutebruck-api\GeViScopeConfigReader
dotnet build
Or use MSBuild:
"C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe" GeViScopeConfigReader.csproj
Running the Tool
Step 1: Start GeViScope Server
cd "C:\Program Files (x86)\GeViScopeSDK\BIN"
GSCServer.exe
Leave this running in the background.
Step 2: Run the Configuration Reader
cd C:\DEV\COPILOT\geutebruck-api\GeViScopeConfigReader\bin\Debug\net48
GeViScopeConfigReader.exe
Or with custom settings:
GeViScopeConfigReader.exe <server> <user> <password> <output.json>
Step 3: View the JSON Output
Open geviScope_config.json in any text editor. You'll see:
{
"System": {
"MediaChannels": {
"0000": {
"Name": "Camera 1",
"Enabled": true,
"GlobalNumber": 1
}
},
"Users": {
"SysAdmin": {
"Name": "System Administrator",
"Password": "abe6db4c9f5484fae8d79f2e868a673c",
"Enabled": true
},
"aa": {
"Name": "aa",
"Password": "aabbccddeeffgghhaabbccddeeffgghh",
"Enabled": true
}
}
}
}
Why This Is Better Than Parsing .set Files
| Aspect | .set File Parsing | SDK Approach |
|---|---|---|
| Complexity | Very high (binary format) | Low (documented API) |
| Reliability | Fragile | Robust |
| Documentation | None (proprietary) | Full SDK docs |
| Format | Binary blob | Structured tree |
| Output | Partial data | Complete config |
| Updates | Easy to break | Version stable |
Example: Reading Specific Configuration
Once you have the JSON, you can easily extract what you need:
using Newtonsoft.Json.Linq;
// Load the exported configuration
var config = JObject.Parse(File.ReadAllText("geviScope_config.json"));
// Get all users
var users = config["System"]["Users"];
foreach (var user in users)
{
string username = user.Path.Split('.').Last();
string name = (string)user["Name"];
string password = (string)user["Password"];
bool enabled = (bool)user["Enabled"];
Console.WriteLine($"User: {username}");
Console.WriteLine($" Name: {name}");
Console.WriteLine($" Password Hash: {password}");
Console.WriteLine($" Enabled: {enabled}");
Console.WriteLine();
}
// Get all cameras
var cameras = config["System"]["MediaChannels"];
foreach (var camera in cameras)
{
string cameraId = camera.Path.Split('.').Last();
string name = (string)camera["Name"];
int globalNum = (int)camera["GlobalNumber"];
Console.WriteLine($"Camera [{globalNum}]: {name} (ID: {cameraId})");
}
Modifying Configuration
To write changes back to the server, use the SDK:
using Geutebruck.GeViScope.GscDBI;
// 1. Connect to server
GscServer server = new GscServer();
server.Connect("localhost", "sysadmin", "masterkey", null, null);
// 2. Create registry accessor
GscRegistry registry = server.CreateRegistry();
// 3. Read current config
GscRegistryReadRequest[] readReq = new GscRegistryReadRequest[1];
readReq[0] = new GscRegistryReadRequest("/System/Users/aa", 0);
registry.ReadNodes(readReq, null, null);
// 4. Modify a value
GscRegNode userNode = registry.FindNode("/System/Users/aa");
userNode.WriteBoolean("Enabled", false); // Disable user
// 5. Save to server
GscRegistryWriteRequest[] writeReq = new GscRegistryWriteRequest[1];
writeReq[0] = new GscRegistryWriteRequest("/System/Users/aa", 0);
registry.WriteNodes(writeReq, true); // true = permanent save
Console.WriteLine("User 'aa' has been disabled!");
// 6. Cleanup
registry.Destroy();
server.Destroy();
Real-World Use Cases
1. Backup All Configuration
GeViScopeConfigReader.exe localhost sysadmin masterkey backup_$(date +%Y%m%d).json
2. Compare Configurations
# Export from two servers
GeViScopeConfigReader.exe server1 admin pass server1_config.json
GeViScopeConfigReader.exe server2 admin pass server2_config.json
# Use any JSON diff tool
code --diff server1_config.json server2_config.json
3. Bulk User Management
// Read config
var config = ReadConfiguration();
// Disable all users except sysadmin
foreach (var userNode in GetUserNodes(registry))
{
if (userNode.Name != "SysAdmin")
{
userNode.WriteBoolean("Enabled", false);
}
}
// Save
SaveConfiguration();
4. Configuration as Code
// Define desired configuration in code
var desiredConfig = new {
Users = new[] {
new { Name = "operator1", Enabled = true },
new { Name = "operator2", Enabled = true }
},
Cameras = new[] {
new { GlobalNumber = 1, Name = "Entrance" },
new { GlobalNumber = 2, Name = "Parking Lot" }
}
};
// Apply to server
ApplyConfiguration(desiredConfig);
Next Steps
- Build the project using Visual Studio or dotnet CLI
- Run against your server to export configuration
- Examine the JSON to understand the structure
- Modify the code to add your specific features
GeViSoft Alternative
For GeViSoft configuration, you can:
Option A: Access the database directly (it's Microsoft Access format)
using System.Data.OleDb;
string connStr = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\GEVISOFT\DATABASE\GeViDB.mdb";
using (var conn = new OleDbConnection(connStr))
{
conn.Open();
var cmd = new OleDbCommand("SELECT * FROM [Users]", conn);
using (var reader = cmd.ExecuteReader())
{
while (reader.Read())
{
Console.WriteLine($"User: {reader["Username"]}");
}
}
}
Option B: Use the GeViAPI (similar to GeViScope)
using GeViAPI_Namespace;
GeViAPIClient client = new GeViAPIClient(
"MyServer", "127.0.0.1", "sysadmin", password, null, null);
client.Connect(progressCallback, this);
// Use SendQuery methods to read/write configuration
Support
For SDK documentation:
- Local:
C:\Program Files (x86)\GeViScopeSDK\Documentation\ - Text:
C:\DEV\COPILOT\SOURCES\GeViScope_SDK_text\ - Examples:
C:\Program Files (x86)\GeViScopeSDK\Examples\
For issues with this tool:
- Check README.md for troubleshooting
- Review the SDK documentation
- Examine the example code in Program.cs
Summary: Instead of struggling with binary .set files, use the official SDK to read configuration in a clean, documented way. The SDK provides everything you need! 🎉