Merge branch 'master' of git.psi.ch:epics_ioc_modules/ecmc_plugin_safety

This commit is contained in:
2024-02-19 16:32:50 +01:00
2 changed files with 30 additions and 3 deletions

View File

@@ -18,7 +18,7 @@ OPT_CXXFLAGS_YES = -O3
ECmasterECMC_VERSION = v1.1.0
# motorECMC_VERSION = 7.0.7-ESS
#ecmc_VERSION = v9.0.1_RC4
ecmc_VERSION = sandst_a
ecmc_VERSION = v9.0.1_RC4
################################################################################
# THIS RELATES TO THE EtherCAT MASTER LIBRARY

View File

@@ -183,10 +183,37 @@ void ecmcSS1SafetyGroup::validateCfgs() {
void ecmcSS1SafetyGroup::validateAxes() {
for(std::vector<safetyAxis*>::iterator saxis = axes_.begin(); saxis != axes_.end(); ++saxis) {
if(!(*saxis)) {
// Ensure that axis is not linked twice to group
for(std::vector<safetyAxis*>::iterator iaxis = axes_.begin(); iaxis != axes_.end(); ++iaxis) {
int axisLinkedCounter = 0;
if(!(*iaxis)) {
throw std::runtime_error( "Safety: Axis object NULL.");
}
int axisCheck_1 = (*iaxis)->axisId_;
int axisCheck_2 = -1;
for(std::vector<safetyAxis*>::iterator jaxis = axes_.begin(); jaxis != axes_.end(); ++jaxis) {
if(!(*jaxis)) {
throw std::runtime_error( "Safety: Axis object NULL.");
}
axisCheck_2 =(*jaxis)->axisId_;
if( axisCheck_1 == axisCheck_2) {
axisLinkedCounter++;
}
}
if(axisLinkedCounter > 1) {
if(cfgDbgMode_) {
printf("Safety %s: Axis %d linked %d times to group\n",
sName_,axisCheck_2,axisLinkedCounter);
}
throw std::runtime_error( "Safety: Axis linked multiple times");
}
}
// Check axis object exists and valid
for(std::vector<safetyAxis*>::iterator saxis = axes_.begin(); saxis != axes_.end(); ++saxis) {
if(!getAxisValid((*saxis)->axisId_)) {
throw std::runtime_error( "Safety: Ecmc Axis object not valid.");
}