Commit b564b91f authored by Claes Sjofors's avatar Claes Sjofors

Wb method CheckSyntax updated with new check functions, and SyntaxCheck in configurator popup menu

parent 7645369d
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
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_ACS800_1
ABB_ACC800
ABB_ACS800MotorAggr
/*
* 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
};
/*
* 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
};
/*
* 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
};
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
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
BaseSupSwitch
BaseCDamper
BaseCValve
BaseCircuitBreaker
BaseContactor
BaseDirValve
BaseFilter
BaseSensor
BaseMValve
BaseManValve
BaseMotorAggr
BaseMotorIncrDecrAggr
BaseOverloadRelay
BasePositSensor
BasePropValve
BaseSafetySwitch
BaseFcPPO3
BaseFcPPO3MotorAggr
BaseFcPPO5
BaseFcPPO5MotorAggr
/*
* 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
};
/*
* 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
};
/*
* 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
};
/*
* 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
};
/*
* 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
};
/*
* 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
};
/*
* 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
};
/*
* 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
};
/*
* 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
};
/*
* 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
};
/*
* 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
};
/*
* 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
};
/*
* 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
};
/*
* 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
};
/*
* 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
};
/*
* 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
};
/*
* 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
};
/*
* 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
};
/*
* 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
};
/*
* 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
};
...@@ -51,6 +51,8 @@ ...@@ -51,6 +51,8 @@
#include "wb_pwrb_msg.h" #include "wb_pwrb_msg.h"
#include "rt_pb_msg.h" #include "rt_pb_msg.h"
#include "wb_wnav.h" #include "wb_wnav.h"
#include "wb_wsx.h"
#include "wb_session.h"
using namespace std; using namespace std;
...@@ -536,5 +538,26 @@ pwr_tStatus pb_dp_slave_create_ctx( ldh_tSession ldhses, pwr_tAttrRef aref, ...@@ -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
};
/*
* 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
};
/*
* 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
};
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
#include "wb_pwrb_msg.h" #include "wb_pwrb_msg.h"
#include "rt_pb_msg.h" #include "rt_pb_msg.h"
#include "wb_wnav.h" #include "wb_wnav.h"
#include "wb_wsx.h"
using namespace std; using namespace std;
...@@ -812,4 +813,26 @@ pwr_tStatus pndevice_init( device_sCtx *ctx) ...@@ -812,4 +813,26 @@ pwr_tStatus pndevice_init( device_sCtx *ctx)
return 1; 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
};
/*
* 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
};
/*
* 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
};
Pb_DP_Slave Pb_DP_Slave
PnDevice Pb_Module
\ No newline at end of file Profiboard
PnDevice
PnModule
PnControllerSoftingPNAK
\ No newline at end of file
...@@ -27,8 +27,8 @@ success <successful completion> /succ ...@@ -27,8 +27,8 @@ success <successful completion> /succ
carddevname <DevName in card-object is missing> /error carddevname <DevName in card-object is missing> /error
carderrsoftlim <ErrorSoftLimit in card-object is missing> /error carderrsoftlim <ErrorSoftLimit in card-object is missing> /error
carderrhardlim <ErrorHardLimit in card-object is missing> /error carderrhardlim <ErrorHardLimit in card-object is missing> /error
sigchancon <Error in SigChanCon-object> /error sigchancon <Error in connected channel> /error
sigchanconclass <Error in class of SigChanCon-object> /error sigchanconclass <Error in class of connected channel> /error
maxchan <MaxNoOfChannels is out of range> /error maxchan <MaxNoOfChannels is out of range> /error
numrange <Number of is out of range> /error numrange <Number of is out of range> /error
numnotunique <Number is not unique> /error numnotunique <Number is not unique> /error
......
...@@ -154,6 +154,12 @@ SObject pwrs:Class ...@@ -154,6 +154,12 @@ SObject pwrs:Class
Attr MethodName = "$Object-Crossreferences" Attr MethodName = "$Object-Crossreferences"
EndBody EndBody
EndObject EndObject
Object PM_SyntaxCheck $MenuButton
Body SysBody
Attr ButtonName = "Syntax Check"
Attr MethodName = "$Object-PM_SyntaxCheck"
EndBody
EndObject
Object Help $MenuButton Object Help $MenuButton
Body SysBody Body SysBody
Attr ButtonName = "Help" Attr ButtonName = "Help"
...@@ -184,6 +190,12 @@ SObject pwrs:Class ...@@ -184,6 +190,12 @@ SObject pwrs:Class
Attr MethodName = "$Object-Crossreferences" Attr MethodName = "$Object-Crossreferences"
EndBody EndBody
EndObject EndObject
Object PM_SyntaxCheck $MenuButton
Body SysBody
Attr ButtonName = "Syntax Check"
Attr MethodName = "$Object-PM_SyntaxCheck"
EndBody
EndObject
Object Help $MenuButton Object Help $MenuButton
Body SysBody Body SysBody
Attr ButtonName = "Help" Attr ButtonName = "Help"
...@@ -257,6 +269,12 @@ SObject pwrs:Class ...@@ -257,6 +269,12 @@ SObject pwrs:Class
Attr MethodName = "$Object-Crossreferences" Attr MethodName = "$Object-Crossreferences"
EndBody EndBody
EndObject EndObject
Object PM_SyntaxCheck $MenuButton
Body SysBody
Attr ButtonName = "Syntax Check"
Attr MethodName = "$Object-PM_SyntaxCheck"
EndBody
EndObject
Object Delete $MenuButton Object Delete $MenuButton
Body SysBody Body SysBody
Attr ButtonName = "Delete Object" Attr ButtonName = "Delete Object"
...@@ -341,6 +359,12 @@ SObject pwrs:Class ...@@ -341,6 +359,12 @@ SObject pwrs:Class
Attr MethodName = "$Object-Crossreferences" Attr MethodName = "$Object-Crossreferences"
EndBody EndBody
EndObject EndObject
Object PM_SyntaxCheck $MenuButton
Body SysBody
Attr ButtonName = "Syntax Check"
Attr MethodName = "$Object-PM_SyntaxCheck"
EndBody
EndObject
Object Help $MenuButton Object Help $MenuButton
Body SysBody Body SysBody
Attr ButtonName = "Help" Attr ButtonName = "Help"
...@@ -496,6 +520,12 @@ SObject pwrs:Class ...@@ -496,6 +520,12 @@ SObject pwrs:Class
Attr MethodName = "$Object-Crossreferences" Attr MethodName = "$Object-Crossreferences"
EndBody EndBody
EndObject EndObject
Object PM_SyntaxCheck $MenuButton
Body SysBody
Attr ButtonName = "Syntax Check"
Attr MethodName = "$Object-PM_SyntaxCheck"
EndBody
EndObject
Object Help $MenuButton Object Help $MenuButton
Body SysBody Body SysBody
Attr ButtonName = "Help" Attr ButtonName = "Help"
...@@ -651,6 +681,12 @@ SObject pwrs:Class ...@@ -651,6 +681,12 @@ SObject pwrs:Class
Attr MethodName = "$Object-Crossreferences" Attr MethodName = "$Object-Crossreferences"
EndBody EndBody
EndObject EndObject
Object PM_SyntaxCheck $MenuButton
Body SysBody
Attr ButtonName = "Syntax Check"
Attr MethodName = "$Object-PM_SyntaxCheck"
EndBody
EndObject
Object Help $MenuButton Object Help $MenuButton
Body SysBody Body SysBody
Attr ButtonName = "Help" Attr ButtonName = "Help"
......
...@@ -262,7 +262,7 @@ static pwr_tStatus PostUnadopt ( ...@@ -262,7 +262,7 @@ static pwr_tStatus PostUnadopt (
static pwr_tStatus SyntaxCheck ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* current object */ pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */ int *WarningCount /* accumulated waring count */
) { ) {
......
...@@ -262,7 +262,7 @@ static pwr_tStatus PostUnadopt ( ...@@ -262,7 +262,7 @@ static pwr_tStatus PostUnadopt (
static pwr_tStatus SyntaxCheck ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* current object */ pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */ int *WarningCount /* accumulated waring count */
) { ) {
......
...@@ -229,7 +229,7 @@ static pwr_tStatus PostUnadopt ( ...@@ -229,7 +229,7 @@ static pwr_tStatus PostUnadopt (
static pwr_tStatus SyntaxCheck ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* current object */ pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */ int *WarningCount /* accumulated waring count */
) { ) {
......
...@@ -229,7 +229,7 @@ static pwr_tStatus PostUnadopt ( ...@@ -229,7 +229,7 @@ static pwr_tStatus PostUnadopt (
static pwr_tStatus SyntaxCheck ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* current object */ pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */ int *WarningCount /* accumulated waring count */
) { ) {
......
...@@ -227,7 +227,7 @@ PostUnadopt ( ...@@ -227,7 +227,7 @@ PostUnadopt (
static pwr_tStatus SyntaxCheck ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* current object */ pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */ int *WarningCount /* accumulated waring count */
) { ) {
......
...@@ -227,7 +227,7 @@ PostUnadopt ( ...@@ -227,7 +227,7 @@ PostUnadopt (
static pwr_tStatus SyntaxCheck ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* current object */ pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */ int *WarningCount /* accumulated waring count */
) { ) {
......
...@@ -232,7 +232,7 @@ static pwr_tStatus PostUnadopt ( ...@@ -232,7 +232,7 @@ static pwr_tStatus PostUnadopt (
static pwr_tStatus SyntaxCheck ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* current object */ pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */ int *WarningCount /* accumulated waring count */
) { ) {
......
...@@ -231,7 +231,7 @@ static pwr_tStatus PostUnadopt ( ...@@ -231,7 +231,7 @@ static pwr_tStatus PostUnadopt (
static pwr_tStatus SyntaxCheck ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* current object */ pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */ int *WarningCount /* accumulated waring count */
) { ) {
......
/*
* 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
};
/*
* 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
};
/*
* 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
};
...@@ -7,3 +7,6 @@ Co_PI24BO ...@@ -7,3 +7,6 @@ Co_PI24BO
Co_CO4uP Co_CO4uP
Di_DIX2 Di_DIX2
Do_HVDO32 Do_HVDO32
Ssab_BaseACard
Ssab_BaseDiCard
Ssab_BaseDoCard
...@@ -140,4 +140,7 @@ ...@@ -140,4 +140,7 @@
090902 cs plc Compile error for reference to disabled signal (not in template code). 090902 cs plc Compile error for reference to disabled signal (not in template code).
090909 cs wb Bugfix in Connect wb method, couldn't handle array element attributes. 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. 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 New crossreference window and method in wtt.
\ No newline at end of file 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
...@@ -133,11 +133,9 @@ void Wb::find_wnav_cb( void *ctx, pwr_tOid oid) ...@@ -133,11 +133,9 @@ void Wb::find_wnav_cb( void *ctx, pwr_tOid oid)
char projectname[80]; char projectname[80];
pwr_tStatus sts; pwr_tStatus sts;
Wtt *wtt; Wtt *wtt;
printf( "Here in find wnav...\n");
wb->wttlist_find( &sts, oid.vid, &wtt); wb->wttlist_find( &sts, oid.vid, &wtt);
if ( ODD(sts)) { if ( ODD(sts)) {
printf( "Wtt Found\n");
sts = wtt->find( oid); sts = wtt->find( oid);
wtt->pop(); wtt->pop();
} }
......
...@@ -1187,7 +1187,7 @@ pwr_tStatus WFoeGtk::create_window( int x_top, ...@@ -1187,7 +1187,7 @@ pwr_tStatus WFoeGtk::create_window( int x_top,
gtk_menu_item_set_submenu(GTK_MENU_ITEM(file_print), gtk_menu_item_set_submenu(GTK_MENU_ITEM(file_print),
GTK_WIDGET(file_print_menu)); 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_signal_connect( widgets.syntax, "activate",
G_CALLBACK(WFoeGtk::activate_syntax), this); G_CALLBACK(WFoeGtk::activate_syntax), this);
......
...@@ -2078,9 +2078,6 @@ WttGtk::WttGtk( ...@@ -2078,9 +2078,6 @@ WttGtk::WttGtk(
accel_g); accel_g);
g_signal_connect(menu_revert_w, "activate", G_CALLBACK(WttGtk::activate_revert), this); 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"); GtkWidget *file_history = gtk_menu_item_new_with_mnemonic( "_History");
g_signal_connect(file_history, "activate", G_CALLBACK(WttGtk::activate_history), this); g_signal_connect(file_history, "activate", G_CALLBACK(WttGtk::activate_history), this);
...@@ -2091,7 +2088,6 @@ WttGtk::WttGtk( ...@@ -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), file_print);
gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), menu_save_w); 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), 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_history);
gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), file_close); gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), file_close);
...@@ -2369,6 +2365,9 @@ WttGtk::WttGtk( ...@@ -2369,6 +2365,9 @@ WttGtk::WttGtk(
'r', GdkModifierType(GDK_CONTROL_MASK), 'r', GdkModifierType(GDK_CONTROL_MASK),
GTK_ACCEL_VISIBLE); 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"); menu_change_value_w = gtk_menu_item_new_with_mnemonic( "Change _Value");
g_signal_connect( menu_change_value_w, "activate", g_signal_connect( menu_change_value_w, "activate",
G_CALLBACK(WttGtk::activate_change_value), this); G_CALLBACK(WttGtk::activate_change_value), this);
...@@ -2396,6 +2395,7 @@ WttGtk::WttGtk( ...@@ -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_classeditor_w);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_menu), menu_updateclasses_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_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), menu_change_value_w);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_menu), functions_command); gtk_menu_shell_append(GTK_MENU_SHELL(functions_menu), functions_command);
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
static pwr_tStatus SyntaxCheck ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* current object */ pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */ int *WarningCount /* accumulated waring count */
) { ) {
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
static pwr_tStatus SyntaxCheck ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* current object */ pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */ int *WarningCount /* accumulated waring count */
) { ) {
......
...@@ -29,11 +29,11 @@ ...@@ -29,11 +29,11 @@
#include "wb_ldh.h" #include "wb_ldh.h"
#include "wb_wsx.h" #include "wb_wsx.h"
#include "wb_wsx_msg.h" #include "wb_wsx_msg.h"
#include "wb_session.h"
//
/*----------------------------------------------------------------------------*\ // PostCreate
//
\*----------------------------------------------------------------------------*/
static pwr_tStatus PostCreate ( static pwr_tStatus PostCreate (
ldh_tSesContext Session, ldh_tSesContext Session,
...@@ -66,10 +66,10 @@ static pwr_tStatus PostCreate ( ...@@ -66,10 +66,10 @@ static pwr_tStatus PostCreate (
return PWRB__SUCCESS; return PWRB__SUCCESS;
} }
/*----------------------------------------------------------------------------*\ //
// PostMove
\*----------------------------------------------------------------------------*/ //
static pwr_tStatus PostMove ( static pwr_tStatus PostMove (
ldh_tSesContext Session, ldh_tSesContext Session,
...@@ -102,80 +102,93 @@ static pwr_tStatus PostMove ( ...@@ -102,80 +102,93 @@ static pwr_tStatus PostMove (
return PWRB__SUCCESS; return PWRB__SUCCESS;
} }
/*----------------------------------------------------------------------------*\
Syntax check.
\*----------------------------------------------------------------------------*/
//
// Syntax check.
//
static pwr_tStatus SyntaxCheck ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* current object */ pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */ int *WarningCount /* accumulated waring count */
) { ) {
pwr_tStatus sts;
int size;
char Name[255];
pwr_sAttrRef Attribute;
char *NamePtr;
char *s; char *s;
pwr_tClassId cid;
/*
If DataName is a signal, the attribute has to be ActualValue.
*/
sts = ldh_GetObjectPar( Session, // Check DataName
Object, wb_session *sp = (wb_session *)Session;
"RtBody", pwr_tAttrRef dataname_aref;
"DataName",
(char **)&NamePtr, &size); wb_attribute a = sp->attribute( &Object);
if ( EVEN(sts)) return sts; if ( !a) return a.sts();
strcpy( Name, NamePtr);
free( NamePtr); 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();
if ( strcmp( Name, "") == 0) 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; return PWRB__SUCCESS;
}
sts = ldh_NameToAttrRef(Session, Name, &Attribute); // Backup on whole signal objects is not allowed
if (EVEN(sts)) return PWRB__SUCCESS; switch ( data_a.tid()) {
case pwr_cClass_Do:
sts = ldh_GetObjectClass ( Session, Attribute.Objid, &cid); case pwr_cClass_Dv:
if ( EVEN(sts)) return sts; case pwr_cClass_Ao:
case pwr_cClass_Av:
case pwr_cClass_Io:
case pwr_cClass_Iv:
case pwr_cClass_Po:
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: ;
}
switch ( cid) // 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_Do:
case pwr_cClass_Dv: case pwr_cClass_Dv:
case pwr_cClass_Ao: case pwr_cClass_Ao:
case pwr_cClass_Av: case pwr_cClass_Av:
case pwr_cClass_Io:
case pwr_cClass_Iv:
case pwr_cClass_Po: case pwr_cClass_Po:
s = strchr( Name, '.'); case pwr_cClass_Co: {
if ( s == 0) if ( strcmp( s+1, "ActualValue") != 0)
{ wsx_error_msg( Session, WSX__BCKINVALID, Object, ErrorCount, WarningCount);
wsx_error_msg( Session, WSX__BCKINVALID, Object, ErrorCount, WarningCount);
return PWRB__SUCCESS;
}
if ( strcmp( s, ".ActualValue") != 0)
{
wsx_error_msg( Session, WSX__BCKINVALID, Object, ErrorCount, WarningCount);
return PWRB__SUCCESS;
}
break; break;
case pwr_cClass_Co: }
case pwr_cClass_Di: case pwr_cClass_Di:
case pwr_cClass_Ai: case pwr_cClass_Ai:
case pwr_cClass_Ii: {
wsx_error_msg( Session, WSX__BCKINVALID, Object, ErrorCount, WarningCount); wsx_error_msg( Session, WSX__BCKINVALID, Object, ErrorCount, WarningCount);
return PWRB__SUCCESS;
break; break;
}
default: ;
}
} }
return PWRB__SUCCESS; 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_dExport pwr_BindMethods(Backup) = {
pwr_BindMethod(PostCreate), pwr_BindMethod(PostCreate),
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
static pwr_tStatus SyntaxCheck ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* current object */ pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */ int *WarningCount /* accumulated waring count */
) { ) {
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
static pwr_tStatus SyntaxCheck ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* current object */ pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */ int *WarningCount /* accumulated waring count */
) { ) {
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
static pwr_tStatus SyntaxCheck ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* current object */ pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */ int *WarningCount /* accumulated waring count */
) { ) {
......
...@@ -35,15 +35,16 @@ ...@@ -35,15 +35,16 @@
static pwr_tStatus SyntaxCheck ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* current object */ pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */ int *WarningCount /* accumulated waring count */
) { ) {
#if 0
pwr_tStatus sts; pwr_tStatus sts;
sts = wsx_CheckSigChanCon( Session, Object, ErrorCount, WarningCount); sts = wsx_CheckSigChanCon( Session, Object, ErrorCount, WarningCount);
if (EVEN(sts)) return sts; if (EVEN(sts)) return sts;
#endif
return PWRB__SUCCESS; return PWRB__SUCCESS;
} }
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
static pwr_tStatus SyntaxCheck ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* current object */ pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */ int *WarningCount /* accumulated waring count */
) { ) {
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
static pwr_tStatus SyntaxCheck ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* current object */ pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */ int *WarningCount /* accumulated waring count */
) { ) {
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
static pwr_tStatus SyntaxCheck ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* current object */ pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */ int *WarningCount /* accumulated waring count */
) { ) {
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
static pwr_tStatus SyntaxCheck ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* current object */ pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */ int *WarningCount /* accumulated waring count */
) { ) {
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
static pwr_tStatus SyntaxCheck ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* current object */ pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */ int *WarningCount /* accumulated waring count */
) { ) {
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
static pwr_tStatus SyntaxCheck ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* current object */ pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */ int *WarningCount /* accumulated waring count */
) { ) {
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
static pwr_tStatus SyntaxCheck ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* current object */ pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */ int *WarningCount /* accumulated waring count */
) { ) {
......
...@@ -25,12 +25,13 @@ ...@@ -25,12 +25,13 @@
#include "wb_pwrb_msg.h" #include "wb_pwrb_msg.h"
#include "pwr_baseclasses.h" #include "pwr_baseclasses.h"
#include "wb_ldh.h" #include "wb_ldh.h"
#include "wb_session.h"
#include "wb_wsx.h"
#include "wb_pwrb_msg.h"
//
/*----------------------------------------------------------------------------*\ // PostCreate
//
\*----------------------------------------------------------------------------*/
static pwr_tStatus PostCreate ( static pwr_tStatus PostCreate (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, pwr_tObjid Object,
...@@ -64,11 +65,10 @@ static pwr_tStatus PostCreate ( ...@@ -64,11 +65,10 @@ static pwr_tStatus PostCreate (
return PWRB__SUCCESS; return PWRB__SUCCESS;
} }
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
//
// PostMove
//
static pwr_tStatus PostMove ( static pwr_tStatus PostMove (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, pwr_tObjid Object,
...@@ -100,13 +100,60 @@ static pwr_tStatus PostMove ( ...@@ -100,13 +100,60 @@ static pwr_tStatus PostMove (
return PWRB__SUCCESS; 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_dExport pwr_BindMethods(DsTrend) = {
pwr_BindMethod(PostCreate), pwr_BindMethod(PostCreate),
pwr_BindMethod(PostMove), pwr_BindMethod(PostMove),
pwr_BindMethod(SyntaxCheck),
pwr_NullMethod pwr_NullMethod
}; };
/*
* 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
};
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
static pwr_tStatus SyntaxCheck ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* current object */ pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */ int *WarningCount /* accumulated waring count */
) { ) {
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
static pwr_tStatus SyntaxCheck ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* current object */ pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */ int *WarningCount /* accumulated waring count */
) { ) {
......
/*
* 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
};
...@@ -22,6 +22,10 @@ ...@@ -22,6 +22,10 @@
#include "wb_pwrs.h" #include "wb_pwrs.h"
#include "wb_pwrs_msg.h" #include "wb_pwrs_msg.h"
#include "wb_ldh.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 ( static pwr_tStatus PostCreate (
ldh_tSesContext Session, ldh_tSesContext Session,
...@@ -64,8 +68,68 @@ static pwr_tStatus PostCreate ( ...@@ -64,8 +68,68 @@ static pwr_tStatus PostCreate (
return PWRS__SUCCESS; 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_dExport pwr_BindMethods($Node) = {
pwr_BindMethod(PostCreate), pwr_BindMethod(PostCreate),
pwr_BindMethod(SyntaxCheck),
pwr_NullMethod pwr_NullMethod
}; };
......
...@@ -20,10 +20,18 @@ ...@@ -20,10 +20,18 @@
/* wb_c_nodeconfig.c -- work bench methods of the NodeConfig class. */ /* wb_c_nodeconfig.c -- work bench methods of the NodeConfig class. */
#include <string.h> #include <string.h>
#include "co_dcli.h"
#include "wb_pwrs.h" #include "wb_pwrs.h"
#include "wb_pwrs_msg.h" #include "wb_pwrs_msg.h"
#include "wb_ldh.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 ( static pwr_tStatus PostCreate (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, pwr_tObjid Object,
...@@ -43,8 +51,82 @@ static pwr_tStatus PostCreate ( ...@@ -43,8 +51,82 @@ static pwr_tStatus PostCreate (
return PWRS__SUCCESS; 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_dExport pwr_BindMethods(NodeConfig) = {
pwr_BindMethod(PostCreate), pwr_BindMethod(PostCreate),
pwr_BindMethod(SyntaxCheck),
pwr_NullMethod pwr_NullMethod
}; };
...@@ -1086,6 +1086,31 @@ static pwr_tStatus CrossreferencesFilter( ldh_sMenuCall *ip) ...@@ -1086,6 +1086,31 @@ static pwr_tStatus CrossreferencesFilter( ldh_sMenuCall *ip)
return 1; 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_dExport pwr_BindMethods($Object) = {
pwr_BindMethod(CreateObject), pwr_BindMethod(CreateObject),
...@@ -1117,6 +1142,8 @@ pwr_dExport pwr_BindMethods($Object) = { ...@@ -1117,6 +1142,8 @@ pwr_dExport pwr_BindMethods($Object) = {
pwr_BindMethod(HistoryFilter), pwr_BindMethod(HistoryFilter),
pwr_BindMethod(Crossreferences), pwr_BindMethod(Crossreferences),
pwr_BindMethod(CrossreferencesFilter), pwr_BindMethod(CrossreferencesFilter),
pwr_BindMethod(PM_SyntaxCheck),
pwr_BindMethod(PM_SyntaxCheckFilter),
pwr_NullMethod pwr_NullMethod
}; };
......
...@@ -23,6 +23,9 @@ ...@@ -23,6 +23,9 @@
#include "wb_pwrs.h" #include "wb_pwrs.h"
#include "wb_pwrs_msg.h" #include "wb_pwrs_msg.h"
#include "wb_ldh.h" #include "wb_ldh.h"
#include "wb_session.h"
#include "wb_wsx.h"
#include "wb_pwrb_msg.h"
static pwr_tStatus PostCreate ( static pwr_tStatus PostCreate (
ldh_tSesContext Session, ldh_tSesContext Session,
...@@ -50,8 +53,44 @@ static pwr_tStatus PostCreate ( ...@@ -50,8 +53,44 @@ static pwr_tStatus PostCreate (
return PWRS__SUCCESS; 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_dExport pwr_BindMethods(OpPlace) = {
pwr_BindMethod(PostCreate), pwr_BindMethod(PostCreate),
pwr_BindMethod(SyntaxCheck),
pwr_NullMethod pwr_NullMethod
}; };
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "flow_browapi.h" #include "flow_browapi.h"
#include "wb_wnav.h" #include "wb_wnav.h"
#include "wb_build.h" #include "wb_build.h"
#include "wb_wsx.h"
#include "co_msgwindow.h" #include "co_msgwindow.h"
/*----------------------------------------------------------------------------*\ /*----------------------------------------------------------------------------*\
...@@ -52,6 +53,27 @@ static pwr_tStatus Build ( ...@@ -52,6 +53,27 @@ static pwr_tStatus Build (
return build.sts(); 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. Every method to be exported to the workbench should be registred here.
...@@ -59,6 +81,7 @@ static pwr_tStatus Build ( ...@@ -59,6 +81,7 @@ static pwr_tStatus Build (
pwr_dExport pwr_BindMethods($PlantHier) = { pwr_dExport pwr_BindMethods($PlantHier) = {
pwr_BindMethod(Build), pwr_BindMethod(Build),
pwr_BindMethod(SyntaxCheck),
pwr_NullMethod pwr_NullMethod
}; };
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "flow_browapi.h" #include "flow_browapi.h"
#include "wb_wnav.h" #include "wb_wnav.h"
#include "wb_build.h" #include "wb_build.h"
#include "wb_session.h"
/*----------------------------------------------------------------------------*\ /*----------------------------------------------------------------------------*\
...@@ -76,59 +77,75 @@ static pwr_tStatus Build ( ...@@ -76,59 +77,75 @@ static pwr_tStatus Build (
Syntax check. 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 ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* current object */ pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */ int *WarningCount /* accumulated warning count */
) { ) {
pwr_tStatus sts; wb_session *sp = (wb_session *)Session;
pwr_tObjid *ThreadObjectPtr; pwr_tOid thread_oid;
int size; pwr_tOid reset_oid;
pwr_tObjid child;
pwr_tClassId cid; // Check ThreadObject
wb_attribute a = sp->attribute( Object.Objid, "RtBody", "ThreadObject");
/* if (!a) return a.sts();
Check that ScanTime is set to something.
*/ a.value( &thread_oid);
if ( !a) return a.sts();
sts = ldh_GetObjectPar( Session,
Object, wb_object othread = sp->object( thread_oid);
"RtBody", if ( !othread)
"ThreadObject", wsx_error_msg_str( Session, "Bad thread object", Object, 'E', ErrorCount, WarningCount);
(char **)&ThreadObjectPtr, &size); else if ( othread.cid() != pwr_cClass_PlcThread)
if ( EVEN(sts)) return sts; wsx_error_msg_str( Session, "Bad thread object class", Object, 'E', ErrorCount, WarningCount);
sts = ldh_GetObjectClass ( Session, *ThreadObjectPtr, &cid); // Check WindowPlc object
if ( EVEN(sts)) bool found = 0;
wsx_error_msg( Session, WSX__PLCTHREAD, Object, ErrorCount, WarningCount); wb_object o = sp->object( Object.Objid);
else if ( cid != pwr_cClass_PlcThread) if ( !o) return o.sts();
wsx_error_msg( Session, WSX__PLCTHREAD, Object, ErrorCount, WarningCount);
for ( wb_object child = o.first(); child; child = child.after()) {
free( (char *)ThreadObjectPtr); if ( child.cid() == pwr_cClass_windowplc) {
found = 1;
/* break;
Check that the child is a plcwindow. }
*/
sts = ldh_GetChild( Session, Object, &child);
if (EVEN(sts))
{
wsx_error_msg( Session, WSX__PLCWIND, Object, ErrorCount, WarningCount);
} }
else if ( !found)
{ wsx_error_msg_str( Session, "Plc window is not created", Object, 'E', ErrorCount, WarningCount);
sts = ldh_GetObjectClass( Session, child, &cid);
if (EVEN(sts)) return sts;
// Check ResetObject if there is a grafcet sequence present
if ( cid != pwr_cClass_windowplc) if ( CheckChildCid( o, pwr_cClass_initstep)) {
wsx_error_msg( Session, WSX__PLCCHILD, Object, ErrorCount, WarningCount); a = sp->attribute( Object.Objid, "DevBody", "ResetObject");
if (!a) return a.sts();
sts = ldh_GetNextSibling( Session, child, &child);
if ( ODD(sts)) a.value( &reset_oid);
wsx_error_msg( Session, WSX__PLCCHILD, Object, ErrorCount, WarningCount); 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; return PWRB__SUCCESS;
} }
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
static pwr_tStatus SyntaxCheck ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* current object */ pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */ int *WarningCount /* accumulated waring count */
) { ) {
......
...@@ -42,13 +42,13 @@ ...@@ -42,13 +42,13 @@
static pwr_tStatus SyntaxCheck ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* current object */ pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */ int *WarningCount /* accumulated waring count */
) { ) {
pwr_tStatus sts; pwr_tStatus sts;
sts = wsx_CheckVolume( Session, Object, ErrorCount, WarningCount); sts = wsx_CheckVolume( Session, Object.Objid, ErrorCount, WarningCount);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
return PWRS__SUCCESS; return PWRS__SUCCESS;
......
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
#include "wb_pwrb_msg.h" #include "wb_pwrb_msg.h"
#include "pwr_baseclasses.h" #include "pwr_baseclasses.h"
#include "wb_ldh.h" #include "wb_ldh.h"
#include "wb_session.h"
#include "wb_wsx.h"
/*----------------------------------------------------------------------------*\ /*----------------------------------------------------------------------------*\
...@@ -102,13 +104,77 @@ static pwr_tStatus PostMove ( ...@@ -102,13 +104,77 @@ static pwr_tStatus PostMove (
return PWRB__SUCCESS; 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_dExport pwr_BindMethods(SevHist) = {
pwr_BindMethod(PostCreate), pwr_BindMethod(PostCreate),
pwr_BindMethod(PostMove), pwr_BindMethod(PostMove),
pwr_BindMethod(SyntaxCheck),
pwr_NullMethod pwr_NullMethod
}; };
...@@ -20,10 +20,14 @@ ...@@ -20,10 +20,14 @@
/* wb_c_sevnodeconfig.c -- work bench methods of the SevNodeConfig class. */ /* wb_c_sevnodeconfig.c -- work bench methods of the SevNodeConfig class. */
#include <string.h> #include <string.h>
#include "co_dcli.h"
#include "wb_pwrs.h" #include "wb_pwrs.h"
#include "wb_pwrs_msg.h" #include "wb_pwrs_msg.h"
#include "wb_ldh.h" #include "wb_ldh.h"
#include "pwr_baseclasses.h" #include "pwr_baseclasses.h"
#include "wb_session.h"
#include "wb_wsx.h"
#include "wb_pwrb_msg.h"
static pwr_tStatus PostCreate ( static pwr_tStatus PostCreate (
ldh_tSesContext Session, ldh_tSesContext Session,
...@@ -53,8 +57,80 @@ static pwr_tStatus PostCreate ( ...@@ -53,8 +57,80 @@ static pwr_tStatus PostCreate (
return PWRS__SUCCESS; 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_dExport pwr_BindMethods(SevNodeConfig) = {
pwr_BindMethod(PostCreate), pwr_BindMethod(PostCreate),
pwr_BindMethod(SyntaxCheck),
pwr_NullMethod pwr_NullMethod
}; };
...@@ -30,13 +30,13 @@ ...@@ -30,13 +30,13 @@
static pwr_tStatus SyntaxCheck ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* current object */ pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */ int *WarningCount /* accumulated waring count */
) { ) {
pwr_tStatus sts; pwr_tStatus sts;
sts = wsx_CheckVolume( Session, Object, ErrorCount, WarningCount); sts = wsx_CheckVolume( Session, Object.Objid, ErrorCount, WarningCount);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
return PWRS__SUCCESS; return PWRS__SUCCESS;
......
/*
* 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
};
...@@ -57,6 +57,7 @@ pwr_dImport pwr_BindMethods(PlcThread); ...@@ -57,6 +57,7 @@ pwr_dImport pwr_BindMethods(PlcThread);
pwr_dImport pwr_BindMethods(NodeConfig); pwr_dImport pwr_BindMethods(NodeConfig);
pwr_dImport pwr_BindMethods(SevNodeConfig); pwr_dImport pwr_BindMethods(SevNodeConfig);
pwr_dImport pwr_BindMethods(Application); pwr_dImport pwr_BindMethods(Application);
pwr_dImport pwr_BindMethods(FriendNodeConfig);
pwr_dExport pwr_BindClasses(Base) = { pwr_dExport pwr_BindClasses(Base) = {
pwr_BindClass(ASup), pwr_BindClass(ASup),
...@@ -95,6 +96,7 @@ pwr_dExport pwr_BindClasses(Base) = { ...@@ -95,6 +96,7 @@ pwr_dExport pwr_BindClasses(Base) = {
pwr_BindClass(NodeConfig), pwr_BindClass(NodeConfig),
pwr_BindClass(SevNodeConfig), pwr_BindClass(SevNodeConfig),
pwr_BindClass(Application), pwr_BindClass(Application),
pwr_BindClass(FriendNodeConfig),
pwr_NullClass pwr_NullClass
}; };
......
...@@ -36,6 +36,8 @@ pwr_dImport pwr_BindMethods($AttrRef); ...@@ -36,6 +36,8 @@ pwr_dImport pwr_BindMethods($AttrRef);
pwr_dImport pwr_BindMethods($PlantHier); pwr_dImport pwr_BindMethods($PlantHier);
pwr_dImport pwr_BindMethods($NodeHier); pwr_dImport pwr_BindMethods($NodeHier);
pwr_dImport pwr_BindMethods($Security); pwr_dImport pwr_BindMethods($Security);
pwr_dImport pwr_BindMethods($System);
pwr_dImport pwr_BindMethods($MountObject);
pwr_dExport pwr_BindClasses(System) = { pwr_dExport pwr_BindClasses(System) = {
pwr_BindClass($AttrXRef), pwr_BindClass($AttrXRef),
...@@ -53,5 +55,7 @@ pwr_dExport pwr_BindClasses(System) = { ...@@ -53,5 +55,7 @@ pwr_dExport pwr_BindClasses(System) = {
pwr_BindClass($PlantHier), pwr_BindClass($PlantHier),
pwr_BindClass($NodeHier), pwr_BindClass($NodeHier),
pwr_BindClass($Security), pwr_BindClass($Security),
pwr_BindClass($System),
pwr_BindClass($MountObject),
pwr_NullClass pwr_NullClass
}; };
...@@ -83,7 +83,7 @@ typedef pwr_tStatus (* wb_tMethodPostAdopt) (ldh_tSesContext, pwr_tOid, pwr_tOi ...@@ -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_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_tMethodPostUnadopt)(ldh_tSesContext, pwr_tOid, pwr_tOid, pwr_tCid);
typedef pwr_tStatus (* wb_tMethodPostRename) (ldh_tSesContext, pwr_tOid); typedef pwr_tStatus (* wb_tMethodPostRename) (ldh_tSesContext, pwr_tOid);
typedef pwr_tStatus (* wb_tMethodSyntaxCheck)(ldh_tSesContext, pwr_tOid, int *, int *); typedef pwr_tStatus (* wb_tMethodSyntaxCheck)(ldh_tSesContext, pwr_tAttrRef, int *, int *);
#if defined OS_VMS #if defined OS_VMS
...@@ -135,7 +135,7 @@ static pwr_tStatus PostUnadopt ( ...@@ -135,7 +135,7 @@ static pwr_tStatus PostUnadopt (
); );
static pwr_tStatus SyntaxCheck ( static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session, ldh_tSesContext Session,
pwr_tObjid Object, /* object to check */ pwr_tAttrRef Object, /* object to check */
int *ErrorCount, /* accumulated error count */ int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated warning count */ int *WarningCount /* accumulated warning count */
); );
......
...@@ -477,60 +477,138 @@ bool wb_volume::exportTree(wb_volume &import, pwr_tOid oid) ...@@ -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 wb_volume::syntaxCheck(int *errorcount, int *warningcount)
{ {
pwr_tStatus sts; pwr_tStatus sts = LDH__SUCCESS;
pwr_tStatus osts;
wb_object o = object(); for ( wb_object o = object(); o; o = o.after()) {
if (o) { if ( o.cid() == pwr_eClass_LibHier)
sts = syntaxCheckObject(o, errorcount, warningcount); continue;
return sts; 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 wb_volume::syntaxCheckObject(wb_object& o, int *errorcount, int *warningcount)
{ {
pwr_tStatus sts; pwr_tStatus sts, csts;
wb_object first, after; 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; if (EVEN(sts)) return sts;
switch (o.cid()) { // Get any attribute objects
case pwr_eClass_LibHier: wb_cdef cd = cdef(o);
break; if ( !cd) return cd.sts();
default:
first = o.first(); wb_bdef bdef = cd.bdef(pwr_eBix_rt);
if (first) { wb_adef adef;
sts = syntaxCheckObject(first, errorcount, warningcount); if ( bdef) {
if (EVEN(sts)) return sts; for (adef = bdef.adef(); adef; adef = adef.next()) {
} if ( !(adef.flags() & PWR_MASK_CLASS))
after = o.after(); continue;
if (after) {
sts = syntaxCheckObject(after, errorcount, warningcount); if ( adef.flags() & PWR_MASK_ARRAY) {
if ( EVEN(sts)) return sts; 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;
}
}
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; pwr_tStatus sts;
char methodName[] = "SyntaxCheck"; char methodName[80];
wb_tMethod method; wb_tMethod method;
// wb_cdrep *cdrep = m_vrep->merep()->cdrep(&sts, o.cid()); if ( !cdh_tidIsCid( a.tid()))
// if (EVEN(sts)) return sts; return 0;
// cdrep->dbCallBack(&sts, ldh_eDbCallBack_SyntaxCheck, &methodName, 0); // Call object method, or inherited method
// delete cdrep; for ( wb_cdef cd = cdef( a.tid()); cd; cd = cd.super()) {
// if (EVEN(sts)) return LDH__SUCCESS; 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); m_vrep->erep()->method(&sts, methodName, &method);
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) pwr_tStatus wb_volume::triggAnteAdopt(wb_object& father, pwr_tCid cid)
......
...@@ -104,7 +104,8 @@ public: ...@@ -104,7 +104,8 @@ public:
pwr_tStatus syntaxCheck( int *errorcount, int *warningcount); pwr_tStatus syntaxCheck( int *errorcount, int *warningcount);
pwr_tStatus syntaxCheckObject( wb_object& o, 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 triggAnteAdopt( wb_object& o, pwr_tCid cid);
pwr_tStatus triggAnteCreate( wb_object& father, 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); pwr_tStatus triggAnteMove( wb_object& o, wb_object& father, wb_object& old_father);
......
...@@ -34,3 +34,4 @@ PlcThread ...@@ -34,3 +34,4 @@ PlcThread
NodeConfig NodeConfig
SevNodeConfig SevNodeConfig
Application Application
FriendNodeConfig
...@@ -426,7 +426,7 @@ dcli_tCmdTable wnav_command_table[] = { ...@@ -426,7 +426,7 @@ dcli_tCmdTable wnav_command_table[] = {
{ {
"CHECK", "CHECK",
&wnav_check_func, &wnav_check_func,
{ "dcli_arg1", ""} { "dcli_arg1", "/VOLUME", "/NAME", ""}
}, },
{ {
"UPDATE", "UPDATE",
...@@ -4996,6 +4996,53 @@ static int wnav_check_func( void *client_data, ...@@ -4996,6 +4996,53 @@ static int wnav_check_func( void *client_data,
wb_vrepdb *vrep = (wb_vrepdb *)((wb_vrep *) *v); wb_vrepdb *vrep = (wb_vrepdb *)((wb_vrep *) *v);
vrep->checkMeta(); 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 { else {
wnav->message('E', "Syntax error"); wnav->message('E', "Syntax error");
return WNAV__SYNTAX; return WNAV__SYNTAX;
......
This diff is collapsed.
...@@ -30,46 +30,67 @@ extern "C" { ...@@ -30,46 +30,67 @@ extern "C" {
typedef enum { typedef enum {
wsx_mCardOption_None = 0, wsx_mCardOption_None = 0,
wsx_mCardOption_DevName = 1 << 0 wsx_mCardOption_DevName = 1 << 0,
wsx_mCardOption_ErrorLimits = 1 << 1
} wsx_mCardOption; } wsx_mCardOption;
pwr_tStatus wsx_error_msg( pwr_tStatus wsx_error_msg( ldh_tSesContext sesctx,
ldh_tSesContext sesctx, pwr_tStatus sts,
pwr_tStatus sts, pwr_tAttrRef aref,
pwr_tObjid objid, int *errorcount,
int *errorcount, int *warningcount);
int *warningcount
); pwr_tStatus wsx_error_msg_str( ldh_tSesContext sesctx,
const char *str,
pwr_tStatus wsx_CheckCard( pwr_tAttrRef aref,
ldh_tSesContext sesctx, int severity,
pwr_tObjid objid, int *errorcount,
int *errorcount, int *warningcount);
int *warningcount,
wsx_mCardOption options pwr_tStatus wsx_CheckCard( ldh_tSesContext sesctx,
); pwr_tAttrRef aref,
int *errorcount,
pwr_tStatus wsx_CheckCoCard( int *warningcount,
ldh_tSesContext sesctx, wsx_mCardOption options);
pwr_tObjid objid,
int *errorcount, pwr_tStatus wsx_CheckCoCard( ldh_tSesContext sesctx,
int *warningcount pwr_tAttrRef aref,
); int *errorcount,
int *warningcount);
pwr_tStatus wsx_CheckSigChanCon(
ldh_tSesContext sesctx, pwr_tStatus wsx_CheckIoDevice( ldh_tSesContext sesctx,
pwr_tObjid objid, pwr_tAttrRef aref,
int *errorcount, int *errorcount,
int *warningcount int *warningcount,
); wsx_mCardOption options);
pwr_tStatus wsx_CheckVolume( pwr_tStatus wsx_CheckSigChanCon( ldh_tSesContext sesctx,
ldh_tSesContext sesctx, pwr_tAttrRef aref,
pwr_tObjid objid, int *errorcount,
int *errorcount, int *warningcount);
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);
pwr_tStatus wsx_CheckVolume( ldh_tSesContext sesctx,
pwr_tObjid objid,
int *errorcount,
int *warningcount);
#if defined __cplusplus #if defined __cplusplus
} }
......
...@@ -433,6 +433,8 @@ void Wtt::save_cb( void *ctx, int quiet) ...@@ -433,6 +433,8 @@ void Wtt::save_cb( void *ctx, int quiet)
} }
unsigned int opt; unsigned int opt;
if ( !wtt->focused_wnav)
wtt->set_focus_default();
if ( wtt->focused_wnav->gbl.enable_comment) if ( wtt->focused_wnav->gbl.enable_comment)
opt = log_mOption_Comment; opt = log_mOption_Comment;
else else
...@@ -697,6 +699,8 @@ int Wtt::set_noedit( wtt_eNoEditMode save, wtt_eNoEditVolMode detach) ...@@ -697,6 +699,8 @@ int Wtt::set_noedit( wtt_eNoEditMode save, wtt_eNoEditVolMode detach)
sts = lfu_SaveDirectoryVolume( ldhses, wnav->wow, 0); sts = lfu_SaveDirectoryVolume( ldhses, wnav->wow, 0);
unsigned int opt; unsigned int opt;
if ( !focused_wnav)
set_focus_default();
if ( focused_wnav->gbl.enable_comment) if ( focused_wnav->gbl.enable_comment)
opt = log_mOption_Comment; opt = log_mOption_Comment;
else else
...@@ -1594,6 +1598,8 @@ void Wtt::activate_buildobject() ...@@ -1594,6 +1598,8 @@ void Wtt::activate_buildobject()
message( ' ', ""); message( ' ', "");
if ( !focused_wnav)
set_focus_default();
strcpy( cmd, "build object"); strcpy( cmd, "build object");
if ( focused_wnav->gbl.build.force) if ( focused_wnav->gbl.build.force)
strcat( cmd, " /force"); strcat( cmd, " /force");
...@@ -1830,6 +1836,8 @@ void Wtt::activate_buildvolume() ...@@ -1830,6 +1836,8 @@ void Wtt::activate_buildvolume()
set_clock_cursor(); set_clock_cursor();
wb_build *build = build_new(); wb_build *build = build_new();
if ( !focused_wnav)
set_focus_default();
build->opt = focused_wnav->gbl.build; build->opt = focused_wnav->gbl.build;
build->volume(); build->volume();
...@@ -1873,6 +1881,8 @@ void Wtt::activate_buildnode() ...@@ -1873,6 +1881,8 @@ void Wtt::activate_buildnode()
} }
if ( found) { if ( found) {
wb_build *build = build_new(); wb_build *build = build_new();
if ( !focused_wnav)
set_focus_default();
build->opt = focused_wnav->gbl.build; build->opt = focused_wnav->gbl.build;
set_clock_cursor(); set_clock_cursor();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment