//
//  Copyright © 2001 - 2002, RESON Inc. All Rights Reserved.
//
//  No part of this file may be reproduced or transmitted in any form or by
//  any means, electronic or mechanical, including photocopy, recording, or
//  information storage or retrieval system, without permission in writing
//  from RESON Inc.
//
//  Filename:   DataProcessor.cpp
//
//  Project:    6046
//
//  Author(s):  W. Arcus
//
//  Purpose:    
//
//  Notes:      
//

#include "StdAfx.h"
#include "DataProcessor.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// CDataProcessor class implementation.

CDataProcessor::CDataProcessor  (   PFN_HANDLER_CALLBACK    pfnHandlerCallback,
                                    void                   *pvParam,
                                    char                   *pszAddress,
                                    const unsigned long    &rulPort,
                                    const unsigned long    &rulMaxMessageSize )

               :CMessageProcessor(  pfnHandlerCallback,
                                    pvParam,
                                    pszAddress,
                                    rulPort,
                                    rulMaxMessageSize )
{
}

CDataProcessor::~CDataProcessor( void )
{
}

bool CDataProcessor::HandleSonarMessage(    const unsigned long &rulTimestamp,
                                            CEdgeTechMessage    &rMessage )
{
    // Filter messages of interest otherwise give the base class a chance to deal with them.

    bool bSuccess = false;

    switch ( rMessage.SonarMessage() )
    {
        case SONAR_MESSAGE_DATA:                    // Seg-y SBP data.
        case SONAR_MESSAGE_DATA_SIDESCAN:           // Sidescan (SidescanHeaderType).

            bSuccess = CallCallback( rulTimestamp, rMessage );
            break;

        default:

            bSuccess = CMessageProcessor::HandleSonarMessage( rulTimestamp, rMessage );
            break;
    }

    return bSuccess;
}

