void SUPERVGUI_Graph::deleteLink(SUPERVGUI_Link* theLink) {
- //update values of input ports of theLink if theLink is deleted
- if ( theLink->getInputPort() ) {
- //input port exist
+ if (getMain()->getDataflow()->IsDone()) {
+ //update values of input ports of theLink if theLink is deleted and dataflow has been executed any times
SUPERVGUI_PortIn* aInPort = theLink->getInputPort();
- if (aInPort->getPort()->IsParam() || aInPort->getPort()->IsInLine()) {
- QString aPortValue = QString(aInPort->getPort()->ToString());
- if (!aPortValue.isNull()) {
+ if ( aInPort ) {
+ //input port exist
+ QString aPortValue = QString(aInPort->getPort()->ToString());
+ if ( (aInPort->getPort()->IsParam() || aInPort->getPort()->IsInLine())
+ &&
+ !aPortValue.isNull()) {
//gives a value to an input port
theLink->destroyEngine();
aInPort->getPort()->Input( Supervision.getEngine()->StringValue( aPortValue ) );
aInPort->sync();
}
+ else
+ theLink->destroyEngine();
}
+ else
+ theLink->destroyEngine();
}
- else
+ else
theLink->destroyEngine();
myLinksList.removeRef(theLink);