Commit c6d05388 authored by Claes Sjofors's avatar Claes Sjofors

PlcPgm and Node, adopt and create methods added

parent b320bcef
...@@ -29,5 +29,6 @@ alochan <could not allocate a new channel> /error ...@@ -29,5 +29,6 @@ alochan <could not allocate a new channel> /error
graphaction <no action defined in graph object> /error graphaction <no action defined in graph object> /error
inlibhier <Object is in library hierarchy> /info inlibhier <Object is in library hierarchy> /info
nobuilt <Nothing is built> /info nobuilt <Nothing is built> /info
plcpgmchild <Object can not be a child to a PlcPgm> /error
...@@ -47,6 +47,7 @@ moveattribute <an attribute object can only be moved within the same childhood> ...@@ -47,6 +47,7 @@ moveattribute <an attribute object can only be moved within the same childhood>
movebody <a body object can only be moved within the same childhood> /error movebody <a body object can only be moved within the same childhood> /error
possecurity <a Security object should be a child to a $Node object> /error possecurity <a Security object should be a child to a $Node object> /error
securityalrex <a security object already exist> /error securityalrex <a security object already exist> /error
nodealrex <a node object already exist> /error
......
...@@ -145,6 +145,11 @@ SObject pwrb:Class ...@@ -145,6 +145,11 @@ SObject pwrb:Class
Attr MethodName = "PlcPgm-PostCreate" Attr MethodName = "PlcPgm-PostCreate"
EndBody EndBody
EndObject EndObject
Object AnteAdopt $DbCallBack
Body SysBody
Attr MethodName = "PlcPgm-AnteAdopt"
EndBody
EndObject
Object NavigatorPosnn $Menu Object NavigatorPosnn $Menu
Object Pointed $Menu Object Pointed $Menu
Object OpenProgram $MenuButton Object OpenProgram $MenuButton
......
...@@ -200,7 +200,7 @@ SObject pwrs:Class ...@@ -200,7 +200,7 @@ SObject pwrs:Class
Attr Type = pwr_eType_TypeId Attr Type = pwr_eType_TypeId
Attr Offset = 60 Attr Offset = 60
Attr Size = 4 Attr Size = 4
Attr Flags = PWR_MASK_ALWAYSWBL Attr Flags |= PWR_MASK_NOWBL
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_RTHIDE Attr Flags |= PWR_MASK_RTHIDE
Attr Elements = 1 Attr Elements = 1
......
...@@ -140,6 +140,7 @@ SObject pwrs:Class ...@@ -140,6 +140,7 @@ SObject pwrs:Class
Attr Size = 4 Attr Size = 4
Attr Flags = PWR_MASK_INVISIBLE Attr Flags = PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_RTHIDE Attr Flags |= PWR_MASK_RTHIDE
Attr Flags |= PWR_MASK_NOWBL
Attr Elements = 1 Attr Elements = 1
Attr ParamIndex = 6 Attr ParamIndex = 6
Attr TypeRef = pwr_eType_Int32 Attr TypeRef = pwr_eType_Int32
......
...@@ -283,6 +283,16 @@ SObject pwrs:Class ...@@ -283,6 +283,16 @@ SObject pwrs:Class
Attr MethodName = "$Node-PostCreate" Attr MethodName = "$Node-PostCreate"
EndBody EndBody
EndObject EndObject
Object AnteCreate $DbCallBack
Body SysBody
Attr MethodName = "$Node-AnteCreate"
EndBody
EndObject
Object PostCreate $DbCallBack
Body SysBody
Attr MethodName = "$Node-PostCreate"
EndBody
EndObject
Object NavigatorPosnn $Menu Object NavigatorPosnn $Menu
Object Pointed $Menu Object Pointed $Menu
Object Build $MenuButton Object Build $MenuButton
......
...@@ -127,8 +127,25 @@ static pwr_tStatus SyntaxCheck ( ...@@ -127,8 +127,25 @@ static pwr_tStatus SyntaxCheck (
return PWRB__SUCCESS; return PWRB__SUCCESS;
} }
static pwr_tStatus AnteCreate (
ldh_tSesContext Session,
pwr_tObjid Father,
pwr_tClassId Class
) {
pwr_tStatus sts;
pwr_tOid oid;
// There should only be one node object
sts = ldh_GetClassList( Session, pwr_eClass_Node, &oid);
if ( ODD(sts))
return PWRS__NODEALREX;
return PWRS__SUCCESS;
}
pwr_dExport pwr_BindMethods($Node) = { pwr_dExport pwr_BindMethods($Node) = {
pwr_BindMethod(PostCreate), pwr_BindMethod(PostCreate),
pwr_BindMethod(AnteCreate),
pwr_BindMethod(SyntaxCheck), pwr_BindMethod(SyntaxCheck),
pwr_NullMethod pwr_NullMethod
}; };
......
...@@ -174,6 +174,18 @@ static pwr_tStatus PostCreate ( ...@@ -174,6 +174,18 @@ static pwr_tStatus PostCreate (
} }
return PWRB__SUCCESS; return PWRB__SUCCESS;
} }
static pwr_tStatus AnteAdopt (
ldh_tSesContext Session,
pwr_tOid Father,
pwr_tCid Class
) {
// Only allow plc window objects
if ( Class != pwr_cClass_windowplc)
return PWRB__PLCPGMCHILD;
return PWRB__SUCCESS;
}
/*----------------------------------------------------------------------------*\ /*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here. Every method to be exported to the workbench should be registred here.
...@@ -184,5 +196,6 @@ pwr_dExport pwr_BindMethods(PlcPgm) = { ...@@ -184,5 +196,6 @@ pwr_dExport pwr_BindMethods(PlcPgm) = {
pwr_BindMethod(Build), pwr_BindMethod(Build),
pwr_BindMethod(SyntaxCheck), pwr_BindMethod(SyntaxCheck),
pwr_BindMethod(PostCreate), pwr_BindMethod(PostCreate),
pwr_BindMethod(AnteAdopt),
pwr_NullMethod pwr_NullMethod
}; };
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