Exemplo n.º 1
0
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;
}
Exemplo n.º 2
0
int operator>(const TIntegrationEvent& left,
    const TIntegrationEvent& right)
/* --------------------------
     * Author  : Bruno Orsier                : Original Delphi code
             Diego Segura / Gilles Orazi : C++ translation
 * Created : 06/2002
 * Purpose :
 * History :
 * -------------------------- */
{
    return left.Time() > right.Time() ;
}
Exemplo n.º 3
0
bool SortEventsByTime(TIntegrationEvent& evt1, TIntegrationEvent& evt2)
/* --------------------------
     * Author  : Bruno Orsier                : Original Delphi code
             Diego Segura / Gilles Orazi : C++ translation
 * Created : 06/2002
 * Purpose :
 * History :
 * -------------------------- */
{
    INT_FLOAT t1 = evt1.Time();
    INT_FLOAT t2 = evt2.Time();
    return (t1 < t2);
}
Exemplo n.º 4
0
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 ;
}  
Exemplo n.º 5
0
//---------------------------------------------------------------------
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 ;
}
Exemplo n.º 6
0
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
}