About persistence problem [message #547462] |
Sat, 17 July 2010 01:59 |
Eclipse User |
|
|
|
Hello, I met a persistence problem when I was storing and opening the file. I fixed two input port and one output port to the node and I implemented this scheme by putting createInputPin and createOutputPin function inside the node's constructor. For example, please see the code below:
protected StartImpl() {
super();
numOfOutputPin = 1;
OutputPin outputSignal = EcasFactory.eINSTANCE.createOutputPin();
outputSignal.setAttachedBlock(this);
outputSignal.setLabel("startSignal");
getOutputPins().add(outputSignal);
setName("Start");
}
Here is the constructor of the node "Start".
The problem ocurred when I tried to open the stored file. After I opened the file, there are four input ports and two output ports. In the case of above code, there are two OutputPins . The number of pins became double size. Does anyone tell me any solution? I know this is because that when I recovered the model from the serialized file, the system called the constructor twice. But I am still confused how to fix it.
Please help. Thanks!
|
|
|
Powered by
FUDForum. Page generated in 0.04013 seconds