Files
I150/srcs/RobotNet10/Commons/RobotNet10.MapManager
2026-07-03 16:37:12 +07:00
..
2026-07-03 16:37:12 +07:00
2026-07-03 16:37:12 +07:00
2026-07-03 16:37:12 +07:00
2026-07-03 16:37:12 +07:00
2026-07-03 16:37:12 +07:00
2026-07-03 16:37:12 +07:00
2026-07-03 16:37:12 +07:00
2026-07-03 16:37:12 +07:00
2026-07-03 16:37:12 +07:00

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)

  1. Layout.cs - Root entity (Building/Facility)
  2. LayoutVersion.cs - Version history
  3. LayoutLevel.cs - Floors/Levels

Master Data

  1. VehicleType.cs - Vehicle types (AMR-T800, etc.)

Map Elements

  1. Node.cs - Waypoints (VDMA LIF compliant)
  2. Edge.cs - Paths (with EdgeName/EdgeDescription extensions)
  3. Station.cs - Interaction points

Junction Tables

  1. StationInteractionNode.cs - Station ↔ Node mapping
  2. NodeVehicleProperty.cs - Node × VehicleType properties
  3. 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


Version: 1.0
Date: 2024-11-26
Status: Phase 1 Complete