Multiplicity of a part with a relay port [message #1826919] |
Mon, 04 May 2020 11:28  |
Eclipse User |
|
|
|
I am trying to make a version of the CarDoorLock example in which instead of 4 instances of Door I like to use multiplicity 4. But I cannot get it work and I suspect that the messages do not get through the relay port. Any idea what might be causing this?
|
|
|
|
|
Re: Multiplicity of a part with a relay port [message #1827080 is a reply to message #1826919] |
Wed, 06 May 2020 14:32  |
Eclipse User |
|
|
|
I took a look at the model. There is nothing obviously wrong, but there are a couple of odd things:
1) The "Door" parts are not replicated, only the centralLock.lockPort is replicated (4). Although this should not matter.
2) The "send" is done in the centralLock's 'doorsOpen' state's entry action, written as:
This doesn't mean "send 4 'lock' messages through the 'lockPort'". This means "send 'lock' message to all capsules connected to the 'lockPort', with priority 4".
The priority should not matter, but I suggest trying
This would send the message to all doors.
3) The output shows "Car.door1[0].lock", "Car.door1[1].lock", etc. That's not what I would expect with the attached model (where the slot name is printed with the expression "this->borderPorts[0]->slotName()"). I would expect that output if there was only one Door part called "door1", replicated 4 times. With the model attached, where the doors are separate parts, I would expect "Car.door1.lock", "Car.door2.lock", etc.
So that makes me think that the output you attached was not from the model attached but from a different version. Is that the case?
|
|
|
Powered by
FUDForum. Page generated in 0.03860 seconds