From bf4f35ca292140d43b82c33f062b46f0c4624042 Mon Sep 17 00:00:00 2001 From: "quentin.perret" Date: Thu, 1 Dec 2022 17:29:47 +0100 Subject: [PATCH] move .h in include --- .vscode/launch.json | 7 +++++ .vscode/settings.json | 6 ++++- Code-C/average.c | 10 +++---- Code-C/b2hd.c | 2 +- Code-C/ctest.c | 14 +++++----- Code-C/fileGestion.c | 2 +- Code-C/getArray.c | 6 ++--- Code-C/growthRate.c | 8 +++--- Code-C/{ => include}/average.h | 0 Code-C/{ => include}/b2hd.h | 0 Code-C/{ => include}/fileGestion.h | 0 Code-C/{ => include}/getArray.h | 0 Code-C/{ => include}/growthRate.h | 0 Code-C/{ => include}/initialParameters.h | 0 Code-C/{ => include}/power.h | 0 Code-C/{ => include}/queue.h | 0 Code-C/{ => include}/simulateFlux.h | 0 Code-C/main.c | 33 +++++++++++++----------- Code-C/power.c | 11 ++++---- Code-C/queue.c | 3 ++- Code-C/simulateFlux.c | 6 ++--- 21 files changed, 62 insertions(+), 46 deletions(-) create mode 100644 .vscode/launch.json rename Code-C/{ => include}/average.h (100%) rename Code-C/{ => include}/b2hd.h (100%) rename Code-C/{ => include}/fileGestion.h (100%) rename Code-C/{ => include}/getArray.h (100%) rename Code-C/{ => include}/growthRate.h (100%) rename Code-C/{ => include}/initialParameters.h (100%) rename Code-C/{ => include}/power.h (100%) rename Code-C/{ => include}/queue.h (100%) rename Code-C/{ => include}/simulateFlux.h (100%) diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..5c7247b --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,7 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 332f5c0..4a323d6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -16,6 +16,10 @@ "type_traits": "c", "simulateflux.h": "c", "pthread.h": "c", - "types.h": "c" + "types.h": "c", + "average.h": "c", + "queue.h": "c", + "growthrate.h": "c", + "stdbool.h": "c" } } \ No newline at end of file diff --git a/Code-C/average.c b/Code-C/average.c index 3da32f2..afdc6bc 100644 --- a/Code-C/average.c +++ b/Code-C/average.c @@ -1,8 +1,8 @@ -#include "average.h" -#include "getArray.h" -#include "fileGestion.h" -#include "initialParameters.h" -#include "queue.h" +#include "include/average.h" +#include "include/getArray.h" +#include "include/fileGestion.h" +#include "include/initialParameters.h" +#include "include/queue.h" /** * @brief realize the average calcul * diff --git a/Code-C/b2hd.c b/Code-C/b2hd.c index 2de322a..25c0a2d 100644 --- a/Code-C/b2hd.c +++ b/Code-C/b2hd.c @@ -1,4 +1,4 @@ -#include "b2hd.h" +#include "include/b2hd.h" #include diff --git a/Code-C/ctest.c b/Code-C/ctest.c index f5dfdb2..3043142 100644 --- a/Code-C/ctest.c +++ b/Code-C/ctest.c @@ -5,13 +5,13 @@ #include #include -#include "fileGestion.h" -#include "getArray.h" -#include "growthRate.h" -#include "power.c" -#include "simulateFlux.h" -#include "queue.h" -#include "average.h" +#include "include/fileGestion.h" +#include "include/getArray.h" +#include "include/growthRate.h" +#include "include/power.h" +#include "include/simulateFlux.h" +#include "include/queue.h" +#include "include/average.h" //#include "b2hd.h" bool rawDataWriteFlag; diff --git a/Code-C/fileGestion.c b/Code-C/fileGestion.c index 544d311..99e0a62 100644 --- a/Code-C/fileGestion.c +++ b/Code-C/fileGestion.c @@ -1,4 +1,4 @@ -#include "fileGestion.h" +#include "include/fileGestion.h" /** * @brief function that delete nRow lign in the beginning of the file rawData.csv . This function is necessary to not deal with the same ligns over and over diff --git a/Code-C/getArray.c b/Code-C/getArray.c index 1fe1691..3b775d4 100644 --- a/Code-C/getArray.c +++ b/Code-C/getArray.c @@ -1,6 +1,6 @@ -#include "getArray.h" -#include "fileGestion.h" -#include "initialParameters.h" +#include "include/getArray.h" +#include "include/fileGestion.h" +#include "include/initialParameters.h" //#include long **getlongArray(int N, int M) /* Allocate the array */ diff --git a/Code-C/growthRate.c b/Code-C/growthRate.c index 64a0a2e..8188a8f 100644 --- a/Code-C/growthRate.c +++ b/Code-C/growthRate.c @@ -1,7 +1,7 @@ -#include "initialParameters.h" -#include "fileGestion.h" -#include "getArray.h" -#include "growthRate.h" +#include "include/initialParameters.h" +#include "include/fileGestion.h" +#include "include/getArray.h" +#include "include/growthRate.h" /** * @brief calculate de growth rate between to point next to each other * diff --git a/Code-C/average.h b/Code-C/include/average.h similarity index 100% rename from Code-C/average.h rename to Code-C/include/average.h diff --git a/Code-C/b2hd.h b/Code-C/include/b2hd.h similarity index 100% rename from Code-C/b2hd.h rename to Code-C/include/b2hd.h diff --git a/Code-C/fileGestion.h b/Code-C/include/fileGestion.h similarity index 100% rename from Code-C/fileGestion.h rename to Code-C/include/fileGestion.h diff --git a/Code-C/getArray.h b/Code-C/include/getArray.h similarity index 100% rename from Code-C/getArray.h rename to Code-C/include/getArray.h diff --git a/Code-C/growthRate.h b/Code-C/include/growthRate.h similarity index 100% rename from Code-C/growthRate.h rename to Code-C/include/growthRate.h diff --git a/Code-C/initialParameters.h b/Code-C/include/initialParameters.h similarity index 100% rename from Code-C/initialParameters.h rename to Code-C/include/initialParameters.h diff --git a/Code-C/power.h b/Code-C/include/power.h similarity index 100% rename from Code-C/power.h rename to Code-C/include/power.h diff --git a/Code-C/queue.h b/Code-C/include/queue.h similarity index 100% rename from Code-C/queue.h rename to Code-C/include/queue.h diff --git a/Code-C/simulateFlux.h b/Code-C/include/simulateFlux.h similarity index 100% rename from Code-C/simulateFlux.h rename to Code-C/include/simulateFlux.h diff --git a/Code-C/main.c b/Code-C/main.c index 6ee1fb8..77e17c5 100644 --- a/Code-C/main.c +++ b/Code-C/main.c @@ -1,15 +1,16 @@ #include #include -#include "simulateFlux.h" -#include "power.h" -#include "initialParameters.h" -#include "queue.h" -#include "average.h" -#include "growthRate.h" -#include "getArray.h" + +#include "include/simulateFlux.h" +#include "include/power.h" +#include "include/initialParameters.h" +#include "include/queue.h" +#include "include/average.h" +#include "include/growthRate.h" +#include "include/getArray.h" bool rawDataWriteFlag; -int nRowRawData = 500; +int nRowRawData = 5000; int nRowGR = 150; int nCol = 1; double freqEch = 250; @@ -19,7 +20,7 @@ int nbRowIgnore = 19; Pqueue firstRawDataQueue; // Captor 1 2 3 4 5 6 7 8 -bool selectionCaptors[] = {true, false, true, false, false, false, true, false}; +bool selectionCaptors[] = {true, false, false, false, false, false, true, false}; int cptData = 0; int cptFile = 1; @@ -56,6 +57,7 @@ void *threadCalculAverage(void *vargp) { rawDataQueue = queueGetNextE(rawDataQueue); fileName = queueGetTabChar(rawDataQueue); + printf("%s\n", fileName); averageFunction(fileName, NULL); remove(fileName); } @@ -142,6 +144,7 @@ int main(int argc, char **argv) nCol++; } } + printf("%d", nCol); rawDataWriteFlag = true; @@ -156,12 +159,12 @@ int main(int argc, char **argv) exit(1); } - // pthread_t calculAverage; - // if (pthread_create(&calculAverage, NULL, threadCalculAverage, "threadCalculAverage")) - // { - // perror("threadCalculAverage() error"); - // exit(1); - // } + pthread_t calculAverage; + if (pthread_create(&calculAverage, NULL, threadCalculAverage, "threadCalculAverage")) + { + perror("threadCalculAverage() error"); + exit(1); + } // pthread_t calculGrowthRate; // if (pthread_create(&calculGrowthRate, NULL, threadCalculGrowthRate, "threadCalculGrowthRate")) diff --git a/Code-C/power.c b/Code-C/power.c index 596110f..87ae6a3 100644 --- a/Code-C/power.c +++ b/Code-C/power.c @@ -1,9 +1,10 @@ #include -#include "power.h" -#include "getArray.h" -#include "fileGestion.h" -#include "initialParameters.h" -#include "queue.h" + +#include "include/power.h" +#include "include/getArray.h" +#include "include/fileGestion.h" +#include "include/initialParameters.h" +#include "include/queue.h" /** * @brief realize the powerThreadFunction calcul diff --git a/Code-C/queue.c b/Code-C/queue.c index 72e5f7c..b311c39 100644 --- a/Code-C/queue.c +++ b/Code-C/queue.c @@ -3,7 +3,8 @@ #include #include #include -#include "queue.h" + +#include "include/queue.h" /** * @brief struct queue struct used for queueing string name diff --git a/Code-C/simulateFlux.c b/Code-C/simulateFlux.c index fbe6337..dd5cef2 100644 --- a/Code-C/simulateFlux.c +++ b/Code-C/simulateFlux.c @@ -1,6 +1,6 @@ -#include "simulateFlux.h" -#include "initialParameters.h" -#include "queue.h" +#include "include/simulateFlux.h" +#include "include/initialParameters.h" +#include "include/queue.h" #include #include