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>
134 lines
3.9 KiB
C#
134 lines
3.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace GeViSetEditor.Core.Models
|
|
{
|
|
/// <summary>
|
|
/// Complete representation of a .set file with full structure
|
|
/// Supports JSON serialization and round-trip conversion
|
|
/// </summary>
|
|
public class SetFileComplete
|
|
{
|
|
[JsonPropertyName("version")]
|
|
public string Version { get; set; } = "1.0";
|
|
|
|
[JsonPropertyName("fileSize")]
|
|
public int FileSize { get; set; }
|
|
|
|
[JsonPropertyName("headerNullByte")]
|
|
public bool HeaderNullByte { get; set; }
|
|
|
|
[JsonPropertyName("header")]
|
|
public string Header { get; set; } = "";
|
|
|
|
[JsonPropertyName("sections")]
|
|
public List<SectionComplete> Sections { get; set; } = new();
|
|
|
|
/// <summary>
|
|
/// Original raw data (not serialized to JSON)
|
|
/// </summary>
|
|
[JsonIgnore]
|
|
public byte[] RawData { get; set; }
|
|
|
|
/// <summary>
|
|
/// Get statistics about the configuration
|
|
/// </summary>
|
|
[JsonIgnore]
|
|
public ConfigStatisticsComplete Statistics => new ConfigStatisticsComplete
|
|
{
|
|
TotalSections = Sections.Count,
|
|
TotalItems = Sections.Sum(s => s.Items.Count),
|
|
TotalRules = Sections.Sum(s => s.Rules.Count),
|
|
TotalActions = Sections.Sum(s => s.Rules.Sum(r => r.Actions.Count)),
|
|
SectionTypes = Sections.GroupBy(s => s.Name)
|
|
.ToDictionary(g => g.Key, g => g.Count())
|
|
};
|
|
}
|
|
|
|
/// <summary>
|
|
/// Complete section with all items and rules
|
|
/// </summary>
|
|
public class SectionComplete
|
|
{
|
|
[JsonPropertyName("name")]
|
|
public string Name { get; set; } = "";
|
|
|
|
[JsonPropertyName("fileOffset")]
|
|
public int FileOffset { get; set; }
|
|
|
|
[JsonPropertyName("fileEndOffset")]
|
|
public int FileEndOffset { get; set; }
|
|
|
|
[JsonPropertyName("items")]
|
|
public List<ConfigItemComplete> Items { get; set; } = new();
|
|
|
|
[JsonPropertyName("rules")]
|
|
public List<ActionRuleComplete> Rules { get; set; } = new();
|
|
|
|
[JsonIgnore]
|
|
public int ByteSize => FileEndOffset - FileOffset;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Configuration item (key-value pair)
|
|
/// </summary>
|
|
public class ConfigItemComplete
|
|
{
|
|
[JsonPropertyName("key")]
|
|
public string Key { get; set; } = "";
|
|
|
|
[JsonPropertyName("value")]
|
|
public object Value { get; set; }
|
|
|
|
[JsonPropertyName("valueType")]
|
|
public string ValueType { get; set; } = "";
|
|
|
|
[JsonPropertyName("fileOffset")]
|
|
public int FileOffset { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Action rule (trigger → actions)
|
|
/// </summary>
|
|
public class ActionRuleComplete
|
|
{
|
|
[JsonPropertyName("id")]
|
|
public int RuleId { get; set; }
|
|
|
|
[JsonPropertyName("fileOffset")]
|
|
public int FileOffset { get; set; }
|
|
|
|
[JsonPropertyName("triggers")]
|
|
public Dictionary<string, bool> Triggers { get; set; } = new();
|
|
|
|
[JsonPropertyName("actions")]
|
|
public List<string> Actions { get; set; } = new();
|
|
|
|
[JsonPropertyName("metadata")]
|
|
public Dictionary<string, object> Metadata { get; set; } = new();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Configuration statistics (Complete parser version)
|
|
/// </summary>
|
|
public class ConfigStatisticsComplete
|
|
{
|
|
[JsonPropertyName("totalSections")]
|
|
public int TotalSections { get; set; }
|
|
|
|
[JsonPropertyName("totalItems")]
|
|
public int TotalItems { get; set; }
|
|
|
|
[JsonPropertyName("totalRules")]
|
|
public int TotalRules { get; set; }
|
|
|
|
[JsonPropertyName("totalActions")]
|
|
public int TotalActions { get; set; }
|
|
|
|
[JsonPropertyName("sectionTypes")]
|
|
public Dictionary<string, int> SectionTypes { get; set; } = new();
|
|
}
|
|
}
|