4.5 KiB
4.5 KiB
RobotNet10.MapManager
Overview
Entity Framework Core module for managing AGV/AMR maps according to VDMA LIF (Layout Interchange Format) 1.0.0 standard.
Status
✅ Phase 1 Complete: Database Foundation
- Entity classes generated (10 entities)
- DbContext created with full configurations
- EF Core packages installed (v9.0.0)
- Design documentation finalized
Entity Classes
Hierarchy (Layout → Version → Level)
- Layout.cs - Root entity (Building/Facility)
- LayoutVersion.cs - Version history
- LayoutLevel.cs - Floors/Levels
Master Data
- VehicleType.cs - Vehicle types (AMR-T800, etc.)
Map Elements
- Node.cs - Waypoints (VDMA LIF compliant)
- Edge.cs - Paths (with EdgeName/EdgeDescription extensions)
- Station.cs - Interaction points
Junction Tables
- StationInteractionNode.cs - Station ↔ Node mapping
- NodeVehicleProperty.cs - Node × VehicleType properties
- EdgeVehicleProperty.cs - Edge × VehicleType properties
Database Context
- MapDbContext.cs - EF Core DbContext with all configurations
Key Features
VDMA LIF Compliance
- ✅ 100% adherence to lif-schema.json
- ✅ Proper JSON serialization for import/export
- ✅ Support for vehicleTypeNodeProperties and vehicleTypeEdgeProperties
Version Control
- ✅ Multiple versions per layout
- ✅ Only ONE active version per layout
- ✅ Active version is READ-ONLY
Multi-Level Support
- ✅ Multiple levels (floors) per version
- ✅ LevelOrder for flexible sorting
- ✅ Each level exports as separate layout entry in JSON
VehicleType Customization
- ✅ Per-vehicle properties for nodes and edges
- ✅ Actions stored as JSON in NodeVehicleProperties
- ✅ NURBS trajectory support in EdgeVehicleProperties
Database Schema
Layouts (10 tables)
├── Layouts → LayoutVersions → LayoutLevels
├── VehicleTypes
├── Nodes (with NodeVehicleProperties)
├── Edges (with EdgeVehicleProperties)
└── Stations (with StationInteractionNodes)
Total Indexes: ~25 (PKs, FKs, composite indexes)
Next Steps
Phase 2: Migrations
# Add EF Core tools (if not installed)
dotnet tool install --global dotnet-ef
# Create initial migration
dotnet ef migrations add InitialCreate --project srcs/RobotNet10/Commons/RobotNet10.MapManager
# Update database
dotnet ef database update --project srcs/RobotNet10/Commons/RobotNet10.MapManager
Phase 3: Import/Export Services
- Create VDMA LIF JSON models
- Implement Export service (DB → JSON)
- Implement Import service (JSON → DB)
- Validation against lif-schema.json
Phase 4: Integration
- API endpoints for MapEditor
- Version management
- VehicleType management
Documentation
- DATABASE_DESIGN.md - Complete schema documentation
- docs/MapEditor/V2-DangNV/DATABASE_DESIGN_DISCUSSION.md - Design discussion summary
- lif-schema.json - VDMA LIF JSON schema reference
Configuration
Connection Strings
SQL Server:
"ConnectionStrings": {
"MapManagerDb": "Server=localhost;Database=RobotNetMaps;Trusted_Connection=True;TrustServerCertificate=True;"
}
SQLite:
"ConnectionStrings": {
"MapManagerDb": "Data Source=robotnet_maps.db"
}
Program.cs
using Microsoft.EntityFrameworkCore;
using RobotNet10.MapManager.Data;
var builder = WebApplication.CreateBuilder(args);
// Add MapDbContext
builder.Services.AddDbContext<MapDbContext>(options =>
options.UseSqlServer(builder.Configuration.GetConnectionString("MapManagerDb"))
// or options.UseSqlite(builder.Configuration.GetConnectionString("MapManagerDb"))
);
var app = builder.Build();
app.Run();
Scale Targets
- 50 Layouts
- 10 Versions per Layout
- 10 Levels per Version
- 1,000 Nodes per Level
- 999 Edges per Level
- 10 VehicleTypes
Total: ~5M Nodes, ~5M Edges
Performance Optimizations
- ✅ Strategic indexing (25+ indexes)
- ✅ Designed for partitioning (by LayoutId or LevelId)
- ✅ Caching strategy identified
- ✅ Pagination support planned
References
- VDMA LIF Specification: FuI_Guideline_LIF_GB_final.pdf
- Entity Framework Core: https://docs.microsoft.com/ef/core/
- VDMA LIF Schema: lif-schema.json
Version: 1.0
Date: 2024-11-26
Status: Phase 1 Complete ✅