Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request]: Node (Betriebspunkt / Operational point) name unicity #205

Open
3 tasks done
louisgreiner opened this issue Aug 1, 2024 · 2 comments
Open
3 tasks done
Labels
help wanted Extra attention is needed

Comments

@louisgreiner
Copy link
Collaborator

louisgreiner commented Aug 1, 2024

Preflight Checklist

Request type

Request for enhancement of a component (Node constructor).

Functionality

Context

According to business structures, a Node BP is unique.

However, currently a Node (Betriebspunkt or BP in german, Operational Point or OP in english for business) can have the same name and shortname, for instance :

  • when we create 2 nodes without renaming any of it
    image
  • or just when we rename one with the informations of an existing one
    image

In the code, the nodes are identified by the id, but for the user, who doesn't have access to the ids, it can be confusing, especially in the graphic timetable (Streckengrafik)

Solution

User can choose (or not) to enable node unicity at any time in a scenario.

It could be a box to check in the Settings menu.

The box would be only enabled (or visible) when all the nodes of the variants are unique. If not, the box is disabled and a message explains why on mouse hover (or simply not visible).

Consequence : if node unicity is true, when a user creates a node that has the same name / shortname than another one (open discussion), we can:

  • create the new node with something like "{name}-1" if another copy exists ("...-2" if another one etc...)
  • cancel creation
  • show error message for user understanding

Questions

  • Do we want the combinaison of name and shortname to be unique ? Or only name ? Or only shortname ?

Examples

Invalid combinations of nodes:

[
  { "fullName": "Zuerich", "betriebspunktName": "ZUE" },
  { "fullName": "Zuerich", "betriebspunktName": "ZUE" },
  { "fullName": "Paris-Gare-de-Lyon", "betriebspunktName": "PLY/BV" },
  { "fullName": "Paris-Gare-de-Lyon", "betriebspunktName": "PLY/BV" }
]

Valid combinations of nodes:

[
  { "fullName": "Zuerich", "betriebspunktName": "ZUE" },
  { "fullName": "Zürich", "betriebspunktName": "ZUE" },
  { "fullName": "Paris-Gare-de-Lyon", "betriebspunktName": "PLY/BV" },
  { "fullName": "Paris-Gare-de-Lyon", "betriebspunktName": "PLY/AG" }
]

Link to design proposal file

No response

@aiAdrian
Copy link
Collaborator

aiAdrian commented Aug 19, 2024

General

It might be a good idea to only display the "unique" checkbox if this option is activated in the application's environment, otherwise, it adds more complexity to the Netzgrafik-Editor with respect to the standard way of working, which should be avoided. In many applications, such as quickly trying out ideas, it does not matter if the node names are unique because the created data will not be shared with third parties.

Answer question - what should be unique

I recommend that only the short name be unique, such as 0085BN (0085 Switzerland / BN: Bern). However, we could have more than one "Bern" – How should the operation point be encoded: encodable country code + short name / or unique UIC operation point code.

Validation (current version) - what might improve usability of Netzgrafik-Editor

In the current version, the user can still encode the node's short name to be unique, but there is no double-check/validation available. This missing validation of uniqueness makes the Netzgrafik-Editor easy to use but quite complicated for exchanging data with third parties. Thus it might be worthfull having a validator in the current system, which "flags" all node's short names that are not unique with a warning element - but allow them to exist.

Next steps

  • Refine the request

@aiAdrian aiAdrian added the help wanted Extra attention is needed label Aug 19, 2024
@munterfi
Copy link
Member

Having unique and mandatory operational point names on nodes would be very helpful, especially when converting the network graphic export into different timetable formats, which often involve coordinate lookups.

To enhance consistency and accuracy I would propose the following changes:

  • The operational point name should be a mandatory field.
  • Implement input validations, such as restricting trailing whitespaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants