#include "Brooks0254ParID.hh" map, Brooks0254ParID::bpiVarType> Brooks0254ParID::bpiTypeMap; map, double> Brooks0254ParID::bpiLoLim; map, double> Brooks0254ParID::bpiHiLim; int Brooks0254ParID::bpiDummyInt = Brooks0254ParID::InitMap(); int Brooks0254ParID::InitMap() { //! Initialize global parameter types bpiTypeMap[ pair(bpiGlobal, 32) ] = bpiBool; bpiTypeMap[ pair(bpiGlobal, 33) ] = bpiBool; bpiTypeMap[ pair(bpiGlobal, 34) ] = bpiBool; //! Initilize Input parameter types bpiTypeMap[ pair(bpiInput, 0) ] = bpiInt; bpiTypeMap[ pair(bpiInput, 3) ] = bpiInt; bpiTypeMap[ pair(bpiInput, 4) ] = bpiInt; bpiTypeMap[ pair(bpiInput, 9) ] = bpiDouble; bpiTypeMap[ pair(bpiInput, 10) ] = bpiInt; bpiTypeMap[ pair(bpiInput, 27) ] = bpiDouble; //! this are "fake" parameter that do not exist in Brooks054 //! These were introduce for PV related readout bpiTypeMap[ pair(bpiInput, 101) ] = bpiDouble; bpiTypeMap[ pair(bpiInput, 102) ] = bpiDouble; bpiTypeMap[ pair(bpiInput, 103) ] = bpiDouble; //! Initilize Output parameter types bpiTypeMap[ pair(bpiOutput, 0) ] = bpiInt; bpiTypeMap[ pair(bpiOutput, 1) ] = bpiDouble; bpiTypeMap[ pair(bpiOutput, 2) ] = bpiInt; bpiTypeMap[ pair(bpiOutput, 9) ] = bpiDouble; bpiTypeMap[ pair(bpiOutput, 29) ] = bpiInt; bpiTypeMap[ pair(bpiOutput, 44) ] = bpiDouble; bpiTypeMap[ pair(bpiOutput, 45) ] = bpiDouble; bpiTypeMap[ pair(bpiOutput, 46) ] = bpiBool; //! Low limits for global port parameters bpiLoLim[ pair(bpiGlobal, 32) ] = 0; bpiLoLim[ pair(bpiGlobal, 33) ] = 0; bpiLoLim[ pair(bpiGlobal, 39) ] = 0; //! Low limits for global port parameters bpiHiLim[ pair(bpiGlobal, 32) ] = 1; bpiHiLim[ pair(bpiGlobal, 33) ] = 1; bpiHiLim[ pair(bpiGlobal, 39) ] = 1; //! Low limits for input port parameters bpiLoLim[ pair(bpiInput, 0) ] = 7; bpiLoLim[ pair(bpiInput, 3) ] = 3; bpiLoLim[ pair(bpiInput, 4) ] = 0; bpiLoLim[ pair(bpiInput, 9) ] = 0; bpiLoLim[ pair(bpiInput, 10) ] = 1; bpiLoLim[ pair(bpiInput, 27) ] = 0; bpiLoLim[ pair(bpiInput, 101) ] = -999999.999; bpiLoLim[ pair(bpiInput, 102) ] = -999999.999; bpiLoLim[ pair(bpiInput, 103) ] = -999999.999; //! High limits for input port parameters bpiHiLim[ pair(bpiInput, 0) ] = 12; bpiHiLim[ pair(bpiInput, 3) ] = 3; bpiHiLim[ pair(bpiInput, 4) ] = 41; bpiHiLim[ pair(bpiInput, 9) ] = +999.999; bpiHiLim[ pair(bpiInput, 10) ] = 4; bpiHiLim[ pair(bpiInput, 27) ] = +999.999; bpiHiLim[ pair(bpiInput, 101) ] = +999999.999; bpiHiLim[ pair(bpiInput, 102) ] = +999999.999; bpiHiLim[ pair(bpiInput, 103) ] = +999999.999; //! Low limits for output port parameters bpiLoLim[ pair(bpiOutput, 0) ] = 1; bpiLoLim[ pair(bpiOutput, 1) ] = 0; bpiLoLim[ pair(bpiOutput, 2) ] = 0; bpiLoLim[ pair(bpiOutput, 9) ] = 0; bpiLoLim[ pair(bpiOutput, 29) ] = 0; bpiLoLim[ pair(bpiOutput, 44) ] = 0; bpiLoLim[ pair(bpiOutput, 45) ] = 0; bpiLoLim[ pair(bpiOutput, 46) ] = 1; //! High limits for output port parameters bpiHiLim[ pair(bpiOutput, 0) ] = 6; bpiHiLim[ pair(bpiOutput, 1) ] = +999.999; bpiHiLim[ pair(bpiOutput, 2) ] = 3; bpiHiLim[ pair(bpiOutput, 9) ] = +999.999; bpiHiLim[ pair(bpiOutput, 29) ] = 2; bpiHiLim[ pair(bpiOutput, 44) ] = +999.999; bpiHiLim[ pair(bpiOutput, 45) ] = +999.999; bpiHiLim[ pair(bpiOutput, 46) ] = 1; return 0; } //! This function checks if the values are within the range of the //! the parameter limits of this parameter ID object bool Brooks0254ParID::BadRange( double val ) { bool tmpStat = 1; pair* tmpPair = this->CreatePair(); if( bpiLoLim[*tmpPair] <= val && val <= bpiHiLim[*tmpPair] ) tmpStat = 0; delete tmpPair; return tmpStat; }