Skip to content

Conversation

@josihoppe
Copy link

added js check to see if the nodes are connected before saving

Since I solved this on the client Side the nodes don't know what kind of type they are and I needed to base the validation of of their names. Right now I have implemented the validation with this logic:

  • name that starts with "bus": need to have at least 1 input and 1 output
  • name that ends with "demand": need to have at least 1 input
  • the rest (which I think are mostly sources): need to have at least

I am not sure if like Conversion nodes need to be handled differently, but more diverse checks could be implemented.

Copy link

@paulapreuss paulapreuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that for components with in- and outputs it only checks for outputs (it will still save if the component has only an input set). This also applies to buses, although those even have an explicit check condition, I think the condition might not be called properly.

The most important check though is that no component gets lost without any connections, and that seems to be working fine :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement check to avoid starting a simulation with unconnected components

3 participants