INT_FLOAT TEventOnOffAndPeaks::FindClosingTime(TIntegrationEventList& EventList ) /* -------------------------- * Author : Bruno Orsier : Original Delphi code Gilles Orazi : C++ translation * Created : 06/2002 * Purpose : * History : * -------------------------- */ { INT_FLOAT time = INT_MINFLOAT ; for (TIntegrationEventList::iterator otherEvent_it = EventList.begin()+FidxEvent+1; (time<0) && (otherEvent_it != EventList.end()); otherEvent_it++) { TIntegrationEvent* pOtherEvent = *otherEvent_it ; if ( (pOtherEvent->Code() == pFEvent->Code()) || CompatibleEvents(pOtherEvent->Code(), pFEvent->Code()) ) { if (FAnyOtherWillClose) { time = pOtherEvent->Time() ; } else { TIntegrationEvent_OnOff *otherEvent_OnOff = (TIntegrationEvent_OnOff*) pOtherEvent; if (! otherEvent_OnOff->On() ) { time = pOtherEvent->Time() ; } } } } return time; }
//--------------------------------------------------------------------- INT_FLOAT TEventAndPeaks_Skimming::FindClosingTime(TIntegrationEventList& EventList) /* -------------------------- * Author : Bruno Orsier : Original Delphi code Gilles Orazi : C++ translation * Created : 06/2002 * Purpose : * History : * -------------------------- */ { INT_FLOAT time = INT_MINFLOAT ; for (TIntegrationEventList::iterator it_otherEvent = EventList.begin()+FidxEvent+1; ( (it_otherEvent != EventList.end() ) && (time<0)); it_otherEvent++) { TIntegrationEvent* pOtherEvent = *it_otherEvent ; if (pOtherEvent->Code() == pFEvent->Code()) { if (FAnyOtherWillClose) { time = pOtherEvent->Time() ; } else { //What a typecast !! Can we do something simpler ? TIntegrationEvent_OnOff* otherEvent_OnOff = (TIntegrationEvent_OnOff*) pOtherEvent ; if ( ! otherEvent_OnOff->On() ) { time = pOtherEvent->Time(); } } } if (time < 0) { //What a typecast !! Can we do something simpler ? TIntegrationEvent_OnOff* otherEvent_OnOff = (TIntegrationEvent_OnOff*) pOtherEvent ; if ( (pFEvent->Code() >= INTEGRATIONEVENT_TANGENTSKIM) && (pFEvent->Code() <= INTEGRATIONEVENT_TANGENTSKIM_FRONT_EXP) && (pOtherEvent->Code() >= INTEGRATIONEVENT_TANGENTSKIM) && (pOtherEvent->Code() <= INTEGRATIONEVENT_TANGENTSKIM_FRONT_EXP) && otherEvent_OnOff->On() ) { time = pOtherEvent->Time() ; } } } return time ; }
INT_FLOAT TEventAndPeaks_CommonLine::FindClosingTime(TIntegrationEventList& EventList) /* -------------------------- * Author : Bruno Orsier : Original Delphi code Gilles Orazi : C++ translation * Created : 06/2002 * Purpose : * History : * -------------------------- */ { INT_FLOAT time = INT_MINFLOAT ; for (unsigned int idxEvent = FidxEvent+1 ; (idxEvent<EventList.size()) && (time<0); ++idxEvent) { TIntegrationEvent* pOtherEvent = EventList[idxEvent] ; if ((pOtherEvent->Code() == pFEvent->Code()) || ( (pOtherEvent->Code() == INTEGRATIONEVENT_COMMONLINE_BYPEAK) && (pFEvent->Code() == INTEGRATIONEVENT_COMMONLINE) ) || ( (pOtherEvent->Code() == INTEGRATIONEVENT_COMMONLINE) && (pFEvent->Code() == INTEGRATIONEVENT_COMMONLINE_BYPEAK) )) { if (FAnyOtherWillClose) { time = pOtherEvent->Time() ; } else { //What a typecast !! Can we do something simpler ? TIntegrationEvent_OnOff* otherEvent_OnOff = (TIntegrationEvent_OnOff*) pOtherEvent ; if ( ! otherEvent_OnOff->On() ) { time = pOtherEvent->Time() ; } } } if (time > 0) //in pascal original source test if otherevent is assigned. //not tested here because it seems to be unuseful. { FEndIsByPeak = (pOtherEvent->Code() == INTEGRATIONEVENT_COMMONLINE_BYPEAK) ; } } return time ; }
TIntegrationEvent::TIntegrationEvent( const TIntegrationEvent &source ) /* -------------------------- * Author : Bruno Orsier : Original Delphi code Diego Segura / Gilles Orazi : C++ translation * Created : 06/2002 * Purpose : * History : * -------------------------- */ { Name(source.Name()); Time(source.Time()); Code(source.Code()); m_priority = source.Priority(); ShortName(source.ShortName()); Category(source.Category()); #ifdef INTEGR_DEBUG ++Glob_InEventsCount; ++Glob_InEventsTotal; #endif }