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
b564b91f
Commit
b564b91f
authored
Oct 28, 2009
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wb method CheckSyntax updated with new check functions, and SyntaxCheck in configurator popup menu
parent
7645369d
Changes
95
Show whitespace changes
Inline
Side-by-side
Showing
95 changed files
with
3481 additions
and
428 deletions
+3481
-428
abb/lib/wb/src/os_linux/hw_x86/makefile
abb/lib/wb/src/os_linux/hw_x86/makefile
+15
-0
abb/lib/wb/src/os_linux/hw_x86_64/makefile
abb/lib/wb/src/os_linux/hw_x86_64/makefile
+15
-0
abb/lib/wb/src/wb_abb.meth
abb/lib/wb/src/wb_abb.meth
+3
-0
abb/lib/wb/src/wb_c_abb_acc800.cpp
abb/lib/wb/src/wb_c_abb_acc800.cpp
+69
-0
abb/lib/wb/src/wb_c_abb_acs800_1.cpp
abb/lib/wb/src/wb_c_abb_acs800_1.cpp
+69
-0
abb/lib/wb/src/wb_c_abb_acs800motoraggr.cpp
abb/lib/wb/src/wb_c_abb_acs800motoraggr.cpp
+63
-0
bcomp/lib/wb/src/os_linux/hw_x86/makefile
bcomp/lib/wb/src/os_linux/hw_x86/makefile
+15
-0
bcomp/lib/wb/src/os_linux/hw_x86_64/makefile
bcomp/lib/wb/src/os_linux/hw_x86_64/makefile
+15
-0
bcomp/lib/wb/src/wb_bcomp.meth
bcomp/lib/wb/src/wb_bcomp.meth
+20
-0
bcomp/lib/wb/src/wb_c_basecdamper.cpp
bcomp/lib/wb/src/wb_c_basecdamper.cpp
+63
-0
bcomp/lib/wb/src/wb_c_basecircuitbreaker.cpp
bcomp/lib/wb/src/wb_c_basecircuitbreaker.cpp
+58
-0
bcomp/lib/wb/src/wb_c_basecontactor.cpp
bcomp/lib/wb/src/wb_c_basecontactor.cpp
+63
-0
bcomp/lib/wb/src/wb_c_basecvalve.cpp
bcomp/lib/wb/src/wb_c_basecvalve.cpp
+63
-0
bcomp/lib/wb/src/wb_c_basedirvalve.cpp
bcomp/lib/wb/src/wb_c_basedirvalve.cpp
+58
-0
bcomp/lib/wb/src/wb_c_basefcppo3.cpp
bcomp/lib/wb/src/wb_c_basefcppo3.cpp
+69
-0
bcomp/lib/wb/src/wb_c_basefcppo3motoraggr.cpp
bcomp/lib/wb/src/wb_c_basefcppo3motoraggr.cpp
+63
-0
bcomp/lib/wb/src/wb_c_basefcppo5.cpp
bcomp/lib/wb/src/wb_c_basefcppo5.cpp
+69
-0
bcomp/lib/wb/src/wb_c_basefcppo5motoraggr.cpp
bcomp/lib/wb/src/wb_c_basefcppo5motoraggr.cpp
+63
-0
bcomp/lib/wb/src/wb_c_basefilter.cpp
bcomp/lib/wb/src/wb_c_basefilter.cpp
+58
-0
bcomp/lib/wb/src/wb_c_basemanvalve.cpp
bcomp/lib/wb/src/wb_c_basemanvalve.cpp
+58
-0
bcomp/lib/wb/src/wb_c_basemotoraggr.cpp
bcomp/lib/wb/src/wb_c_basemotoraggr.cpp
+63
-0
bcomp/lib/wb/src/wb_c_basemotorincrdecraggr.cpp
bcomp/lib/wb/src/wb_c_basemotorincrdecraggr.cpp
+63
-0
bcomp/lib/wb/src/wb_c_basemvalve.cpp
bcomp/lib/wb/src/wb_c_basemvalve.cpp
+63
-0
bcomp/lib/wb/src/wb_c_baseoverloadrelay.cpp
bcomp/lib/wb/src/wb_c_baseoverloadrelay.cpp
+58
-0
bcomp/lib/wb/src/wb_c_basepositsensor.cpp
bcomp/lib/wb/src/wb_c_basepositsensor.cpp
+63
-0
bcomp/lib/wb/src/wb_c_basepropvalve.cpp
bcomp/lib/wb/src/wb_c_basepropvalve.cpp
+58
-0
bcomp/lib/wb/src/wb_c_basesafetyswitch.cpp
bcomp/lib/wb/src/wb_c_basesafetyswitch.cpp
+58
-0
bcomp/lib/wb/src/wb_c_basesensor.cpp
bcomp/lib/wb/src/wb_c_basesensor.cpp
+63
-0
bcomp/lib/wb/src/wb_c_basesupswitch.cpp
bcomp/lib/wb/src/wb_c_basesupswitch.cpp
+58
-0
profibus/lib/wb/src/wb_c_pb_dp_slave.cpp
profibus/lib/wb/src/wb_c_pb_dp_slave.cpp
+23
-0
profibus/lib/wb/src/wb_c_pb_module.cpp
profibus/lib/wb/src/wb_c_pb_module.cpp
+62
-0
profibus/lib/wb/src/wb_c_pncontrollersoftingpnak.cpp
profibus/lib/wb/src/wb_c_pncontrollersoftingpnak.cpp
+62
-0
profibus/lib/wb/src/wb_c_pndevice.cpp
profibus/lib/wb/src/wb_c_pndevice.cpp
+23
-0
profibus/lib/wb/src/wb_c_pnmodule.cpp
profibus/lib/wb/src/wb_c_pnmodule.cpp
+62
-0
profibus/lib/wb/src/wb_c_profiboard.cpp
profibus/lib/wb/src/wb_c_profiboard.cpp
+62
-0
profibus/lib/wb/src/wb_profibus.meth
profibus/lib/wb/src/wb_profibus.meth
+5
-1
src/msg/wb/src/wb_wsx_msg.msg
src/msg/wb/src/wb_wsx_msg.msg
+2
-2
src/wbl/pwrs/src/pwrs_c_object.wb_load
src/wbl/pwrs/src/pwrs_c_object.wb_load
+36
-0
ssabox/lib/wb/src/wb_c_ai_ai32up.cpp
ssabox/lib/wb/src/wb_c_ai_ai32up.cpp
+1
-1
ssabox/lib/wb/src/wb_c_ai_hvai32.cpp
ssabox/lib/wb/src/wb_c_ai_hvai32.cpp
+1
-1
ssabox/lib/wb/src/wb_c_ao_ao8up.cpp
ssabox/lib/wb/src/wb_c_ao_ao8up.cpp
+1
-1
ssabox/lib/wb/src/wb_c_ao_hvao4.cpp
ssabox/lib/wb/src/wb_c_ao_hvao4.cpp
+1
-1
ssabox/lib/wb/src/wb_c_co_co4up.cpp
ssabox/lib/wb/src/wb_c_co_co4up.cpp
+1
-1
ssabox/lib/wb/src/wb_c_co_pi24bo.cpp
ssabox/lib/wb/src/wb_c_co_pi24bo.cpp
+1
-1
ssabox/lib/wb/src/wb_c_di_dix2.cpp
ssabox/lib/wb/src/wb_c_di_dix2.cpp
+1
-1
ssabox/lib/wb/src/wb_c_do_hvdo32.cpp
ssabox/lib/wb/src/wb_c_do_hvdo32.cpp
+1
-1
ssabox/lib/wb/src/wb_c_ssab_baseacard.cpp
ssabox/lib/wb/src/wb_c_ssab_baseacard.cpp
+54
-0
ssabox/lib/wb/src/wb_c_ssab_basedicard.cpp
ssabox/lib/wb/src/wb_c_ssab_basedicard.cpp
+55
-0
ssabox/lib/wb/src/wb_c_ssab_basedocard.cpp
ssabox/lib/wb/src/wb_c_ssab_basedocard.cpp
+54
-0
ssabox/lib/wb/src/wb_ssabox.meth
ssabox/lib/wb/src/wb_ssabox.meth
+3
-0
wb/changelog.txt
wb/changelog.txt
+4
-1
wb/exe/wb/src/wb_main.cpp
wb/exe/wb/src/wb_main.cpp
+0
-2
wb/lib/wb/gtk/wb_foe_gtk.cpp
wb/lib/wb/gtk/wb_foe_gtk.cpp
+1
-1
wb/lib/wb/gtk/wb_wtt_gtk.cpp
wb/lib/wb/gtk/wb_wtt_gtk.cpp
+4
-4
wb/lib/wb/src/wb_c_ai.cpp
wb/lib/wb/src/wb_c_ai.cpp
+1
-1
wb/lib/wb/src/wb_c_ao.cpp
wb/lib/wb/src/wb_c_ao.cpp
+1
-1
wb/lib/wb/src/wb_c_backup.cpp
wb/lib/wb/src/wb_c_backup.cpp
+69
-56
wb/lib/wb/src/wb_c_chanai.cpp
wb/lib/wb/src/wb_c_chanai.cpp
+1
-1
wb/lib/wb/src/wb_c_chanait.cpp
wb/lib/wb/src/wb_c_chanait.cpp
+1
-1
wb/lib/wb/src/wb_c_chanao.cpp
wb/lib/wb/src/wb_c_chanao.cpp
+1
-1
wb/lib/wb/src/wb_c_chanco.cpp
wb/lib/wb/src/wb_c_chanco.cpp
+3
-2
wb/lib/wb/src/wb_c_chandi.cpp
wb/lib/wb/src/wb_c_chandi.cpp
+1
-1
wb/lib/wb/src/wb_c_chando.cpp
wb/lib/wb/src/wb_c_chando.cpp
+1
-1
wb/lib/wb/src/wb_c_chanii.cpp
wb/lib/wb/src/wb_c_chanii.cpp
+1
-1
wb/lib/wb/src/wb_c_chanio.cpp
wb/lib/wb/src/wb_c_chanio.cpp
+1
-1
wb/lib/wb/src/wb_c_co.cpp
wb/lib/wb/src/wb_c_co.cpp
+1
-1
wb/lib/wb/src/wb_c_di.cpp
wb/lib/wb/src/wb_c_di.cpp
+1
-1
wb/lib/wb/src/wb_c_do.cpp
wb/lib/wb/src/wb_c_do.cpp
+1
-1
wb/lib/wb/src/wb_c_dstrend.cpp
wb/lib/wb/src/wb_c_dstrend.cpp
+60
-13
wb/lib/wb/src/wb_c_friendnodeconfig.cpp
wb/lib/wb/src/wb_c_friendnodeconfig.cpp
+99
-0
wb/lib/wb/src/wb_c_ii.cpp
wb/lib/wb/src/wb_c_ii.cpp
+1
-1
wb/lib/wb/src/wb_c_io.cpp
wb/lib/wb/src/wb_c_io.cpp
+1
-1
wb/lib/wb/src/wb_c_mountobject.cpp
wb/lib/wb/src/wb_c_mountobject.cpp
+60
-0
wb/lib/wb/src/wb_c_node.cpp
wb/lib/wb/src/wb_c_node.cpp
+64
-0
wb/lib/wb/src/wb_c_nodeconfig.cpp
wb/lib/wb/src/wb_c_nodeconfig.cpp
+82
-0
wb/lib/wb/src/wb_c_object.cpp
wb/lib/wb/src/wb_c_object.cpp
+27
-0
wb/lib/wb/src/wb_c_opplace.cpp
wb/lib/wb/src/wb_c_opplace.cpp
+39
-0
wb/lib/wb/src/wb_c_planthier.cpp
wb/lib/wb/src/wb_c_planthier.cpp
+23
-0
wb/lib/wb/src/wb_c_plcpgm.cpp
wb/lib/wb/src/wb_c_plcpgm.cpp
+64
-47
wb/lib/wb/src/wb_c_po.cpp
wb/lib/wb/src/wb_c_po.cpp
+1
-1
wb/lib/wb/src/wb_c_rootvolume.cpp
wb/lib/wb/src/wb_c_rootvolume.cpp
+2
-2
wb/lib/wb/src/wb_c_sevhist.cpp
wb/lib/wb/src/wb_c_sevhist.cpp
+70
-4
wb/lib/wb/src/wb_c_sevnodeconfig.cpp
wb/lib/wb/src/wb_c_sevnodeconfig.cpp
+76
-0
wb/lib/wb/src/wb_c_subvolume.cpp
wb/lib/wb/src/wb_c_subvolume.cpp
+2
-2
wb/lib/wb/src/wb_c_system.cpp
wb/lib/wb/src/wb_c_system.cpp
+88
-0
wb/lib/wb/src/wb_i_base_methods.cpp
wb/lib/wb/src/wb_i_base_methods.cpp
+2
-0
wb/lib/wb/src/wb_i_system_methods.cpp
wb/lib/wb/src/wb_i_system_methods.cpp
+4
-0
wb/lib/wb/src/wb_pwrs.h
wb/lib/wb/src/wb_pwrs.h
+2
-2
wb/lib/wb/src/wb_volume.cpp
wb/lib/wb/src/wb_volume.cpp
+112
-34
wb/lib/wb/src/wb_volume.h
wb/lib/wb/src/wb_volume.h
+2
-1
wb/lib/wb/src/wb_wb.meth
wb/lib/wb/src/wb_wb.meth
+1
-0
wb/lib/wb/src/wb_wnav_command.cpp
wb/lib/wb/src/wb_wnav_command.cpp
+48
-1
wb/lib/wb/src/wb_wsx.cpp
wb/lib/wb/src/wb_wsx.cpp
+363
-193
wb/lib/wb/src/wb_wsx.h
wb/lib/wb/src/wb_wsx.h
+58
-37
wb/lib/wb/src/wb_wtt.cpp
wb/lib/wb/src/wb_wtt.cpp
+10
-0
No files found.
abb/lib/wb/src/os_linux/hw_x86/makefile
0 → 100644
View file @
b564b91f
include
$(pwre_dir_symbols)
-include
$(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq
($($(type_name)_generic_mk),)
-include
$(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq
($($(type_name)_generic_mk),)
include
$(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include
../../special.mk
-include
../special.mk
-include
special.mk
abb/lib/wb/src/os_linux/hw_x86_64/makefile
0 → 100644
View file @
b564b91f
include
$(pwre_dir_symbols)
-include
$(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq
($($(type_name)_generic_mk),)
-include
$(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq
($($(type_name)_generic_mk),)
include
$(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include
../../special.mk
-include
../special.mk
-include
special.mk
abb/lib/wb/src/wb_abb.meth
0 → 100644
View file @
b564b91f
ABB_ACS800_1
ABB_ACC800
ABB_ACS800MotorAggr
abb/lib/wb/src/wb_c_abb_acc800.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_basefcppo3.cpp -- work bench methods of the ABB_ACC800 class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_pwrb_msg.h"
#include "pwr_abbclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
int
*
ErrorCount
,
int
*
WarningCount
)
{
pwr_tStatus
sts
;
pwr_tCid
plcconnect_class
[]
=
{
pwr_cClass_ABB_ACC800Fo
,
0
};
pwr_tCid
simconnect_class
[]
=
{
pwr_cClass_ABB_ACC800Sim
,
0
};
pwr_tCid
ioconnect_class
[]
=
{
pwr_cClass_ABB_ACC_PPO5
,
0
};
// TODO Change io IoArea object
if
(
Object
.
Offset
==
0
)
{
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"PlcConnect"
,
"PlcConnect"
,
plcconnect_class
,
0
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"SimConnect"
,
"PlcConnect"
,
simconnect_class
,
1
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
}
sts
=
wsx_CheckAttrRef
(
Session
,
Object
,
"IOConnect"
,
ioconnect_class
,
0
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
return
PWRB__SUCCESS
;
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
ABB_ACC800
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
abb/lib/wb/src/wb_c_abb_acs800_1.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_abb_acs800_1.cpp -- work bench methods of the ABB_ACS800_1 class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_pwrb_msg.h"
#include "pwr_abbclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
int
*
ErrorCount
,
int
*
WarningCount
)
{
pwr_tStatus
sts
;
pwr_tCid
plcconnect_class
[]
=
{
pwr_cClass_ABB_ACS800_1Fo
,
0
};
pwr_tCid
simconnect_class
[]
=
{
pwr_cClass_ABB_ACS800_1Sim
,
0
};
pwr_tCid
ioconnect_class
[]
=
{
pwr_cClass_ABB_ACS_PPO5
,
0
};
// TODO Change io IoArea object
if
(
Object
.
Offset
==
0
)
{
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"PlcConnect"
,
"PlcConnect"
,
plcconnect_class
,
0
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"SimConnect"
,
"PlcConnect"
,
simconnect_class
,
1
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
}
sts
=
wsx_CheckAttrRef
(
Session
,
Object
,
"IOConnect"
,
ioconnect_class
,
0
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
return
PWRB__SUCCESS
;
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
ABB_ACS800_1
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
abb/lib/wb/src/wb_c_abb_acs800motoraggr.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_abb_acs800motoraggr.cpp -- work bench methods of the ABB_ACS800MotorAggr class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_pwrb_msg.h"
#include "pwr_abbclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
int
*
ErrorCount
,
int
*
WarningCount
)
{
pwr_tStatus
sts
;
pwr_tCid
plcconnect_class
[]
=
{
pwr_cClass_ABB_ACS800MotorAggrFo
,
0
};
pwr_tCid
simconnect_class
[]
=
{
pwr_cClass_ABB_ACS800MotorAggrSim
,
0
};
if
(
Object
.
Offset
==
0
)
{
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"PlcConnect"
,
"PlcConnect"
,
plcconnect_class
,
0
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"SimConnect"
,
"PlcConnect"
,
simconnect_class
,
1
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
}
return
PWRB__SUCCESS
;
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
ABB_ACS800MotorAggr
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
bcomp/lib/wb/src/os_linux/hw_x86/makefile
0 → 100644
View file @
b564b91f
include
$(pwre_dir_symbols)
-include
$(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq
($($(type_name)_generic_mk),)
-include
$(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq
($($(type_name)_generic_mk),)
include
$(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include
../../special.mk
-include
../special.mk
-include
special.mk
bcomp/lib/wb/src/os_linux/hw_x86_64/makefile
0 → 100644
View file @
b564b91f
include
$(pwre_dir_symbols)
-include
$(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq
($($(type_name)_generic_mk),)
-include
$(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq
($($(type_name)_generic_mk),)
include
$(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include
../../special.mk
-include
../special.mk
-include
special.mk
bcomp/lib/wb/src/wb_bcomp.meth
0 → 100644
View file @
b564b91f
BaseSupSwitch
BaseCDamper
BaseCValve
BaseCircuitBreaker
BaseContactor
BaseDirValve
BaseFilter
BaseSensor
BaseMValve
BaseManValve
BaseMotorAggr
BaseMotorIncrDecrAggr
BaseOverloadRelay
BasePositSensor
BasePropValve
BaseSafetySwitch
BaseFcPPO3
BaseFcPPO3MotorAggr
BaseFcPPO5
BaseFcPPO5MotorAggr
bcomp/lib/wb/src/wb_c_basecdamper.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_basecdamper.cpp -- work bench methods of the BaseCDamper class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_pwrb_msg.h"
#include "pwr_basecomponentclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
int
*
ErrorCount
,
int
*
WarningCount
)
{
pwr_tStatus
sts
;
pwr_tCid
plcconnect_class
[]
=
{
pwr_cClass_BaseCDamperFo
,
0
};
pwr_tCid
simconnect_class
[]
=
{
pwr_cClass_BaseCDamperSim
,
0
};
if
(
Object
.
Offset
==
0
)
{
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"PlcConnect"
,
"PlcConnect"
,
plcconnect_class
,
0
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"SimConnect"
,
"PlcConnect"
,
simconnect_class
,
1
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
}
return
PWRB__SUCCESS
;
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
BaseCDamper
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
bcomp/lib/wb/src/wb_c_basecircuitbreaker.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_basecircuitbreaker.cpp -- work bench methods of the BaseCircuitBreaker class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_pwrb_msg.h"
#include "pwr_basecomponentclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
int
*
ErrorCount
,
int
*
WarningCount
)
{
pwr_tStatus
sts
;
pwr_tCid
plcconnect_class
[]
=
{
pwr_cClass_BaseCircuitBreakerFo
,
0
};
if
(
Object
.
Offset
==
0
)
{
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"PlcConnect"
,
"PlcConnect"
,
plcconnect_class
,
0
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
}
return
PWRB__SUCCESS
;
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
BaseCircuitBreaker
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
bcomp/lib/wb/src/wb_c_basecontactor.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_basecontactor.cpp -- work bench methods of the BaseContactor class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_pwrb_msg.h"
#include "pwr_basecomponentclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
int
*
ErrorCount
,
int
*
WarningCount
)
{
pwr_tStatus
sts
;
pwr_tCid
plcconnect_class
[]
=
{
pwr_cClass_BaseContactorFo
,
0
};
pwr_tCid
simconnect_class
[]
=
{
pwr_cClass_BaseContactorSim
,
0
};
if
(
Object
.
Offset
==
0
)
{
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"PlcConnect"
,
"PlcConnect"
,
plcconnect_class
,
0
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"SimConnect"
,
"PlcConnect"
,
simconnect_class
,
1
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
}
return
PWRB__SUCCESS
;
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
BaseContactor
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
bcomp/lib/wb/src/wb_c_basecvalve.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_basecvalve.cpp -- work bench methods of the BaseCValve class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_pwrb_msg.h"
#include "pwr_basecomponentclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
int
*
ErrorCount
,
int
*
WarningCount
)
{
pwr_tStatus
sts
;
pwr_tCid
plcconnect_class
[]
=
{
pwr_cClass_BaseCValveFo
,
0
};
pwr_tCid
simconnect_class
[]
=
{
pwr_cClass_BaseCValveSim
,
0
};
if
(
Object
.
Offset
==
0
)
{
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"PlcConnect"
,
"PlcConnect"
,
plcconnect_class
,
0
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"SimConnect"
,
"PlcConnect"
,
simconnect_class
,
1
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
}
return
PWRB__SUCCESS
;
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
BaseCValve
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
bcomp/lib/wb/src/wb_c_basedirvalve.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_basedirvalve.cpp -- work bench methods of the BaseDirValve class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_pwrb_msg.h"
#include "pwr_basecomponentclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
int
*
ErrorCount
,
int
*
WarningCount
)
{
pwr_tStatus
sts
;
pwr_tCid
plcconnect_class
[]
=
{
pwr_cClass_BaseDirValveFo
,
0
};
if
(
Object
.
Offset
==
0
)
{
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"PlcConnect"
,
"PlcConnect"
,
plcconnect_class
,
0
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
}
return
PWRB__SUCCESS
;
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
BaseDirValve
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
bcomp/lib/wb/src/wb_c_basefcppo3.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_basefcppo3.cpp -- work bench methods of the BaseFcPPO3 class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_pwrb_msg.h"
#include "pwr_basecomponentclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
int
*
ErrorCount
,
int
*
WarningCount
)
{
pwr_tStatus
sts
;
pwr_tCid
plcconnect_class
[]
=
{
pwr_cClass_BaseFcPPO3Fo
,
0
};
pwr_tCid
simconnect_class
[]
=
{
pwr_cClass_BaseFcPPO3Sim
,
0
};
pwr_tCid
ioconnect_class
[]
=
{
pwr_cClass_BaseFcPPO3PbModule
,
0
};
// TODO Change io IoArea object
if
(
Object
.
Offset
==
0
)
{
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"PlcConnect"
,
"PlcConnect"
,
plcconnect_class
,
0
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"SimConnect"
,
"PlcConnect"
,
simconnect_class
,
1
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
}
sts
=
wsx_CheckAttrRef
(
Session
,
Object
,
"IOConnect"
,
ioconnect_class
,
0
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
return
PWRB__SUCCESS
;
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
BaseFcPPO3
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
bcomp/lib/wb/src/wb_c_basefcppo3motoraggr.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_basefcppo3motor.cpp -- work bench methods of the BaseFcPPO3MotorAggr class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_pwrb_msg.h"
#include "pwr_basecomponentclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
int
*
ErrorCount
,
int
*
WarningCount
)
{
pwr_tStatus
sts
;
pwr_tCid
plcconnect_class
[]
=
{
pwr_cClass_BaseFcPPO3MotorAggrFo
,
0
};
pwr_tCid
simconnect_class
[]
=
{
pwr_cClass_BaseFcPPO3MotorAggrSim
,
0
};
if
(
Object
.
Offset
==
0
)
{
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"PlcConnect"
,
"PlcConnect"
,
plcconnect_class
,
0
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"SimConnect"
,
"PlcConnect"
,
simconnect_class
,
1
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
}
return
PWRB__SUCCESS
;
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
BaseFcPPO3MotorAggr
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
bcomp/lib/wb/src/wb_c_basefcppo5.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_basefcppo5.cpp -- work bench methods of the BaseFcPPO5 class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_pwrb_msg.h"
#include "pwr_basecomponentclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
int
*
ErrorCount
,
int
*
WarningCount
)
{
pwr_tStatus
sts
;
pwr_tCid
plcconnect_class
[]
=
{
pwr_cClass_BaseFcPPO5Fo
,
0
};
pwr_tCid
simconnect_class
[]
=
{
pwr_cClass_BaseFcPPO5Sim
,
0
};
pwr_tCid
ioconnect_class
[]
=
{
pwr_cClass_BaseFcPPO5PbModule
,
0
};
// TODO Change io IoArea object
if
(
Object
.
Offset
==
0
)
{
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"PlcConnect"
,
"PlcConnect"
,
plcconnect_class
,
0
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"SimConnect"
,
"PlcConnect"
,
simconnect_class
,
1
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
}
sts
=
wsx_CheckAttrRef
(
Session
,
Object
,
"IOConnect"
,
ioconnect_class
,
0
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
return
PWRB__SUCCESS
;
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
BaseFcPPO5
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
bcomp/lib/wb/src/wb_c_basefcppo5motoraggr.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_basefcppo5motoraggr.cpp -- work bench methods of the BaseFcPPO5MotorAggr class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_pwrb_msg.h"
#include "pwr_basecomponentclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
int
*
ErrorCount
,
int
*
WarningCount
)
{
pwr_tStatus
sts
;
pwr_tCid
plcconnect_class
[]
=
{
pwr_cClass_BaseFcPPO5MotorAggrFo
,
0
};
pwr_tCid
simconnect_class
[]
=
{
pwr_cClass_BaseFcPPO5MotorAggrSim
,
0
};
if
(
Object
.
Offset
==
0
)
{
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"PlcConnect"
,
"PlcConnect"
,
plcconnect_class
,
0
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"SimConnect"
,
"PlcConnect"
,
simconnect_class
,
1
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
}
return
PWRB__SUCCESS
;
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
BaseFcPPO5MotorAggr
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
bcomp/lib/wb/src/wb_c_basefilter.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_basefilter.cpp -- work bench methods of the BaseFilter class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_pwrb_msg.h"
#include "pwr_basecomponentclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
int
*
ErrorCount
,
int
*
WarningCount
)
{
pwr_tStatus
sts
;
pwr_tCid
plcconnect_class
[]
=
{
pwr_cClass_BaseFilterFo
,
0
};
if
(
Object
.
Offset
==
0
)
{
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"PlcConnect"
,
"PlcConnect"
,
plcconnect_class
,
0
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
}
return
PWRB__SUCCESS
;
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
BaseFilter
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
bcomp/lib/wb/src/wb_c_basemanvalve.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_basemanvalve.cpp -- work bench methods of the BaseManValve class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_pwrb_msg.h"
#include "pwr_basecomponentclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
int
*
ErrorCount
,
int
*
WarningCount
)
{
pwr_tStatus
sts
;
pwr_tCid
plcconnect_class
[]
=
{
pwr_cClass_BaseManValveFo
,
0
};
if
(
Object
.
Offset
==
0
)
{
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"PlcConnect"
,
"PlcConnect"
,
plcconnect_class
,
0
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
}
return
PWRB__SUCCESS
;
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
BaseManValve
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
bcomp/lib/wb/src/wb_c_basemotoraggr.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_basemotoraggr.cpp -- work bench methods of the BaseMotorAggr class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_pwrb_msg.h"
#include "pwr_basecomponentclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
int
*
ErrorCount
,
int
*
WarningCount
)
{
pwr_tStatus
sts
;
pwr_tCid
plcconnect_class
[]
=
{
pwr_cClass_BaseMotorAggrFo
,
0
};
pwr_tCid
simconnect_class
[]
=
{
pwr_cClass_BaseMotorAggrSim
,
0
};
if
(
Object
.
Offset
==
0
)
{
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"PlcConnect"
,
"PlcConnect"
,
plcconnect_class
,
0
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"SimConnect"
,
"PlcConnect"
,
simconnect_class
,
1
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
}
return
PWRB__SUCCESS
;
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
BaseMotorAggr
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
bcomp/lib/wb/src/wb_c_basemotorincrdecraggr.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_basemotorincrdecraggr.cpp -- work bench methods of the BaseMotorIncrDecrAggr class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_pwrb_msg.h"
#include "pwr_basecomponentclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
int
*
ErrorCount
,
int
*
WarningCount
)
{
pwr_tStatus
sts
;
pwr_tCid
plcconnect_class
[]
=
{
pwr_cClass_BaseMotorIncrDecrAggrFo
,
0
};
pwr_tCid
simconnect_class
[]
=
{
pwr_cClass_BaseMotorIncrDecrAggrSim
,
0
};
if
(
Object
.
Offset
==
0
)
{
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"PlcConnect"
,
"PlcConnect"
,
plcconnect_class
,
0
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"SimConnect"
,
"PlcConnect"
,
simconnect_class
,
1
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
}
return
PWRB__SUCCESS
;
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
BaseMotorIncrDecrAggr
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
bcomp/lib/wb/src/wb_c_basemvalve.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_basemvalve.cpp -- work bench methods of the BaseMValve class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_pwrb_msg.h"
#include "pwr_basecomponentclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
int
*
ErrorCount
,
int
*
WarningCount
)
{
pwr_tStatus
sts
;
pwr_tCid
plcconnect_class
[]
=
{
pwr_cClass_BaseMValveFo
,
0
};
pwr_tCid
simconnect_class
[]
=
{
pwr_cClass_BaseMValveSim
,
0
};
if
(
Object
.
Offset
==
0
)
{
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"PlcConnect"
,
"PlcConnect"
,
plcconnect_class
,
0
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"SimConnect"
,
"PlcConnect"
,
simconnect_class
,
1
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
}
return
PWRB__SUCCESS
;
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
BaseMValve
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
bcomp/lib/wb/src/wb_c_baseoverloadrelay.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_baseoverloadrelay.cpp -- work bench methods of the BaseOverloadRelay class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_pwrb_msg.h"
#include "pwr_basecomponentclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
int
*
ErrorCount
,
int
*
WarningCount
)
{
pwr_tStatus
sts
;
pwr_tCid
plcconnect_class
[]
=
{
pwr_cClass_BaseOverloadRelayFo
,
0
};
if
(
Object
.
Offset
==
0
)
{
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"PlcConnect"
,
"PlcConnect"
,
plcconnect_class
,
0
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
}
return
PWRB__SUCCESS
;
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
BaseOverloadRelay
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
bcomp/lib/wb/src/wb_c_basepositsensor.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_basepositsensor.cpp -- work bench methods of the BasePositSensor class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_pwrb_msg.h"
#include "pwr_basecomponentclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
int
*
ErrorCount
,
int
*
WarningCount
)
{
pwr_tStatus
sts
;
pwr_tCid
plcconnect_class
[]
=
{
pwr_cClass_BasePositSensorFo
,
0
};
pwr_tCid
simconnect_class
[]
=
{
pwr_cClass_BaseSensorSim
,
0
};
if
(
Object
.
Offset
==
0
)
{
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"PlcConnect"
,
"PlcConnect"
,
plcconnect_class
,
0
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"SimConnect"
,
"PlcConnect"
,
simconnect_class
,
1
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
}
return
PWRB__SUCCESS
;
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
BasePositSensor
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
bcomp/lib/wb/src/wb_c_basepropvalve.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_basepropvalve.cpp -- work bench methods of the BasePropValve class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_pwrb_msg.h"
#include "pwr_basecomponentclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
int
*
ErrorCount
,
int
*
WarningCount
)
{
pwr_tStatus
sts
;
pwr_tCid
plcconnect_class
[]
=
{
pwr_cClass_BasePropValveFo
,
0
};
if
(
Object
.
Offset
==
0
)
{
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"PlcConnect"
,
"PlcConnect"
,
plcconnect_class
,
0
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
}
return
PWRB__SUCCESS
;
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
BasePropValve
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
bcomp/lib/wb/src/wb_c_basesafetyswitch.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_basesafetyswitch.cpp -- work bench methods of the BaseSafetySwitch class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_pwrb_msg.h"
#include "pwr_basecomponentclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
int
*
ErrorCount
,
int
*
WarningCount
)
{
pwr_tStatus
sts
;
pwr_tCid
plcconnect_class
[]
=
{
pwr_cClass_BaseSafetySwitchFo
,
0
};
if
(
Object
.
Offset
==
0
)
{
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"PlcConnect"
,
"PlcConnect"
,
plcconnect_class
,
0
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
}
return
PWRB__SUCCESS
;
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
BaseSafetySwitch
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
bcomp/lib/wb/src/wb_c_basesensor.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_basesensor.cpp -- work bench methods of the BaseSensor class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_pwrb_msg.h"
#include "pwr_basecomponentclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
int
*
ErrorCount
,
int
*
WarningCount
)
{
pwr_tStatus
sts
;
pwr_tCid
plcconnect_class
[]
=
{
pwr_cClass_BaseSensorFo
,
0
};
pwr_tCid
simconnect_class
[]
=
{
pwr_cClass_BaseSensorSim
,
0
};
if
(
Object
.
Offset
==
0
)
{
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"PlcConnect"
,
"PlcConnect"
,
plcconnect_class
,
0
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"SimConnect"
,
"PlcConnect"
,
simconnect_class
,
1
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
}
return
PWRB__SUCCESS
;
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
BaseSensor
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
bcomp/lib/wb/src/wb_c_basesupswitch.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_basesupswitch.cpp -- work bench methods of the BaseSupSwitch class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_pwrb_msg.h"
#include "pwr_basecomponentclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
int
*
ErrorCount
,
int
*
WarningCount
)
{
pwr_tStatus
sts
;
pwr_tCid
plcconnect_class
[]
=
{
pwr_cClass_BaseSupSwitchFo
,
0
};
if
(
Object
.
Offset
==
0
)
{
sts
=
wsx_CheckXAttrRef
(
Session
,
Object
,
"PlcConnect"
,
"PlcConnect"
,
plcconnect_class
,
0
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
}
return
PWRB__SUCCESS
;
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
BaseSupSwitch
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
profibus/lib/wb/src/wb_c_pb_dp_slave.cpp
View file @
b564b91f
...
...
@@ -51,6 +51,8 @@
#include "wb_pwrb_msg.h"
#include "rt_pb_msg.h"
#include "wb_wnav.h"
#include "wb_wsx.h"
#include "wb_session.h"
using
namespace
std
;
...
...
@@ -536,5 +538,26 @@ pwr_tStatus pb_dp_slave_create_ctx( ldh_tSession ldhses, pwr_tAttrRef aref,
}
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
return
wsx_CheckIoDevice
(
Session
,
Object
,
ErrorCount
,
WarningCount
,
wsx_mCardOption_None
);
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
Pb_DP_Slave
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
profibus/lib/wb/src/wb_c_pb_module.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_pb_module.c -- work bench methods of the Pb_Module class. */
#include <stdio.h>
#include <string.h>
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "pwr_profibusclasses.h"
#include "wb_env.h"
#include "co_msg.h"
#include "co_cdh.h"
#include "co_dcli.h"
#include "wb_pwrs.h"
#include "wb_ldh_msg.h"
#include "wb_ldh.h"
#include "wb_pwrb_msg.h"
#include "rt_pb_msg.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
return
wsx_CheckIoDevice
(
Session
,
Object
,
ErrorCount
,
WarningCount
,
wsx_mCardOption_None
);
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
Pb_Module
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
profibus/lib/wb/src/wb_c_pncontrollersoftingpnak.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_pncontrollersoftingpnak.c -- work bench methods of the PnControllerSoftingPNAK class. */
#include <stdio.h>
#include <string.h>
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "pwr_profibusclasses.h"
#include "wb_env.h"
#include "co_msg.h"
#include "co_cdh.h"
#include "co_dcli.h"
#include "wb_pwrs.h"
#include "wb_ldh_msg.h"
#include "wb_ldh.h"
#include "wb_pwrb_msg.h"
#include "rt_pb_msg.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
return
wsx_CheckIoDevice
(
Session
,
Object
,
ErrorCount
,
WarningCount
,
wsx_mCardOption_None
);
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
PnControllerSoftingPNAK
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
profibus/lib/wb/src/wb_c_pndevice.cpp
View file @
b564b91f
...
...
@@ -53,6 +53,7 @@
#include "wb_pwrb_msg.h"
#include "rt_pb_msg.h"
#include "wb_wnav.h"
#include "wb_wsx.h"
using
namespace
std
;
...
...
@@ -812,4 +813,26 @@ pwr_tStatus pndevice_init( device_sCtx *ctx)
return
1
;
}
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
return
wsx_CheckIoDevice
(
Session
,
Object
,
ErrorCount
,
WarningCount
,
wsx_mCardOption_None
);
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
PnDevice
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
profibus/lib/wb/src/wb_c_pnmodule.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_pnmodule.c -- work bench methods of the PnModule class. */
#include <stdio.h>
#include <string.h>
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "pwr_profibusclasses.h"
#include "wb_env.h"
#include "co_msg.h"
#include "co_cdh.h"
#include "co_dcli.h"
#include "wb_pwrs.h"
#include "wb_ldh_msg.h"
#include "wb_ldh.h"
#include "wb_pwrb_msg.h"
#include "rt_pb_msg.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
return
wsx_CheckIoDevice
(
Session
,
Object
,
ErrorCount
,
WarningCount
,
wsx_mCardOption_None
);
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
PnModule
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
profibus/lib/wb/src/wb_c_profiboard.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_profiboard.cpp -- work bench methods of the Profiboard class. */
#include <stdio.h>
#include <string.h>
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "pwr_profibusclasses.h"
#include "wb_env.h"
#include "co_msg.h"
#include "co_cdh.h"
#include "co_dcli.h"
#include "wb_pwrs.h"
#include "wb_ldh_msg.h"
#include "wb_ldh.h"
#include "wb_pwrb_msg.h"
#include "rt_pb_msg.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
return
wsx_CheckIoDevice
(
Session
,
Object
,
ErrorCount
,
WarningCount
,
wsx_mCardOption_None
);
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
Profiboard
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
profibus/lib/wb/src/wb_profibus.meth
View file @
b564b91f
Pb_DP_Slave
Pb_Module
Profiboard
PnDevice
PnModule
PnControllerSoftingPNAK
\ No newline at end of file
src/msg/wb/src/wb_wsx_msg.msg
View file @
b564b91f
...
...
@@ -27,8 +27,8 @@ success <successful completion> /succ
carddevname <DevName in card-object is missing> /error
carderrsoftlim <ErrorSoftLimit in card-object is missing> /error
carderrhardlim <ErrorHardLimit in card-object is missing> /error
sigchancon <Error in
SigChanCon-object
> /error
sigchanconclass <Error in class of
SigChanCon-object
> /error
sigchancon <Error in
connected channel
> /error
sigchanconclass <Error in class of
connected channel
> /error
maxchan <MaxNoOfChannels is out of range> /error
numrange <Number of is out of range> /error
numnotunique <Number is not unique> /error
...
...
src/wbl/pwrs/src/pwrs_c_object.wb_load
View file @
b564b91f
...
...
@@ -154,6 +154,12 @@ SObject pwrs:Class
Attr MethodName = "$Object-Crossreferences"
EndBody
EndObject
Object PM_SyntaxCheck $MenuButton
Body SysBody
Attr ButtonName = "Syntax Check"
Attr MethodName = "$Object-PM_SyntaxCheck"
EndBody
EndObject
Object Help $MenuButton
Body SysBody
Attr ButtonName = "Help"
...
...
@@ -184,6 +190,12 @@ SObject pwrs:Class
Attr MethodName = "$Object-Crossreferences"
EndBody
EndObject
Object PM_SyntaxCheck $MenuButton
Body SysBody
Attr ButtonName = "Syntax Check"
Attr MethodName = "$Object-PM_SyntaxCheck"
EndBody
EndObject
Object Help $MenuButton
Body SysBody
Attr ButtonName = "Help"
...
...
@@ -257,6 +269,12 @@ SObject pwrs:Class
Attr MethodName = "$Object-Crossreferences"
EndBody
EndObject
Object PM_SyntaxCheck $MenuButton
Body SysBody
Attr ButtonName = "Syntax Check"
Attr MethodName = "$Object-PM_SyntaxCheck"
EndBody
EndObject
Object Delete $MenuButton
Body SysBody
Attr ButtonName = "Delete Object"
...
...
@@ -341,6 +359,12 @@ SObject pwrs:Class
Attr MethodName = "$Object-Crossreferences"
EndBody
EndObject
Object PM_SyntaxCheck $MenuButton
Body SysBody
Attr ButtonName = "Syntax Check"
Attr MethodName = "$Object-PM_SyntaxCheck"
EndBody
EndObject
Object Help $MenuButton
Body SysBody
Attr ButtonName = "Help"
...
...
@@ -496,6 +520,12 @@ SObject pwrs:Class
Attr MethodName = "$Object-Crossreferences"
EndBody
EndObject
Object PM_SyntaxCheck $MenuButton
Body SysBody
Attr ButtonName = "Syntax Check"
Attr MethodName = "$Object-PM_SyntaxCheck"
EndBody
EndObject
Object Help $MenuButton
Body SysBody
Attr ButtonName = "Help"
...
...
@@ -651,6 +681,12 @@ SObject pwrs:Class
Attr MethodName = "$Object-Crossreferences"
EndBody
EndObject
Object PM_SyntaxCheck $MenuButton
Body SysBody
Attr ButtonName = "Syntax Check"
Attr MethodName = "$Object-PM_SyntaxCheck"
EndBody
EndObject
Object Help $MenuButton
Body SysBody
Attr ButtonName = "Help"
...
...
ssabox/lib/wb/src/wb_c_ai_ai32up.cpp
View file @
b564b91f
...
...
@@ -262,7 +262,7 @@ static pwr_tStatus PostUnadopt (
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* current object */
pwr_t
AttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
...
...
ssabox/lib/wb/src/wb_c_ai_hvai32.cpp
View file @
b564b91f
...
...
@@ -262,7 +262,7 @@ static pwr_tStatus PostUnadopt (
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* current object */
pwr_t
AttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
...
...
ssabox/lib/wb/src/wb_c_ao_ao8up.cpp
View file @
b564b91f
...
...
@@ -229,7 +229,7 @@ static pwr_tStatus PostUnadopt (
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* current object */
pwr_t
AttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
...
...
ssabox/lib/wb/src/wb_c_ao_hvao4.cpp
View file @
b564b91f
...
...
@@ -229,7 +229,7 @@ static pwr_tStatus PostUnadopt (
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* current object */
pwr_t
AttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
...
...
ssabox/lib/wb/src/wb_c_co_co4up.cpp
View file @
b564b91f
...
...
@@ -227,7 +227,7 @@ PostUnadopt (
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* current object */
pwr_t
AttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
...
...
ssabox/lib/wb/src/wb_c_co_pi24bo.cpp
View file @
b564b91f
...
...
@@ -227,7 +227,7 @@ PostUnadopt (
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* current object */
pwr_t
AttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
...
...
ssabox/lib/wb/src/wb_c_di_dix2.cpp
View file @
b564b91f
...
...
@@ -232,7 +232,7 @@ static pwr_tStatus PostUnadopt (
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* current object */
pwr_t
AttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
...
...
ssabox/lib/wb/src/wb_c_do_hvdo32.cpp
View file @
b564b91f
...
...
@@ -231,7 +231,7 @@ static pwr_tStatus PostUnadopt (
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* current object */
pwr_t
AttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
...
...
ssabox/lib/wb/src/wb_c_ssab_baseacard.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_ssab_baseacard.cpp -- work bench methods of the Ssab_BaseACard class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_ldh_msg.h"
#include "wb_pwrb_msg.h"
#include "pwr_baseclasses.h"
#include "pwr_basecomponentclasses.h"
#include "pwr_ssaboxclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
return
wsx_CheckIoDevice
(
Session
,
Object
,
ErrorCount
,
WarningCount
,
wsx_mCardOption_ErrorLimits
);
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
Ssab_BaseACard
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
ssabox/lib/wb/src/wb_c_ssab_basedicard.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_ssab_basedicard.cpp -- work bench methods of the Ssab_BaseDiCard class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_ldh_msg.h"
#include "wb_pwrb_msg.h"
#include "pwr_baseclasses.h"
#include "pwr_basecomponentclasses.h"
#include "pwr_ssaboxclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
return
wsx_CheckIoDevice
(
Session
,
Object
,
ErrorCount
,
WarningCount
,
wsx_mCardOption_ErrorLimits
);
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
Ssab_BaseDiCard
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
ssabox/lib/wb/src/wb_c_ssab_basedocard.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_ssab_basedocard.cpp -- work bench methods of the Ssab_BaseDoCard class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_ldh_msg.h"
#include "wb_pwrb_msg.h"
#include "pwr_baseclasses.h"
#include "pwr_basecomponentclasses.h"
#include "pwr_ssaboxclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
return
wsx_CheckIoDevice
(
Session
,
Object
,
ErrorCount
,
WarningCount
,
wsx_mCardOption_ErrorLimits
);
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
Ssab_BaseDoCard
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
ssabox/lib/wb/src/wb_ssabox.meth
View file @
b564b91f
...
...
@@ -7,3 +7,6 @@ Co_PI24BO
Co_CO4uP
Di_DIX2
Do_HVDO32
Ssab_BaseACard
Ssab_BaseDiCard
Ssab_BaseDoCard
wb/changelog.txt
View file @
b564b91f
...
...
@@ -141,3 +141,6 @@
090909 cs wb Bugfix in Connect wb method, couldn't handle array element attributes.
090909 cs wb Limitation of wb_load files in one directory changed from 500 to 1000.
091020 cs wb New crossreference window and method in wtt.
091020 cs wb Expand/Compress in plc editor on GetATp, GetDTp, StoATp etc.
091021 cs wb Crossreferences on channels added.
091028 cs wb Syntax check works again with new check functions, and SyntaxCheck in configurator popup menu.
\ No newline at end of file
wb/exe/wb/src/wb_main.cpp
View file @
b564b91f
...
...
@@ -133,11 +133,9 @@ void Wb::find_wnav_cb( void *ctx, pwr_tOid oid)
char
projectname
[
80
];
pwr_tStatus
sts
;
Wtt
*
wtt
;
printf
(
"Here in find wnav...
\n
"
);
wb
->
wttlist_find
(
&
sts
,
oid
.
vid
,
&
wtt
);
if
(
ODD
(
sts
))
{
printf
(
"Wtt Found
\n
"
);
sts
=
wtt
->
find
(
oid
);
wtt
->
pop
();
}
...
...
wb/lib/wb/gtk/wb_foe_gtk.cpp
View file @
b564b91f
...
...
@@ -1187,7 +1187,7 @@ pwr_tStatus WFoeGtk::create_window( int x_top,
gtk_menu_item_set_submenu
(
GTK_MENU_ITEM
(
file_print
),
GTK_WIDGET
(
file_print_menu
));
widgets
.
syntax
=
gtk_menu_item_new_with_mnemonic
(
"Synta_x"
);
widgets
.
syntax
=
gtk_menu_item_new_with_mnemonic
(
"Synta_x
Check
"
);
g_signal_connect
(
widgets
.
syntax
,
"activate"
,
G_CALLBACK
(
WFoeGtk
::
activate_syntax
),
this
);
...
...
wb/lib/wb/gtk/wb_wtt_gtk.cpp
View file @
b564b91f
...
...
@@ -2078,9 +2078,6 @@ WttGtk::WttGtk(
accel_g
);
g_signal_connect
(
menu_revert_w
,
"activate"
,
G_CALLBACK
(
WttGtk
::
activate_revert
),
this
);
GtkWidget
*
file_syntax
=
gtk_menu_item_new_with_mnemonic
(
"S_yntax"
);
g_signal_connect
(
file_syntax
,
"activate"
,
G_CALLBACK
(
WttGtk
::
activate_syntax
),
this
);
GtkWidget
*
file_history
=
gtk_menu_item_new_with_mnemonic
(
"_History"
);
g_signal_connect
(
file_history
,
"activate"
,
G_CALLBACK
(
WttGtk
::
activate_history
),
this
);
...
...
@@ -2091,7 +2088,6 @@ WttGtk::WttGtk(
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
file_menu
),
file_print
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
file_menu
),
menu_save_w
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
file_menu
),
menu_revert_w
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
file_menu
),
file_syntax
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
file_menu
),
file_history
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
file_menu
),
file_close
);
...
...
@@ -2369,6 +2365,9 @@ WttGtk::WttGtk(
'r'
,
GdkModifierType
(
GDK_CONTROL_MASK
),
GTK_ACCEL_VISIBLE
);
GtkWidget
*
functions_syntax
=
gtk_menu_item_new_with_mnemonic
(
"S_yntax Check"
);
g_signal_connect
(
functions_syntax
,
"activate"
,
G_CALLBACK
(
WttGtk
::
activate_syntax
),
this
);
menu_change_value_w
=
gtk_menu_item_new_with_mnemonic
(
"Change _Value"
);
g_signal_connect
(
menu_change_value_w
,
"activate"
,
G_CALLBACK
(
WttGtk
::
activate_change_value
),
this
);
...
...
@@ -2396,6 +2395,7 @@ WttGtk::WttGtk(
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
functions_menu
),
menu_classeditor_w
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
functions_menu
),
menu_updateclasses_w
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
functions_menu
),
functions_showcrossref
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
functions_menu
),
functions_syntax
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
functions_menu
),
menu_change_value_w
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
functions_menu
),
functions_command
);
...
...
wb/lib/wb/src/wb_c_ai.cpp
View file @
b564b91f
...
...
@@ -35,7 +35,7 @@
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* current object */
pwr_t
AttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
...
...
wb/lib/wb/src/wb_c_ao.cpp
View file @
b564b91f
...
...
@@ -35,7 +35,7 @@
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* current object */
pwr_t
AttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
...
...
wb/lib/wb/src/wb_c_backup.cpp
View file @
b564b91f
...
...
@@ -29,11 +29,11 @@
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_wsx_msg.h"
#include "wb_session.h"
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
//
// PostCreate
//
static
pwr_tStatus
PostCreate
(
ldh_tSesContext
Session
,
...
...
@@ -66,10 +66,10 @@ static pwr_tStatus PostCreate (
return
PWRB__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
//
// PostMove
//
static
pwr_tStatus
PostMove
(
ldh_tSesContext
Session
,
...
...
@@ -102,80 +102,93 @@ static pwr_tStatus PostMove (
return
PWRB__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Syntax check.
\*----------------------------------------------------------------------------*/
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* current object */
pwr_t
AttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
pwr_tStatus
sts
;
int
size
;
char
Name
[
255
];
pwr_sAttrRef
Attribute
;
char
*
NamePtr
;
char
*
s
;
pwr_tClassId
cid
;
/
*
If DataName is a signal, the attribute has to be ActualValue.
*/
/
/ Check DataName
wb_session
*
sp
=
(
wb_session
*
)
Session
;
pwr_tAttrRef
dataname_aref
;
sts
=
ldh_GetObjectPar
(
Session
,
Object
,
"RtBody"
,
"DataName"
,
(
char
**
)
&
NamePtr
,
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
strcpy
(
Name
,
NamePtr
);
free
(
NamePtr
);
wb_attribute
a
=
sp
->
attribute
(
&
Object
);
if
(
!
a
)
return
a
.
sts
();
if
(
strcmp
(
Name
,
""
)
==
0
)
return
PWRB__SUCCESS
;
wb_attribute
dataname_a
(
a
,
0
,
"DataName"
);
if
(
!
dataname_a
)
return
dataname_a
.
sts
()
;
sts
=
ldh_NameToAttrRef
(
Session
,
Name
,
&
Attribute
);
if
(
EVEN
(
sts
))
return
PWRB__SUCCESS
;
dataname_a
.
value
(
&
dataname_aref
);
if
(
!
dataname_a
)
return
dataname_a
.
sts
()
;
sts
=
ldh_GetObjectClass
(
Session
,
Attribute
.
Objid
,
&
cid
);
if
(
EVEN
(
sts
))
return
sts
;
wb_attribute
data_a
=
sp
->
attribute
(
&
dataname_aref
);
if
(
!
data_a
)
{
wsx_error_msg_str
(
Session
,
"Bad DataName reference"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
return
PWRB__SUCCESS
;
}
switch
(
cid
)
{
// Backup on whole signal objects is not allowed
switch
(
data_a
.
tid
())
{
case
pwr_cClass_Do
:
case
pwr_cClass_Dv
:
case
pwr_cClass_Ao
:
case
pwr_cClass_Av
:
case
pwr_cClass_Io
:
case
pwr_cClass_Iv
:
case
pwr_cClass_Po
:
s
=
strchr
(
Name
,
'.'
);
if
(
s
==
0
)
{
case
pwr_cClass_Co
:
case
pwr_cClass_Di
:
case
pwr_cClass_Ai
:
case
pwr_cClass_Ii
:
wsx_error_msg
(
Session
,
WSX__BCKINVALID
,
Object
,
ErrorCount
,
WarningCount
);
return
PWRB__SUCCESS
;
default:
;
}
if
(
strcmp
(
s
,
".ActualValue"
)
!=
0
)
{
// If DataName is a signal, the attribute has to be ActualValue
pwr_tAName
aname
;
strncpy
(
aname
,
data_a
.
longName
().
c_str
(),
sizeof
(
aname
));
if
((
s
=
strchr
(
aname
,
'.'
)))
{
*
s
=
0
;
wb_attribute
data_aobject
=
sp
->
attribute
(
aname
);
if
(
!
data_aobject
)
return
data_aobject
.
sts
();
switch
(
data_aobject
.
cid
())
{
case
pwr_cClass_Do
:
case
pwr_cClass_Dv
:
case
pwr_cClass_Ao
:
case
pwr_cClass_Av
:
case
pwr_cClass_Io
:
case
pwr_cClass_Iv
:
case
pwr_cClass_Po
:
case
pwr_cClass_Co
:
{
if
(
strcmp
(
s
+
1
,
"ActualValue"
)
!=
0
)
wsx_error_msg
(
Session
,
WSX__BCKINVALID
,
Object
,
ErrorCount
,
WarningCount
);
return
PWRB__SUCCESS
;
}
break
;
case
pwr_cClass_Co
:
}
case
pwr_cClass_Di
:
case
pwr_cClass_Ai
:
case
pwr_cClass_Ii
:
{
wsx_error_msg
(
Session
,
WSX__BCKINVALID
,
Object
,
ErrorCount
,
WarningCount
);
return
PWRB__SUCCESS
;
break
;
}
default:
;
}
}
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.
pwr_dExport
pwr_BindMethods
(
Backup
)
=
{
pwr_BindMethod
(
PostCreate
),
...
...
wb/lib/wb/src/wb_c_chanai.cpp
View file @
b564b91f
...
...
@@ -35,7 +35,7 @@
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* current object */
pwr_t
AttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
...
...
wb/lib/wb/src/wb_c_chanait.cpp
View file @
b564b91f
...
...
@@ -35,7 +35,7 @@
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* current object */
pwr_t
AttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
...
...
wb/lib/wb/src/wb_c_chanao.cpp
View file @
b564b91f
...
...
@@ -35,7 +35,7 @@
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* current object */
pwr_t
AttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
...
...
wb/lib/wb/src/wb_c_chanco.cpp
View file @
b564b91f
...
...
@@ -35,15 +35,16 @@
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* current object */
pwr_t
AttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
#if 0
pwr_tStatus sts;
sts = wsx_CheckSigChanCon( Session, Object, ErrorCount, WarningCount);
if (EVEN(sts)) return sts;
#endif
return
PWRB__SUCCESS
;
}
...
...
wb/lib/wb/src/wb_c_chandi.cpp
View file @
b564b91f
...
...
@@ -35,7 +35,7 @@
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* current object */
pwr_t
AttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
...
...
wb/lib/wb/src/wb_c_chando.cpp
View file @
b564b91f
...
...
@@ -35,7 +35,7 @@
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* current object */
pwr_t
AttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
...
...
wb/lib/wb/src/wb_c_chanii.cpp
View file @
b564b91f
...
...
@@ -35,7 +35,7 @@
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* current object */
pwr_t
AttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
...
...
wb/lib/wb/src/wb_c_chanio.cpp
View file @
b564b91f
...
...
@@ -35,7 +35,7 @@
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* current object */
pwr_t
AttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
...
...
wb/lib/wb/src/wb_c_co.cpp
View file @
b564b91f
...
...
@@ -35,7 +35,7 @@
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* current object */
pwr_t
AttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
...
...
wb/lib/wb/src/wb_c_di.cpp
View file @
b564b91f
...
...
@@ -35,7 +35,7 @@
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* current object */
pwr_t
AttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
...
...
wb/lib/wb/src/wb_c_do.cpp
View file @
b564b91f
...
...
@@ -35,7 +35,7 @@
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* current object */
pwr_t
AttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
...
...
wb/lib/wb/src/wb_c_dstrend.cpp
View file @
b564b91f
...
...
@@ -25,12 +25,13 @@
#include "wb_pwrb_msg.h"
#include "pwr_baseclasses.h"
#include "wb_ldh.h"
#include "wb_session.h"
#include "wb_wsx.h"
#include "wb_pwrb_msg.h"
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
//
// PostCreate
//
static
pwr_tStatus
PostCreate
(
ldh_tSesContext
Session
,
pwr_tObjid
Object
,
...
...
@@ -64,11 +65,10 @@ static pwr_tStatus PostCreate (
return
PWRB__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
//
// PostMove
//
static
pwr_tStatus
PostMove
(
ldh_tSesContext
Session
,
pwr_tObjid
Object
,
...
...
@@ -100,13 +100,60 @@ static pwr_tStatus PostMove (
return
PWRB__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
// Check DataName
wb_session
*
sp
=
(
wb_session
*
)
Session
;
pwr_tAttrRef
dataname_aref
;
wb_attribute
a
=
sp
->
attribute
(
&
Object
);
if
(
!
a
)
return
a
.
sts
();
wb_attribute
dataname_a
(
a
,
0
,
"DataName"
);
if
(
!
dataname_a
)
return
dataname_a
.
sts
();
dataname_a
.
value
(
&
dataname_aref
);
if
(
!
dataname_a
)
return
dataname_a
.
sts
();
wb_attribute
data_a
=
sp
->
attribute
(
&
dataname_aref
);
if
(
!
data_a
)
{
wsx_error_msg_str
(
Session
,
"Bad DataName reference"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
return
PWRB__SUCCESS
;
}
// Check DataName type
switch
(
data_a
.
tid
())
{
case
pwr_eType_Boolean
:
case
pwr_eType_Float32
:
case
pwr_eType_Float64
:
case
pwr_eType_Int8
:
case
pwr_eType_Int16
:
case
pwr_eType_Int32
:
case
pwr_eType_UInt8
:
case
pwr_eType_UInt16
:
case
pwr_eType_UInt32
:
break
;
default:
wsx_error_msg_str
(
Session
,
"DataName type not supported"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
}
return
PWRB__SUCCESS
;
}
// Every method to be exported to the workbench should be registred here.
pwr_dExport
pwr_BindMethods
(
DsTrend
)
=
{
pwr_BindMethod
(
PostCreate
),
pwr_BindMethod
(
PostMove
),
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
wb/lib/wb/src/wb_c_friendnodeconfig.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_friendnodeconfig.c -- work bench methods of the FriendNodeConfig class. */
#include <string.h>
#include "co_dcli.h"
#include "wb_pwrs.h"
#include "wb_pwrs_msg.h"
#include "wb_ldh.h"
#include "wb_session.h"
#include "wb_wsx.h"
#include "wb_pwrb_msg.h"
#include "pwr_baseclasses.h"
//
// Syntax check method
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
wb_session
*
sp
=
(
wb_session
*
)
Session
;
pwr_tString80
str
;
wb_object
o
=
sp
->
object
(
Object
.
Objid
);
wb_object
p
=
o
.
parent
();
if
(
!
p
||
!
(
p
.
cid
()
==
pwr_cClass_BusConfig
||
p
.
cid
()
==
pwr_cClass_NodeConfig
||
p
.
cid
()
==
pwr_cClass_SevNodeConfig
))
wsx_error_msg_str
(
Session
,
"Bad parent"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
if
(
Object
.
Objid
.
vid
!=
ldh_cDirectoryVolume
)
wsx_error_msg_str
(
Session
,
"Not a DirectoryVolume"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
// Check NodeName
wb_attribute
a
=
sp
->
attribute
(
Object
.
Objid
,
"RtBody"
,
"NodeName"
);
if
(
!
a
)
return
a
.
sts
();
a
.
value
(
&
str
);
if
(
!
a
)
return
a
.
sts
();
dcli_trim
(
str
,
str
);
if
(
strcmp
(
str
,
""
)
==
0
)
wsx_error_msg_str
(
Session
,
"NodeName is missing"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
// Check Address
a
=
sp
->
attribute
(
Object
.
Objid
,
"RtBody"
,
"Address"
);
if
(
!
a
)
return
a
.
sts
();
a
.
value
(
&
str
);
if
(
!
a
)
return
a
.
sts
();
unsigned
char
adr1
,
adr2
,
adr3
,
adr4
;
int
num
;
num
=
sscanf
(
str
,
"%hhu.%hhu.%hhu.%hhu"
,
&
adr1
,
&
adr2
,
&
adr3
,
&
adr4
);
if
(
num
!=
4
)
wsx_error_msg_str
(
Session
,
"Syntax error in Address"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
else
if
(
adr1
==
0
&&
adr2
==
0
&&
adr3
==
0
&&
adr4
==
0
)
wsx_error_msg_str
(
Session
,
"Address is zero"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
// Check Volume
a
=
sp
->
attribute
(
Object
.
Objid
,
"RtBody"
,
"Volume"
);
if
(
!
a
)
return
a
.
sts
();
a
.
value
(
&
str
);
if
(
!
a
)
return
a
.
sts
();
dcli_trim
(
str
,
str
);
if
(
strcmp
(
str
,
""
)
==
0
)
wsx_error_msg_str
(
Session
,
"Volume is missing"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
return
PWRB__SUCCESS
;
}
pwr_dExport
pwr_BindMethods
(
FriendNodeConfig
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
wb/lib/wb/src/wb_c_ii.cpp
View file @
b564b91f
...
...
@@ -35,7 +35,7 @@
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* current object */
pwr_t
AttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
...
...
wb/lib/wb/src/wb_c_io.cpp
View file @
b564b91f
...
...
@@ -35,7 +35,7 @@
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* current object */
pwr_t
AttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
...
...
wb/lib/wb/src/wb_c_mountobject.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id$
* 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_mountobject.c -- work bench methods of the MountObject class. */
#include "pwr_baseclasses.h"
#include "wb_pwrs_msg.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_wsx_msg.h"
#include "wb_session.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
int
*
ErrorCount
,
int
*
WarningCount
)
{
wb_session
*
sp
=
(
wb_session
*
)
Session
;
pwr_tOid
mount_oid
;
// Check Object attribute
wb_attribute
a
=
sp
->
attribute
(
Object
.
Objid
,
"SysBody"
,
"Object"
);
if
(
!
a
)
return
a
.
sts
();
a
.
value
(
&
mount_oid
);
if
(
!
a
)
return
a
.
sts
();
if
(
cdh_ObjidIsNull
(
mount_oid
))
{
wsx_error_msg_str
(
Session
,
"Mounted object is missing"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
}
return
PWRS__SUCCESS
;
}
//
// Every method to be exported to the workbench should be registred here.
//
pwr_dExport
pwr_BindMethods
(
$
MountObject
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
wb/lib/wb/src/wb_c_node.cpp
View file @
b564b91f
...
...
@@ -22,6 +22,10 @@
#include "wb_pwrs.h"
#include "wb_pwrs_msg.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_session.h"
#include "pwr_baseclasses.h"
#include "wb_pwrb_msg.h"
static
pwr_tStatus
PostCreate
(
ldh_tSesContext
Session
,
...
...
@@ -64,8 +68,68 @@ static pwr_tStatus PostCreate (
return
PWRS__SUCCESS
;
}
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
wb_session
*
sp
=
(
wb_session
*
)
Session
;
pwr_tAttrRef
aref
;
wb_object
o
;
// Check Server objects
// Security object
o
=
sp
->
object
(
pwr_eClass_Security
);
if
(
!
o
)
wsx_error_msg_str
(
Session
,
"No Security object found"
,
Object
,
'W'
,
ErrorCount
,
WarningCount
);
// DsTrend
sp
->
aref
(
pwr_cClass_DsTrend
,
&
aref
);
if
(
sp
->
oddSts
())
{
// Check DsTrendConf
o
=
sp
->
object
(
pwr_cClass_DsTrendConf
);
if
(
!
o
)
wsx_error_msg_str
(
Session
,
"No DsTrendConf object found"
,
Object
,
'W'
,
ErrorCount
,
WarningCount
);
}
// DsFast
sp
->
aref
(
pwr_cClass_DsFast
,
&
aref
);
if
(
sp
->
evenSts
())
sp
->
aref
(
pwr_cClass_DsFastCurve
,
&
aref
);
if
(
sp
->
oddSts
())
{
// Check DsFastConf
o
=
sp
->
object
(
pwr_cClass_DsFastConf
);
if
(
!
o
)
wsx_error_msg_str
(
Session
,
"No DsFastConf object found"
,
Object
,
'W'
,
ErrorCount
,
WarningCount
);
}
// SevHistMonintor
sp
->
aref
(
pwr_cClass_SevHist
,
&
aref
);
if
(
sp
->
oddSts
())
{
// Check SevHistMonitor
o
=
sp
->
object
(
pwr_cClass_SevHistMonitor
);
if
(
!
o
)
wsx_error_msg_str
(
Session
,
"No SevHistMonitor object found"
,
Object
,
'W'
,
ErrorCount
,
WarningCount
);
}
// Backup_Conf
sp
->
aref
(
pwr_cClass_Backup
,
&
aref
);
if
(
sp
->
oddSts
())
{
// Check Backup_Conf
o
=
sp
->
object
(
pwr_cClass_Backup_Conf
);
if
(
!
o
)
wsx_error_msg_str
(
Session
,
"No Backup_Conf object found"
,
Object
,
'W'
,
ErrorCount
,
WarningCount
);
}
return
PWRB__SUCCESS
;
}
pwr_dExport
pwr_BindMethods
(
$
Node
)
=
{
pwr_BindMethod
(
PostCreate
),
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
...
...
wb/lib/wb/src/wb_c_nodeconfig.cpp
View file @
b564b91f
...
...
@@ -20,10 +20,18 @@
/* wb_c_nodeconfig.c -- work bench methods of the NodeConfig class. */
#include <string.h>
#include "co_dcli.h"
#include "wb_pwrs.h"
#include "wb_pwrs_msg.h"
#include "wb_ldh.h"
#include "wb_session.h"
#include "wb_wsx.h"
#include "wb_pwrb_msg.h"
#include "pwr_baseclasses.h"
//
// PostCreate method
//
static
pwr_tStatus
PostCreate
(
ldh_tSesContext
Session
,
pwr_tObjid
Object
,
...
...
@@ -43,8 +51,82 @@ static pwr_tStatus PostCreate (
return
PWRS__SUCCESS
;
}
//
// Syntax check method
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
wb_session
*
sp
=
(
wb_session
*
)
Session
;
pwr_tString80
str
;
wb_object
o
=
sp
->
object
(
Object
.
Objid
);
if
(
!
o
)
return
o
.
sts
();
wb_object
p
=
o
.
parent
();
if
(
!
p
||
p
.
cid
()
!=
pwr_cClass_BusConfig
)
wsx_error_msg_str
(
Session
,
"Bad parent"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
if
(
Object
.
Objid
.
vid
!=
ldh_cDirectoryVolume
)
wsx_error_msg_str
(
Session
,
"Not a DirectoryVolume"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
// Check NodeName
wb_attribute
a
=
sp
->
attribute
(
Object
.
Objid
,
"RtBody"
,
"NodeName"
);
if
(
!
a
)
return
a
.
sts
();
a
.
value
(
&
str
);
if
(
!
a
)
return
a
.
sts
();
dcli_trim
(
str
,
str
);
if
(
strcmp
(
str
,
""
)
==
0
)
wsx_error_msg_str
(
Session
,
"NodeName is missing"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
// Check OperatingSystem
a
=
sp
->
attribute
(
Object
.
Objid
,
"RtBody"
,
"OperatingSystem"
);
if
(
!
a
)
return
a
.
sts
();
pwr_tEnum
opsys
;
a
.
value
(
&
opsys
);
if
(
!
a
)
return
a
.
sts
();
if
(
opsys
<=
pwr_mOpSys__
||
opsys
>=
pwr_mOpSys_
)
wsx_error_msg_str
(
Session
,
"Invalid OperatingSystem"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
// Check Address
a
=
sp
->
attribute
(
Object
.
Objid
,
"RtBody"
,
"Address"
);
if
(
!
a
)
return
a
.
sts
();
a
.
value
(
&
str
);
if
(
!
a
)
return
a
.
sts
();
unsigned
char
adr1
,
adr2
,
adr3
,
adr4
;
int
num
;
num
=
sscanf
(
str
,
"%hhu.%hhu.%hhu.%hhu"
,
&
adr1
,
&
adr2
,
&
adr3
,
&
adr4
);
if
(
num
!=
4
)
wsx_error_msg_str
(
Session
,
"Syntax error in Address"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
else
if
(
adr1
==
0
&&
adr2
==
0
&&
adr3
==
0
&&
adr4
==
0
)
wsx_error_msg_str
(
Session
,
"Address is zero"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
// Look for RootVolumeLoad child
bool
found
=
0
;
for
(
wb_object
child
=
o
.
first
();
child
;
child
=
child
.
after
())
{
if
(
child
.
cid
()
==
pwr_cClass_RootVolumeLoad
)
{
found
=
1
;
break
;
}
}
if
(
!
found
)
wsx_error_msg_str
(
Session
,
"RootVolumeLoad object is missing"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
return
PWRB__SUCCESS
;
}
pwr_dExport
pwr_BindMethods
(
NodeConfig
)
=
{
pwr_BindMethod
(
PostCreate
),
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
wb/lib/wb/src/wb_c_object.cpp
View file @
b564b91f
...
...
@@ -1086,6 +1086,31 @@ static pwr_tStatus CrossreferencesFilter( ldh_sMenuCall *ip)
return
1
;
}
//
// PopupMenu SyntaxCheck
//
static
pwr_tStatus
PM_SyntaxCheck
(
ldh_sMenuCall
*
ip
)
{
pwr_tStatus
sts
;
int
size
;
pwr_tOName
oname
;
pwr_tCmd
cmd
;
sts
=
ldh_ObjidToName
(
ip
->
PointedSession
,
ip
->
Pointed
.
Objid
,
ldh_eName_VolPath
,
oname
,
sizeof
(
oname
),
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
sprintf
(
cmd
,
"check syntax/name=%s"
,
oname
);
ip
->
wnav
->
command
(
cmd
);
return
1
;
}
static
pwr_tStatus
PM_SyntaxCheckFilter
(
ldh_sMenuCall
*
ip
)
{
return
1
;
}
pwr_dExport
pwr_BindMethods
(
$
Object
)
=
{
pwr_BindMethod
(
CreateObject
),
...
...
@@ -1117,6 +1142,8 @@ pwr_dExport pwr_BindMethods($Object) = {
pwr_BindMethod
(
HistoryFilter
),
pwr_BindMethod
(
Crossreferences
),
pwr_BindMethod
(
CrossreferencesFilter
),
pwr_BindMethod
(
PM_SyntaxCheck
),
pwr_BindMethod
(
PM_SyntaxCheckFilter
),
pwr_NullMethod
};
...
...
wb/lib/wb/src/wb_c_opplace.cpp
View file @
b564b91f
...
...
@@ -23,6 +23,9 @@
#include "wb_pwrs.h"
#include "wb_pwrs_msg.h"
#include "wb_ldh.h"
#include "wb_session.h"
#include "wb_wsx.h"
#include "wb_pwrb_msg.h"
static
pwr_tStatus
PostCreate
(
ldh_tSesContext
Session
,
...
...
@@ -50,8 +53,44 @@ static pwr_tStatus PostCreate (
return
PWRS__SUCCESS
;
}
//
// SyntaxCheck
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
int
*
ErrorCount
,
int
*
WarningCount
)
{
wb_session
*
sp
=
(
wb_session
*
)
Session
;
pwr_tString80
selectlist
[
20
];
wb_attribute
a
=
sp
->
attribute
(
&
Object
);
if
(
!
a
)
return
a
.
sts
();
// Check Attribute
wb_attribute
selectlist_a
(
a
,
0
,
"EventSelectList"
);
if
(
!
selectlist_a
)
return
selectlist_a
.
sts
();
selectlist_a
.
value
(
selectlist
);
if
(
!
selectlist_a
)
return
selectlist_a
.
sts
();
bool
empty
=
true
;
for
(
unsigned
int
i
=
0
;
i
<
sizeof
(
selectlist
)
/
sizeof
(
selectlist
[
0
]);
i
++
)
{
if
(
strcmp
(
selectlist
[
i
],
""
)
!=
0
)
{
empty
=
false
;
break
;
}
}
if
(
empty
)
wsx_error_msg_str
(
Session
,
"EventSelectList is empty"
,
Object
,
'W'
,
ErrorCount
,
WarningCount
);
return
PWRB__SUCCESS
;
}
pwr_dExport
pwr_BindMethods
(
OpPlace
)
=
{
pwr_BindMethod
(
PostCreate
),
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
wb/lib/wb/src/wb_c_planthier.cpp
View file @
b564b91f
...
...
@@ -33,6 +33,7 @@
#include "flow_browapi.h"
#include "wb_wnav.h"
#include "wb_build.h"
#include "wb_wsx.h"
#include "co_msgwindow.h"
/*----------------------------------------------------------------------------*\
...
...
@@ -52,6 +53,27 @@ static pwr_tStatus Build (
return
build
.
sts
();
}
//
// Syntax Check
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
int
*
ErrorCount
,
int
*
WarningCount
)
{
pwr_tStatus
sts
;
pwr_tCid
defgraph_class
[]
=
{
pwr_cClass_XttGraph
,
0
};
pwr_tCid
deftrend_class
[]
=
{
pwr_cClass_DsTrend
,
pwr_cClass_DsFast
,
pwr_cClass_DsFastCurve
,
pwr_cClass_PlotGroup
,
0
};
sts
=
wsx_CheckAttrRef
(
Session
,
Object
,
"DefGraph"
,
defgraph_class
,
1
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
wsx_CheckAttrRef
(
Session
,
Object
,
"DefTrend"
,
deftrend_class
,
1
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
return
PWRS__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
...
...
@@ -59,6 +81,7 @@ static pwr_tStatus Build (
pwr_dExport
pwr_BindMethods
(
$
PlantHier
)
=
{
pwr_BindMethod
(
Build
),
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
wb/lib/wb/src/wb_c_plcpgm.cpp
View file @
b564b91f
...
...
@@ -35,6 +35,7 @@
#include "flow_browapi.h"
#include "wb_wnav.h"
#include "wb_build.h"
#include "wb_session.h"
/*----------------------------------------------------------------------------*\
...
...
@@ -76,59 +77,75 @@ static pwr_tStatus Build (
Syntax check.
\*----------------------------------------------------------------------------*/
static
bool
CheckChildCid
(
wb_object
&
o
,
pwr_tCid
cid
)
{
for
(
wb_object
child
=
o
.
first
();
child
;
child
=
child
.
after
())
{
if
(
child
.
cid
()
==
cid
)
{
return
true
;
}
if
(
CheckChildCid
(
child
,
cid
))
return
true
;
}
return
false
;
}
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* current object */
pwr_t
AttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
int
*
WarningCount
/* accumulated war
n
ing 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
;
wb_session
*
sp
=
(
wb_session
*
)
Session
;
pwr_tOid
thread_oid
;
pwr_tOid
reset_oid
;
// Check ThreadObject
wb_attribute
a
=
sp
->
attribute
(
Object
.
Objid
,
"RtBody"
,
"ThreadObject"
);
if
(
!
a
)
return
a
.
sts
();
a
.
value
(
&
thread_oid
);
if
(
!
a
)
return
a
.
sts
();
sts
=
ldh_GetObjectClass
(
Session
,
*
ThreadObjectPtr
,
&
c
id
);
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
);
wb_object
othread
=
sp
->
object
(
thread_o
id
);
if
(
!
othread
)
wsx_error_msg
_str
(
Session
,
"Bad thread object"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
else
if
(
othread
.
cid
()
!=
pwr_cClass_PlcThread
)
wsx_error_msg
_str
(
Session
,
"Bad thread object class"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
free
(
(
char
*
)
ThreadObjectPtr
);
/*
Check that the child is a plcwindow.
*/
// Check WindowPlc object
bool
found
=
0
;
wb_object
o
=
sp
->
object
(
Object
.
Objid
);
if
(
!
o
)
return
o
.
sts
();
sts
=
ldh_GetChild
(
Session
,
Object
,
&
child
);
if
(
EVEN
(
sts
))
{
wsx_error_msg
(
Session
,
WSX__PLCWIND
,
Object
,
ErrorCount
,
WarningCount
);
for
(
wb_object
child
=
o
.
first
();
child
;
child
=
child
.
after
())
{
if
(
child
.
cid
()
==
pwr_cClass_windowplc
)
{
found
=
1
;
break
;
}
}
else
{
sts
=
ldh_GetObjectClass
(
Session
,
child
,
&
cid
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
!
found
)
wsx_error_msg_str
(
Session
,
"Plc window is not created"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
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
);
// Check ResetObject if there is a grafcet sequence present
if
(
CheckChildCid
(
o
,
pwr_cClass_initstep
))
{
a
=
sp
->
attribute
(
Object
.
Objid
,
"DevBody"
,
"ResetObject"
);
if
(
!
a
)
return
a
.
sts
();
a
.
value
(
&
reset_oid
);
if
(
!
a
)
return
a
.
sts
();
wb_object
oreset
=
sp
->
object
(
reset_oid
);
if
(
!
oreset
)
wsx_error_msg_str
(
Session
,
"Bad reset object"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
else
if
(
!
(
oreset
.
cid
()
==
pwr_cClass_Dv
||
oreset
.
cid
()
==
pwr_cClass_Di
||
oreset
.
cid
()
==
pwr_cClass_Do
))
wsx_error_msg_str
(
Session
,
"Bad reset object class"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
}
return
PWRB__SUCCESS
;
}
...
...
wb/lib/wb/src/wb_c_po.cpp
View file @
b564b91f
...
...
@@ -35,7 +35,7 @@
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* current object */
pwr_t
AttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
...
...
wb/lib/wb/src/wb_c_rootvolume.cpp
View file @
b564b91f
...
...
@@ -42,13 +42,13 @@
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* current object */
pwr_t
AttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
pwr_tStatus
sts
;
sts
=
wsx_CheckVolume
(
Session
,
Object
,
ErrorCount
,
WarningCount
);
sts
=
wsx_CheckVolume
(
Session
,
Object
.
Objid
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
return
PWRS__SUCCESS
;
...
...
wb/lib/wb/src/wb_c_sevhist.cpp
View file @
b564b91f
...
...
@@ -25,6 +25,8 @@
#include "wb_pwrb_msg.h"
#include "pwr_baseclasses.h"
#include "wb_ldh.h"
#include "wb_session.h"
#include "wb_wsx.h"
/*----------------------------------------------------------------------------*\
...
...
@@ -102,13 +104,77 @@ static pwr_tStatus PostMove (
return
PWRB__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
pwr_tOid
thread_oid
;
wb_session
*
sp
=
(
wb_session
*
)
Session
;
pwr_tAttrRef
dataname_aref
;
wb_attribute
a
=
sp
->
attribute
(
&
Object
);
if
(
!
a
)
return
a
.
sts
();
// Check ThreadObject
wb_attribute
thread_a
(
a
,
0
,
"ThreadObject"
);
if
(
!
thread_a
)
return
thread_a
.
sts
();
thread_a
.
value
(
&
thread_oid
);
if
(
!
thread_a
)
return
thread_a
.
sts
();
wb_object
othread
=
sp
->
object
(
thread_oid
);
if
(
!
othread
)
wsx_error_msg_str
(
Session
,
"Bad thread object"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
else
if
(
othread
.
cid
()
!=
pwr_cClass_SevHistThread
)
wsx_error_msg_str
(
Session
,
"Bad thread object class"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
// Check Attribute
wb_attribute
dataname_a
(
a
,
0
,
"Attribute"
);
if
(
!
dataname_a
)
return
dataname_a
.
sts
();
dataname_a
.
value
(
&
dataname_aref
);
if
(
!
dataname_a
)
return
dataname_a
.
sts
();
wb_attribute
data_a
=
sp
->
attribute
(
&
dataname_aref
);
if
(
!
data_a
)
{
wsx_error_msg_str
(
Session
,
"Bad Attribute reference"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
return
PWRB__SUCCESS
;
}
// Check DataName type
switch
(
data_a
.
tid
())
{
case
pwr_eType_Boolean
:
case
pwr_eType_Int64
:
case
pwr_eType_Int32
:
case
pwr_eType_Int16
:
case
pwr_eType_Int8
:
case
pwr_eType_UInt64
:
case
pwr_eType_UInt32
:
case
pwr_eType_UInt16
:
case
pwr_eType_UInt8
:
case
pwr_eType_Float32
:
case
pwr_eType_Float64
:
case
pwr_eType_String
:
case
pwr_eType_Time
:
break
;
default:
wsx_error_msg_str
(
Session
,
"Attribute type not supported"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
}
return
PWRB__SUCCESS
;
}
// Every method to be exported to the workbench should be registred here.
pwr_dExport
pwr_BindMethods
(
SevHist
)
=
{
pwr_BindMethod
(
PostCreate
),
pwr_BindMethod
(
PostMove
),
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
wb/lib/wb/src/wb_c_sevnodeconfig.cpp
View file @
b564b91f
...
...
@@ -20,10 +20,14 @@
/* wb_c_sevnodeconfig.c -- work bench methods of the SevNodeConfig class. */
#include <string.h>
#include "co_dcli.h"
#include "wb_pwrs.h"
#include "wb_pwrs_msg.h"
#include "wb_ldh.h"
#include "pwr_baseclasses.h"
#include "wb_session.h"
#include "wb_wsx.h"
#include "wb_pwrb_msg.h"
static
pwr_tStatus
PostCreate
(
ldh_tSesContext
Session
,
...
...
@@ -53,8 +57,80 @@ static pwr_tStatus PostCreate (
return
PWRS__SUCCESS
;
}
//
// Syntax check method
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
wb_session
*
sp
=
(
wb_session
*
)
Session
;
pwr_tString80
str
;
wb_object
o
=
sp
->
object
(
Object
.
Objid
);
wb_object
p
=
o
.
parent
();
if
(
!
p
||
p
.
cid
()
!=
pwr_cClass_BusConfig
)
wsx_error_msg_str
(
Session
,
"Bad parent"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
if
(
Object
.
Objid
.
vid
!=
ldh_cDirectoryVolume
)
wsx_error_msg_str
(
Session
,
"Not a DirectoryVolume"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
// Check NodeName
wb_attribute
a
=
sp
->
attribute
(
Object
.
Objid
,
"RtBody"
,
"NodeName"
);
if
(
!
a
)
return
a
.
sts
();
a
.
value
(
&
str
);
if
(
!
a
)
return
a
.
sts
();
dcli_trim
(
str
,
str
);
if
(
strcmp
(
str
,
""
)
==
0
)
wsx_error_msg_str
(
Session
,
"NodeName is missing"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
// Check OperatingSystem
a
=
sp
->
attribute
(
Object
.
Objid
,
"RtBody"
,
"OperatingSystem"
);
if
(
!
a
)
return
a
.
sts
();
pwr_tEnum
opsys
;
a
.
value
(
&
opsys
);
if
(
!
a
)
return
a
.
sts
();
if
(
opsys
<=
pwr_mOpSys__
||
opsys
>=
pwr_mOpSys_
)
wsx_error_msg_str
(
Session
,
"Invalid OperatingSystem"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
// Check Address
a
=
sp
->
attribute
(
Object
.
Objid
,
"RtBody"
,
"Address"
);
if
(
!
a
)
return
a
.
sts
();
a
.
value
(
&
str
);
if
(
!
a
)
return
a
.
sts
();
unsigned
char
adr1
,
adr2
,
adr3
,
adr4
;
int
num
;
num
=
sscanf
(
str
,
"%hhu.%hhu.%hhu.%hhu"
,
&
adr1
,
&
adr2
,
&
adr3
,
&
adr4
);
if
(
num
!=
4
)
wsx_error_msg_str
(
Session
,
"Syntax error in Address"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
else
if
(
adr1
==
0
&&
adr2
==
0
&&
adr3
==
0
&&
adr4
==
0
)
wsx_error_msg_str
(
Session
,
"Address is zero"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
// Check Volume
a
=
sp
->
attribute
(
Object
.
Objid
,
"RtBody"
,
"Volume"
);
if
(
!
a
)
return
a
.
sts
();
a
.
value
(
&
str
);
if
(
!
a
)
return
a
.
sts
();
dcli_trim
(
str
,
str
);
if
(
strcmp
(
str
,
""
)
==
0
)
wsx_error_msg_str
(
Session
,
"Volume is missing"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
return
PWRB__SUCCESS
;
}
pwr_dExport
pwr_BindMethods
(
SevNodeConfig
)
=
{
pwr_BindMethod
(
PostCreate
),
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
wb/lib/wb/src/wb_c_subvolume.cpp
View file @
b564b91f
...
...
@@ -30,13 +30,13 @@
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* current object */
pwr_t
AttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
pwr_tStatus
sts
;
sts
=
wsx_CheckVolume
(
Session
,
Object
,
ErrorCount
,
WarningCount
);
sts
=
wsx_CheckVolume
(
Session
,
Object
.
Objid
,
ErrorCount
,
WarningCount
);
if
(
EVEN
(
sts
))
return
sts
;
return
PWRS__SUCCESS
;
...
...
wb/lib/wb/src/wb_c_system.cpp
0 → 100644
View file @
b564b91f
/*
* Proview $Id: wb_c_ai.cpp,v 1.1 2007-01-04 07:29:02 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_ai.c -- work bench methods of the Ai class. */
#include <stdio.h>
#include <string.h>
#include "co_dcli.h"
#include "wb_pwrs.h"
#include "wb_ldh_msg.h"
#include "wb_pwrb_msg.h"
#include "pwr_baseclasses.h"
#include "wb_ldh.h"
#include "wb_session.h"
#include "wb_wsx.h"
/*----------------------------------------------------------------------------*\
Syntax check.
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
wb_session
*
sp
=
(
wb_session
*
)
Session
;
pwr_tString80
str
;
wb_object
o
=
sp
->
object
(
Object
.
Objid
);
wb_object
p
=
o
.
parent
();
if
(
!
(
!
p
||
p
.
oid
().
oix
==
0
))
wsx_error_msg_str
(
Session
,
"Not on top level"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
if
(
Object
.
Objid
.
vid
!=
ldh_cDirectoryVolume
)
wsx_error_msg_str
(
Session
,
"Not a DirectoryVolume"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
// Check SystemName
wb_attribute
a
=
sp
->
attribute
(
Object
.
Objid
,
"SysBody"
,
"SystemName"
);
if
(
!
a
)
return
a
.
sts
();
a
.
value
(
&
str
);
if
(
!
a
)
return
a
.
sts
();
dcli_trim
(
str
,
str
);
if
(
strcmp
(
str
,
""
)
==
0
)
wsx_error_msg_str
(
Session
,
"SystemName is missing"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
// Check SystemGroup
a
=
sp
->
attribute
(
Object
.
Objid
,
"SysBody"
,
"SystemGroup"
);
if
(
!
a
)
return
a
.
sts
();
a
.
value
(
&
str
);
if
(
!
a
)
return
a
.
sts
();
dcli_trim
(
str
,
str
);
if
(
strcmp
(
str
,
""
)
==
0
)
wsx_error_msg_str
(
Session
,
"SystemGroup is missing"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
return
PWRB__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport
pwr_BindMethods
(
$
System
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
wb/lib/wb/src/wb_i_base_methods.cpp
View file @
b564b91f
...
...
@@ -57,6 +57,7 @@ pwr_dImport pwr_BindMethods(PlcThread);
pwr_dImport
pwr_BindMethods
(
NodeConfig
);
pwr_dImport
pwr_BindMethods
(
SevNodeConfig
);
pwr_dImport
pwr_BindMethods
(
Application
);
pwr_dImport
pwr_BindMethods
(
FriendNodeConfig
);
pwr_dExport
pwr_BindClasses
(
Base
)
=
{
pwr_BindClass
(
ASup
),
...
...
@@ -95,6 +96,7 @@ pwr_dExport pwr_BindClasses(Base) = {
pwr_BindClass
(
NodeConfig
),
pwr_BindClass
(
SevNodeConfig
),
pwr_BindClass
(
Application
),
pwr_BindClass
(
FriendNodeConfig
),
pwr_NullClass
};
...
...
wb/lib/wb/src/wb_i_system_methods.cpp
View file @
b564b91f
...
...
@@ -36,6 +36,8 @@ pwr_dImport pwr_BindMethods($AttrRef);
pwr_dImport
pwr_BindMethods
(
$
PlantHier
);
pwr_dImport
pwr_BindMethods
(
$
NodeHier
);
pwr_dImport
pwr_BindMethods
(
$
Security
);
pwr_dImport
pwr_BindMethods
(
$
System
);
pwr_dImport
pwr_BindMethods
(
$
MountObject
);
pwr_dExport
pwr_BindClasses
(
System
)
=
{
pwr_BindClass
(
$
AttrXRef
),
...
...
@@ -53,5 +55,7 @@ pwr_dExport pwr_BindClasses(System) = {
pwr_BindClass
(
$
PlantHier
),
pwr_BindClass
(
$
NodeHier
),
pwr_BindClass
(
$
Security
),
pwr_BindClass
(
$
System
),
pwr_BindClass
(
$
MountObject
),
pwr_NullClass
};
wb/lib/wb/src/wb_pwrs.h
View file @
b564b91f
...
...
@@ -83,7 +83,7 @@ typedef pwr_tStatus (* wb_tMethodPostAdopt) (ldh_tSesContext, pwr_tOid, pwr_tOi
typedef
pwr_tStatus
(
*
wb_tMethodAnteUnadopt
)(
ldh_tSesContext
,
pwr_tOid
,
pwr_tOid
,
pwr_tCid
);
typedef
pwr_tStatus
(
*
wb_tMethodPostUnadopt
)(
ldh_tSesContext
,
pwr_tOid
,
pwr_tOid
,
pwr_tCid
);
typedef
pwr_tStatus
(
*
wb_tMethodPostRename
)
(
ldh_tSesContext
,
pwr_tOid
);
typedef
pwr_tStatus
(
*
wb_tMethodSyntaxCheck
)(
ldh_tSesContext
,
pwr_t
Oid
,
int
*
,
int
*
);
typedef
pwr_tStatus
(
*
wb_tMethodSyntaxCheck
)(
ldh_tSesContext
,
pwr_t
AttrRef
,
int
*
,
int
*
);
#if defined OS_VMS
...
...
@@ -135,7 +135,7 @@ static pwr_tStatus PostUnadopt (
);
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_t
Objid
Object
,
/* object to check */
pwr_t
AttrRef
Object
,
/* object to check */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated warning count */
);
...
...
wb/lib/wb/src/wb_volume.cpp
View file @
b564b91f
...
...
@@ -477,60 +477,138 @@ bool wb_volume::exportTree(wb_volume &import, pwr_tOid oid)
pwr_tStatus
wb_volume
::
syntaxCheck
(
int
*
errorcount
,
int
*
warningcount
)
{
pwr_tStatus
sts
;
pwr_tStatus
sts
=
LDH__SUCCESS
;
pwr_tStatus
osts
;
wb_object
o
=
object
();
if
(
o
)
{
sts
=
syntaxCheckObject
(
o
,
errorcount
,
warningcount
);
return
sts
;
for
(
wb_object
o
=
object
();
o
;
o
=
o
.
after
())
{
if
(
o
.
cid
()
==
pwr_eClass_LibHier
)
continue
;
osts
=
syntaxCheckObject
(
o
,
errorcount
,
warningcount
);
if
(
EVEN
(
osts
))
sts
=
osts
;
}
return
LDH__SUCCESS
;
return
osts
;
}
pwr_tStatus
wb_volume
::
syntaxCheckAttr
(
wb_attribute
&
a
,
int
*
errorcount
,
int
*
warningcount
)
{
pwr_tStatus
sts
=
LDH__SUCCESS
;
pwr_tStatus
asts
;
if
(
!
a
.
isSuperClass
())
sts
=
triggSyntaxCheck
(
a
,
errorcount
,
warningcount
);
// Get any attribute objects
wb_cdef
cd
=
cdef
(
a
.
tid
());
if
(
!
cd
)
return
cd
.
sts
();
wb_bdef
bdef
=
cd
.
bdef
(
pwr_eBix_rt
);
wb_adef
adef
;
if
(
bdef
)
{
for
(
adef
=
bdef
.
adef
();
adef
;
adef
=
adef
.
next
())
{
if
(
adef
.
flags
()
&
PWR_MASK_SUPERCLASS
)
continue
;
if
(
!
(
adef
.
flags
()
&
PWR_MASK_CLASS
))
continue
;
if
(
adef
.
flags
()
&
PWR_MASK_ARRAY
)
{
for
(
int
i
=
0
;
i
<
adef
.
nElement
();
i
++
)
{
wb_attribute
attr
(
a
,
i
,
adef
.
name
());
asts
=
syntaxCheckAttr
(
attr
,
errorcount
,
warningcount
);
if
(
EVEN
(
asts
))
sts
=
asts
;
}
}
else
{
wb_attribute
attr
(
a
,
0
,
adef
.
name
());
if
(
adef
.
flags
()
&
PWR_MASK_DISABLEATTR
&&
attr
.
disabled
())
continue
;
asts
=
syntaxCheckAttr
(
attr
,
errorcount
,
warningcount
);
if
(
EVEN
(
asts
))
sts
=
asts
;
}
}
}
return
sts
;
}
pwr_tStatus
wb_volume
::
syntaxCheckObject
(
wb_object
&
o
,
int
*
errorcount
,
int
*
warningcount
)
{
pwr_tStatus
sts
;
pwr_tStatus
sts
,
csts
;
wb_object
first
,
after
;
wb_attribute
a
(
o
.
sts
(),
o
);
sts
=
triggSyntaxCheck
(
o
,
errorcount
,
warningcount
);
sts
=
triggSyntaxCheck
(
a
,
errorcount
,
warningcount
);
if
(
EVEN
(
sts
))
return
sts
;
switch
(
o
.
cid
())
{
case
pwr_eClass_LibHier
:
break
;
default:
first
=
o
.
first
();
if
(
first
)
{
sts
=
syntaxCheckObject
(
first
,
errorcount
,
warningcount
);
if
(
EVEN
(
sts
))
return
sts
;
// Get any attribute objects
wb_cdef
cd
=
cdef
(
o
);
if
(
!
cd
)
return
cd
.
sts
();
wb_bdef
bdef
=
cd
.
bdef
(
pwr_eBix_rt
);
wb_adef
adef
;
if
(
bdef
)
{
for
(
adef
=
bdef
.
adef
();
adef
;
adef
=
adef
.
next
())
{
if
(
!
(
adef
.
flags
()
&
PWR_MASK_CLASS
))
continue
;
if
(
adef
.
flags
()
&
PWR_MASK_ARRAY
)
{
for
(
int
i
=
0
;
i
<
adef
.
nElement
();
i
++
)
{
wb_attribute
a
(
adef
.
sts
(),
o
,
adef
,
i
);
csts
=
syntaxCheckAttr
(
a
,
errorcount
,
warningcount
);
if
(
EVEN
(
csts
))
sts
=
csts
;
}
after
=
o
.
after
();
if
(
after
)
{
sts
=
syntaxCheckObject
(
after
,
errorcount
,
warningcount
);
if
(
EVEN
(
sts
))
return
sts
;
}
else
{
wb_attribute
a
(
adef
.
sts
(),
o
,
adef
);
if
(
adef
.
flags
()
&
PWR_MASK_DISABLEATTR
&&
a
.
disabled
())
continue
;
csts
=
syntaxCheckAttr
(
a
,
errorcount
,
warningcount
);
if
(
EVEN
(
csts
))
sts
=
csts
;
}
return
LDH__SUCCESS
;
}
}
for
(
wb_object
c
=
o
.
first
();
c
;
c
=
c
.
after
())
{
if
(
c
.
cid
()
==
pwr_eClass_LibHier
)
continue
;
csts
=
syntaxCheckObject
(
c
,
errorcount
,
warningcount
);
if
(
EVEN
(
csts
))
sts
=
csts
;
}
return
sts
;
}
pwr_tStatus
wb_volume
::
triggSyntaxCheck
(
wb_
object
&
o
,
int
*
errorcount
,
int
*
warningcount
)
pwr_tStatus
wb_volume
::
triggSyntaxCheck
(
wb_
attribute
&
a
,
int
*
errorcount
,
int
*
warningcount
)
{
pwr_tStatus
sts
;
char
methodName
[
]
=
"SyntaxCheck"
;
char
methodName
[
80
]
;
wb_tMethod
method
;
// wb_cdrep *cdrep = m_vrep->merep()->cdrep(&sts, o.cid());
// if (EVEN(sts)) return sts
;
if
(
!
cdh_tidIsCid
(
a
.
tid
()))
return
0
;
//
cdrep->dbCallBack(&sts, ldh_eDbCallBack_SyntaxCheck, &methodName, 0);
// delete cdrep;
// if (EVEN(sts)) return LDH__SUCCESS
;
//
Call object method, or inherited method
for
(
wb_cdef
cd
=
cdef
(
a
.
tid
());
cd
;
cd
=
cd
.
super
())
{
sprintf
(
methodName
,
"%s-SyntaxCheck"
,
cd
.
name
())
;
m_vrep
->
erep
()
->
method
(
&
sts
,
methodName
,
&
method
);
if
(
EVEN
(
sts
))
return
LDH__SUCCESS
;
sts
=
((
wb_tMethodSyntaxCheck
)
(
method
))((
ldh_tSesContext
)
this
,
o
.
oid
(),
errorcount
,
warningcount
);
return
sts
;
if
(
ODD
(
sts
))
{
sts
=
((
wb_tMethodSyntaxCheck
)
(
method
))((
ldh_tSesContext
)
this
,
a
.
aref
(),
errorcount
,
warningcount
);
if
(
EVEN
(
sts
))
return
sts
;
break
;
}
}
return
LDH__SUCCESS
;
}
pwr_tStatus
wb_volume
::
triggAnteAdopt
(
wb_object
&
father
,
pwr_tCid
cid
)
...
...
wb/lib/wb/src/wb_volume.h
View file @
b564b91f
...
...
@@ -104,7 +104,8 @@ public:
pwr_tStatus
syntaxCheck
(
int
*
errorcount
,
int
*
warningcount
);
pwr_tStatus
syntaxCheckObject
(
wb_object
&
o
,
int
*
errorcount
,
int
*
warningcount
);
pwr_tStatus
triggSyntaxCheck
(
wb_object
&
o
,
int
*
errorcount
,
int
*
warningcount
);
pwr_tStatus
syntaxCheckAttr
(
wb_attribute
&
a
,
int
*
errorcount
,
int
*
warningcount
);
pwr_tStatus
triggSyntaxCheck
(
wb_attribute
&
o
,
int
*
errorcount
,
int
*
warningcount
);
pwr_tStatus
triggAnteAdopt
(
wb_object
&
o
,
pwr_tCid
cid
);
pwr_tStatus
triggAnteCreate
(
wb_object
&
father
,
pwr_tCid
cid
);
pwr_tStatus
triggAnteMove
(
wb_object
&
o
,
wb_object
&
father
,
wb_object
&
old_father
);
...
...
wb/lib/wb/src/wb_wb.meth
View file @
b564b91f
...
...
@@ -34,3 +34,4 @@ PlcThread
NodeConfig
SevNodeConfig
Application
FriendNodeConfig
wb/lib/wb/src/wb_wnav_command.cpp
View file @
b564b91f
...
...
@@ -426,7 +426,7 @@ dcli_tCmdTable wnav_command_table[] = {
{
"CHECK"
,
&
wnav_check_func
,
{
"dcli_arg1"
,
""
}
{
"dcli_arg1"
,
"
/VOLUME"
,
"/NAME"
,
"
"
}
},
{
"UPDATE"
,
...
...
@@ -4996,6 +4996,53 @@ static int wnav_check_func( void *client_data,
wb_vrepdb
*
vrep
=
(
wb_vrepdb
*
)((
wb_vrep
*
)
*
v
);
vrep
->
checkMeta
();
}
if
(
strncmp
(
arg1_str
,
"SYNTAX"
,
strlen
(
arg1_str
))
==
0
)
{
int
errorcount
=
0
;
int
warningcount
=
0
;
pwr_tOName
namestr
;
if
(
ODD
(
dcli_get_qualifier
(
"/VOLUME"
,
0
,
0
)))
{
wb_volume
*
v
=
(
wb_volume
*
)
ldh_SessionToVol
(
wnav
->
ldhses
);
sts
=
v
->
syntaxCheck
(
&
errorcount
,
&
warningcount
);
if
(
EVEN
(
sts
))
wnav
->
message
(
' '
,
wnav_get_message
(
sts
));
else
if
(
errorcount
||
warningcount
)
{
char
msg
[
80
];
sprintf
(
msg
,
"Syntax check, %d errors, %d warnings"
,
errorcount
,
warningcount
);
wnav
->
message
(
errorcount
?
'E'
:
'W'
,
msg
);
}
else
wnav
->
message
(
'I'
,
"Successfull syntax check, no errors or warnings found"
);
}
else
{
if
(
EVEN
(
dcli_get_qualifier
(
"/NAME"
,
namestr
,
sizeof
(
namestr
))))
{
if
(
EVEN
(
dcli_get_qualifier
(
"dcli_arg2"
,
namestr
,
sizeof
(
namestr
))))
{
wnav
->
message
(
'E'
,
"Syntax error"
);
return
WNAV__SYNTAX
;
}
}
wb_volume
*
v
=
(
wb_volume
*
)
ldh_SessionToVol
(
wnav
->
ldhses
);
wb_object
o
=
v
->
object
(
namestr
);
if
(
!
o
)
{
wnav
->
message
(
' '
,
wnav_get_message
(
o
.
sts
()));
return
o
.
sts
();
}
sts
=
v
->
syntaxCheckObject
(
o
,
&
errorcount
,
&
warningcount
);
if
(
EVEN
(
sts
))
wnav
->
message
(
' '
,
wnav_get_message
(
sts
));
else
if
(
errorcount
||
warningcount
)
{
char
msg
[
80
];
sprintf
(
msg
,
"Syntax check, %d errors, %d warnings"
,
errorcount
,
warningcount
);
wnav
->
message
(
errorcount
?
'E'
:
'W'
,
msg
);
}
else
wnav
->
message
(
'I'
,
"Successfull syntax check, no errors or warnings found"
);
}
}
else
{
wnav
->
message
(
'E'
,
"Syntax error"
);
return
WNAV__SYNTAX
;
...
...
wb/lib/wb/src/wb_wsx.cpp
View file @
b564b91f
...
...
@@ -35,6 +35,7 @@
#include "wb_trv.h"
#include "wb_wsx.h"
#include "wb_wsx_msg.h"
#include "wb_session.h"
static
int
wsx_object_count
(
pwr_tAttrRef
*
aref
,
...
...
@@ -84,40 +85,41 @@ static int wsx_object_count (
pwr_tStatus
wsx_error_msg
(
ldh_tSesContext
sesctx
,
pwr_tStatus
sts
,
pwr_t
Objid
objid
,
pwr_t
AttrRef
aref
,
int
*
errorcount
,
int
*
warningcount
)
{
static
char
msg
[
256
];
int
status
,
size
;
pwr_tOName
name
;
pwr_tAName
name
;
char
*
namep
;
FILE
*
logfile
;
logfile
=
NULL
;
if
(
EVEN
(
sts
))
{
if
(
EVEN
(
sts
))
{
msg_GetMsg
(
sts
,
msg
,
sizeof
(
msg
));
if
(
logfile
!=
NULL
)
fprintf
(
logfile
,
"%s
\n
"
,
msg
);
else
printf
(
"%s
\n
"
,
msg
);
if
(
cdh_ObjidIsNull
(
o
bjid
))
if
(
cdh_ObjidIsNull
(
aref
.
O
bjid
))
MsgWindow
::
message
(
co_error
(
sts
),
0
,
0
);
//msgw_message_sts( sts, 0, 0);
else
{
/* Get the full hierarchy name for the node */
status
=
ldh_ObjidToName
(
sesctx
,
objid
,
ldh_eName_Default
,
name
,
sizeof
(
name
)
,
&
size
);
status
=
ldh_AttrRefToName
(
sesctx
,
&
aref
,
cdh_mNName
,
&
namep
,
&
size
);
if
(
EVEN
(
status
))
return
status
;
strncpy
(
name
,
namep
,
sizeof
(
name
));
if
(
logfile
!=
NULL
)
fprintf
(
logfile
,
" in object %s
\n
"
,
name
);
else
printf
(
" in object %s
\n
"
,
name
);
MsgWindow
::
message
(
co_error
(
sts
),
" in object"
,
name
,
objid
);
// msgw_message_object( sts, " in object", name, objid);
MsgWindow
::
message
(
co_error
(
sts
),
" in object"
,
name
,
aref
.
Objid
);
}
if
(
(
sts
&
2
)
&&
!
(
sts
&
1
))
(
*
errorcount
)
++
;
...
...
@@ -127,6 +129,53 @@ pwr_tStatus wsx_error_msg(
return
WSX__SUCCESS
;
}
pwr_tStatus
wsx_error_msg_str
(
ldh_tSesContext
sesctx
,
const
char
*
str
,
pwr_tAttrRef
aref
,
int
severity
,
int
*
errorcount
,
int
*
warningcount
)
{
int
status
,
size
;
pwr_tAName
name
;
char
*
namep
;
FILE
*
logfile
;
char
msg
[
200
];
logfile
=
NULL
;
snprintf
(
msg
,
sizeof
(
msg
),
"%%WSX-%c-MSG, %s"
,
severity
,
str
);
if
(
logfile
!=
NULL
)
fprintf
(
logfile
,
"%s
\n
"
,
msg
);
else
printf
(
"%s
\n
"
,
msg
);
if
(
cdh_ObjidIsNull
(
aref
.
Objid
))
MsgWindow
::
message
(
severity
,
msg
,
""
,
0
);
else
{
/* Get the full hierarchy name for the node */
status
=
ldh_AttrRefToName
(
sesctx
,
&
aref
,
cdh_mNName
,
&
namep
,
&
size
);
if
(
EVEN
(
status
))
return
status
;
strncpy
(
name
,
namep
,
sizeof
(
name
));
if
(
logfile
!=
NULL
)
fprintf
(
logfile
,
" in object %s
\n
"
,
name
);
else
printf
(
" in object %s
\n
"
,
name
);
MsgWindow
::
message
(
severity
,
msg
,
" in object"
,
name
,
aref
.
Objid
);
}
if
(
severity
==
'E'
||
severity
==
'F'
)
(
*
errorcount
)
++
;
else
if
(
severity
==
'W'
)
(
*
warningcount
)
++
;
return
WSX__SUCCESS
;
}
/*************************************************************************
*
* Name: wsx_CheckCard()
...
...
@@ -143,7 +192,7 @@ pwr_tStatus wsx_error_msg(
pwr_tStatus
wsx_CheckCard
(
ldh_tSesContext
sesctx
,
pwr_t
Objid
objid
,
pwr_t
AttrRef
aref
,
int
*
errorcount
,
int
*
warningcount
,
wsx_mCardOption
options
...
...
@@ -159,45 +208,31 @@ pwr_tStatus wsx_CheckCard(
pwr_tObjid
chan_objid
;
pwr_tClassId
cid
;
/* Check DevName */
if
(
options
&
wsx_mCardOption_DevName
)
{
sts
=
ldh_GetObjectPar
(
sesctx
,
objid
,
"RtBody"
,
"DevName"
,
(
char
**
)
&
buf_ptr
,
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
strcmp
(
buf_ptr
,
""
)
==
0
)
wsx_error_msg
(
sesctx
,
WSX__CARDDEVNAME
,
objid
,
errorcount
,
warningcount
);
free
((
char
*
)
buf_ptr
);
}
/* Check ErrorSoftLimit */
sts
=
ldh_GetObjectPar
(
sesctx
,
objid
,
sts
=
ldh_Get
Attr
ObjectPar
(
sesctx
,
&
aref
,
"RtBody"
,
"ErrorSoftLimit"
,
(
char
**
)
&
buf_ptr
,
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
*
(
int
*
)
buf_ptr
==
0
)
wsx_error_msg
(
sesctx
,
WSX__CARDERRSOFTLIM
,
objid
,
errorcount
,
warningcount
);
wsx_error_msg
(
sesctx
,
WSX__CARDERRSOFTLIM
,
aref
,
errorcount
,
warningcount
);
free
((
char
*
)
buf_ptr
);
/* Check ErrorHardLimit */
sts
=
ldh_GetObjectPar
(
sesctx
,
objid
,
sts
=
ldh_Get
Attr
ObjectPar
(
sesctx
,
&
aref
,
"RtBody"
,
"ErrorHardLimit"
,
(
char
**
)
&
buf_ptr
,
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
*
(
int
*
)
buf_ptr
==
0
)
wsx_error_msg
(
sesctx
,
WSX__CARDERRHARDLIM
,
objid
,
errorcount
,
warningcount
);
wsx_error_msg
(
sesctx
,
WSX__CARDERRHARDLIM
,
aref
,
errorcount
,
warningcount
);
free
((
char
*
)
buf_ptr
);
/* Get MaxNoOfChannels */
sts
=
ldh_GetObjectPar
(
sesctx
,
objid
,
sts
=
ldh_Get
Attr
ObjectPar
(
sesctx
,
&
aref
,
"RtBody"
,
"MaxNoOfChannels"
,
(
char
**
)
&
buf_ptr
,
&
size
);
...
...
@@ -208,13 +243,13 @@ pwr_tStatus wsx_CheckCard(
if
(
chan_max
>
256
)
{
wsx_error_msg
(
sesctx
,
WSX__MAXCHAN
,
objid
,
errorcount
,
warningcount
);
wsx_error_msg
(
sesctx
,
WSX__MAXCHAN
,
aref
,
errorcount
,
warningcount
);
return
WSX__SUCCESS
;
}
/* Check that Number in channel-objects are unique within the card */
memset
(
chan_number_array
,
0
,
sizeof
(
chan_number_array
));
chan_count
=
0
;
sts
=
ldh_GetChild
(
sesctx
,
o
bjid
,
&
chan_objid
);
sts
=
ldh_GetChild
(
sesctx
,
aref
.
O
bjid
,
&
chan_objid
);
while
(
ODD
(
sts
))
{
sts
=
ldh_GetObjectClass
(
sesctx
,
chan_objid
,
&
cid
);
...
...
@@ -238,22 +273,24 @@ pwr_tStatus wsx_CheckCard(
/* Check than number is within limits */
if
(
number
>=
chan_max
)
{
wsx_error_msg
(
sesctx
,
WSX__NUMRANGE
,
chan_objid
,
errorcount
,
warningcount
);
wsx_error_msg
(
sesctx
,
WSX__NUMRANGE
,
cdh_ObjidToAref
(
chan_objid
),
errorcount
,
warningcount
);
break
;
}
if
(
chan_number_array
[
number
])
/* Number is occupied */
wsx_error_msg
(
sesctx
,
WSX__NUMNOTUNIQUE
,
chan_objid
,
errorcount
,
warningcount
);
wsx_error_msg
(
sesctx
,
WSX__NUMNOTUNIQUE
,
cdh_ObjidToAref
(
chan_objid
),
errorcount
,
warningcount
);
else
chan_number_array
[
number
]
=
1
;
break
;
default:
wsx_error_msg
(
sesctx
,
WSX__MISPLACED
,
objid
,
errorcount
,
warningcount
);
wsx_error_msg
(
sesctx
,
WSX__MISPLACED
,
aref
,
errorcount
,
warningcount
);
}
sts
=
ldh_GetNextSibling
(
sesctx
,
chan_objid
,
&
chan_objid
);
}
if
(
chan_count
>
chan_max
)
wsx_error_msg
(
sesctx
,
WSX__CHANCOUNT
,
objid
,
errorcount
,
warningcount
);
wsx_error_msg
(
sesctx
,
WSX__CHANCOUNT
,
aref
,
errorcount
,
warningcount
);
return
WSX__SUCCESS
;
}
...
...
@@ -274,7 +311,7 @@ pwr_tStatus wsx_CheckCard(
pwr_tStatus
wsx_CheckCoCard
(
ldh_tSesContext
sesctx
,
pwr_t
Objid
objid
,
pwr_t
AttrRef
aref
,
int
*
errorcount
,
int
*
warningcount
)
...
...
@@ -287,42 +324,32 @@ pwr_tStatus wsx_CheckCoCard(
pwr_tObjid
chan_objid
;
pwr_tClassId
cid
;
/* Check DevName */
sts
=
ldh_GetObjectPar
(
sesctx
,
objid
,
"RtBody"
,
"DevName"
,
(
char
**
)
&
buf_ptr
,
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
strcmp
(
buf_ptr
,
""
)
==
0
)
wsx_error_msg
(
sesctx
,
WSX__CARDDEVNAME
,
objid
,
errorcount
,
warningcount
);
free
((
char
*
)
buf_ptr
);
/* Check ErrorSoftLimit */
sts
=
ldh_GetObjectPar
(
sesctx
,
objid
,
sts
=
ldh_Get
Attr
ObjectPar
(
sesctx
,
&
aref
,
"RtBody"
,
"ErrorSoftLimit"
,
(
char
**
)
&
buf_ptr
,
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
*
(
int
*
)
buf_ptr
==
0
)
wsx_error_msg
(
sesctx
,
WSX__CARDERRSOFTLIM
,
objid
,
errorcount
,
warningcount
);
wsx_error_msg
(
sesctx
,
WSX__CARDERRSOFTLIM
,
aref
,
errorcount
,
warningcount
);
free
((
char
*
)
buf_ptr
);
/* Check ErrorHardLimit */
sts
=
ldh_GetObjectPar
(
sesctx
,
objid
,
sts
=
ldh_Get
Attr
ObjectPar
(
sesctx
,
&
aref
,
"RtBody"
,
"ErrorHardLimit"
,
(
char
**
)
&
buf_ptr
,
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
*
(
int
*
)
buf_ptr
==
0
)
wsx_error_msg
(
sesctx
,
WSX__CARDERRHARDLIM
,
objid
,
errorcount
,
warningcount
);
wsx_error_msg
(
sesctx
,
WSX__CARDERRHARDLIM
,
aref
,
errorcount
,
warningcount
);
free
((
char
*
)
buf_ptr
);
/* Get MaxNoOfChannels */
sts
=
ldh_GetObjectPar
(
sesctx
,
objid
,
sts
=
ldh_Get
Attr
ObjectPar
(
sesctx
,
&
aref
,
"RtBody"
,
"MaxNoOfCounters"
,
(
char
**
)
&
buf_ptr
,
&
size
);
...
...
@@ -332,7 +359,7 @@ pwr_tStatus wsx_CheckCoCard(
free
((
char
*
)
buf_ptr
);
chan_count
=
0
;
sts
=
ldh_GetChild
(
sesctx
,
o
bjid
,
&
chan_objid
);
sts
=
ldh_GetChild
(
sesctx
,
aref
.
O
bjid
,
&
chan_objid
);
while
(
ODD
(
sts
))
{
sts
=
ldh_GetObjectClass
(
sesctx
,
chan_objid
,
&
cid
);
...
...
@@ -343,16 +370,83 @@ pwr_tStatus wsx_CheckCoCard(
chan_count
++
;
break
;
default:
wsx_error_msg
(
sesctx
,
WSX__MISPLACED
,
objid
,
errorcount
,
warningcount
);
wsx_error_msg
(
sesctx
,
WSX__MISPLACED
,
aref
,
errorcount
,
warningcount
);
}
sts
=
ldh_GetNextSibling
(
sesctx
,
chan_objid
,
&
chan_objid
);
}
if
(
chan_count
>
chan_max
)
wsx_error_msg
(
sesctx
,
WSX__CHANCOUNT
,
objid
,
errorcount
,
warningcount
);
wsx_error_msg
(
sesctx
,
WSX__CHANCOUNT
,
aref
,
errorcount
,
warningcount
);
return
WSX__SUCCESS
;
}
pwr_tStatus
wsx_CheckIoDevice
(
ldh_tSesContext
sesctx
,
pwr_tAttrRef
aref
,
int
*
errorcount
,
int
*
warningcount
,
wsx_mCardOption
options
)
{
wb_session
*
sp
=
(
wb_session
*
)
sesctx
;
pwr_tMask
process
;
pwr_tOid
thread
;
wb_attribute
a
=
sp
->
attribute
(
&
aref
);
if
(
!
a
)
return
a
.
sts
();
// Check Process
wb_attribute
process_a
(
a
,
0
,
"Process"
);
if
(
!
process_a
)
return
process_a
.
sts
();
process_a
.
value
(
&
process
);
if
(
!
process_a
)
return
process_a
.
sts
();
if
(
process
==
0
)
wsx_error_msg_str
(
sesctx
,
"Process is not specified"
,
aref
,
'W'
,
errorcount
,
warningcount
);
else
if
(
process
==
1
)
{
// Check thread object
wb_attribute
thread_a
(
a
,
0
,
"ThreadObject"
);
if
(
!
thread_a
)
return
thread_a
.
sts
();
thread_a
.
value
(
&
thread
);
if
(
!
thread_a
)
return
thread_a
.
sts
();
if
(
cdh_ObjidIsNull
(
thread
))
wsx_error_msg_str
(
sesctx
,
"ThreadObject is not specified"
,
aref
,
'E'
,
errorcount
,
warningcount
);
else
{
wb_object
thread_o
=
sp
->
object
(
thread
);
if
(
!
thread_o
)
wsx_error_msg_str
(
sesctx
,
"Undefined ThreadObject"
,
aref
,
'E'
,
errorcount
,
warningcount
);
else
if
(
thread_o
.
cid
()
!=
pwr_cClass_PlcThread
)
wsx_error_msg_str
(
sesctx
,
"Error in ThreadObject class"
,
aref
,
'E'
,
errorcount
,
warningcount
);
}
}
if
(
options
&
wsx_mCardOption_ErrorLimits
)
{
pwr_tUInt32
limit
;
// Check SoftLimit
wb_attribute
softlimit_a
(
a
,
0
,
"ErrorSoftLimit"
);
if
(
!
softlimit_a
)
return
softlimit_a
.
sts
();
softlimit_a
.
value
(
&
limit
);
if
(
!
softlimit_a
)
return
softlimit_a
.
sts
();
if
(
limit
==
0
)
wsx_error_msg_str
(
sesctx
,
"ErrorSoftLimit is not specified"
,
aref
,
'W'
,
errorcount
,
warningcount
);
// Check HardLimit
wb_attribute
hardlimit_a
(
a
,
0
,
"ErrorHardLimit"
);
if
(
!
hardlimit_a
)
return
hardlimit_a
.
sts
();
hardlimit_a
.
value
(
&
limit
);
if
(
!
hardlimit_a
)
return
hardlimit_a
.
sts
();
if
(
limit
==
0
)
wsx_error_msg_str
(
sesctx
,
"ErrorHardLimit is not specified"
,
aref
,
'E'
,
errorcount
,
warningcount
);
}
return
WSX__SUCCESS
;
}
/*************************************************************************
*
* Name: wsx_CheckSigChanCon()
...
...
@@ -369,81 +463,44 @@ pwr_tStatus wsx_CheckCoCard(
pwr_tStatus
wsx_CheckSigChanCon
(
ldh_tSesContext
sesctx
,
pwr_t
Objid
objid
,
pwr_t
AttrRef
aref
,
int
*
errorcount
,
int
*
warningcount
)
{
int
sts
;
int
size
;
pwr_tObjid
*
con_ptr
;
pwr_tObjid
*
back_ptr
;
pwr_tAttrRef
*
con_ptr
;
int
class_error
;
pwr_tClassId
cid
;
pwr_tClassId
con_class
;
sts
=
ldh_Get
ObjectClass
(
sesctx
,
objid
,
&
cid
);
sts
=
ldh_Get
AttrRefTid
(
sesctx
,
&
aref
,
&
cid
);
if
(
EVEN
(
sts
))
return
sts
;
/* Check SigChanCon */
sts
=
ldh_GetObjectPar
(
sesctx
,
objid
,
sts
=
ldh_Get
Attr
ObjectPar
(
sesctx
,
&
aref
,
"RtBody"
,
"SigChanCon"
,
(
char
**
)
&
con_ptr
,
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
cdh_ObjidIsNull
(
*
con_ptr
))
{
switch
(
cid
)
{
case
pwr_cClass_ChanDi
:
case
pwr_cClass_ChanDo
:
case
pwr_cClass_ChanAi
:
case
pwr_cClass_ChanAit
:
case
pwr_cClass_ChanAo
:
case
pwr_cClass_ChanCo
:
/* Null objid is OK fr channels */
return
WSX__SUCCESS
;
default:
wsx_error_msg
(
sesctx
,
WSX__SIGCHANCON
,
objid
,
errorcount
,
warningcount
);
if
(
cdh_ObjidIsNull
(
con_ptr
->
Objid
))
{
wsx_error_msg
(
sesctx
,
WSX__SIGCHANCON
,
aref
,
errorcount
,
warningcount
);
free
((
char
*
)
con_ptr
);
return
WSX__SUCCESS
;
}
}
/* Check object class of connected object */
sts
=
ldh_GetObjectClass
(
sesctx
,
*
con_ptr
,
&
con_class
);
if
(
EVEN
(
sts
))
{
wsx_error_msg
(
sesctx
,
WSX__SIGCHANCON
,
objid
,
errorcount
,
warningcount
);
sts
=
ldh_GetAttrRefTid
(
sesctx
,
con_ptr
,
&
con_class
);
if
(
EVEN
(
sts
))
{
wsx_error_msg
(
sesctx
,
WSX__SIGCHANCON
,
aref
,
errorcount
,
warningcount
);
free
((
char
*
)
con_ptr
);
return
WSX__SUCCESS
;
}
class_error
=
0
;
switch
(
cid
)
{
case
pwr_cClass_ChanDi
:
if
(
con_class
!=
pwr_cClass_Di
)
class_error
=
1
;
break
;
case
pwr_cClass_ChanDo
:
if
(
!
(
con_class
==
pwr_cClass_Do
||
con_class
==
pwr_cClass_Po
))
class_error
=
1
;
break
;
case
pwr_cClass_ChanAi
:
case
pwr_cClass_ChanAit
:
if
(
con_class
!=
pwr_cClass_Ai
)
class_error
=
1
;
break
;
case
pwr_cClass_ChanAo
:
if
(
con_class
!=
pwr_cClass_Ao
)
class_error
=
1
;
break
;
case
pwr_cClass_ChanCo
:
if
(
con_class
!=
pwr_cClass_Co
)
class_error
=
1
;
break
;
switch
(
cid
)
{
case
pwr_cClass_Di
:
if
(
con_class
!=
pwr_cClass_ChanDi
)
class_error
=
1
;
...
...
@@ -479,33 +536,146 @@ pwr_tStatus wsx_CheckSigChanCon(
break
;
}
if
(
class_error
)
{
wsx_error_msg
(
sesctx
,
WSX__SIGCHANCONCLASS
,
objid
,
errorcount
,
warningcount
);
if
(
class_error
)
{
wsx_error_msg
(
sesctx
,
WSX__SIGCHANCONCLASS
,
aref
,
errorcount
,
warningcount
);
free
((
char
*
)
con_ptr
);
return
WSX__SUCCESS
;
}
/* Check that the connections is mutual */
sts
=
ldh_GetObjectPar
(
sesctx
,
*
con_ptr
,
"RtBody"
,
"SigChanCon"
,
(
char
**
)
&
back_ptr
,
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
cdh_ObjidIsNotEqual
(
*
back_ptr
,
objid
))
{
wsx_error_msg
(
sesctx
,
WSX__SIGCHANCON
,
objid
,
errorcount
,
warningcount
);
free
((
char
*
)
con_ptr
);
free
((
char
*
)
back_ptr
);
return
WSX__SUCCESS
;
}
//
// Check if an attrref attribute contains an invalid attrref
//
pwr_tStatus
wsx_CheckAttrRef
(
ldh_tSesContext
sesctx
,
pwr_tAttrRef
aref
,
const
pwr_tObjName
attribute
,
pwr_tCid
*
cid_vect
,
int
null_is_ok
,
int
*
errorcount
,
int
*
warningcount
)
{
pwr_tAttrRef
value
;
wb_session
*
sp
=
(
wb_session
*
)
sesctx
;
wb_attribute
a
=
sp
->
attribute
(
&
aref
);
if
(
!
a
)
return
a
.
sts
();
wb_attribute
a_attr
(
a
,
0
,
attribute
);
if
(
!
a_attr
)
return
a_attr
.
sts
();
a_attr
.
value
(
&
value
);
if
(
!
a_attr
)
return
a_attr
.
sts
();
if
(
!
null_is_ok
&&
cdh_ObjidIsNull
(
value
.
Objid
))
{
char
msg
[
80
];
sprintf
(
msg
,
"Attribute reference is null in
\"
%s
\"
"
,
attribute
);
wsx_error_msg_str
(
sesctx
,
msg
,
aref
,
'E'
,
errorcount
,
warningcount
);
}
if
(
cdh_ObjidIsNotNull
(
value
.
Objid
))
{
wb_attribute
a_value
=
sp
->
attribute
(
&
value
);
if
(
!
a_value
)
{
char
msg
[
80
];
sprintf
(
msg
,
"Undefined attribute reference in
\"
%s
\"
"
,
attribute
);
wsx_error_msg_str
(
sesctx
,
msg
,
aref
,
'E'
,
errorcount
,
warningcount
);
}
else
if
(
cid_vect
)
{
// Check attribute reference class
bool
found
=
false
;
for
(
int
i
=
0
;
cid_vect
[
i
];
i
++
)
{
if
(
cid_vect
[
i
]
==
a_value
.
tid
())
{
found
=
true
;
break
;
}
}
if
(
!
found
)
{
char
msg
[
80
];
sprintf
(
msg
,
"Invalid class of attribute reference in
\"
%s
\"
"
,
attribute
);
wsx_error_msg_str
(
sesctx
,
msg
,
aref
,
'E'
,
errorcount
,
warningcount
);
}
}
}
return
WSX__SUCCESS
;
}
//
// Check if an Z attrref attribute contains an invalid attrref and points back
//
pwr_tStatus
wsx_CheckXAttrRef
(
ldh_tSesContext
sesctx
,
pwr_tAttrRef
aref
,
const
pwr_tObjName
attribute
,
const
pwr_tObjName
back_attribute
,
pwr_tCid
*
cid_vect
,
int
null_is_ok
,
int
*
errorcount
,
int
*
warningcount
)
{
pwr_tAttrRef
value
;
pwr_tAttrRef
back_aref
;
wb_session
*
sp
=
(
wb_session
*
)
sesctx
;
wb_attribute
a
=
sp
->
attribute
(
&
aref
);
if
(
!
a
)
return
a
.
sts
();
wb_attribute
a_attr
(
a
,
0
,
attribute
);
if
(
!
a_attr
)
return
a_attr
.
sts
();
a_attr
.
value
(
&
value
);
if
(
!
a_attr
)
return
a_attr
.
sts
();
if
(
!
null_is_ok
&&
cdh_ObjidIsNull
(
value
.
Objid
))
{
char
msg
[
80
];
sprintf
(
msg
,
"Attribute reference is null in
\"
%s
\"
"
,
attribute
);
wsx_error_msg_str
(
sesctx
,
msg
,
aref
,
'E'
,
errorcount
,
warningcount
);
}
if
(
cdh_ObjidIsNotNull
(
value
.
Objid
))
{
wb_attribute
a_value
=
sp
->
attribute
(
&
value
);
if
(
!
a_value
)
{
char
msg
[
80
];
sprintf
(
msg
,
"Undefined attribute reference in
\"
%s
\"
"
,
attribute
);
wsx_error_msg_str
(
sesctx
,
msg
,
aref
,
'E'
,
errorcount
,
warningcount
);
return
WSX__SUCCESS
;
}
if
(
cid_vect
)
{
// Check attribute reference class
bool
found
=
false
;
for
(
int
i
=
0
;
cid_vect
[
i
];
i
++
)
{
if
(
cid_vect
[
i
]
==
a_value
.
tid
())
{
found
=
true
;
break
;
}
}
if
(
!
found
)
{
char
msg
[
80
];
sprintf
(
msg
,
"Invalid class of attribute reference in
\"
%s
\"
"
,
attribute
);
wsx_error_msg_str
(
sesctx
,
msg
,
aref
,
'E'
,
errorcount
,
warningcount
);
return
WSX__SUCCESS
;
}
}
free
((
char
*
)
con_ptr
);
free
((
char
*
)
back_ptr
);
// Check back attrref
wb_attribute
a_back
(
a_value
,
0
,
back_attribute
);
if
(
!
a_back
)
return
a_back
.
sts
();
a_back
.
value
(
&
back_aref
);
if
(
!
a_back
)
return
a_back
.
sts
();
if
(
!
(
cdh_ObjidIsEqual
(
back_aref
.
Objid
,
aref
.
Objid
)
&&
back_aref
.
Offset
==
aref
.
Offset
))
{
char
msg
[
80
];
sprintf
(
msg
,
"Reference is not mutual
\"
%s
\"
"
,
attribute
);
wsx_error_msg_str
(
sesctx
,
msg
,
aref
,
'E'
,
errorcount
,
warningcount
);
return
WSX__SUCCESS
;
}
}
return
WSX__SUCCESS
;
}
/*************************************************************************
*
* Name: wsx_CheckVolume()
...
...
@@ -662,12 +832,12 @@ pwr_tStatus wsx_CheckVolume(
if
(
cid
==
pwr_cClass_RootVolume
)
{
if
(
node_object_count
!=
1
)
wsx_error_msg
(
sesctx
,
WSX__NODECOUNT
,
objid
,
errorcount
,
warningcount
);
wsx_error_msg
(
sesctx
,
WSX__NODECOUNT
,
cdh_ObjidToAref
(
objid
)
,
errorcount
,
warningcount
);
}
else
{
if
(
node_object_count
!=
0
)
wsx_error_msg
(
sesctx
,
WSX__NODECOUNT
,
objid
,
errorcount
,
warningcount
);
wsx_error_msg
(
sesctx
,
WSX__NODECOUNT
,
cdh_ObjidToAref
(
objid
)
,
errorcount
,
warningcount
);
}
/* Check OperatingSystem */
...
...
@@ -688,14 +858,14 @@ pwr_tStatus wsx_CheckVolume(
}
if
(
*
opsys_ptr
&
~
opsys_sum
)
wsx_error_msg
(
sesctx
,
WSX__OSINVALID
,
objid
,
errorcount
,
warningcount
);
wsx_error_msg
(
sesctx
,
WSX__OSINVALID
,
cdh_ObjidToAref
(
objid
)
,
errorcount
,
warningcount
);
free
(
(
char
*
)
opsys_ptr
);
break
;
default:
if
(
node_object_count
!=
0
)
wsx_error_msg
(
sesctx
,
WSX__NODECOUNT
,
objid
,
errorcount
,
warningcount
);
wsx_error_msg
(
sesctx
,
WSX__NODECOUNT
,
cdh_ObjidToAref
(
objid
)
,
errorcount
,
warningcount
);
}
return
WSX__SUCCESS
;
}
...
...
wb/lib/wb/src/wb_wsx.h
View file @
b564b91f
...
...
@@ -30,46 +30,67 @@ extern "C" {
typedef
enum
{
wsx_mCardOption_None
=
0
,
wsx_mCardOption_DevName
=
1
<<
0
wsx_mCardOption_DevName
=
1
<<
0
,
wsx_mCardOption_ErrorLimits
=
1
<<
1
}
wsx_mCardOption
;
pwr_tStatus
wsx_error_msg
(
ldh_tSesContext
sesctx
,
pwr_tStatus
wsx_error_msg
(
ldh_tSesContext
sesctx
,
pwr_tStatus
sts
,
pwr_tObjid
objid
,
pwr_tAttrRef
aref
,
int
*
errorcount
,
int
*
warningcount
);
int
*
warningcount
);
pwr_tStatus
wsx_CheckCard
(
ldh_tSesContext
sesctx
,
pwr_tObjid
objid
,
pwr_tStatus
wsx_error_msg_str
(
ldh_tSesContext
sesctx
,
const
char
*
str
,
pwr_tAttrRef
aref
,
int
severity
,
int
*
errorcount
,
int
*
warningcount
);
pwr_tStatus
wsx_CheckCard
(
ldh_tSesContext
sesctx
,
pwr_tAttrRef
aref
,
int
*
errorcount
,
int
*
warningcount
,
wsx_mCardOption
options
);
wsx_mCardOption
options
);
pwr_tStatus
wsx_CheckCoCard
(
ldh_tSesContext
sesctx
,
pwr_tObjid
objid
,
pwr_tStatus
wsx_CheckCoCard
(
ldh_tSesContext
sesctx
,
pwr_tAttrRef
aref
,
int
*
errorcount
,
int
*
warningcount
);
int
*
warningcount
);
pwr_tStatus
wsx_CheckSigChanCon
(
ldh_tSesContext
sesctx
,
pwr_tObjid
objid
,
pwr_tStatus
wsx_CheckIoDevice
(
ldh_tSesContext
sesctx
,
pwr_tAttrRef
aref
,
int
*
errorcount
,
int
*
warningcount
,
wsx_mCardOption
options
);
pwr_tStatus
wsx_CheckSigChanCon
(
ldh_tSesContext
sesctx
,
pwr_tAttrRef
aref
,
int
*
errorcount
,
int
*
warningcount
);
pwr_tStatus
wsx_CheckAttrRef
(
ldh_tSesContext
sesctx
,
pwr_tAttrRef
aref
,
const
pwr_tObjName
attribute
,
pwr_tCid
*
cid_vect
,
int
null_is_ok
,
int
*
errorcount
,
int
*
warningcount
);
pwr_tStatus
wsx_CheckXAttrRef
(
ldh_tSesContext
sesctx
,
pwr_tAttrRef
aref
,
const
pwr_tObjName
attribute
,
const
pwr_tObjName
back_attribute
,
pwr_tCid
*
cid_vect
,
int
null_is_ok
,
int
*
errorcount
,
int
*
warningcount
);
int
*
warningcount
);
pwr_tStatus
wsx_CheckVolume
(
ldh_tSesContext
sesctx
,
pwr_tStatus
wsx_CheckVolume
(
ldh_tSesContext
sesctx
,
pwr_tObjid
objid
,
int
*
errorcount
,
int
*
warningcount
);
int
*
warningcount
);
#if defined __cplusplus
}
...
...
wb/lib/wb/src/wb_wtt.cpp
View file @
b564b91f
...
...
@@ -433,6 +433,8 @@ void Wtt::save_cb( void *ctx, int quiet)
}
unsigned
int
opt
;
if
(
!
wtt
->
focused_wnav
)
wtt
->
set_focus_default
();
if
(
wtt
->
focused_wnav
->
gbl
.
enable_comment
)
opt
=
log_mOption_Comment
;
else
...
...
@@ -697,6 +699,8 @@ int Wtt::set_noedit( wtt_eNoEditMode save, wtt_eNoEditVolMode detach)
sts
=
lfu_SaveDirectoryVolume
(
ldhses
,
wnav
->
wow
,
0
);
unsigned
int
opt
;
if
(
!
focused_wnav
)
set_focus_default
();
if
(
focused_wnav
->
gbl
.
enable_comment
)
opt
=
log_mOption_Comment
;
else
...
...
@@ -1594,6 +1598,8 @@ void Wtt::activate_buildobject()
message
(
' '
,
""
);
if
(
!
focused_wnav
)
set_focus_default
();
strcpy
(
cmd
,
"build object"
);
if
(
focused_wnav
->
gbl
.
build
.
force
)
strcat
(
cmd
,
" /force"
);
...
...
@@ -1830,6 +1836,8 @@ void Wtt::activate_buildvolume()
set_clock_cursor
();
wb_build
*
build
=
build_new
();
if
(
!
focused_wnav
)
set_focus_default
();
build
->
opt
=
focused_wnav
->
gbl
.
build
;
build
->
volume
();
...
...
@@ -1873,6 +1881,8 @@ void Wtt::activate_buildnode()
}
if
(
found
)
{
wb_build
*
build
=
build_new
();
if
(
!
focused_wnav
)
set_focus_default
();
build
->
opt
=
focused_wnav
->
gbl
.
build
;
set_clock_cursor
();
...
...
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