-
Notifications
You must be signed in to change notification settings - Fork 14
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
Saving port parameters #135
base: master
Are you sure you want to change the base?
Conversation
...e.mit.massif.simulink.api/src/hu/bme/mit/massif/simulink/api/adapter/port/EnableAdapter.java
Outdated
Show resolved
Hide resolved
....massif.simulink.api/src/hu/bme/mit/massif/simulink/api/adapter/port/DefaultPortAdapter.java
Outdated
Show resolved
Hide resolved
@@ -1187,12 +1200,12 @@ private void createAndAddPort(Block parent, PortProvider portProvider, Handle po | |||
Port port; | |||
// State is a special outport kind | |||
if ("outport".equalsIgnoreCase(portType) || "state".equalsIgnoreCase(portType)) { | |||
port = portAdapter.createPort(parent, portHandle, outPorts); | |||
port = portAdapter.createPort(this, parent, portHandle, outPorts); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer passing specific information or a wrapper DTO instead of the importer itself.
|
||
blockHandleCache.put(modelFQN, (Handle) modelHandle); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really worth it to have a cache instead of passing the handle through the call hierarchy (maybe in the same DTO as suggested below)
Another missing feature: during export, after all blocks are added to the diagram, port parameters should be also set. |
@mayerkr look at exporter and evaluate how much work it would be to set port parameters |
# Conflicts: # Jenkinsfile # plugins/hu.bme.mit.massif.simulink.api/src/hu/bme/mit/massif/simulink/api/Exporter.java
Created a separate issue regarding the setting of port parameters: #166 |
Refactored the importer and adapters to send importer specific data via DTOs. The AbstractImporterDTO and the Importer classes are still incomplete, and need a bit more work. |
import hu.bme.mit.massif.simulink.api.util.ISimulinkAPILogger; | ||
import hu.bme.mit.massif.simulink.api.util.ImportMode; | ||
|
||
public abstract class AbstractImporterDTO { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use "DTO" in name.
Rename class to AbstractImportData
and package to data
.
} | ||
|
||
} | ||
|
||
} | ||
} | ||
|
||
private SimulinkModel traverseReferencedLibrary(final Importer traverser, String libraryName, | ||
private SimulinkModel traverseReferencedLibrary(final AbstractImporterDTO importerDTO, String libraryName, | ||
MatlabCommandFactory commandFactory, ImportMode importMode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ImportMode is already part of DTO
Fixes #30