Skip to content

Allow to lock ports in nodes #634

@louisgreiner

Description

@louisgreiner

Description

Type Size (weeks)
Enabler 3

Meta issue: #551

Enabler for:

The idea is to provide this data model evolution for Port.locked (boolean).

The second step is to make the existing ports sorting automated algorithm take the potential locked ports into account and order all the other ports of the network graphic while ignoring the already assigned places.

Acceptance Criteria

  • New attribute: Port.locked
    • Import / export take this new attribute into account
  • Existing ports sorting algorithm ignores the already assigned ports

Implementation Plan

export interface PortDto {
	id: number; // unique identifier
	positionIndex: number; // position index starts at 0, ... for each PortAlignment group
	positionAlignment: PortAlignment; // defines corresponding PortAlignment group within the node
	trainrunSectionId: number; // reference to the connected trainrun section
	locked: boolean; // !! NEW FIELD !! default value is false
}
  "nodes": [
    {
      "id": 128,
      "betriebspunktName": "Lausanne",
      "fullName": "Lausanne",
      "positionX": -3072,
      "positionY": 544,
      "ports": [
        {
          "id": 1207,
          "trainrunSectionId": 596,
          "positionIndex": 0,
          "positionAlignment": 2,
          "locked": true
        },
  • Update the existing algorithm to ignore all the already assigned locked ports
    • some ideas (dunno if good or bad): filter the ports on .locked value and sort only the remaining ports ; or if port is locked, try shift the next ports etc.
  • Update import / export method to take Port.locked into account
  • Update copy / duplicate features to take Port.locked into account
  • Update tests files (import -> export -> replace)

Definition of Ready

  • PO/UX-UI

    • ACs are clear and have been reviewed by another refiner
  • Technical

    • Implementation plan has been written and validated by another maintainer
  • General

    • Validated by Adrian

Metadata

Metadata

Assignees

Labels

area:data-modelData models and structuresarea:servicesServices, helpers, utils and i18n ("logical" stuff)design-documentThis is the main document that a developer uses to implement a feature

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions