示例#1
0
void CTabProfsDlg::SetProfs(CObList &list)
{
	ClearCounts();

	CProfData *pData;
	POSITION pos = list.GetHeadPosition();
	while(pos)
	{
		pData = (CProfData*)list.GetNext(pos);
		UpdateCount(pData->m_chProf,pData->m_nFirstClass,pData->m_nSecondClass);

		// Clear the list, it isn't needed anymore and will save the view from
		// having to do it.
		delete pData;
	}

	list.RemoveAll();
}
示例#2
0
文件: DumpDFS.c 项目: geoffmcl/dump4
BOOL  ProcessDFS( LPDFSTR lpdf )
{
    PFSDFSHDR pdfsh = (PFSDFSHDR) lpdf->df_pVoid;
    PFSDFSREC pr;
    DWORD dwsize, type, len, res, recnum;
    PTSTR pf;
    PBYTE pb;
    int   i;
    PTSTR pts;
    LLD   lld;
    GETLLD   gd;
    PTSTR    ptmp;

    InitLLDTable();
    ClearCounts();
    if( pdfsh->fd_Type != FSDHDR )
    {
        sprtf( "File [%s] is NOT DFS ... ERRANT HEADER"MEOR, lpdf->fn );
        return FALSE;

    }
    dwsize = pdfsh->fd_Size;
    if( dwsize != lpdf->qwSize.QuadPart )
    {
        sprtf( "File [%s] is NOT DFS ... WRONG SIZE IN HEADER"MEOR, lpdf->fn );
        return FALSE;
    }
    pb = (PBYTE)pdfsh;
    for( i = 0; i < sizeof(DWORD); i++ ) {
        szHdr[i] = pb[i];
    }
    szHdr[i] = 0;

    pr = (PFSDFSREC)((PFSDFSHDR)pdfsh + 1);
    pb = (PBYTE)pr;
    dwsize -= sizeof(FSDFSHDR);
    recnum = 0;
    while( dwsize )
    {
        recnum++;
        type = pr->fr_Type;  // fsd_Air, etc - type of record
        len  = pr->fr_Len;   // Total additional LENGTH of this record (inclusive)
        res  = pr->fr_Res;   // Various ADDITONAL things, like Freq.
        pf   = &pr->fr_File[0]; // BGL source file path
        if( IsVT( type ) ) {
            uiTypCnts[type]++;
        } else {
            uiTypCnts[0]++;
        }
        len += sizeof( FSDFSREC );
        if( len && ( len <= dwsize )) {
            dwsize -= len;
            pb += len;
            pr = (PFSDFSREC)pb;
        } else {
            sprtf( "File [%s] is NOT DFS ... FAILED ON RECORD %d"MEOR, lpdf->fn,
                   recnum );
            return FALSE;
        }
    }
    sprtf( "File [%s] appears to be DFS ..."MEOR
           "Successful full scan of %d records."MEOR, lpdf->fn, recnum );

    dwsize = pdfsh->fd_Size;
    pr = (PFSDFSREC)((PFSDFSHDR)pdfsh + 1);
    pb = (PBYTE)pr;
    dwsize -= sizeof(FSDFSHDR);
    recnum = 0;
    sprtf( "Header record: Marker: %s, File Size: %d."MEOR, szHdr, pdfsh->fd_Size );
    sprtf( "Record type counts:"MEOR );
    // output like
    //Record type counts:
    //Runway = 224
    //VOR = 792
    //ILS = 142
    //NDB = 1271
    //ATIS = 46
    //LandMe = 173
    //Marker = 191
    for( i = 0; i < fsd_Max; i++ )
    {
        pts = Type2Stg( i );
        if( uiTypCnts[i] ) {
            sprtf( "%s = %d (type=%d)"MEOR, pts, uiTypCnts[i], i );
        }
    }
    recnum = 0;
    while( dwsize )
    {
        recnum++;
        type = pr->fr_Type;  // fsd_Air, etc - type of record
        len  = pr->fr_Len;   // Total additional LENGTH of this record (inclusive)
        res  = pr->fr_Res;   // Various ADDITONAL things, like Freq.
        pf   = &pr->fr_File[0]; // BGL source file path
        pts = Type2Stg(type);
        if( IsVT( type ) ) {
            uiTypCnts[type]++;
            gd = GetLLDTable[type];
            if(gd) {
                gd( NULL, pr, &lld );
                ptmp = GetNxtBuf();
                // 123456789012345
                // 02838: LandMe
                sprintf(ptmp, "%5d: %s", recnum, pts );
                while(strlen(ptmp) < 16)
                    strcat(ptmp," ");
                sprintf(EndBuf(ptmp), "at lat %3.7f, lon %3.7f ...",
                        lld.ll_Lat, lld.ll_Long );
                if( VERB9 ) {
                    sprintf(EndBuf(ptmp), " Offset %#08X",
                            ((DWORD)pr - (DWORD)pdfsh) );
                }
                sprtf("%s"MEOR, ptmp);
            } else {
                sprtf( "%d: %s - NO lat/lon tranlation available..."MEOR, recnum,
                       pts );
            }

        } else {
            uiTypCnts[0]++;
            sprtf( "%d: %s - UNKNOWN TYPE..."MEOR, recnum,
                   pts );
        }

        len += sizeof( FSDFSREC );
        if( len && ( len <= dwsize )) {
            dwsize -= len;
            pb += len;
            pr = (PFSDFSREC)pb;
        } else {
            sprtf( "File [%s] is NOT DFS ... FAILED ON RECORD %d"MEOR, lpdf->fn,
                   recnum );
            return FALSE;
        }
    }
    return TRUE;
}