About persistence problem [message #547462] |
Sat, 17 July 2010 05:59 |
SonglinPiao ![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=piaosonglin1985%40hotmail.com) Messages: 11 Registered: December 2009 |
Junior Member |
|
|
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.03624 seconds