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:
Administrator
2025-12-31 18:10:54 +01:00
commit 14893e62a5
4189 changed files with 1395076 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="." />
</assemblyBinding>
<loadFromRemoteSources enabled="true"/>
</runtime>
</configuration>

View File

@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{C9B6E0D3-9D5F-4E2B-8F7C-6A4D9B2E1F5A}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>GeViSoftConfigReader</RootNamespace>
<AssemblyName>GeViSoftConfigReader</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>C:\GEVISOFT\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="GeViProcAPINET_4_0, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\GEVISOFT\GeViProcAPINET_4_0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
<HintPath>packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> <ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,193 @@
using System;
using System.IO;
using System.Threading;
using System.Windows.Forms;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using GEUTEBRUECK.GeViSoftSDKNET.ActionsWrapper;
using GEUTEBRUECK.GeViSoftSDKNET.ActionsWrapper.ActionDispatcher;
using GEUTEBRUECK.GeViSoftSDKNET.ActionsWrapper.SystemActions;
using GEUTEBRUECK.GeViSoftSDKNET.ActionsWrapper.DataBaseQueries;
using GEUTEBRUECK.GeViSoftSDKNET.ActionsWrapper.DataBaseAnswers;
namespace GeViSoftConfigReader
{
public class MainForm : Form
{
private GeViDatabase database;
private string[] args;
public MainForm(string[] arguments)
{
this.args = arguments;
this.Shown += MainForm_Shown;
this.WindowState = FormWindowState.Minimized;
this.ShowInTaskbar = false;
this.Size = new System.Drawing.Size(1, 1);
}
private void MainForm_Shown(object sender, EventArgs e)
{
this.Hide();
// Global exception handler - catch EVERYTHING
try
{
File.WriteAllText(@"C:\GEVISOFT\SHOWN_EVENT_FIRED.txt", "Event fired at " + DateTime.Now);
RunExport();
File.WriteAllText(@"C:\GEVISOFT\RUNEXPORT_COMPLETED.txt", "RunExport completed at " + DateTime.Now);
}
catch (Exception ex)
{
try
{
File.WriteAllText(@"C:\GEVISOFT\GLOBAL_EXCEPTION.txt",
"GLOBAL EXCEPTION at " + DateTime.Now + Environment.NewLine +
"Message: " + ex.Message + Environment.NewLine +
"Type: " + ex.GetType().FullName + Environment.NewLine +
"Stack: " + ex.StackTrace + Environment.NewLine +
"ToString: " + ex.ToString());
}
catch { /* Ultimate fallback - can't even write error */ }
}
finally
{
// Give file operations time to complete before exiting
System.Threading.Thread.Sleep(2000);
Application.Exit();
}
}
private void RunExport()
{
string logFile = @"C:\GEVISOFT\GeViSoftConfigReader.log";
void Log(string message)
{
try
{
string logLine = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ": " + message + Environment.NewLine;
File.AppendAllText(logFile, logLine);
// Also force flush by reopening
System.Threading.Thread.Sleep(10);
}
catch (Exception ex)
{
File.WriteAllText(@"C:\GEVISOFT\log_error.txt",
"Log Error at " + DateTime.Now + Environment.NewLine + ex.ToString());
}
}
try
{
// Write immediate confirmation that we entered this method
File.WriteAllText(@"C:\GEVISOFT\runexport_started.txt",
"RunExport started at " + DateTime.Now + Environment.NewLine +
"Args count: " + (args != null ? args.Length.ToString() : "null"));
System.Threading.Thread.Sleep(50); // Ensure file write completes
// Delete old log if exists
if (File.Exists(logFile))
{
try { File.Delete(logFile); } catch { }
}
Log("=== GeViSoft Configuration Reader Started ===");
Log("Working Directory: " + Directory.GetCurrentDirectory());
Log("Application Path: " + Application.ExecutablePath);
// Parse arguments with defaults
string hostname = "localhost";
string username = "sysadmin";
string password = "masterkey";
string outputFile = @"C:\GEVISOFT\geviSoft_config.json"; // Explicit full path
if (args != null && args.Length >= 1) hostname = args[0];
if (args != null && args.Length >= 2) username = args[1];
if (args != null && args.Length >= 3) password = args[2];
if (args != null && args.Length >= 4) outputFile = args[3];
// Ensure output file has full path
if (!Path.IsPathRooted(outputFile))
{
outputFile = Path.Combine(@"C:\GEVISOFT", outputFile);
}
Log($"Server: {hostname}, User: {username}, Output: {outputFile}");
Log("Creating database connection...");
File.WriteAllText(@"C:\GEVISOFT\before_gevidatabase.txt",
"About to create GeViDatabase at " + DateTime.Now);
database = new GeViDatabase();
File.WriteAllText(@"C:\GEVISOFT\after_gevidatabase.txt",
"GeViDatabase created at " + DateTime.Now);
Log("GeViDatabase object created successfully");
Log($"Calling Create({hostname}, {username}, ***)");
database.Create(hostname, username, password);
Log("Create() completed, calling RegisterCallback()");
database.RegisterCallback();
Log("RegisterCallback() completed, calling Connect()");
GeViConnectResult result = database.Connect();
Log($"Connect() returned: {result}");
if (result != GeViConnectResult.connectOk)
{
Log($"ERROR: Connection failed: {result}");
File.WriteAllText(@"C:\GEVISOFT\connection_failed.txt",
"Connection failed: " + result.ToString());
return;
}
Log("Connected successfully!");
JObject config = new JObject();
config["ServerInfo"] = new JObject
{
["Hostname"] = hostname,
["Connected"] = true,
["ConnectionResult"] = result.ToString(),
["Time"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
};
Log("Saving configuration to: " + outputFile);
string jsonContent = config.ToString(Formatting.Indented);
File.WriteAllText(outputFile, jsonContent);
Log($"File written successfully. Size: {new FileInfo(outputFile).Length} bytes");
Log($"SUCCESS! Config saved to: {outputFile}");
database.Disconnect();
database.Dispose();
Log("Database disconnected and disposed");
}
catch (Exception ex)
{
string errorLog = @"C:\GEVISOFT\RUNEXPORT_ERROR.txt";
try
{
string errorInfo = "=== RUNEXPORT EXCEPTION ===" + Environment.NewLine +
"Time: " + DateTime.Now + Environment.NewLine +
"Message: " + ex.Message + Environment.NewLine +
"Type: " + ex.GetType().FullName + Environment.NewLine +
"Stack Trace:" + Environment.NewLine + ex.StackTrace + Environment.NewLine +
Environment.NewLine + "Full ToString:" + Environment.NewLine + ex.ToString();
File.WriteAllText(errorLog, errorInfo);
// Try to log it too
try { Log("EXCEPTION: " + ex.Message); } catch { }
}
catch
{
// Last resort - write minimal error
try { File.WriteAllText(@"C:\GEVISOFT\ERROR_WRITING_ERROR.txt", "Failed to write error log"); } catch { }
}
}
}
}
}

View File

@@ -0,0 +1,16 @@
using System;
using System.Windows.Forms;
namespace GeViSoftConfigReader
{
class Program
{
[STAThread]
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm(args));
}
}
}

View File

@@ -0,0 +1,18 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("GeViSoftConfigReader")]
[assembly: AssemblyDescription("GeViSoft Configuration Reader and JSON Exporter")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("GeViSoftConfigReader")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("c9b6e0d3-9d5f-4e2b-8f7c-6a4d9b2e1f5a")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
</packages>