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
e5535758
Commit
e5535758
authored
Mar 31, 2006
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Build methods
parent
697a61ef
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
1333 additions
and
12 deletions
+1333
-12
wb/exe/wb_cmd/src/os_linux/wb_cmd.cpp
wb/exe/wb_cmd/src/os_linux/wb_cmd.cpp
+3
-2
wb/exe/wb_cmd/src/os_linux/wb_cmdc.h
wb/exe/wb_cmd/src/os_linux/wb_cmdc.h
+6
-1
wb/lib/wb/src/wb.h
wb/lib/wb/src/wb.h
+4
-2
wb/lib/wb/src/wb_api.cpp
wb/lib/wb/src/wb_api.cpp
+6
-1
wb/lib/wb/src/wb_api.h
wb/lib/wb/src/wb_api.h
+3
-1
wb/lib/wb/src/wb_build.cpp
wb/lib/wb/src/wb_build.cpp
+589
-0
wb/lib/wb/src/wb_build.h
wb/lib/wb/src/wb_build.h
+56
-0
wb/lib/wb/src/wb_build_opt.h
wb/lib/wb/src/wb_build_opt.h
+33
-0
wb/lib/wb/src/wb_c_nodehier.cpp
wb/lib/wb/src/wb_c_nodehier.cpp
+76
-0
wb/lib/wb/src/wb_c_object.c
wb/lib/wb/src/wb_c_object.c
+17
-5
wb/lib/wb/src/wb_c_planthier.cpp
wb/lib/wb/src/wb_c_planthier.cpp
+76
-0
wb/lib/wb/src/wb_c_plcpgm.cpp
wb/lib/wb/src/wb_c_plcpgm.cpp
+154
-0
wb/lib/wb/src/wb_c_rootvolume.cpp
wb/lib/wb/src/wb_c_rootvolume.cpp
+76
-0
wb/lib/wb/src/wb_c_webhandler.cpp
wb/lib/wb/src/wb_c_webhandler.cpp
+128
-0
wb/lib/wb/src/wb_c_xttgraph.cpp
wb/lib/wb/src/wb_c_xttgraph.cpp
+106
-0
No files found.
wb/exe/wb_cmd/src/os_linux/wb_cmd.cpp
View file @
e5535758
/*
* Proview $Id: wb_cmd.cpp,v 1.
8 2005-12-15 07:41:17
claes Exp $
* Proview $Id: wb_cmd.cpp,v 1.
9 2006-03-31 14:24:34
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -276,7 +276,8 @@ static void cmd_close_cb( void *ctx)
}
Cmd
::
Cmd
()
:
ldhses
(
0
),
wbctx
(
0
),
volctx
(
0
),
volid
(
0
),
wnav
(
0
),
wb_type
(
0
)
ctx_type
(
wb_eUtility_Cmd
),
ldhses
(
0
),
wbctx
(
0
),
volctx
(
0
),
volid
(
0
),
wnav
(
0
),
wb_type
(
0
)
{
Widget
w
;
pwr_tStatus
sts
;
...
...
wb/exe/wb_cmd/src/os_linux/wb_cmdc.h
View file @
e5535758
/*
* Proview $Id: wb_cmdc.h,v 1.
2 2005-09-01 14:57:48
claes Exp $
* Proview $Id: wb_cmdc.h,v 1.
3 2006-03-31 14:24:34
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -28,6 +28,10 @@ extern "C" {
# include "pwr.h"
#endif
#ifndef wb_h
# include "wb.h"
#endif
#ifndef wb_ldh_h
# include "wb_ldh.h"
#endif
...
...
@@ -44,6 +48,7 @@ class Cmd {
public:
Cmd
();
wb_eUtility
ctx_type
;
ldh_tSesContext
ldhses
;
ldh_tWBContext
wbctx
;
ldh_tVolContext
volctx
;
...
...
wb/lib/wb/src/wb.h
View file @
e5535758
/*
* Proview $Id: wb.h,v 1.
9 2005-10-25 12:04:25
claes Exp $
* Proview $Id: wb.h,v 1.
10 2006-03-31 14:24:34
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -42,7 +42,9 @@ typedef enum {
wb_eUtility_PlcEditor
=
1000
,
wb_eUtility_AttributeEditor
=
1001
,
wb_eUtility_Distributor
=
1002
,
wb_eUtility_SpreadsheetEditor
=
1003
wb_eUtility_SpreadsheetEditor
=
1003
,
wb_eUtility_Cmd
=
1004
,
wb_eUtility_WNav
=
1005
}
wb_eUtility
;
#endif
...
...
wb/lib/wb/src/wb_api.cpp
View file @
e5535758
/*
* Proview $Id: wb_api.cpp,v 1.
8 2005-12-13 15:15:53
claes Exp $
* Proview $Id: wb_api.cpp,v 1.
9 2006-03-31 14:24:34
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -204,6 +204,11 @@ int wtt_command( wtt_tCtx wttctx, char *cmd)
return
((
Wtt
*
)
wttctx
)
->
wnav
->
command
(
cmd
);
}
int
wnav_command
(
wnav_tCtx
wnavctx
,
char
*
cmd
)
{
return
((
WNav
*
)
wnavctx
)
->
command
(
cmd
);
}
//
// Interface to Watt
//
...
...
wb/lib/wb/src/wb_api.h
View file @
e5535758
/*
* Proview $Id: wb_api.h,v 1.
6 2005-09-06 10:43:30
claes Exp $
* Proview $Id: wb_api.h,v 1.
7 2006-03-31 14:24:34
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -88,6 +88,7 @@ void nav_set_inputfocus( nav_tCtx navctx, int focus);
/* Wtt */
typedef
void
*
wtt_tCtx
;
typedef
void
*
wnav_tCtx
;
wtt_tCtx
wtt_new
(
void
*
parent_ctx
,
...
...
@@ -104,6 +105,7 @@ wtt_tCtx wtt_new(
int
wtt_get_select_first
(
wtt_tCtx
palctx
,
pwr_sAttrRef
*
attrref
,
int
*
is_attr
);
int
wtt_command
(
wtt_tCtx
wttctx
,
char
*
cmd
);
int
wnav_command
(
wnav_tCtx
wnavctx
,
char
*
cmd
);
typedef
void
*
watt_tCtx
;
watt_tCtx
watt_new
(
...
...
wb/lib/wb/src/wb_build.cpp
0 → 100644
View file @
e5535758
/*
* Proview $Id: wb_build.cpp,v 1.1 2006-03-31 14:24:34 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "co_msgwindow.h"
#include "co_dcli.h"
#include "co_time.h"
#include "wb_foe_msg.h"
#include "wb_pwrb_msg.h"
#include "wb_utl.h"
#include "wb_build.h"
#include "wb_name.h"
#include "wb_lfu.h"
#include <Xm/Xm.h>
#include <Xm/XmP.h>
#include <Xm/Text.h>
#include <Mrm/MrmPublic.h>
#include <X11/Intrinsic.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "glow.h"
#include "glow_growctx.h"
#include "glow_growapi.h"
#include "glow_growwidget.h"
#include "ge_graph.h"
#include "ge.h"
void
wb_build
::
classlist
(
pwr_tCid
cid
)
{
pwr_tStatus
sumsts
;
// Build all objects of specified class
sumsts
=
PWRB__NOBUILT
;
for
(
wb_object
o
=
m_session
.
object
(
cid
);
o
.
oddSts
();
o
=
o
.
next
())
{
// Call build method for object
switch
(
cid
)
{
case
pwr_cClass_plc
:
plcpgm
(
o
.
oid
());
break
;
case
pwr_cClass_XttGraph
:
xttgraph
(
o
.
oid
());
break
;
case
pwr_cClass_WebHandler
:
webhandler
(
o
.
oid
());
break
;
default:
m_sts
=
PWRB__NOBUILT
;
}
if
(
evenSts
())
sumsts
=
m_sts
;
else
if
(
sumsts
==
PWRB__NOBUILT
&&
m_sts
!=
PWRB__NOBUILT
&&
m_sts
!=
PWRB__INLIBHIER
)
sumsts
=
m_sts
;
}
m_sts
=
sumsts
;
}
void
wb_build
::
node
(
char
*
nodename
,
void
*
volumelist
,
int
volumecnt
)
{
lfu_t_volumelist
*
vlist
=
(
lfu_t_volumelist
*
)
volumelist
;
pwr_tTime
vtime
;
pwr_tTime
btime
;
pwr_tFileName
fname
;
pwr_tObjName
vname
;
int
bussid
=
-
1
;
int
rebuild
=
1
;
pwr_tStatus
status
;
printf
(
"Build node %s
\n
"
,
nodename
);
if
(
!
opt
.
manual
)
{
// Check if there is any new dbsfile
rebuild
=
0
;
for
(
int
i
=
0
;
i
<
volumecnt
;
i
++
)
{
if
(
cdh_NoCaseStrcmp
(
nodename
,
vlist
[
i
].
p1
)
==
0
)
{
if
(
bussid
==
-
1
)
{
char
systemname
[
80
],
systemgroup
[
80
],
pname
[
80
];
pwr_tVid
*
vl
;
pwr_tString40
*
vnl
;
int
vcnt
;
// Get time for current bootfile
status
=
sscanf
(
vlist
[
i
].
p3
,
"%d"
,
&
bussid
);
if
(
status
!=
1
)
{
// Bussid error
}
sprintf
(
fname
,
load_cNameBoot
,
load_cDirectory
,
nodename
,
bussid
);
dcli_translate_filename
(
fname
,
fname
);
status
=
lfu_ReadBootFile
(
fname
,
&
btime
,
systemname
,
systemgroup
,
&
vl
,
&
vnl
,
&
vcnt
,
pname
);
if
(
EVEN
(
status
))
{
rebuild
=
1
;
break
;
}
}
if
(
vlist
[
i
].
volume_id
==
m_session
.
vid
())
{
// Build current volume
volume
();
}
cdh_ToLower
(
vname
,
vlist
[
i
].
volume_name
);
if
(
vlist
[
i
].
volume_id
>=
cdh_cUserVolMin
&&
vlist
[
i
].
volume_id
<=
cdh_cUserVolMax
)
{
sprintf
(
fname
,
"$pwrp_load/%s.dbs"
,
vname
);
dcli_translate_filename
(
fname
,
fname
);
m_sts
=
dcli_file_time
(
fname
,
&
vtime
);
if
(
evenSts
())
{
// Dbs file is missing
return
;
}
if
(
vtime
.
tv_sec
>
btime
.
tv_sec
)
rebuild
=
1
;
}
}
}
}
if
(
opt
.
force
||
opt
.
manual
||
rebuild
)
m_sts
=
lfu_create_bootfile
(
nodename
,
(
lfu_t_volumelist
*
)
volumelist
,
volumecnt
,
opt
.
debug
);
else
m_sts
=
PWRB__NOBUILT
;
if
(
m_sts
!=
PWRB__NOBUILT
)
{
char
msg
[
200
];
sprintf
(
msg
,
"Build: Node %s"
,
nodename
);
MsgWindow
::
message
(
'I'
,
msg
,
msgw_ePop_No
);
}
}
void
wb_build
::
volume
()
{
switch
(
m_session
.
cid
())
{
case
pwr_eClass_RootVolume
:
case
pwr_eClass_SubVolume
:
case
pwr_eClass_SharedVolume
:
rootvolume
(
0
);
break
;
case
pwr_eClass_ClassVolume
:
classvolume
(
0
);
break
;
default:
;
}
}
void
wb_build
::
rootvolume
(
pwr_tVid
vid
)
{
pwr_tStatus
sumsts
,
plcsts
;
pwr_tOid
oid
;
pwr_tTime
modtime
;
pwr_tObjName
vname
;
pwr_tFileName
fname
;
pwr_tTime
dbs_time
,
rtt_time
;
pwr_tCmd
cmd
;
char
msg
[
80
];
if
(
!
opt
.
manual
)
{
// Build all plcpgm
classlist
(
pwr_cClass_plc
);
if
(
evenSts
())
return
;
plcsts
=
sumsts
=
m_sts
;
// Build all XttGraph
classlist
(
pwr_cClass_XttGraph
);
if
(
evenSts
())
return
;
if
(
sumsts
==
PWRB__NOBUILT
&&
m_sts
!=
PWRB__NOBUILT
)
sumsts
=
m_sts
;
classlist
(
pwr_cClass_WebHandler
);
if
(
evenSts
())
return
;
if
(
sumsts
==
PWRB__NOBUILT
&&
m_sts
!=
PWRB__NOBUILT
)
sumsts
=
m_sts
;
}
// Create loadfiles
oid
.
oix
=
0
;
oid
.
vid
=
m_session
.
vid
();
wb_attribute
a
=
m_session
.
attribute
(
oid
,
"SysBody"
,
"Modified"
);
if
(
!
a
)
{
m_sts
=
a
.
sts
();
return
;
}
a
.
value
(
&
modtime
);
if
(
!
a
)
{
m_sts
=
a
.
sts
();
return
;
}
cdh_ToLower
(
vname
,
m_session
.
name
());
sprintf
(
fname
,
"$pwrp_load/%s.dbs"
,
vname
);
dcli_translate_filename
(
fname
,
fname
);
m_sts
=
dcli_file_time
(
fname
,
&
dbs_time
);
if
(
opt
.
force
||
opt
.
manual
||
evenSts
()
||
time_Acomp
(
&
modtime
,
&
dbs_time
)
==
1
||
plcsts
!=
PWRB__NOBUILT
)
{
m_sts
=
lfu_create_loadfile
(
(
ldh_tSession
*
)
&
m_session
);
if
(
evenSts
())
return
;
m_sts
=
ldh_CreateLoadFile
(
(
ldh_tSession
*
)
&
m_session
);
if
(
evenSts
())
return
;
sprintf
(
msg
,
"Build: Volume Loadfiles created volume %s"
,
m_session
.
name
());
MsgWindow
::
message
(
'I'
,
msg
,
msgw_ePop_No
);
sumsts
=
PWRB__SUCCESS
;
}
else
m_sts
=
sumsts
;
cdh_uVolumeId
uvid
;
uvid
.
pwr
=
m_session
.
vid
();
sprintf
(
fname
,
"$pwrp_load/"
load_cNameRttCrr
,
uvid
.
v
.
vid_3
,
uvid
.
v
.
vid_2
,
uvid
.
v
.
vid_1
,
uvid
.
v
.
vid_0
);
dcli_translate_filename
(
fname
,
fname
);
m_sts
=
dcli_file_time
(
fname
,
&
rtt_time
);
if
(
opt
.
crossref
&&
(
evenSts
()
||
time_Acomp
(
&
modtime
,
&
rtt_time
)
==
1
))
{
strcat
(
cmd
,
"create rttfiles"
);
m_wnav
->
command
(
cmd
);
if
(
ODD
(
sumsts
))
sumsts
=
PWRB__SUCCESS
;
sprintf
(
msg
,
"Build: Volume Crossreference file generated volume %s"
,
m_session
.
name
());
MsgWindow
::
message
(
'I'
,
msg
,
msgw_ePop_No
);
}
m_sts
=
sumsts
;
}
void
wb_build
::
classvolume
(
pwr_tVid
vid
)
{
pwr_tCmd
cmd
;
pwr_tFileName
fname
;
pwr_tObjName
name
;
pwr_tTime
wbl_time
,
dbs_time
,
h_time
;
pwr_tStatus
fsts
;
if
(
vid
==
0
)
{
// Build current volume
cdh_ToLower
(
name
,
m_session
.
name
());
}
else
{
wb_env
env
=
m_session
.
env
();
wb_volume
v
=
env
.
volume
(
vid
);
if
(
!
v
)
{
m_sts
=
v
.
sts
();
return
;
}
strcpy
(
name
,
v
.
name
());
}
// Get time for wb_load file
sprintf
(
fname
,
"$pwrp_db/%s.wb_load"
,
name
);
dcli_translate_filename
(
fname
,
fname
);
m_sts
=
dcli_file_time
(
fname
,
&
wbl_time
);
if
(
evenSts
())
return
;
// Get time for dbs file
sprintf
(
fname
,
"$pwrp_load/%s.dbs"
,
name
);
dcli_translate_filename
(
fname
,
fname
);
fsts
=
dcli_file_time
(
fname
,
&
dbs_time
);
// Create new loadfile
if
(
EVEN
(
fsts
)
||
wbl_time
.
tv_sec
>
dbs_time
.
tv_sec
)
{
sprintf
(
cmd
,
"create snapshot/file=
\"
$pwrp_db/%s.wb_load
\"
"
,
name
);
m_sts
=
m_wnav
->
command
(
cmd
);
}
else
m_sts
=
PWRB__NOBUILT
;
// Get time for struct file
sprintf
(
fname
,
"$pwrp_inc/pwr_%sclasses.h"
,
name
);
dcli_translate_filename
(
fname
,
fname
);
fsts
=
dcli_file_time
(
fname
,
&
h_time
);
// Create new struct file
if
(
EVEN
(
fsts
)
||
wbl_time
.
tv_sec
>
h_time
.
tv_sec
)
{
sprintf
(
cmd
,
"create struct/file=
\"
$pwrp_db/%s.wb_load
\"
"
,
name
);
m_sts
=
m_wnav
->
command
(
cmd
);
}
if
(
m_sts
!=
PWRB__NOBUILT
)
{
char
msg
[
80
];
sprintf
(
msg
,
"Build: Volume %s"
,
name
);
MsgWindow
::
message
(
'I'
,
msg
,
msgw_ePop_No
);
}
}
void
wb_build
::
planthier
(
pwr_tOid
oid
)
{
pwr_tStatus
sumsts
;
m_hierarchy
=
oid
;
// Build all plcpgm
classlist
(
pwr_cClass_plc
);
if
(
evenSts
())
return
;
sumsts
=
m_sts
;
// Build all XttGraph
classlist
(
pwr_cClass_XttGraph
);
if
(
evenSts
())
return
;
if
(
sumsts
==
PWRB__NOBUILT
&&
m_sts
!=
PWRB__NOBUILT
)
sumsts
=
m_sts
;
m_sts
=
sumsts
;
}
void
wb_build
::
nodehier
(
pwr_tOid
oid
)
{
pwr_tStatus
sumsts
;
m_hierarchy
=
oid
;
// Build all XttGraph
classlist
(
pwr_cClass_XttGraph
);
if
(
evenSts
())
return
;
sumsts
=
m_sts
;
classlist
(
pwr_cClass_XttGraph
);
if
(
evenSts
())
return
;
if
(
sumsts
==
PWRB__NOBUILT
&&
m_sts
!=
PWRB__NOBUILT
)
sumsts
=
m_sts
;
classlist
(
pwr_cClass_WebHandler
);
if
(
evenSts
())
return
;
if
(
sumsts
==
PWRB__NOBUILT
&&
m_sts
!=
PWRB__NOBUILT
)
sumsts
=
m_sts
;
m_sts
=
sumsts
;
}
void
wb_build
::
plcpgm
(
pwr_tOid
oid
)
{
int
check_hierarchy
=
cdh_ObjidIsNotNull
(
m_hierarchy
);
int
hierarchy_found
=
0
;
wb_object
o
=
m_session
.
object
(
oid
);
if
(
!
o
)
{
m_sts
=
o
.
sts
();
return
;
}
// Check that no ancestor is a LibHier
for
(
wb_object
p
=
o
.
parent
();
p
.
oddSts
();
p
=
p
.
parent
())
{
if
(
p
.
cid
()
==
pwr_eClass_LibHier
)
{
m_sts
=
PWRB__INLIBHIER
;
return
;
}
if
(
check_hierarchy
&&
cdh_ObjidIsEqual
(
m_hierarchy
,
p
.
oid
()))
hierarchy_found
=
1
;
}
if
(
check_hierarchy
&&
!
hierarchy_found
)
{
m_sts
=
PWRB__NOBUILT
;
return
;
}
m_sts
=
utl_compile
(
(
ldh_tSession
*
)
&
m_session
,
ldh_SessionToWB
(
(
ldh_tSession
*
)
&
m_session
),
o
.
longName
().
name
(
cdh_mName_volumeStrict
),
0
,
0
,
0
,
!
opt
.
force
,
opt
.
debug
,
0
,
0
);
if
(
oddSts
()
&&
m_sts
!=
GSX__NOMODIF
)
{
char
msg
[
200
];
sprintf
(
msg
,
"Build: PlcPgm %s"
,
o
.
longName
().
name
(
cdh_mName_path
|
cdh_mName_object
));
MsgWindow
::
message
(
'I'
,
msg
,
msgw_ePop_No
,
oid
);
}
else
if
(
m_sts
==
GSX__NOMODIF
)
{
m_sts
=
PWRB__NOBUILT
;
}
}
void
wb_build
::
xttgraph
(
pwr_tOid
oid
)
{
pwr_tFileName
src_fname
,
dest_fname
;
pwr_tCmd
cmd
;
pwr_tString80
action
;
pwr_tTime
dest_time
,
src_time
;
int
check_hierarchy
=
cdh_ObjidIsNotNull
(
m_hierarchy
);
int
hierarchy_found
=
0
;
int
is_frame
,
is_applet
;
char
java_name
[
80
];
pwr_tStatus
fsts
;
int
jexport
;
wb_object
o
=
m_session
.
object
(
oid
);
if
(
!
o
)
{
m_sts
=
o
.
sts
();
return
;
}
// Check that no ancestor is a LibHier
for
(
wb_object
p
=
o
.
parent
();
p
.
oddSts
();
p
=
p
.
parent
())
{
if
(
p
.
cid
()
==
pwr_eClass_LibHier
)
{
m_sts
=
PWRB__INLIBHIER
;
return
;
}
if
(
check_hierarchy
&&
cdh_ObjidIsEqual
(
m_hierarchy
,
p
.
oid
()))
hierarchy_found
=
1
;
}
if
(
check_hierarchy
&&
!
hierarchy_found
)
{
m_sts
=
PWRB__NOBUILT
;
return
;
}
wb_attribute
a
=
m_session
.
attribute
(
oid
,
"RtBody"
,
"Action"
);
if
(
!
a
)
{
m_sts
=
a
.
sts
();
return
;
}
a
.
value
(
&
action
);
if
(
!
a
)
{
m_sts
=
a
.
sts
();
return
;
}
if
(
strstr
(
action
,
".pwg"
))
{
strcpy
(
src_fname
,
"$pwrp_pop/"
);
strcat
(
src_fname
,
action
);
dcli_translate_filename
(
src_fname
,
src_fname
);
m_sts
=
dcli_file_time
(
src_fname
,
&
src_time
);
if
(
evenSts
())
{
m_sts
=
PWRB__NOBUILT
;
return
;
}
strcpy
(
dest_fname
,
"$pwrp_exe/"
);
strcat
(
dest_fname
,
action
);
dcli_translate_filename
(
dest_fname
,
dest_fname
);
m_sts
=
dcli_file_time
(
dest_fname
,
&
dest_time
);
if
(
opt
.
force
||
evenSts
()
||
src_time
.
tv_sec
>
dest_time
.
tv_sec
)
{
sprintf
(
cmd
,
"cp %s %s"
,
src_fname
,
dest_fname
);
system
(
cmd
);
sprintf
(
cmd
,
"Build: XttGraph copy $pwrp_pop/%s -> $pwrp_exe"
,
action
);
MsgWindow
::
message
(
'I'
,
cmd
,
msgw_ePop_No
,
oid
);
m_sts
=
PWRB__SUCCESS
;
}
else
m_sts
=
PWRB__NOBUILT
;
jexport
=
0
;
fsts
=
grow_IsJava
(
src_fname
,
&
is_frame
,
&
is_applet
,
java_name
);
if
(
EVEN
(
fsts
))
{
m_sts
=
fsts
;
return
;
}
if
(
is_frame
)
{
// Check exported java frame
sprintf
(
dest_fname
,
"$pwrp_pop/%s.java"
,
java_name
);
dcli_translate_filename
(
dest_fname
,
dest_fname
);
fsts
=
dcli_file_time
(
dest_fname
,
&
dest_time
);
if
(
opt
.
force
||
EVEN
(
fsts
)
||
time_Acomp
(
&
src_time
,
&
dest_time
)
==
1
)
jexport
=
1
;
}
if
(
is_applet
)
{
// Check exported java applet
sprintf
(
dest_fname
,
"$pwrp_pop/%s_A.java"
,
java_name
);
dcli_translate_filename
(
dest_fname
,
dest_fname
);
fsts
=
dcli_file_time
(
dest_fname
,
&
dest_time
);
if
(
opt
.
force
||
EVEN
(
fsts
)
||
time_Acomp
(
&
src_time
,
&
dest_time
)
==
1
)
jexport
=
1
;
}
if
(
jexport
)
{
if
(
!
m_window
)
{
sprintf
(
cmd
,
"Build: XttGraph Unable to export java in this environment %s"
,
action
);
MsgWindow
::
message
(
'W'
,
cmd
,
msgw_ePop_No
,
oid
);
}
else
{
void
*
gectx
=
ge_new
(
NULL
,
(
Widget
)
m_window
,
(
ldh_tSession
*
)
&
m_session
,
0
,
action
);
strcpy
(
cmd
,
"export java"
);
ge_command
(
gectx
,
cmd
);
ge_del
(
gectx
);
sprintf
(
cmd
,
"Build: XttGraph Export java %s"
,
action
);
MsgWindow
::
message
(
'I'
,
cmd
,
msgw_ePop_No
,
oid
);
m_sts
=
PWRB__SUCCESS
;
}
}
}
}
void
wb_build
::
webhandler
(
pwr_tOid
oid
)
{
pwr_tTime
modtime
;
char
timestr
[
40
];
pwr_tString80
file_name
,
name
;
pwr_tFileName
fname
;
pwr_tTime
ftime
;
pwr_tTime
xtthelp_time
,
html_time
;
char
*
s
;
pwr_tStatus
fsts
;
wb_object
o
=
m_session
.
object
(
oid
);
if
(
!
o
)
{
m_sts
=
o
.
sts
();
return
;
}
modtime
=
o
.
modTime
();
time_AtoAscii
(
&
modtime
,
time_eFormat_DateAndTime
,
timestr
,
sizeof
(
timestr
));
printf
(
"WebHandler time: %s
\n
"
,
timestr
);
wb_attribute
a
=
m_session
.
attribute
(
oid
,
"RtBody"
,
"FileName"
);
if
(
!
a
)
{
m_sts
=
a
.
sts
();
return
;
}
a
.
value
(
&
file_name
);
if
(
!
a
)
{
m_sts
=
a
.
sts
();
return
;
}
// Parse the name of the start page
if
(
(
s
=
strrchr
(
file_name
,
'/'
))
||
(
s
=
strrchr
(
file_name
,
'<'
))
||
(
s
=
strrchr
(
file_name
,
':'
)))
strcpy
(
name
,
s
+
1
);
else
strcpy
(
name
,
file_name
);
if
(
(
s
=
strrchr
(
name
,
'.'
)))
*
s
=
0
;
sprintf
(
fname
,
"$pwrp_web/%s_opwin_menu.html"
,
name
);
dcli_translate_filename
(
fname
,
fname
);
fsts
=
dcli_file_time
(
fname
,
&
ftime
);
m_sts
=
PWRB__NOBUILT
;
if
(
opt
.
force
||
EVEN
(
fsts
)
||
time_Acomp
(
&
modtime
,
&
ftime
)
==
1
)
{
// modtime > ftime
m_sts
=
Graph
::
generate_web
(
(
ldh_tSession
*
)
&
m_session
);
if
(
evenSts
())
return
;
char
msg
[
200
];
sprintf
(
msg
,
"Build: WebHandler Webpage generated %s"
,
fname
);
MsgWindow
::
message
(
'I'
,
msg
,
msgw_ePop_No
,
oid
);
}
// Check if xtthelp should be converted to html
dcli_translate_filename
(
fname
,
"$pwrp_exe/xtt_help.dat"
);
fsts
=
dcli_file_time
(
fname
,
&
xtthelp_time
);
if
(
EVEN
(
fsts
))
return
;
dcli_translate_filename
(
fname
,
"$pwrp_web/xtt_help_index.html"
);
fsts
=
dcli_file_time
(
fname
,
&
html_time
);
if
(
opt
.
force
||
EVEN
(
fsts
)
||
time_Acomp
(
&
xtthelp_time
,
&
html_time
)
==
1
)
{
system
(
"co_convert -d $pwrp_web -t $pwrp_exe/xtt_help.dat"
);
char
msg
[
200
];
sprintf
(
msg
,
"Build: WebHandler xtt_help.dat converted to html"
);
MsgWindow
::
message
(
'I'
,
msg
,
msgw_ePop_No
,
oid
);
m_sts
=
PWRB__SUCCESS
;
}
}
wb/lib/wb/src/wb_build.h
0 → 100644
View file @
e5535758
/*
* Proview $Id: wb_build.h,v 1.1 2006-03-31 14:24:34 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#ifndef wb_build_h
#define wb_build_h
#include "pwr.h"
#include "wb_ldh.h"
#include "wb_session.h"
#include "wb_wnav.h"
#include "wb_build_opt.h"
class
Wtt
;
class
wb_build
:
public
wb_status
{
public:
wb_build
(
wb_session
ses
,
WNav
*
wnav
=
0
,
void
*
window
=
0
)
:
m_session
(
ses
),
m_wnav
(
wnav
),
m_hierarchy
(
pwr_cNOid
),
m_window
(
window
)
{};
void
classlist
(
pwr_tCid
cid
);
void
node
(
char
*
nodename
,
void
*
volumelist
,
int
volumecnt
);
void
volume
();
void
rootvolume
(
pwr_tVid
vid
);
void
classvolume
(
pwr_tVid
vid
);
void
planthier
(
pwr_tOid
oid
);
void
nodehier
(
pwr_tOid
oid
);
void
plcpgm
(
pwr_tOid
oid
);
void
xttgraph
(
pwr_tOid
oid
);
void
webhandler
(
pwr_tOid
oid
);
wb_build_opt
opt
;
wb_session
m_session
;
WNav
*
m_wnav
;
pwr_tOid
m_hierarchy
;
void
*
m_window
;
};
#endif
wb/lib/wb/src/wb_build_opt.h
0 → 100644
View file @
e5535758
/*
* Proview $Id: wb_build_opt.h,v 1.1 2006-03-31 14:24:34 claes Exp $
* Copyright (C) 2005 SSAB Oxelösund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#ifndef wb_build_opt_h
#define wb_build_opt_h
class
wb_build_opt
{
public:
wb_build_opt
()
:
force
(
0
),
debug
(
0
),
crossref
(
0
),
manual
(
0
)
{}
int
force
;
int
debug
;
int
crossref
;
int
manual
;
};
#endif
wb/lib/wb/src/wb_c_nodehier.cpp
0 → 100644
View file @
e5535758
/*
* Proview $Id: wb_c_nodehier.cpp,v 1.1 2006-03-31 14:24:34 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
/* wb_c_nodehier.c -- work bench methods of the NodeHier class. */
#include <string.h>
#include <X11/Intrinsic.h>
#undef Status
#include "wb_pwrs.h"
#include "wb_pwrs_msg.h"
#include "wb_pwrb_msg.h"
#include "wb_foe_msg.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "pwr_baseclasses.h"
#include "co_dcli.h"
#include <Xm/Xm.h>
#include <Xm/XmP.h>
#include <Mrm/MrmPublic.h>
#include <X11/Intrinsic.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "flow.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "flow_browwidget.h"
#include "wb_wnav.h"
#include "wb_build.h"
#include "co_msgwindow.h"
/*----------------------------------------------------------------------------*\
Build NodeHier.
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
Build
(
ldh_sMenuCall
*
ip
)
{
WNav
*
wnav
=
(
WNav
*
)
ip
->
EditorContext
;
wb_build
build
(
*
(
wb_session
*
)
ip
->
PointedSession
,
wnav
,
ip
->
WindowContext
);
build
.
opt
=
wnav
->
gbl
.
build
;
build
.
nodehier
(
ip
->
Pointed
.
Objid
);
if
(
build
.
sts
()
==
PWRB__NOBUILT
)
wnav
->
message
(
'I'
,
"Nothing to build"
);
return
build
.
sts
();
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport
pwr_BindMethods
(
$
NodeHier
)
=
{
pwr_BindMethod
(
Build
),
pwr_NullMethod
};
wb/lib/wb/src/wb_c_object.c
View file @
e5535758
/*
* Proview $Id: wb_c_object.c,v 1.
8 2005-12-06 10:54:51
claes Exp $
* Proview $Id: wb_c_object.c,v 1.
9 2006-03-31 14:24:34
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -31,6 +31,7 @@
#include "co_api.h"
#include <X11/Intrinsic.h>
#include "wb_api.h"
#include "wb_login.h"
static
pwr_tStatus
CopyObject
(
ldh_sMenuCall
*
ip
...
...
@@ -564,7 +565,7 @@ static pwr_tStatus ClassHelp( ldh_sMenuCall *ip)
else
sprintf
(
cmd
,
"help %s /strict"
,
cname
);
w
tt
_command
(
ip
->
EditorContext
,
cmd
);
w
nav
_command
(
ip
->
EditorContext
,
cmd
);
return
1
;
}
...
...
@@ -597,7 +598,7 @@ static pwr_tStatus HelpClass( ldh_sMenuCall *ip)
sprintf
(
cmd
,
"help %s /helpfile=
\"
$pwr_exe/%s/%s_xtthelp.dat
\"
/strict"
,
cname
,
lng_get_language_str
(),
vname
);
w
tt
_command
(
ip
->
EditorContext
,
cmd
);
w
nav
_command
(
ip
->
EditorContext
,
cmd
);
return
1
;
}
...
...
@@ -606,7 +607,7 @@ static pwr_tStatus HelpClass( ldh_sMenuCall *ip)
else
sprintf
(
cmd
,
"help %s /strict"
,
cname
);
w
tt
_command
(
ip
->
EditorContext
,
cmd
);
w
nav
_command
(
ip
->
EditorContext
,
cmd
);
return
1
;
}
...
...
@@ -637,7 +638,7 @@ static pwr_tStatus Help( ldh_sMenuCall *ip)
sprintf
(
cmd
,
"help %s /strict"
,
topic
);
free
(
topic
);
w
tt
_command
(
ip
->
EditorContext
,
cmd
);
w
nav
_command
(
ip
->
EditorContext
,
cmd
);
return
1
;
}
...
...
@@ -955,6 +956,16 @@ static pwr_tStatus ConfigureComponentFilter( ldh_sMenuCall *ip)
}
// Common Build filter
static
pwr_tStatus
BuildFilter
(
ldh_sMenuCall
*
ip
)
{
if
(
login_prv
.
priv
&
pwr_mPrv_DevConfig
)
return
1
;
else
return
0
;
}
pwr_dExport
pwr_BindMethods
(
$
Object
)
=
{
pwr_BindMethod
(
CreateObject
),
pwr_BindMethod
(
CopyObject
),
...
...
@@ -980,6 +991,7 @@ pwr_dExport pwr_BindMethods($Object) = {
pwr_BindMethod
(
DisableFilter
),
pwr_BindMethod
(
ConfigureComponent
),
pwr_BindMethod
(
ConfigureComponentFilter
),
pwr_BindMethod
(
BuildFilter
),
pwr_NullMethod
};
...
...
wb/lib/wb/src/wb_c_planthier.cpp
0 → 100644
View file @
e5535758
/*
* Proview $Id: wb_c_planthier.cpp,v 1.1 2006-03-31 14:24:34 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
/* wb_c_planthier.c -- work bench methods of the PlantHier class. */
#include <string.h>
#include <X11/Intrinsic.h>
#undef Status
#include "wb_pwrs.h"
#include "wb_pwrs_msg.h"
#include "wb_pwrb_msg.h"
#include "wb_foe_msg.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "pwr_baseclasses.h"
#include "co_dcli.h"
#include <Xm/Xm.h>
#include <Xm/XmP.h>
#include <Mrm/MrmPublic.h>
#include <X11/Intrinsic.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "flow.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "flow_browwidget.h"
#include "wb_wnav.h"
#include "wb_build.h"
#include "co_msgwindow.h"
/*----------------------------------------------------------------------------*\
Build volume.
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
Build
(
ldh_sMenuCall
*
ip
)
{
WNav
*
wnav
=
(
WNav
*
)
ip
->
EditorContext
;
wb_build
build
(
*
(
wb_session
*
)
ip
->
PointedSession
,
wnav
,
ip
->
WindowContext
);
build
.
opt
=
wnav
->
gbl
.
build
;
build
.
planthier
(
ip
->
Pointed
.
Objid
);
if
(
build
.
sts
()
==
PWRB__NOBUILT
)
wnav
->
message
(
'I'
,
"Nothing to build"
);
return
build
.
sts
();
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport
pwr_BindMethods
(
$
PlantHier
)
=
{
pwr_BindMethod
(
Build
),
pwr_NullMethod
};
wb/lib/wb/src/wb_c_plcpgm.cpp
0 → 100644
View file @
e5535758
/*
* Proview $Id: wb_c_plcpgm.cpp,v 1.1 2006-03-31 14:24:34 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
/* wb_c_plcpgm.c -- work bench methods of the PlcPgm class. */
#include <X11/Intrinsic.h>
#undef Status
#include "wb_pwrs.h"
#include "pwr_baseclasses.h"
#include "wb_ldh_msg.h"
#include "wb_ldh.h"
#include "wb_foe_api.h"
#include "wb_pwrb_msg.h"
#include "wb_foe_msg.h"
#include "wb_wsx.h"
#include "wb_wsx_msg.h"
#include "wb_utl.h"
#include <Xm/Xm.h>
#include <Xm/XmP.h>
#include <Mrm/MrmPublic.h>
#include <X11/Intrinsic.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "flow.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "flow_browwidget.h"
#include "wb_wnav.h"
#include "wb_build.h"
/*----------------------------------------------------------------------------*\
To open a PLC program with the PLC editor.
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
OpenProgram
(
ldh_sMenuCall
*
ip
)
{
foe_Open
(
ip
->
EditorContext
,
ip
->
WindowContext
,
ip
->
PointedSession
,
ip
->
Pointed
.
Objid
);
return
1
;
}
/*----------------------------------------------------------------------------*\
Build, i.e. compile the plcpgm.
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
Build
(
ldh_sMenuCall
*
ip
)
{
WNav
*
wnav
=
(
WNav
*
)
ip
->
EditorContext
;
wb_build
build
(
*
(
wb_session
*
)
ip
->
PointedSession
,
wnav
,
ip
->
WindowContext
);
build
.
opt
=
wnav
->
gbl
.
build
;
build
.
plcpgm
(
ip
->
Pointed
.
Objid
);
if
(
build
.
sts
()
==
PWRB__NOBUILT
)
wnav
->
message
(
'I'
,
"Nothing to build"
);
return
build
.
sts
();
}
/*----------------------------------------------------------------------------*\
Syntax check.
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tObjid
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
pwr_tStatus
sts
;
pwr_tObjid
*
ThreadObjectPtr
;
int
size
;
pwr_tObjid
child
;
pwr_tClassId
cid
;
/*
Check that ScanTime is set to something.
*/
sts
=
ldh_GetObjectPar
(
Session
,
Object
,
"RtBody"
,
"ThreadObject"
,
(
char
**
)
&
ThreadObjectPtr
,
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ldh_GetObjectClass
(
Session
,
*
ThreadObjectPtr
,
&
cid
);
if
(
EVEN
(
sts
))
wsx_error_msg
(
Session
,
WSX__PLCTHREAD
,
Object
,
ErrorCount
,
WarningCount
);
else
if
(
cid
!=
pwr_cClass_PlcThread
)
wsx_error_msg
(
Session
,
WSX__PLCTHREAD
,
Object
,
ErrorCount
,
WarningCount
);
free
(
(
char
*
)
ThreadObjectPtr
);
/*
Check that the child is a plcwindow.
*/
sts
=
ldh_GetChild
(
Session
,
Object
,
&
child
);
if
(
EVEN
(
sts
))
{
wsx_error_msg
(
Session
,
WSX__PLCWIND
,
Object
,
ErrorCount
,
WarningCount
);
}
else
{
sts
=
ldh_GetObjectClass
(
Session
,
child
,
&
cid
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
cid
!=
pwr_cClass_windowplc
)
wsx_error_msg
(
Session
,
WSX__PLCCHILD
,
Object
,
ErrorCount
,
WarningCount
);
sts
=
ldh_GetNextSibling
(
Session
,
child
,
&
child
);
if
(
ODD
(
sts
))
wsx_error_msg
(
Session
,
WSX__PLCCHILD
,
Object
,
ErrorCount
,
WarningCount
);
}
return
PWRB__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport
pwr_BindMethods
(
PlcPgm
)
=
{
pwr_BindMethod
(
OpenProgram
),
pwr_BindMethod
(
Build
),
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
wb/lib/wb/src/wb_c_rootvolume.cpp
0 → 100644
View file @
e5535758
/*
* Proview $Id: wb_c_rootvolume.cpp,v 1.1 2006-03-31 14:24:34 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
/* wb_c_rootvolume.c -- work bench methods of the RootVolume class. */
#include <string.h>
#include <X11/Intrinsic.h>
#undef Status
#include "wb_pwrs.h"
#include "wb_pwrs_msg.h"
#include "wb_pwrb_msg.h"
#include "wb_foe_msg.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "pwr_baseclasses.h"
#include "co_dcli.h"
#include "wb_lfu.h"
#include <Xm/Xm.h>
#include <Xm/XmP.h>
#include <Mrm/MrmPublic.h>
#include <X11/Intrinsic.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "flow.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "flow_browwidget.h"
#include "wb_wtt.h"
#include "co_msgwindow.h"
/*----------------------------------------------------------------------------*\
Syntax check.
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tObjid
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
pwr_tStatus
sts
;
sts
=
wsx_CheckVolume
(
Session
,
Object
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
return
PWRS__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport
pwr_BindMethods
(
$
RootVolume
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
wb/lib/wb/src/wb_c_webhandler.cpp
0 → 100644
View file @
e5535758
/*
* Proview $Id: wb_c_webhandler.cpp,v 1.1 2006-03-31 14:24:34 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
/* wb_c_webhandler.cpp -- work bench methods of the WebHandler class. */
#include <X11/Intrinsic.h>
#undef Status
#include "wb_pwrs.h"
#include "pwr_baseclasses.h"
#include "wb_ldh_msg.h"
#include "wb_ldh.h"
#include "ge.h"
#include "wb_pwrb_msg.h"
#include "wb_wsx.h"
#include "wb_wsx_msg.h"
#include "co_cdh.h"
#include "co_dcli.h"
#include <Xm/Xm.h>
#include <Xm/XmP.h>
#include <Mrm/MrmPublic.h>
#include <X11/Intrinsic.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "flow.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "flow_browwidget.h"
#include "wb_wnav.h"
#include "wb_build.h"
#include "co_msgwindow.h"
static
pwr_tStatus
Build
(
ldh_sMenuCall
*
ip
)
{
WNav
*
wnav
=
(
WNav
*
)
ip
->
EditorContext
;
wb_build
build
(
*
(
wb_session
*
)
ip
->
PointedSession
);
build
.
opt
=
wnav
->
gbl
.
build
;
build
.
webhandler
(
ip
->
Pointed
.
Objid
);
if
(
build
.
sts
()
==
PWRB__NOBUILT
)
wnav
->
message
(
'I'
,
"Nothing to build"
);
return
build
.
sts
();
}
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
PWRB__SUCCESS
;
}
pwr_dExport
pwr_BindMethods
(
WebHandler
)
=
{
pwr_BindMethod
(
Build
),
pwr_BindMethod
(
PostCreate
),
pwr_NullMethod
};
wb/lib/wb/src/wb_c_xttgraph.cpp
0 → 100644
View file @
e5535758
/*
* Proview $Id: wb_c_xttgraph.cpp,v 1.1 2006-03-31 14:24:34 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
/* wb_c_xttgraph.c -- work bench methods of the XttGraph class. */
#include <X11/Intrinsic.h>
#undef Status
#include "wb_pwrs.h"
#include "pwr_baseclasses.h"
#include "wb_ldh_msg.h"
#include "wb_ldh.h"
#include "ge.h"
#include "wb_pwrb_msg.h"
#include "wb_wsx.h"
#include "wb_wsx_msg.h"
#include "co_cdh.h"
#include "co_dcli.h"
#include <Xm/Xm.h>
#include <Xm/XmP.h>
#include <Mrm/MrmPublic.h>
#include <X11/Intrinsic.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "flow.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "flow_browwidget.h"
#include "wb_wtt.h"
#include "wb_build.h"
#include "co_msgwindow.h"
/*----------------------------------------------------------------------------*\
To open Ge.
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
OpenGraph
(
ldh_sMenuCall
*
ip
)
{
int
sts
;
char
*
action
;
int
size
;
char
graph_name
[
80
];
sts
=
ldh_GetObjectPar
(
ip
->
PointedSession
,
ip
->
Pointed
.
Objid
,
"RtBody"
,
"Action"
,
&
action
,
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
cdh_ToLower
(
graph_name
,
action
);
free
(
(
char
*
)
action
);
if
(
strstr
(
graph_name
,
".pwg"
))
{
ge_new
(
NULL
,
(
Widget
)
ip
->
WindowContext
,
ip
->
PointedSession
,
0
,
graph_name
);
return
1
;
}
return
PWRB__GRAPHACTION
;
}
static
pwr_tStatus
Build
(
ldh_sMenuCall
*
ip
)
{
WNav
*
wnav
=
(
WNav
*
)
ip
->
EditorContext
;
wb_build
build
(
*
(
wb_session
*
)
ip
->
PointedSession
,
wnav
,
ip
->
WindowContext
);
build
.
opt
=
wnav
->
gbl
.
build
;
build
.
xttgraph
(
ip
->
Pointed
.
Objid
);
if
(
build
.
sts
()
==
PWRB__NOBUILT
)
wnav
->
message
(
'I'
,
"Nothing to build"
);
return
build
.
sts
();
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport
pwr_BindMethods
(
XttGraph
)
=
{
pwr_BindMethod
(
OpenGraph
),
pwr_BindMethod
(
Build
),
pwr_NullMethod
};
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