Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

MonitoringProfile.cpp

00001 // 00002 // Copyright 2004 P&P Software GmbH - All Rights Reserved 00003 // 00004 // MonitoringProfile.cpp 00005 // 00006 // Version 1.2 00007 // Date 04.01.03 (Version 1.0) 00008 // 14.04.03 (Version 1.1) 00009 // 30.09.03 (Version 1.2) 00010 // Author A. Pasetti (P&P Software), R.Totaro 00011 // 00012 // Change Record: 00013 // Version 1.1: changed the parameter associated to the events (was 00014 // the instance ID, is the class ID) 00015 // Version 1.2: replaced double and int with TD_Float and TD_Integer 00016 00017 #include "../GeneralInclude/CompilerSwitches.h" 00018 #include "../GeneralInclude/Constants.h" 00019 #include "../Base/CC_RootObject.h" 00020 #include "MonitoringProfile.h" 00021 00022 MonitoringProfile::MonitoringProfile(void) { 00023 enableStatus = ENABLED; 00024 pNext = pNULL; 00025 } 00026 00027 bool MonitoringProfile::deviatesFromProfile(TD_Float value) { 00028 bool outcome = NO_MON_PROFILE_DEVIATION; 00029 if ( isEnabled() ) { 00030 if ( doProfileCheck(value) ) { 00031 CC_RootObject::getEventRepository()->create(this, EVT_MON_PROFILE_VIOLATION ); 00032 outcome = MON_PROFILE_DEVIATION; 00033 } 00034 } 00035 if ( pNext!=pNULL ) 00036 if ( pNext->deviatesFromProfile(value) ) 00037 outcome = MON_PROFILE_DEVIATION; 00038 return outcome; 00039 } 00040 00041 bool MonitoringProfile::deviatesFromProfile(TD_Integer value) { 00042 bool outcome = NO_MON_PROFILE_DEVIATION; 00043 if ( isEnabled() ) { 00044 if ( doProfileCheck(value) ) { 00045 CC_RootObject::getEventRepository()->create(this, EVT_MON_PROFILE_VIOLATION ); 00046 outcome = MON_PROFILE_DEVIATION; 00047 } 00048 } 00049 if ( pNext!=pNULL ) 00050 if ( pNext->deviatesFromProfile(value) ) 00051 outcome = MON_PROFILE_DEVIATION; 00052 return outcome; 00053 } 00054 00055 void MonitoringProfile::setNextMonitoringProfile(MonitoringProfile* pNextMonitoringProfile) { 00056 assert( pNextMonitoringProfile!=pNULL ); 00057 pNext = pNextMonitoringProfile; 00058 } 00059 00060 MonitoringProfile* MonitoringProfile::getNextMonitoringProfile() { 00061 return pNext; 00062 } 00063 00064 void MonitoringProfile::reset(void) { 00065 return; 00066 }
Copyright 2003 P&P Software GmbH - All Rights Reserved