From 1f350d095d9d3cc3d11d3dcf42cc1390a56cb17b Mon Sep 17 00:00:00 2001 From: "quentin.perret" Date: Fri, 10 Jun 2022 11:13:03 +0200 Subject: [PATCH] debug dtatFill gestion --- Code-C/main | Bin 18144 -> 18256 bytes Code-C/simulateFlux.c | 33 ++++++++++++++++++--------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Code-C/main b/Code-C/main index 0f0ab264328876ddd7e8d07052dec28851deaf65..c46c7d20ffe5cb8b84a8555a9fa1984010b670aa 100755 GIT binary patch delta 3099 zcmZ8j4NP3e5#BxSIKbG)0mt3L#0U7VfX(sagWwqZ&KPqfP(czJyJ}2mV%Kh|WB!^r zZ4CtD_;k4nccjR5l^>#1iTV@SK37U`iti$)^i8d7|L$@Y?XLWQRzTCh13Pnw8v@GB_oo@nldw5yZ9)-0M9m3K zYD##X|5}XrDai*VKO*`2l3$nnx00_UzuCiIrVenDmUjiGNwbSzl%q7Wnaq|gj%Ze_JQ(>VD?HLGaG@y$9L8r`w(yURKvo zzrCilthls-wYGliyU!kM?dopp>~3vECKF4*W0E5iGt05ig+=%L*Q<|2Cph~Q{xm$f zczUuAptA|gELsHOh@OXpzd{;bIq?cQXJ%;th#)-xwGx_1bn+M_TZ=S{ z?vi|Zo34n@kV=hKr?z5=H@3u^Nk4>Fd?JI4_KAE>`jyqmU3A&n%FVPksZ~=eLxOkt z^cX8d3cZ@-)RyT6$@lwoMR=FfwWPXwwbZ2f_!4ir4wQUoi9KV9{p1q6Ba)X~lXx~Q zo%eQn7~3!2?G}rJ)_z;)HlfGQ1AmJ( zJ>C$ue2hgC2ruuFqWU)G9(U|R%ojHI4&kZpN5VkZ@`4ambA{cGK*+KcfWY8bcXE8% z=I#@jFDi+EW*Ojpm_qiP9S(&|icjy884X~c#IYVvOJJb-%Z*482!7I?8VFUNLP&HY z-X*#p?24rza@+nU-%^t*Ahp*q7oR?y3|T(jz*z8VbQfL~zKK8xe&`n$gnkj~giz1X z?=yC%eSOh5DU6R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>A9v1iN8X_A(eY*_*-?>@J4-ZIW!IFsRmujM6SO7 E0-TSoPyhe` diff --git a/Code-C/simulateFlux.c b/Code-C/simulateFlux.c index bf41fb2..5c94eff 100644 --- a/Code-C/simulateFlux.c +++ b/Code-C/simulateFlux.c @@ -35,15 +35,15 @@ char *createNewRawDataFileName(){ char *fileNumber = convertIntegerToChar(cptFile); char fileNameNumber[strlen(fileName)+strlen(fileNumber)]; - char *fullFillName = malloc( (strlen(fileNameNumber)+strlen(extension)) * sizeof(char*) ); + char *fullFileName = malloc( (strlen(fileNameNumber)+strlen(extension)) * sizeof(char*) ); strcpy( fileNameNumber, fileName ); strcat( fileNameNumber, fileNumber ); - strcpy( fullFillName, fileNameNumber ); - strcat( fullFillName, extension ); + strcpy( fullFileName, fileNameNumber ); + strcat( fullFileName, extension ); - return fullFillName; + return fullFileName; } int intInArray(int number , int *array , int N){ @@ -66,7 +66,7 @@ int64_t millis() timespec_get(&now, TIME_UTC); return ((int64_t) now.tv_sec) * 1000 + ((int64_t) now.tv_nsec) / 1000000; } -bool writeOneRawData(FILE *rawDataFill){ +bool writeOneRawData(FILE *rawDataFile){ char buff[26]; char buff2[18]; int32_t values[8]; @@ -75,7 +75,7 @@ bool writeOneRawData(FILE *rawDataFill){ if(fread(&buff, 26, 1, stdin)) { - fprintf(rawDataFill , "%d,", millis()); + fprintf(rawDataFile , "%d,", millis()); if (strncmp(buff, "#################\n", (size_t)18) == 0) { if (!(fread(&buff2, 18, 1, stdin))) { fprintf(stderr, "Erreur lecture après ###...#"); @@ -98,10 +98,10 @@ bool writeOneRawData(FILE *rawDataFill){ if(i==maxCApteurNb){ - fprintf(rawDataFill, "%d\n", values[i]/256); + fprintf(rawDataFile, "%d\n", values[i]/256); } else{ - fprintf(rawDataFill, "%d,", values[i]/256); + fprintf(rawDataFile, "%d,", values[i]/256); } } } @@ -115,15 +115,18 @@ bool writeOneRawData(FILE *rawDataFill){ } void *simulateFlux(void *vargp){ - - char *fillName = createNewRawDataFileName(); - FILE *rawDataFill = fopen(fillName,"w+"); - while(writeOneRawData(rawDataFill)){ + char *fileName = createNewRawDataFileName(); + FILE *rawDataFile = fopen(fileName,"w+"); + while(writeOneRawData(rawDataFile)){ if(cptData == nRow){ + fclose(rawDataFile); cptData = 0; cptFile++; - fillName = createNewRawDataFileName(); - FILE *rawDataFill = fopen(fillName,"w+"); + //create struct here + char *fileName = createNewRawDataFileName(); + printf(fileName); + printf("\n"); + FILE *rawDataFile = fopen(fileName,"w+"); } } -} \ No newline at end of file +}