MetaCase Homepage
Forum Home Forum Home > > MetaEdit+
  New Posts New Posts RSS Feed - Constrain port to be in one binding
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Constrain port to be in one binding

 Post Reply Post Reply
Author
Message
jkouwer View Drop Down
Major Contributor
Major Contributor


Joined: 08.Mar.2010
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote jkouwer Quote  Post ReplyReply Direct Link To This Post Topic: Constrain port to be in one binding
    Posted: 04.Jun.2010 at 10:23
Hello,

I would like to restrict the number of possible bindings for my port to exactly one. Is this possible? I can find how to constrain objects to be part in just one relationship, but I cannot find how to do this for the ports of an object.

I'm trying to make a cable diagram editor and each physical port of the computer can handle just one cable, so...

Regards,
Jeroen Kouwer
Back to Top
stevek View Drop Down
MetaCase
MetaCase
Avatar

Joined: 11.Mar.2008
Points: 643
Post Options Post Options   Thanks (0) Thanks(0)   Quote stevek Quote  Post ReplyReply Direct Link To This Post Posted: 04.Jun.2010 at 12:35
Hello Jeroen,
 
You can edit the symbol for the object or the role, so that it shows an error symbol or message when the port is used multiple times. E.g. assuming ports named port1, port2 etc., put a red exclamation mark (or whatever) in the object symbol next to port1, and give it a conditional:
   do ~()#() where id = 'port1' { 'X' }
Show the symbol if the output of that is equal to XX, XXX etc. (wildcard comparison with XX*)
 
In future versions we're looking at adding more hard constraints for cases like this.
 
Cheers,
Steve
Back to Top
jkouwer View Drop Down
Major Contributor
Major Contributor


Joined: 08.Mar.2010
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote jkouwer Quote  Post ReplyReply Direct Link To This Post Posted: 04.Jun.2010 at 14:56
Hello Steve,

That did the job. Now I have visual feedback (indeed, the red exclamation mark) when there are too many connections on one port.

Thanks,
Jeroen KOuwer
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.05
Copyright ©2001-2022 Web Wiz Ltd.

This page was generated in 0.036 seconds.