// oldPorts list should be filtered to include only Input Ports.
// But I'll filter Gate-s as well..
bool isAnyLinked = false; // check if any port from old ports is linked
+ // map PortName <-> (PortType, PortInputValue) for non linked input ports, which have input
+ QMap< QString, QPair< QString,QString > > InNameInput;
QObjectList portsToRemove;
while ( (obj = it.current()) != 0 ) {
++it;
// check if port has a link (output porst of Loop node are also checked)
if ( !aPort->IsGate() && aPort->IsLinked() && !isAnyLinked)
isAnyLinked = true;
+ // check if input port has an input value
+ if ( !aPort->IsGate() && aPort->IsInput() && aPort->HasInput() )
+ InNameInput.insert( QString(aPort->Name()),
+ QPair<QString, QString>(QString(aPort->Type()),QString(aPort->ToString())) );
}
delete oldPorts; // delete the list, not the objects
for ( i = 0; i < myInList->count(); i++ ) {
item = (PortListItem*)myInList->item( i );
aPort = aINode->InPort( item->PortName.latin1(), item->PortType.latin1() );
- myNode->createPort( aPort.in() );
-
- // mkr : PAL8060
- if ( !InPortsL.isEmpty() && !OutPortsL.isEmpty() )
- // create links for those input ports, which had links earlier
- createLinkEngine( aPort, InPortsL, OutPortsL );
+ if ( InNameInput.contains( item->PortName )
+ &&
+ item->PortType.compare(InNameInput[item->PortName].first) == 0 ) {
+ // i.e. aPort is input and had a value (not linked!)
+ // if ports' name and type didn't change and ports had an input value => set this value again
+ SUPERVGUI* aSupMod = SUPERVGUI::Supervision();
+ if ( aSupMod )
+ aPort->Input( aSupMod->getEngine()->StringValue( InNameInput[item->PortName].second ) );
+ myNode->createPort( aPort.in() );
+ }
+ else {
+ myNode->createPort( aPort.in() );
+ // mkr : PAL8060
+ if ( !InPortsL.isEmpty() && !OutPortsL.isEmpty() )
+ // create links for those input ports, which had links earlier
+ createLinkEngine( aPort, InPortsL, OutPortsL );
+ }
}
if ( isLoop ) {