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

Proxy port #349

Merged
merged 9 commits into from Jun 30, 2020
Merged

Proxy port #349

merged 9 commits into from Jun 30, 2020

Conversation

amolenaar
Copy link
Member

@amolenaar amolenaar commented Jun 11, 2020

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Documentation content changes

Issue Number: #138

What is the new behavior?

A proxy port.

image

Still needs:

  • Connector to block (should also raise the port's z-index
  • Name
  • Stereotype
  • Orientation of text should change, depending on the side of the Block it's connected to

@amolenaar amolenaar requested a review from danyeaw June 11, 2020 20:48
@danyeaw
Copy link
Member

danyeaw commented Jun 12, 2020

Looks great so far!

@danyeaw danyeaw added the feature A new feature label Jun 20, 2020
@danyeaw danyeaw added this to the 2.0 milestone Jun 20, 2020
@danyeaw
Copy link
Member

danyeaw commented Jun 20, 2020

@amolenaar Is this ready for review / merge?

@amolenaar
Copy link
Member Author

Not yet. I want to fix text placement first.

@amolenaar
Copy link
Member Author

Port text is updated based on where the port is placed.

image

image

@amolenaar
Copy link
Member Author

@danyeaw Ok, ready for review 😃

Copy link
Member

@danyeaw danyeaw left a comment

Choose a reason for hiding this comment

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

@amolenaar The code looks really good! I also really like the way the labels snap to the right position, very nice.

I noticed when trying it out that the proxy ports work great when attached to a Block, but don't work on a part or reference properties for me (which is the primary use case of proxy ports).

@amolenaar
Copy link
Member Author

Ah. Thanks!
I only added a connector for Blocks so far. I'll add one for ref. and part properties too.
I did not add a connector for the (UML) Class yet, since that's out of scope for SysML support.

  • Connect Proxy Port to Reference Property
  • Connect Proxy Port to Part Property

@amolenaar
Copy link
Member Author

@danyeaw I need some help. A Proxy port is a subtype of Property. It can be linked to a Classifier. A Part or Reference Property is a property. I can not attach the port to the

I figured that if you place a port myPort on a Classifier myBlock, myPort.encapsulatedClassifier = myBlock`.

It's unclear to me what relation should be created at model level when a Port is attached to a Part/Reference Property. Do you have an idea? Should it be done via a Connector internally?

@danyeaw
Copy link
Member

danyeaw commented Jun 29, 2020

image
Looking at what one of the other tools I thought might give us some ideas.

You can create a part property without adding a type to it. Once you add a proxy port to it it automatically creates a block (block1 in this case), types the part property with the block, nests the proxy port under the block (makes block1 the owner), creates a new Property that is typed with the Block that the ibd is representing (called Model), and creates an association between the Model property and the part property.

So maybe you were on the right track making the proxy port part of the block, it sounds like we need to be able to then display it on the instantiation of the block (part property).

@danyeaw danyeaw merged commit 6c47a48 into master Jun 30, 2020
@danyeaw danyeaw deleted the proxy-port branch June 30, 2020 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants