Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
b963ac2c
Commit
b963ac2c
authored
Apr 10, 2003
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PostCreate methods
parent
3571d0b0
Changes
30
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
641 additions
and
54 deletions
+641
-54
src/exe/rt_bck/src/rt_bck.c
src/exe/rt_bck/src/rt_bck.c
+7
-2
src/wbl/pwrb/src/pwrb_c_backup_conf.wb_load
src/wbl/pwrb/src/pwrb_c_backup_conf.wb_load
+5
-0
src/wbl/pwrb/src/pwrb_c_nodeconfig.wb_load
src/wbl/pwrb/src/pwrb_c_nodeconfig.wb_load
+5
-0
src/wbl/pwrb/src/pwrb_c_opplace.wb_load
src/wbl/pwrb/src/pwrb_c_opplace.wb_load
+5
-0
src/wbl/pwrb/src/pwrb_c_plcprocess.wb_load
src/wbl/pwrb/src/pwrb_c_plcprocess.wb_load
+5
-0
src/wbl/pwrb/src/pwrb_c_plcthread.wb_load
src/wbl/pwrb/src/pwrb_c_plcthread.wb_load
+5
-0
src/wbl/pwrb/src/pwrb_c_rttconfig.wb_load
src/wbl/pwrb/src/pwrb_c_rttconfig.wb_load
+5
-0
src/wbl/pwrb/src/pwrb_c_webhandler.wb_load
src/wbl/pwrb/src/pwrb_c_webhandler.wb_load
+5
-0
wb/lib/wb/src/wb_c_node.c
wb/lib/wb/src/wb_c_node.c
+22
-0
wb/lib/wb/src/wb_c_nodeconfig.c
wb/lib/wb/src/wb_c_nodeconfig.c
+42
-0
wb/lib/wb/src/wb_c_opplace.c
wb/lib/wb/src/wb_c_opplace.c
+72
-0
wb/lib/wb/src/wb_c_plcprocess.c
wb/lib/wb/src/wb_c_plcprocess.c
+44
-0
wb/lib/wb/src/wb_c_plcthread.c
wb/lib/wb/src/wb_c_plcthread.c
+63
-0
wb/lib/wb/src/wb_c_rttconfig.c
wb/lib/wb/src/wb_c_rttconfig.c
+72
-0
wb/lib/wb/src/wb_c_webhandler.c
wb/lib/wb/src/wb_c_webhandler.c
+72
-0
wb/lib/wb/src/wb_destination.cpp
wb/lib/wb/src/wb_destination.cpp
+13
-0
wb/lib/wb/src/wb_destination.h
wb/lib/wb/src/wb_destination.h
+1
-1
wb/lib/wb/src/wb_i_base_methods.c
wb/lib/wb/src/wb_i_base_methods.c
+19
-0
wb/lib/wb/src/wb_session.cpp
wb/lib/wb/src/wb_session.cpp
+3
-3
wb/lib/wb/src/wb_volume.cpp
wb/lib/wb/src/wb_volume.cpp
+12
-0
wb/lib/wb/src/wb_volume.h
wb/lib/wb/src/wb_volume.h
+1
-1
wb/lib/wb/src/wb_vrep.h
wb/lib/wb/src/wb_vrep.h
+1
-0
wb/lib/wb/src/wb_vrepdb.h
wb/lib/wb/src/wb_vrepdb.h
+1
-0
wb/lib/wb/src/wb_vrepdbs.h
wb/lib/wb/src/wb_vrepdbs.h
+1
-0
wb/lib/wb/src/wb_vrepmem.cpp
wb/lib/wb/src/wb_vrepmem.cpp
+62
-0
wb/lib/wb/src/wb_vrepmem.h
wb/lib/wb/src/wb_vrepmem.h
+28
-0
wb/lib/wb/src/wb_vrepwbl.h
wb/lib/wb/src/wb_vrepwbl.h
+1
-0
wb/lib/wb/src/wb_wnav.cpp
wb/lib/wb/src/wb_wnav.cpp
+52
-40
wb/lib/wb/src/wb_wnav_menu.cpp
wb/lib/wb/src/wb_wnav_menu.cpp
+15
-1
wb/lib/wb/src/wb_wtt.cpp
wb/lib/wb/src/wb_wtt.cpp
+2
-6
No files found.
src/exe/rt_bck/src/rt_bck.c
View file @
b963ac2c
...
...
@@ -54,6 +54,7 @@
#include "rt_bckdef.h"
#include "co_cdh.h"
#include "co_time.h"
#include "co_dcli.h"
#define check4a(sts,str) if((sts)==-1)perror(str)
...
...
@@ -570,6 +571,8 @@ bck_file_process (
pwr_tUInt32
c
;
pwr_tUInt32
csts
;
pwr_tUInt32
cnt
;
char
fname
[
200
];
#if defined OS_VMS || defined OS_ELN
pwr_tUInt32
sts
;
...
...
@@ -618,7 +621,8 @@ bck_file_process (
#else
if
(
backup_confp
->
DiskStatus
==
0
)
{
bckfile
=
fopen
(
backup_confp
->
BackupFile
,
"r+"
A_MODE
);
dcli_translate_filename
(
fname
,
backup_confp
->
BackupFile
);
bckfile
=
fopen
(
fname
,
"r+"
A_MODE
);
if
(
bckfile
!=
NULL
)
{
errh_Info
(
"BACKUP opened existing backupfile %s
\n
"
,
FGETNAME
);
csts
=
fread
(
&
filehead
,
sizeof
filehead
,
1
,
bckfile
);
...
...
@@ -657,7 +661,8 @@ bck_file_process (
}
#else
bckfile
=
fopen
(
backup_confp
->
BackupFile
,
"w+"
A_MODE
);
dcli_translate_filename
(
fname
,
backup_confp
->
BackupFile
);
bckfile
=
fopen
(
fname
,
"w+"
A_MODE
);
if
(
bckfile
==
NULL
)
perror
(
"BACKUP cannot create backupfile"
);
else
{
...
...
src/wbl/pwrb/src/pwrb_c_backup_conf.wb_load
View file @
b963ac2c
...
...
@@ -216,6 +216,11 @@ SObject pwrb:Class
! Template for Backup_Conf
!
Object Template Backup_Conf
Body RtBody
Attr BackupFile = "$pwrp_load:pwr_console.log"
Attr CycleFast = 100
Attr CycleSlow = 600
EndBody
EndObject
EndObject
EndSObject
src/wbl/pwrb/src/pwrb_c_nodeconfig.wb_load
View file @
b963ac2c
...
...
@@ -136,6 +136,11 @@ SObject pwrb:Class
EndBody
EndObject
EndObject
Object PostCreate $DbCallBack
Body SysBody
Attr MethodName = "NodeConfig-PostCreate"
EndBody
EndObject
EndObject
EndSObject
...
...
src/wbl/pwrb/src/pwrb_c_opplace.wb_load
View file @
b963ac2c
...
...
@@ -449,5 +449,10 @@ SObject pwrb:Class
Attr GraphicsUpdateInterval = 0.25
EndBody
EndObject
Object PostCreate $DbCallBack
Body SysBody
Attr MethodName = "OpPlace-PostCreate"
EndBody
EndObject
EndObject
EndSObject
src/wbl/pwrb/src/pwrb_c_plcprocess.wb_load
View file @
b963ac2c
...
...
@@ -102,5 +102,10 @@ SObject pwrb:Class
Attr SubscriptionInterval = 1.0
EndBody
EndObject
Object PostCreate $DbCallBack
Body SysBody
Attr MethodName = "PlcProcess-PostCreate"
EndBody
EndObject
EndObject
EndSObject
src/wbl/pwrb/src/pwrb_c_plcthread.wb_load
View file @
b963ac2c
...
...
@@ -242,5 +242,10 @@ SObject pwrb:Class
EndBody
EndObject
EndObject
Object PostCreate $DbCallBack
Body SysBody
Attr MethodName = "PlcThread-PostCreate"
EndBody
EndObject
EndObject
EndSObject
src/wbl/pwrb/src/pwrb_c_rttconfig.wb_load
View file @
b963ac2c
...
...
@@ -87,5 +87,10 @@ SObject pwrb:Class
Attr DefaultVMSNode = ""
EndBody
EndObject
Object PostCreate $DbCallBack
Body SysBody
Attr MethodName = "RttConfig-PostCreate"
EndBody
EndObject
EndObject
EndSObject
src/wbl/pwrb/src/pwrb_c_webhandler.wb_load
View file @
b963ac2c
...
...
@@ -162,5 +162,10 @@ SObject pwrb:Class
Attr MaxConnections = 50
EndBody
EndObject
Object PostCreate $DbCallBack
Body SysBody
Attr MethodName = "WebHandler-PostCreate"
EndBody
EndObject
EndObject
EndSObject
wb/lib/wb/src/wb_c_node.c
View file @
b963ac2c
...
...
@@ -23,6 +23,24 @@ static pwr_tStatus PostCreate (
sts
=
ldh_ClassNameToId
(
Session
,
&
cid
,
"IOHandler"
);
sts
=
ldh_CreateObject
(
Session
,
&
oid
,
"IOHandler"
,
cid
,
Object
,
ldh_eDest_IntoLast
);
sts
=
ldh_ClassNameToId
(
Session
,
&
cid
,
"Backup_Conf"
);
sts
=
ldh_CreateObject
(
Session
,
&
oid
,
"Backup"
,
cid
,
Object
,
ldh_eDest_IntoLast
);
sts
=
ldh_ClassNameToId
(
Session
,
&
cid
,
"OpPlace"
);
sts
=
ldh_CreateObject
(
Session
,
&
oid
,
"Op"
,
cid
,
Object
,
ldh_eDest_IntoLast
);
sts
=
ldh_CreateObject
(
Session
,
&
oid
,
"Maintenance"
,
cid
,
Object
,
ldh_eDest_IntoLast
);
sts
=
ldh_ClassNameToId
(
Session
,
&
cid
,
"RttConfig"
);
sts
=
ldh_CreateObject
(
Session
,
&
oid
,
"RttConfig"
,
cid
,
Object
,
ldh_eDest_IntoLast
);
sts
=
ldh_ClassNameToId
(
Session
,
&
cid
,
"PlcProcess"
);
sts
=
ldh_CreateObject
(
Session
,
&
oid
,
"Plc"
,
cid
,
Object
,
ldh_eDest_IntoLast
);
sts
=
ldh_ClassNameToId
(
Session
,
&
cid
,
"WebHandler"
);
sts
=
ldh_CreateObject
(
Session
,
&
oid
,
"WebHandler"
,
cid
,
Object
,
ldh_eDest_IntoLast
);
sts
=
ldh_ClassNameToId
(
Session
,
&
cid
,
"WebBrowserConfig"
);
sts
=
ldh_CreateObject
(
Session
,
&
oid
,
"WebBrowser"
,
cid
,
Object
,
ldh_eDest_IntoLast
);
return
PWRS__SUCCESS
;
}
...
...
@@ -35,3 +53,7 @@ pwr_dExport pwr_BindMethods($Node) = {
wb/lib/wb/src/wb_c_nodeconfig.c
0 → 100644
View file @
b963ac2c
/* wb_c_nodeconfig.c -- work bench methods of the NodeConfig class.
PROVIEW/R
Copyright (C) 1994 by Comator Process AB. */
#include "wb_pwrs.h"
#include "wb_pwrs_msg.h"
#include "wb_ldh.h"
static
pwr_tStatus
PostCreate
(
ldh_tSesContext
Session
,
pwr_tObjid
Object
,
pwr_tObjid
Father
,
pwr_tClassId
Class
)
{
pwr_tObjid
oid
,
poid
;
pwr_tClassId
cid
;
pwr_tStatus
sts
;
char
source
[
80
];
sts
=
ldh_ClassNameToId
(
Session
,
&
cid
,
"RootVolumeLoad"
);
sts
=
ldh_CreateObject
(
Session
,
&
oid
,
"O1"
,
cid
,
Object
,
ldh_eDest_IntoLast
);
sts
=
ldh_ClassNameToId
(
Session
,
&
cid
,
"$NodeHier"
);
sts
=
ldh_CreateObject
(
Session
,
&
poid
,
"Distribute"
,
cid
,
Object
,
ldh_eDest_IntoLast
);
sts
=
ldh_ClassNameToId
(
Session
,
&
cid
,
"GraphDistribute"
);
sts
=
ldh_CreateObject
(
Session
,
&
oid
,
"AllPwg"
,
cid
,
poid
,
ldh_eDest_IntoLast
);
strcpy
(
source
,
"$pwrp_pop/*.pwg"
);
sts
=
ldh_SetObjectPar
(
Session
,
oid
,
"DevBody"
,
"Source"
,
source
,
sizeof
(
source
));
if
(
EVEN
(
sts
))
return
sts
;
return
PWRS__SUCCESS
;
}
pwr_dExport
pwr_BindMethods
(
NodeConfig
)
=
{
pwr_BindMethod
(
PostCreate
),
pwr_NullMethod
};
wb/lib/wb/src/wb_c_opplace.c
0 → 100644
View file @
b963ac2c
/* wb_c_opplace.c -- work bench methods of the OpPlace class.
PROVIEW/R
Copyright (C) 1994 by Comator Process AB. */
#include "wb_pwrs.h"
#include "wb_pwrs_msg.h"
#include "wb_ldh.h"
static
pwr_tStatus
PostCreate
(
ldh_tSesContext
Session
,
pwr_tOid
Object
,
pwr_tOid
Father
,
pwr_tCid
Class
)
{
pwr_tOid
oid
;
pwr_tCid
cid
;
pwr_tStatus
sts
;
pwr_tInt32
*
number
;
pwr_tInt32
max_number
=
0
;
int
size
;
sts
=
ldh_ClassNameToId
(
Session
,
&
cid
,
"OpPlace"
);
if
(
EVEN
(
sts
))
return
sts
;
// Get next OpNumber
sts
=
ldh_GetClassList
(
Session
,
cid
,
&
oid
);
while
(
ODD
(
sts
))
{
sts
=
ldh_GetObjectPar
(
Session
,
oid
,
"RtBody"
,
"OpNumber"
,
(
char
**
)
&
number
,
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
*
number
>
max_number
)
max_number
=
*
number
;
free
(
(
char
*
)
number
);
sts
=
ldh_GetNextObject
(
Session
,
oid
,
&
oid
);
}
sts
=
ldh_ClassNameToId
(
Session
,
&
cid
,
"User"
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ldh_GetClassList
(
Session
,
cid
,
&
oid
);
while
(
ODD
(
sts
))
{
sts
=
ldh_GetObjectPar
(
Session
,
oid
,
"RtBody"
,
"OpNumber"
,
(
char
**
)
&
number
,
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
*
number
>
max_number
)
max_number
=
*
number
;
free
(
(
char
*
)
number
);
sts
=
ldh_GetNextObject
(
Session
,
oid
,
&
oid
);
}
max_number
++
;
sts
=
ldh_CreateObject
(
Session
,
&
oid
,
"User"
,
cid
,
Object
,
ldh_eDest_IntoLast
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ldh_SetObjectPar
(
Session
,
Object
,
"RtBody"
,
"OpNumber"
,
(
char
*
)
&
max_number
,
sizeof
(
max_number
));
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ldh_SetObjectPar
(
Session
,
oid
,
"RtBody"
,
"OpNumber"
,
(
char
*
)
&
max_number
,
sizeof
(
max_number
));
if
(
EVEN
(
sts
))
return
sts
;
return
PWRS__SUCCESS
;
}
pwr_dExport
pwr_BindMethods
(
OpPlace
)
=
{
pwr_BindMethod
(
PostCreate
),
pwr_NullMethod
};
wb/lib/wb/src/wb_c_plcprocess.c
0 → 100644
View file @
b963ac2c
/* wb_c_plcprocess.c -- work bench methods of the PlcProcess class.
PROVIEW/R
Copyright (C) 1994 by Comator Process AB. */
#include "wb_pwrs.h"
#include "wb_pwrs_msg.h"
#include "wb_ldh.h"
static
pwr_tStatus
PostCreate
(
ldh_tSesContext
Session
,
pwr_tOid
Object
,
pwr_tOid
Father
,
pwr_tCid
Class
)
{
pwr_tOid
oid
;
pwr_tCid
cid
;
pwr_tStatus
sts
;
pwr_tFloat32
scan_time
=
0
.
1
;
sts
=
ldh_ClassNameToId
(
Session
,
&
cid
,
"PlcThread"
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ldh_CreateObject
(
Session
,
&
oid
,
"100ms"
,
cid
,
Object
,
ldh_eDest_IntoLast
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ldh_SetObjectPar
(
Session
,
oid
,
"RtBody"
,
"ScanTime"
,
(
char
*
)
&
scan_time
,
sizeof
(
scan_time
));
if
(
EVEN
(
sts
))
return
sts
;
return
PWRS__SUCCESS
;
}
pwr_dExport
pwr_BindMethods
(
PlcProcess
)
=
{
pwr_BindMethod
(
PostCreate
),
pwr_NullMethod
};
wb/lib/wb/src/wb_c_plcthread.c
0 → 100644
View file @
b963ac2c
/* wb_c_plcthread.c -- work bench methods of the PlcThread class.
PROVIEW/R
Copyright (C) 1994 by Comator Process AB. */
#include "wb_pwrs.h"
#include "wb_pwrs_msg.h"
#include "wb_ldh.h"
static
pwr_tStatus
PostCreate
(
ldh_tSesContext
Session
,
pwr_tOid
Object
,
pwr_tOid
Father
,
pwr_tCid
Class
)
{
pwr_tOid
oid
;
pwr_tCid
cid
;
pwr_tStatus
sts
;
pwr_tEnum
delay_action
;
pwr_tString80
detect_text
=
"Plc thread delayed"
;
pwr_tFloat32
max_delay
;
sts
=
ldh_ClassNameToId
(
Session
,
&
cid
,
"CycleSup"
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ldh_CreateObject
(
Session
,
&
oid
,
"Alarm"
,
cid
,
Object
,
ldh_eDest_IntoLast
);
if
(
EVEN
(
sts
))
return
sts
;
delay_action
=
1
;
sts
=
ldh_SetObjectPar
(
Session
,
oid
,
"RtBody"
,
"DelayAction"
,
(
char
*
)
&
delay_action
,
sizeof
(
delay_action
));
if
(
EVEN
(
sts
))
return
sts
;
max_delay
=
0
.
1
;
sts
=
ldh_SetObjectPar
(
Session
,
oid
,
"RtBody"
,
"MaxDelay"
,
(
char
*
)
&
max_delay
,
sizeof
(
max_delay
));
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ldh_SetObjectPar
(
Session
,
oid
,
"RtBody"
,
"DetectText"
,
(
char
*
)
&
detect_text
,
sizeof
(
detect_text
));
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ldh_CreateObject
(
Session
,
&
oid
,
"Halt"
,
cid
,
Object
,
ldh_eDest_IntoLast
);
if
(
EVEN
(
sts
))
return
sts
;
delay_action
=
2
;
sts
=
ldh_SetObjectPar
(
Session
,
oid
,
"RtBody"
,
"DelayAction"
,
(
char
*
)
&
delay_action
,
sizeof
(
delay_action
));
if
(
EVEN
(
sts
))
return
sts
;
max_delay
=
1
.
0
;
sts
=
ldh_SetObjectPar
(
Session
,
oid
,
"RtBody"
,
"MaxDelay"
,
(
char
*
)
&
max_delay
,
sizeof
(
max_delay
));
if
(
EVEN
(
sts
))
return
sts
;
return
PWRS__SUCCESS
;
}
pwr_dExport
pwr_BindMethods
(
PlcThread
)
=
{
pwr_BindMethod
(
PostCreate
),
pwr_NullMethod
};
wb/lib/wb/src/wb_c_rttconfig.c
0 → 100644
View file @
b963ac2c
/* wb_c_rttconfig.c -- work bench methods of the RttConfig class.
PROVIEW/R
Copyright (C) 1994 by Comator Process AB. */
#include "wb_pwrs.h"
#include "wb_pwrs_msg.h"
#include "wb_ldh.h"
static
pwr_tStatus
PostCreate
(
ldh_tSesContext
Session
,
pwr_tOid
Object
,
pwr_tOid
Father
,
pwr_tCid
Class
)
{
pwr_tOid
oid
;
pwr_tCid
cid
;
pwr_tStatus
sts
;
pwr_tInt32
*
number
;
pwr_tInt32
max_number
=
0
;
int
size
;
sts
=
ldh_ClassNameToId
(
Session
,
&
cid
,
"OpPlace"
);
if
(
EVEN
(
sts
))
return
sts
;
// Get next OpNumber
sts
=
ldh_GetClassList
(
Session
,
cid
,
&
oid
);
while
(
ODD
(
sts
))
{
sts
=
ldh_GetObjectPar
(
Session
,
oid
,
"RtBody"
,
"OpNumber"
,
(
char
**
)
&
number
,
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
*
number
>
max_number
)
max_number
=
*
number
;
free
(
(
char
*
)
number
);
sts
=
ldh_GetNextObject
(
Session
,
oid
,
&
oid
);
}
sts
=
ldh_ClassNameToId
(
Session
,
&
cid
,
"User"
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ldh_GetClassList
(
Session
,
cid
,
&
oid
);
while
(
ODD
(
sts
))
{
sts
=
ldh_GetObjectPar
(
Session
,
oid
,
"RtBody"
,
"OpNumber"
,
(
char
**
)
&
number
,
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
*
number
>
max_number
)
max_number
=
*
number
;
free
(
(
char
*
)
number
);
sts
=
ldh_GetNextObject
(
Session
,
oid
,
&
oid
);
}
max_number
++
;
sts
=
ldh_CreateObject
(
Session
,
&
oid
,
"User"
,
cid
,
Object
,
ldh_eDest_IntoLast
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ldh_SetObjectPar
(
Session
,
oid
,
"RtBody"
,
"OpNumber"
,
(
char
*
)
&
max_number
,
sizeof
(
max_number
));
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ldh_SetObjectPar
(
Session
,
Object
,
"RtBody"
,
"UserObject"
,
(
char
*
)
&
oid
,
sizeof
(
oid
));
if
(
EVEN
(
sts
))
return
sts
;
return
PWRS__SUCCESS
;
}
pwr_dExport
pwr_BindMethods
(
RttConfig
)
=
{
pwr_BindMethod
(
PostCreate
),
pwr_NullMethod
};
wb/lib/wb/src/wb_c_webhandler.c
0 → 100644
View file @
b963ac2c
/* wb_c_webhandler.c -- work bench methods of the WebHandler class.
PROVIEW/R
Copyright (C) 1994 by Comator Process AB. */
#include "wb_pwrs.h"
#include "wb_pwrs_msg.h"
#include "wb_ldh.h"
static
pwr_tStatus
PostCreate
(
ldh_tSesContext
Session
,
pwr_tOid
Object
,
pwr_tOid
Father
,
pwr_tCid
Class
)
{
pwr_tOid
oid
;
pwr_tCid
cid
;
pwr_tStatus
sts
;
pwr_tInt32
*
number
;
pwr_tInt32
max_number
=
0
;
int
size
;
sts
=
ldh_ClassNameToId
(
Session
,
&
cid
,
"OpPlace"
);
if
(
EVEN
(
sts
))
return
sts
;
// Get next OpNumber
sts
=
ldh_GetClassList
(
Session
,
cid
,
&
oid
);
while
(
ODD
(
sts
))
{
sts
=
ldh_GetObjectPar
(
Session
,
oid
,
"RtBody"
,
"OpNumber"
,
(
char
**
)
&
number
,
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
*
number
>
max_number
)
max_number
=
*
number
;
free
(
(
char
*
)
number
);
sts
=
ldh_GetNextObject
(
Session
,
oid
,
&
oid
);
}
sts
=
ldh_ClassNameToId
(
Session
,
&
cid
,
"User"
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ldh_GetClassList
(
Session
,
cid
,
&
oid
);
while
(
ODD
(
sts
))
{
sts
=
ldh_GetObjectPar
(
Session
,
oid
,
"RtBody"
,
"OpNumber"
,
(
char
**
)
&
number
,
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
*
number
>
max_number
)
max_number
=
*
number
;
free
(
(
char
*
)
number
);
sts
=
ldh_GetNextObject
(
Session
,
oid
,
&
oid
);
}
max_number
++
;
sts
=
ldh_CreateObject
(
Session
,
&
oid
,
"User"
,
cid
,
Object
,
ldh_eDest_IntoLast
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ldh_SetObjectPar
(
Session
,
oid
,
"RtBody"
,
"OpNumber"
,
(
char
*
)
&
max_number
,
sizeof
(
max_number
));
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ldh_SetObjectPar
(
Session
,
Object
,
"RtBody"
,
"UserObject"
,
(
char
*
)
&
oid
,
sizeof
(
oid
));
if
(
EVEN
(
sts
))
return
sts
;
return
PWRS__SUCCESS
;
}
pwr_dExport
pwr_BindMethods
(
WebHandler
)
=
{
pwr_BindMethod
(
PostCreate
),
pwr_NullMethod
};
wb/lib/wb/src/wb_destination.cpp
View file @
b963ac2c
#include "wb_destination.h"
#include "wb_object.h"
#include "pwr_systemclasses.h"
#include "pwr_baseclasses.h"
wb_destination
::
wb_destination
(
pwr_tOid
oid
,
ldh_eDest
code
)
:
m_oid
(
oid
),
m_code
(
code
)
...
...
@@ -10,3 +12,14 @@ wb_destination::wb_destination(wb_object &o, ldh_eDest code) :
m_oid
(
o
.
oid
()),
m_code
(
code
)
{
}
bool
wb_destination
::
canAdopt
(
pwr_tCid
cid
)
{
switch
(
cid
)
{
case
pwr_cClass_MountObject
:
case
pwr_cClass_CreateVolume
:
return
false
;
default:
return
true
;
}
}
wb/lib/wb/src/wb_destination.h
View file @
b963ac2c
...
...
@@ -17,7 +17,7 @@ public:
wb_destination
(
pwr_tOid
oid
,
ldh_eDest
code
);
bool
canAdopt
(
pwr_tCid
cid
)
{
return
true
;}
// Fix
bool
canAdopt
(
pwr_tCid
cid
)
;
bool
canAdopt
(
pwr_tOid
oid
)
{
return
true
;}
// Fix
pwr_tOid
oid
()
{
return
m_oid
;}
ldh_eDest
code
()
{
return
m_code
;}
...
...
wb/lib/wb/src/wb_i_base_methods.c
View file @
b963ac2c
...
...
@@ -44,6 +44,12 @@ pwr_dImport pwr_BindMethods(Co);
pwr_dImport
pwr_BindMethods
(
Po
);
pwr_dImport
pwr_BindMethods
(
XttGraph
);
pwr_dImport
pwr_BindMethods
(
WebGraph
);
pwr_dImport
pwr_BindMethods
(
OpPlace
);
pwr_dImport
pwr_BindMethods
(
RttConfig
);
pwr_dImport
pwr_BindMethods
(
WebHandler
);
pwr_dImport
pwr_BindMethods
(
PlcProcess
);
pwr_dImport
pwr_BindMethods
(
PlcThread
);
pwr_dImport
pwr_BindMethods
(
NodeConfig
);
pwr_dExport
pwr_BindClasses
(
Base
)
=
{
pwr_BindClass
(
ASup
),
...
...
@@ -85,6 +91,19 @@ pwr_dExport pwr_BindClasses(Base) = {
pwr_BindClass
(
Po
),
pwr_BindClass
(
XttGraph
),
pwr_BindClass
(
WebGraph
),
pwr_BindClass
(
OpPlace
),
pwr_BindClass
(
RttConfig
),
pwr_BindClass
(
WebHandler
),
pwr_BindClass
(
PlcProcess
),
pwr_BindClass
(
PlcThread
),
pwr_BindClass
(
NodeConfig
),
pwr_NullClass
};
wb/lib/wb/src/wb_session.cpp
View file @
b963ac2c
...
...
@@ -524,9 +524,9 @@ pwr_tStatus wb_session::getMenu( ldh_sMenuCall *ip)
o_menu
=
cdrep
->
menuAfter
(
&
sts
,
o_menu
,
&
o_menu_body
);
prev
->
unref
();
}
delete
cdrep
;
o
->
unref
();
}
delete
cdrep
;
switch
(
ip
->
SelectedSet
)
{
case
ldh_eMenuSet_Attribute
:
...
...
@@ -552,9 +552,9 @@ pwr_tStatus wb_session::getMenu( ldh_sMenuCall *ip)
o_menu
=
cdrep
->
menuAfter
(
&
sts
,
o_menu
,
&
o_menu_body
);
prev
->
unref
();
}
delete
cdrep
;
o
->
unref
();
}
delete
cdrep
;
/* Find specific menues for selected object(s) */
if
(
ip
->
PointedSet
==
ldh_eMenuSet_Class
)
{
...
...
@@ -588,9 +588,9 @@ pwr_tStatus wb_session::getMenu( ldh_sMenuCall *ip)
o_menu
=
cdrep
->
menuAfter
(
&
sts
,
o_menu
,
&
o_menu_body
);
prev
->
unref
();
}
delete
cdrep
;
o
->
unref
();
}
delete
cdrep
;
break
;
default:
...
...
wb/lib/wb/src/wb_volume.cpp
View file @
b963ac2c
...
...
@@ -121,6 +121,18 @@ wb_object wb_volume::object(pwr_tOid oid) const
return
o
;
}
wb_object
wb_volume
::
object
(
pwr_tCid
cid
)
const
{
pwr_tStatus
sts
;
wb_orep
*
orep
;
wb_object
o
;
orep
=
m_vrep
->
object
(
&
sts
,
cid
);
o
=
wb_object
(
sts
,
orep
);
return
o
;
}
wb_object
wb_volume
::
object
(
const
char
*
name
)
const
{
pwr_tStatus
sts
;
...
...
wb/lib/wb/src/wb_volume.h
View file @
b963ac2c
...
...
@@ -49,7 +49,7 @@ public:
wb_object
object
()
const
;
// Get root list
wb_object
object
(
pwr_tOid
oid
)
const
;
wb_object
object
(
pwr_tCid
cid
)
const
{
wb_object
o
;
return
o
;}
// Fix
wb_object
object
(
pwr_tCid
cid
)
const
;
wb_object
object
(
const
char
*
name
)
const
;
wb_attribute
attribute
(
pwr_tOid
oid
,
const
char
*
bname
,
const
char
*
aname
)
const
;
...
...
wb/lib/wb/src/wb_vrep.h
View file @
b963ac2c
...
...
@@ -69,6 +69,7 @@ public:
virtual
wb_orep
*
object
(
pwr_tStatus
*
sts
,
pwr_tOid
oid
)
=
0
;
virtual
wb_orep
*
object
(
pwr_tStatus
*
sts
,
wb_name
&
name
)
=
0
;
virtual
wb_orep
*
object
(
pwr_tStatus
*
sts
,
const
wb_orep
*
parent
,
wb_name
&
name
)
=
0
;
virtual
wb_orep
*
object
(
pwr_tStatus
*
sts
,
pwr_tCid
cid
)
=
0
;
virtual
wb_orep
*
createObject
(
pwr_tStatus
*
sts
,
wb_cdef
cdef
,
wb_destination
&
d
,
wb_name
&
name
)
=
0
;
...
...
wb/lib/wb/src/wb_vrepdb.h
View file @
b963ac2c
...
...
@@ -53,6 +53,7 @@ public:
virtual
wb_orep
*
object
(
pwr_tStatus
*
sts
);
virtual
wb_orep
*
object
(
pwr_tStatus
*
sts
,
pwr_tOid
oid
);
virtual
wb_orep
*
object
(
pwr_tStatus
*
sts
,
pwr_tCid
cid
)
{
*
sts
=
LDH__NYI
;
return
0
;}
virtual
wb_orep
*
object
(
pwr_tStatus
*
sts
,
wb_name
&
name
);
virtual
wb_orep
*
object
(
pwr_tStatus
*
sts
,
const
wb_orep
*
parent
,
wb_name
&
name
);
...
...
wb/lib/wb/src/wb_vrepdbs.h
View file @
b963ac2c
...
...
@@ -59,6 +59,7 @@ public:
virtual
wb_orep
*
object
(
pwr_tStatus
*
sts
,
pwr_tOid
oid
);
virtual
wb_orep
*
object
(
pwr_tStatus
*
sts
,
pwr_tCid
cid
)
{
*
sts
=
LDH__NYI
;
return
0
;}
virtual
wb_orep
*
object
(
pwr_tStatus
*
sts
,
wb_name
&
name
);
virtual
wb_orep
*
object
(
pwr_tStatus
*
sts
,
const
wb_orep
*
parent
,
wb_name
&
name
);
...
...
wb/lib/wb/src/wb_vrepmem.cpp
View file @
b963ac2c
...
...
@@ -71,6 +71,25 @@ wb_orep *wb_vrepmem::object(pwr_tStatus *sts, pwr_tOid oid)
return
new
wb_orepmem
(
this
,
n
);
}
wb_orep
*
wb_vrepmem
::
object
(
pwr_tStatus
*
sts
,
pwr_tCid
cid
)
{
if
(
root_object
)
{
mem_object
*
n
;
if
(
root_object
->
m_cid
==
cid
)
n
=
root_object
;
else
{
pwr_tOix
oix
=
0
;
n
=
root_object
->
next
(
cid
,
&
oix
);
}
if
(
n
)
{
*
sts
=
LDH__SUCCESS
;
return
new
wb_orepmem
(
this
,
n
);
}
}
*
sts
=
LDH__NOSUCHOBJ
;
return
0
;
}
wb_orep
*
wb_vrepmem
::
object
(
pwr_tStatus
*
sts
,
wb_name
&
name
)
{
mem_object
*
n
=
find
(
name
.
name
());
...
...
@@ -351,6 +370,16 @@ wb_orep *wb_vrepmem::last(pwr_tStatus *sts, const wb_orep *o)
wb_orep
*
wb_vrepmem
::
next
(
pwr_tStatus
*
sts
,
const
wb_orep
*
o
)
{
mem_object
*
mem
=
findObject
(
o
->
oid
().
oix
);
if
(
mem
)
{
pwr_tOix
oix
=
mem
->
m_oid
.
oix
;
mem_object
*
next
=
root_object
->
next
(
mem
->
m_cid
,
&
oix
);
if
(
next
)
{
wb_orepmem
*
orep
=
new
wb_orepmem
(
this
,
next
);
return
orep
;
}
}
*
sts
=
LDH__NOSUCHOBJ
;
return
0
;
}
...
...
@@ -547,6 +576,11 @@ wb_orep *wb_vrepmem::createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination
*
sts
=
LDH__BADDEST
;
return
0
;
}
// Check that name is unic
if
(
name
&&
!
nameCheck
(
dest
,
name
.
segment
(),
code
))
{
*
sts
=
LDH__NAMALREXI
;
return
0
;
}
}
pwr_tOix
oix
=
nextOix
();
...
...
@@ -744,6 +778,9 @@ bool wb_vrepmem::moveObject(pwr_tStatus *sts, wb_orep *orep, wb_destination &d)
mem_object
*
dest
;
ldh_eDest
code
=
d
.
code
();
if
(
cdh_ObjidIsEqual
(
d
.
oid
(),
orep
->
oid
()))
return
false
;
if
(
cdh_ObjidIsNull
(
d
.
oid
()))
{
dest
=
root_object
;
if
(
code
==
ldh_eDest_After
)
...
...
@@ -1325,6 +1362,31 @@ bool wb_vrepmem::nameCheck( mem_object *memo)
return
true
;
}
bool
wb_vrepmem
::
nameCheck
(
mem_object
*
dest
,
char
*
name
,
ldh_eDest
code
)
{
mem_object
*
o
;
switch
(
code
)
{
case
ldh_eDest_After
:
case
ldh_eDest_Before
:
o
=
dest
;
while
(
o
->
bws
)
o
=
o
->
bws
;
break
;
case
ldh_eDest_IntoFirst
:
case
ldh_eDest_IntoLast
:
o
=
dest
->
fch
;
break
;
default:
return
false
;
}
while
(
o
)
{
if
(
cdh_NoCaseStrcmp
(
name
,
o
->
name
())
==
0
)
return
false
;
o
=
o
->
fws
;
}
return
true
;
}
...
...
wb/lib/wb/src/wb_vrepmem.h
View file @
b963ac2c
...
...
@@ -76,6 +76,32 @@ class mem_object
return
true
;
}
mem_object
*
next
(
pwr_tCid
cid
,
pwr_tOix
*
oix
)
{
// search is turned on when oix = 0
if
(
*
oix
==
m_oid
.
oix
)
*
oix
=
0
;
mem_object
*
n
;
if
(
fch
)
{
if
(
!*
oix
&&
fch
->
m_cid
==
cid
)
return
fch
;
else
{
n
=
fch
->
next
(
cid
,
oix
);
if
(
n
)
return
n
;
}
}
if
(
fws
)
{
if
(
!*
oix
&&
fws
->
m_cid
==
cid
)
return
fws
;
else
{
n
=
fws
->
next
(
cid
,
oix
);
if
(
n
)
return
n
;
}
}
return
0
;
}
mem_object
*
find
(
wb_name
*
oname
,
int
level
);
size_t
rbody_size
;
...
...
@@ -171,6 +197,7 @@ public:
wb_orep
*
object
(
pwr_tStatus
*
sts
);
wb_orep
*
object
(
pwr_tStatus
*
sts
,
pwr_tOid
oid
);
wb_orep
*
object
(
pwr_tStatus
*
sts
,
pwr_tCid
cid
);
wb_orep
*
object
(
pwr_tStatus
*
sts
,
wb_name
&
name
);
wb_orep
*
object
(
pwr_tStatus
*
sts
,
const
wb_orep
*
parent
,
wb_name
&
name
)
{
return
0
;}
...
...
@@ -249,6 +276,7 @@ public:
private:
bool
nameCheck
(
mem_object
*
memo
);
bool
nameCheck
(
mem_object
*
parent
,
char
*
name
,
ldh_eDest
code
);
void
deleteChildren
(
mem_object
*
memo
);
};
...
...
wb/lib/wb/src/wb_vrepwbl.h
View file @
b963ac2c
...
...
@@ -126,6 +126,7 @@ public:
wb_orep
*
object
(
pwr_tStatus
*
sts
);
wb_orep
*
object
(
pwr_tStatus
*
sts
,
pwr_tOid
oid
);
wb_orep
*
object
(
pwr_tStatus
*
sts
,
pwr_tCid
cid
)
{
*
sts
=
LDH__NYI
;
return
0
;}
wb_orep
*
object
(
pwr_tStatus
*
sts
,
wb_name
&
name
);
wb_orep
*
object
(
pwr_tStatus
*
sts
,
const
wb_orep
*
parent
,
wb_name
&
name
)
{
return
0
;}
...
...
wb/lib/wb/src/wb_wnav.cpp
View file @
b963ac2c
...
...
@@ -2905,51 +2905,63 @@ void WNav::ldh_refresh( pwr_tObjid new_open)
brow_Redraw
(
brow
->
ctx
,
0
);
}
void
WNav
::
ldh_event
(
ldh_sEvent
*
e
vent
)
void
WNav
::
ldh_event
(
ldh_sEvent
*
e
)
{
WItem
*
item
;
ldh_sEvent
*
event
=
e
;
switch
(
event
->
Event
)
{
case
ldh_eEvent_ObjectCopied
:
case
ldh_eEvent_ObjectCreated
:
if
(
cdh_ObjidIsNull
(
event
->
NewParent
)
||
find
(
event
->
NewParent
,
(
void
**
)
&
item
))
ldh_refresh
(
event
->
NewParent
);
break
;
case
ldh_eEvent_ObjectDeleted
:
if
(
cdh_ObjidIsNull
(
event
->
NewParent
)
||
find
(
event
->
OldParent
,
(
void
**
)
&
item
))
ldh_refresh
(
event
->
NewParent
);
break
;
case
ldh_eEvent_ObjectMoved
:
if
(
cdh_ObjidIsNull
(
event
->
NewParent
)
||
cdh_ObjidIsNull
(
event
->
OldParent
)
||
find
(
event
->
NewParent
,
(
void
**
)
&
item
)
||
find
(
event
->
OldParent
,
(
void
**
)
&
item
))
ldh_refresh
(
event
->
NewParent
);
break
;
case
ldh_eEvent_AttributeModified
:
case
ldh_eEvent_ObjectRenamed
:
case
ldh_eEvent_BodyModified
:
if
(
find
(
event
->
Object
,
(
void
**
)
&
item
))
ldh_refresh
(
pwr_cNObjid
);
break
;
case
ldh_eEvent_ObjectTreeCopied
:
if
(
find
(
event
->
Object
,
(
void
**
)
&
item
))
ldh_refresh
(
event
->
Object
);
break
;
if
(
e
->
nep
)
// Multiple events
brow_SetNodraw
(
brow
->
ctx
);
case
ldh_eEvent_SessionReverted
:
ldh_refresh
(
pwr_cNObjid
);
break
;
while
(
event
)
{
switch
(
event
->
Event
)
{
case
ldh_eEvent_ObjectCopied
:
case
ldh_eEvent_ObjectCreated
:
if
(
cdh_ObjidIsNull
(
event
->
NewParent
)
||
find
(
event
->
NewParent
,
(
void
**
)
&
item
))
ldh_refresh
(
event
->
NewParent
);
break
;
case
ldh_eEvent_ObjectDeleted
:
if
(
cdh_ObjidIsNull
(
event
->
NewParent
)
||
find
(
event
->
OldParent
,
(
void
**
)
&
item
))
ldh_refresh
(
event
->
NewParent
);
break
;
case
ldh_eEvent_ObjectMoved
:
if
(
cdh_ObjidIsNull
(
event
->
NewParent
)
||
cdh_ObjidIsNull
(
event
->
OldParent
)
||
find
(
event
->
NewParent
,
(
void
**
)
&
item
)
||
find
(
event
->
OldParent
,
(
void
**
)
&
item
))
ldh_refresh
(
event
->
NewParent
);
break
;
case
ldh_eEvent_AttributeModified
:
case
ldh_eEvent_ObjectRenamed
:
case
ldh_eEvent_BodyModified
:
if
(
find
(
event
->
Object
,
(
void
**
)
&
item
))
ldh_refresh
(
pwr_cNObjid
);
break
;
case
ldh_eEvent_ObjectTreeCopied
:
if
(
find
(
event
->
Object
,
(
void
**
)
&
item
))
ldh_refresh
(
event
->
Object
);
break
;
case
ldh_eEvent_SessionReverted
:
ldh_refresh
(
pwr_cNObjid
);
break
;
default:
break
;
default:
break
;
}
event
=
event
->
nep
;
}
if
(
e
->
nep
)
{
brow_ResetNodraw
(
brow
->
ctx
);
brow_Redraw
(
brow
->
ctx
,
0
);
}
}
...
...
wb/lib/wb/src/wb_wnav_menu.cpp
View file @
b963ac2c
...
...
@@ -216,7 +216,7 @@ Widget wtt_create_popup_menu( Wtt *wtt, pwr_tObjid objid)
else
sel2_cnt
=
0
;
if
(
sel1_cnt
+
sel2_cnt
!=
0
)
if
(
sel1_cnt
+
sel2_cnt
!=
0
)
{
mcp
->
SelectedSet
=
sel1_cnt
+
sel2_cnt
>
1
?
ldh_eMenuSet_Many
:
ldh_eMenuSet_Object
;
}
...
...
@@ -238,6 +238,20 @@ Widget wtt_create_popup_menu( Wtt *wtt, pwr_tObjid objid)
mcp
->
Selected
[
sel1_cnt
+
sel2_cnt
].
Objid
=
pwr_cNObjid
;
mcp
->
SelectCount
=
sel1_cnt
+
sel2_cnt
;
if
(
sel1_cnt
+
sel2_cnt
==
0
)
{
pwr_tCid
cid
;
sts
=
wtt
->
palette
->
get_select
(
&
cid
);
if
(
ODD
(
sts
))
{
XtFree
(
(
char
*
)
mcp
->
Selected
);
mcp
->
Selected
=
(
pwr_sAttrRef
*
)
XtCalloc
(
2
,
sizeof
(
pwr_sAttrRef
));
mcp
->
SelectedSet
=
ldh_eMenuSet_Class
;
mcp
->
Selected
[
0
].
Objid
=
cdh_ClassIdToObjid
(
cid
);
mcp
->
Selected
[
1
].
Objid
=
pwr_cNObjid
;
mcp
->
SelectCount
=
1
;
}
}
sts
=
ldh_GetMenu
(
wtt
->
ldhses
,
mcp
);
if
(
EVEN
(
sts
)
||
mcp
->
ItemList
[
0
].
Level
==
0
)
{
return
NULL
;
...
...
wb/lib/wb/src/wb_wtt.cpp
View file @
b963ac2c
...
...
@@ -124,12 +124,8 @@ static pwr_tStatus wtt_ldh_this_session_cb (
{
Wtt
*
wtt
=
(
Wtt
*
)
ctx
;
while
(
event
)
{
wtt
->
wnav
->
ldh_event
(
event
);
wtt
->
wnavnode
->
ldh_event
(
event
);
event
=
event
->
nep
;
}
wtt
->
wnav
->
ldh_event
(
event
);
wtt
->
wnavnode
->
ldh_event
(
event
);
return
1
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment