Skip to content

Commit

Permalink
chore: refactor meta model
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianBirchler committed Aug 6, 2024
1 parent 81b376c commit e584058
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 42 deletions.
68 changes: 41 additions & 27 deletions elements.gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ type Element interface {
}

type OpenDRIVE struct {
Header *Header
Road *Road
Controller *Controller
JunctionCrossing *JunctionCrossing
JunctionDefault *JunctionDefault
JunctionDirect *JunctionDirect
JunctionVirtual *JunctionVirtual
JunctionGroup *JunctionGroup
Station *Station
Header *Header
Road *Road
JunctionController *JunctionController
JunctionCrossing *JunctionCrossing
JunctionDefault *JunctionDefault
JunctionDirect *JunctionDirect
JunctionVirtual *JunctionVirtual
JunctionGroup *JunctionGroup
Station *Station
}

type Header struct {
Expand Down Expand Up @@ -95,7 +95,7 @@ type Road struct {
Lanes *Lanes
Objects *Objects
Signals *Signals
Surface *Surface
RoadSurface *RoadSurface
Railroad *Railroad
}

Expand Down Expand Up @@ -520,7 +520,7 @@ type Object struct {
ParkingSpace *ParkingSpace
Markings *Markings
Borders *Borders
Surface *Surface
RoadSurface *RoadSurface
Skeleton *Skeleton
}

Expand Down Expand Up @@ -563,7 +563,7 @@ type Borders struct {
Border *Border
}

type Surface struct {
type RoadSurface struct {
RoadSurfaceCRG *RoadSurfaceCRG
}

Expand Down Expand Up @@ -667,7 +667,13 @@ type SideTrack struct {
type Partner struct {
}

type Controller struct {
type JunctionController struct {
// ID of the controller
Id string
// Sequence number (priority) of this controller with respect to other controllers in the same junction
Sequence int
// Type of control for this junction. Free text, depending on the application.
Type string
Control *Control
}

Expand All @@ -677,8 +683,8 @@ type Control struct {
type JunctionCrossing struct {
JunctionRoadSection *JunctionRoadSection
Priority *Priority
Controller *Controller
Surface *Surface
JunctionController *JunctionController
RoadSurface *RoadSurface
RoadPlanView *RoadPlanView
}

Expand Down Expand Up @@ -710,8 +716,8 @@ type JunctionDefault struct {
Connection *Connection
CrossPath *CrossPath
Priority *Priority
Controller *Controller
Surface *Surface
JunctionController *JunctionController
RoadSurface *RoadSurface
RoadPlanView *RoadPlanView
JunctionBoundary *JunctionBoundary
JunctionElevationGrid *JunctionElevationGrid
Expand Down Expand Up @@ -828,12 +834,12 @@ type JunctionDirect struct {
// Name of the junction. May be chosen freely.
Name string
// Common junctions are of type 'default'. If the attribute is not specified, the junction type is 'default'. This attribute is mandatory for all other junction types.
Type string
Connection *Connection
Priority *Priority
Controller *Controller
Surface *Surface
RoadPlanView *RoadPlanView
Type string
Connection *Connection
Priority *Priority
JunctionController *JunctionController
RoadSurface *RoadSurface
RoadPlanView *RoadPlanView
}

type JunctionVirtual struct {
Expand All @@ -855,8 +861,8 @@ type JunctionVirtual struct {
JunctionConnectionVirtual *JunctionConnectionVirtual
CrossPath *CrossPath
Priority *Priority
Controller *Controller
Surface *Surface
JunctionController *JunctionController
RoadSurface *RoadSurface
RoadPlanView *RoadPlanView
}

Expand Down Expand Up @@ -891,10 +897,18 @@ type JunctionConnectionVirtual struct {
}

type JunctionGroup struct {
JunctionReference *JunctionReference
// Unique ID within database
Id string
// Name of the junction group. May be chosen freely.
Name string
// Type of junction group
Type string
JunctionGroupJunctionReference *JunctionGroupJunctionReference
}

type JunctionReference struct {
type JunctionGroupJunctionReference struct {
// ID of the junction
Junction string
}

type Station struct {
Expand Down
65 changes: 50 additions & 15 deletions elements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ elements:
children:
- name: header
- name: road
- name: controller
- name: junctionController
- name: junctionCrossing
- name: junctionDefault
- name: junctionDirect
Expand Down Expand Up @@ -126,7 +126,7 @@ elements:
- name: lanes
- name: objects
- name: signals
- name: surface
- name: roadSurface
- name: railroad
- name: link
children:
Expand Down Expand Up @@ -735,7 +735,7 @@ elements:
- name: parkingSpace
- name: markings
- name: borders
- name: surface
- name: roadSurface
- name: skeleton
- name: repeat
- name: outline
Expand All @@ -759,7 +759,8 @@ elements:
- name: borders
children:
- name: border
- name: surface
- name: roadSurface
xmlTag: surface
children:
- name: roadSurfaceCRG
- name: skeleton
Expand Down Expand Up @@ -856,7 +857,21 @@ elements:
- name: mainTrack
- name: sideTrack
- name: partner
- name: controller
- name: junctionController
xmlTag: controller
attributes:
- name: id
type: string
use: required
description: "ID of the controller"
- name: sequence
type: int
use: optional
description: "Sequence number (priority) of this controller with respect to other controllers in the same junction"
- name: type
type: string
use: optional
description: "Type of control for this junction. Free text, depending on the application."
children:
- name: control
- name: control
Expand All @@ -865,8 +880,8 @@ elements:
children:
- name: junctionRoadSection
- name: priority
- name: controller
- name: surface
- name: junctionController
- name: roadSurface
- name: roadPlanView
- name: junctionRoadSection
xmlTag: roadSection
Expand Down Expand Up @@ -916,8 +931,8 @@ elements:
- name: connection
- name: crossPath
- name: priority
- name: controller
- name: surface
- name: junctionController
- name: roadSurface
- name: roadPlanView
- name: junctionBoundary
- name: junctionElevationGrid
Expand Down Expand Up @@ -1110,8 +1125,8 @@ elements:
children:
- name: connection
- name: priority
- name: controller
- name: surface
- name: junctionController
- name: roadSurface
- name: roadPlanView
- name: junctionVirtual
xmlTag: junction type='virtual'
Expand Down Expand Up @@ -1149,8 +1164,8 @@ elements:
- name: junctionConnectionVirtual
- name: crossPath
- name: priority
- name: controller
- name: surface
- name: junctionController
- name: roadSurface
- name: roadPlanView
- name: junctionConnectionDefault
xmlTag: connection type='default'
Expand Down Expand Up @@ -1203,9 +1218,29 @@ elements:
- name: successor
- name: junctionConnectionLaneLink
- name: junctionGroup
xmlTag: junctionGroup
attributes:
- name: id
type: string
use: required
description: "Unique ID within database"
- name: name
type: string
use: optional
description: "Name of the junction group. May be chosen freely."
- name: type
type: string
use: required
description: "Type of junction group"
children:
- name: junctionReference
- name: junctionReference
- name: junctionGroupJunctionReference
- name: junctionGroupJunctionReference
xmlTag: junctionReference
attributes:
- name: junction
type: string
use: required
description: "ID of the junction"
- name: station
children:
- name: platform
Expand Down

0 comments on commit e584058

Please sign in to comment.