OpenModelica


Forgot password? | Forgot username? | Register

Restricting connection possibilities in OMEdit

Restricting connection possibilities in OMEdit


In short, I'm not able (using OMEdit) to prohibit the connection of objects of different underlying types nor the ability to prohibit the connection of inputs to inputs nor outputs to outputs.

Here are the details.

The graphic annotations aren't included in the code below as they don't really matter (unless you're trying to actually demonstrate the behavior in OMEdit, I can supply an example if necessary)... I think this is mostly a misunderstanding on my part, and thanks for bearing with me.

Let's suppose that I define 2 blocks called C1 and C2...

  block C1
    ... a bunch of variables defined here (some of which may be other class instances)
  end C1

  block C2
    ... a bunch of variables defined here different from C1 (some of which may be other class instances)
  end C2

Then I define 2 pseudo-connector classes each of which uses the above. These classes/blocks are defined in order to provide icon graphics for each (which are not included here)...

  block C1Connector
    C1 class1Entity;
  end C1Connector;

  block C2Connector
    C2 class2Entity;
  end C2Connector;

Now I declare the real connector objects:

  connector C1In = input C1Connector;
  connector C1Out = output C1Connector;
  connector C2In = input C2Connector;
  connector C2Out = output C2Connector;


Finally, I create a couple of simple component blocks that include all 4 of these connectors...

  block Component1
    C1In c1In;
    C1Out c1Out
    C2In c2In;
    C2Out c2Out
  end Component1

  block Component2
    C1In c1In;
    C1Out c1Out
    C2In c2In;
    C2Out c2Out
  end Component2
   
My hope is that I am not able to interconnect a C1* connector to a C2* connector, nor a *In connector to a *In connector nor a *Out connector to a *Out connector. Unfortunately, I am able to do so.

Now, I drag these instances of Component1 and Component2 onto the OMEdit canvas. Selecting the OMEdit connect button, I can now click on any connector shown for Component1 and connect it to any connector of Component2. Why should I be able to connect across the connector type classes that also allow input-input and output-output connections?

What am I missing here?

Administrator has disabled public posting. Please login or register in order to proceed.

Re: Restricting connection possibilities in OMEdit

We don't check for types when making the connection. You will get the errors when you instantiate or translate the model.
Perhaps with the new faster frontend we can check for such connections.

Adeel.

Administrator has disabled public posting. Please login or register in order to proceed.

Re: Restricting connection possibilities in OMEdit

Thanks for the explanation, that helps.

Unfortunately, a novice (like me) building a model using OMEdit is going to proceed by dragging a bunch of components into a new model and then create connections. Unless one actually checks the model each time after a connection is made, all connection errors are going to be unrecognized until such time that the model is manually checked or attempted to be simulated.  Prohibiting improper connections in the graphical editor in the first place  would make for a far better experience than the current behavior. Further, if a model is created in OMEdit with improper connections, even double clicking its icon within a library will show it in the OMEdit canvas (is this not instantiation?) but any connection errors are not flagged by this operation.

Edited by: DanField - Dec-06-18 15:52:57
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Restricting connection possibilities in OMEdit

> Unfortunately, a novice (like me) building a model using OMEdit is going to proceed by dragging a bunch of components into a new model and then create connections. Unless one actually checks the model each time after a connection is made, all connection errors are going to be unrecognized until such time that the model is manually checked or attempted to be simulated.  Prohibiting improper connections in the graphical editor in the first place  would make for a far better experience than the current behavior.

Yeah we use to have that functionality. But it was way too slow for real models. As I said earlier we can have that functionality possible with the new frontend.

> Further, if a model is created in OMEdit with improper connections, even double clicking its icon within a library will show it in the OMEdit canvas (is this not instantiation?) but any connection errors are not flagged by this operation.

No, that is not instantiation.

Adeel.

Administrator has disabled public posting. Please login or register in order to proceed.

Re: Restricting connection possibilities in OMEdit

I sort-of understand this decision, but it has removed something important for novices. Perhaps there could be an OMEdit option that enforces connection consistency checking for newbies like me or be disabled for more experienced users? The mentioned new faster front-end sounds promising for a number of reasons related to some other of my issues as well, but it doesn't promise a solution for this particular problem nor do I see when it may be realized.

Edited by: DanField - Dec-07-18 22:13:43
Administrator has disabled public posting. Please login or register in order to proceed.
There are 0 guests and 0 other users also viewing this topic
You are here: