Commit 3c596330 authored by DeAn Wei's avatar DeAn Wei
Browse files

delete the old parse code

parent e84c869e
Loading
Loading
Loading
Loading
+49 −102
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ int ReadTecplotNormalData(string &file, Table_t &table, string &secLine)
        if(feof(fp))break;
        if(str == "\n" || str == NULL)continue;

//        if(strstr(str, "variables") != NULL || strstr(str, "VARIABLES") != NULL){
        if(firstPoint){
            if(strstr(str, "variables") != NULL){
                token = strtok(str, "=");
                while(1){
@@ -89,7 +89,7 @@ int ReadTecplotNormalData(string &file, Table_t &table, string &secLine)
//                printf("\n");
                continue;
            }
#if 1

            buff0 = str;
            if(std::regex_search(buff0, equation_match, aux_equation)){
                buff1 = equation_match[0].str();
@@ -131,60 +131,7 @@ int ReadTecplotNormalData(string &file, Table_t &table, string &secLine)
                }
                continue;
            }
#else   
//        if(strstri(str, "Zone") != NULL || strstri(str, "ZONE") != NULL || strstri(str, "zone") != NULL){
        if(strstri(str, "zone") != NULL){
//            printf("second line: %s\n", secLine.c_str());

            if((p2 = strstr(str, "T = ")) != (char *)NULL){
                token = strtok(p2, quotation);
                if((token = strtok(NULL, quotation)) != NULL){
                    auxVar.type = DOUBLE_DATA;
                    auxVar.name = "T";
                    auxVar.val = token;
                    table.aux[auxVar.name] = auxVar.val;
//                    printf("Time: %d %s = %s\n", auxVar.type, auxVar.name.c_str(), auxVar.val.c_str());
                }
            }
            if((p2=strstr(str, "SOLUTIONTIME")) != (char *)NULL){
                token = strtok(p2, quotation);
                if((token = strtok(NULL, quotation)) != NULL){
                    auxVar.type = DOUBLE_DATA;
                    auxVar.name = "SOLUTIONTIME";
                    auxVar.val = token;
                    table.aux[auxVar.name] = auxVar.val;
                    printf("Soluition Time: %d %s = %s\n", auxVar.type, auxVar.name.c_str(), auxVar.val.c_str());
                }
            }
            if((p2=strstr(str, "i = ")) != (char *)NULL){
                token = strtok(p2, quotation);
                if((token = strtok(NULL, quotation)) != NULL){
                    numPoints = atoi(token);
//                    printf("%d points will be read.\n", numPoints);
                }
            }
            continue;
        }

        if((p2 = strstr(str, "AUXDATA")) != NULL){
            if((token = strtok(p2, " ")) != NULL){
                if((token = strtok(NULL, " ")) != NULL){
                    auxVar.type = DOUBLE_DATA;
                    auxVar.name = token;
                    if((token = strtok(NULL, quotation)) != NULL 
                        && (token = strtok(NULL, quotation)) != NULL){
                        auxVar.val = token;
                    }else{
                        Fatal("can not read the value of %s\n", auxVar.name.c_str());
                    }
//                    printf("aux data: %d %s=%s\n", auxVar.type, auxVar.name.c_str(), auxVar.val.c_str());
                    table.aux[auxVar.name] = auxVar.val;
                }
            }
            continue;
        }
#endif  
        if(firstPoint){
            firstPoint = 0;
            if(table.variables.size() == 0){
                char strBak[MAXLINELENGTH];