Commit 7ae502d7 authored by claes's avatar claes

Subwindow removed for PlcConnecdt or SimConnect object, when new connect is done

parent 7a353bd4
...@@ -982,6 +982,8 @@ unsigned long index; ...@@ -982,6 +982,8 @@ unsigned long index;
char *aname; char *aname;
int size; int size;
char msg[200]; char msg[200];
pwr_tOid woid;
pwr_tCid cid;
/* Get the selected object in the navigator */ /* Get the selected object in the navigator */
plc = (node->hn.wind)->hw.plc; plc = (node->hn.wind)->hw.plc;
...@@ -1013,6 +1015,18 @@ unsigned long index; ...@@ -1013,6 +1015,18 @@ unsigned long index;
gre_node_update( foectx->grectx, node); gre_node_update( foectx->grectx, node);
/* Remove the subwindow which might hold old references */
sts = ldh_GetChild( ldhses, node->ln.oid, &woid);
if ( ODD(sts)) {
sts = ldh_GetObjectClass( ldhses, woid, &cid);
if ( EVEN(sts)) return sts;
if ( cid == pwr_cClass_windowplc) {
sts = ldh_DeleteObjectTree( ldhses, woid);
if ( EVEN(sts)) return sts;
}
}
sts = ldh_AttrRefToName( ldhses, &attrref, cdh_mNName, &aname, &size); sts = ldh_AttrRefToName( ldhses, &attrref, cdh_mNName, &aname, &size);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
...@@ -2745,6 +2759,8 @@ unsigned long index; ...@@ -2745,6 +2759,8 @@ unsigned long index;
char *aname; char *aname;
int size; int size;
char msg[200]; char msg[200];
pwr_tOid woid;
pwr_tCid cid;
/* Get the selected object in the navigator */ /* Get the selected object in the navigator */
plc = (node->hn.wind)->hw.plc; plc = (node->hn.wind)->hw.plc;
...@@ -2773,6 +2789,18 @@ unsigned long index; ...@@ -2773,6 +2789,18 @@ unsigned long index;
"RtBody", "SimConnect", "RtBody", "SimConnect",
(char *)&nattrref, sizeof(nattrref)); (char *)&nattrref, sizeof(nattrref));
/* Remove the subwindow which might hold old references */
sts = ldh_GetChild( ldhses, node->ln.oid, &woid);
if ( ODD(sts)) {
sts = ldh_GetObjectClass( ldhses, woid, &cid);
if ( EVEN(sts)) return sts;
if ( cid == pwr_cClass_windowplc) {
sts = ldh_DeleteObjectTree( ldhses, woid);
if ( EVEN(sts)) return sts;
}
}
gre_node_update( foectx->grectx, node); gre_node_update( foectx->grectx, node);
sts = ldh_AttrRefToName( ldhses, &attrref, cdh_mNName, &aname, &size); sts = ldh_AttrRefToName( ldhses, &attrref, cdh_mNName, &aname, &size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment