sql integration for create and insert captor metadata and trials ok
This commit is contained in:
parent
ab1a87c6ac
commit
cb0e33c175
|
@ -1,9 +1,10 @@
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 2.8)
|
cmake_minimum_required(VERSION 2.8)
|
||||||
project(Traitement-signal-plantes C)
|
project(Traitement-signal-plantes C)
|
||||||
|
|
||||||
include(CTest)
|
include(CTest)
|
||||||
enable_testing()
|
enable_testing()
|
||||||
set(CMAKE_C_FLAGS "-lsqlite3 -std=c99 -g -Wall") #what are the flag for ?
|
set(CMAKE_C_FLAGS "-std=c99 -g -Wall") #what are the flag for ?
|
||||||
|
|
||||||
file(MAKE_DIRECTORY RawDataFiles) #why do we make this folder each time ?
|
file(MAKE_DIRECTORY RawDataFiles) #why do we make this folder each time ?
|
||||||
file(MAKE_DIRECTORY Executable)
|
file(MAKE_DIRECTORY Executable)
|
||||||
|
@ -13,7 +14,7 @@ set (CMAKE_RUNTIME_OUTPUT_DIRECTORY Executable) #Set Executable directory as def
|
||||||
add_executable(exect fileGestion.c getArray.c average.c growthRate.c power.c queue.c simulateFlux.c database.c main.c)
|
add_executable(exect fileGestion.c getArray.c average.c growthRate.c power.c queue.c simulateFlux.c database.c main.c)
|
||||||
# add_executable(exect main.c simulateFlux.c queue.c power.c growthRate.c average.c getArray.c fileGestion.c)
|
# add_executable(exect main.c simulateFlux.c queue.c power.c growthRate.c average.c getArray.c fileGestion.c)
|
||||||
|
|
||||||
find_package(SQLite3)
|
find_package(SQLite3 REQUIRED)
|
||||||
target_link_libraries(exect ${SQLite3_LIBRARIES} m)
|
target_link_libraries(exect ${SQLite3_LIBRARIES} m)
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,6 +25,7 @@ set(CTEST_MEMORYCHECK_TYPE "AddressSanitizer")
|
||||||
set(CTEST_MEMORYCHECK_SANITIZER_OPTIONS "verbosity=1:symbolize=1:abort_on_error=1:detect_leaks=1")
|
set(CTEST_MEMORYCHECK_SANITIZER_OPTIONS "verbosity=1:symbolize=1:abort_on_error=1:detect_leaks=1")
|
||||||
|
|
||||||
add_executable(ctest fileGestion.c getArray.c average.c growthRate.c queue.c simulateFlux.c database.c ctest.c)
|
add_executable(ctest fileGestion.c getArray.c average.c growthRate.c queue.c simulateFlux.c database.c ctest.c)
|
||||||
|
target_link_libraries(ctest ${SQLite3_LIBRARIES} m)
|
||||||
target_link_libraries(ctest ${CMAKE_THREAD_LIBS_INIT} m)
|
target_link_libraries(ctest ${CMAKE_THREAD_LIBS_INIT} m)
|
||||||
|
|
||||||
add_test(test_queueCreateEmpty ./ctest queueCreateEmpty)
|
add_test(test_queueCreateEmpty ./ctest queueCreateEmpty)
|
||||||
|
|
|
@ -240,7 +240,7 @@ int initiaizeNewTrial(char *position, double frequency, bool *captorOneHot)
|
||||||
{
|
{
|
||||||
if (captorOneHot[i])
|
if (captorOneHot[i])
|
||||||
{
|
{
|
||||||
insertCaptorMetadataElement(i, trialId);
|
insertCaptorMetadataElement(i + 1, trialId);
|
||||||
createCaptorDataTable(trialId, i + 1);
|
createCaptorDataTable(trialId, i + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
BIN
Code-C/main
BIN
Code-C/main
Binary file not shown.
|
@ -148,14 +148,6 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
printf("%d", nCol);
|
printf("%d", nCol);
|
||||||
|
|
||||||
for (int i = 0; i < 8; i++)
|
|
||||||
{
|
|
||||||
if (selectionCaptors[i])
|
|
||||||
{
|
|
||||||
nCol++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rawDataWriteFlag = true;
|
rawDataWriteFlag = true;
|
||||||
|
|
||||||
period = 1 / freqEch;
|
period = 1 / freqEch;
|
||||||
|
@ -167,19 +159,19 @@ int main(int argc, char **argv)
|
||||||
createDb(); // Created the Db if not exist
|
createDb(); // Created the Db if not exist
|
||||||
initiaizeNewTrial("test", freqEch, selectionCaptors); // Initialize Trials data and tables
|
initiaizeNewTrial("test", freqEch, selectionCaptors); // Initialize Trials data and tables
|
||||||
|
|
||||||
pthread_t rawData;
|
// pthread_t rawData;
|
||||||
if (pthread_create(&rawData, NULL, threadSimulateFlux, "threadSimulflux") != 0)
|
// if (pthread_create(&rawData, NULL, threadSimulateFlux, "threadSimulflux") != 0)
|
||||||
{
|
// {
|
||||||
perror("threadSimulflux() error");
|
// perror("threadSimulflux() error");
|
||||||
exit(1);
|
// exit(1);
|
||||||
}
|
// }
|
||||||
|
|
||||||
pthread_t calculAverage;
|
// pthread_t calculAverage;
|
||||||
if (pthread_create(&calculAverage, NULL, threadCalculAverage, "threadCalculAverage"))
|
// if (pthread_create(&calculAverage, NULL, threadCalculAverage, "threadCalculAverage"))
|
||||||
{
|
// {
|
||||||
perror("threadCalculAverage() error");
|
// perror("threadCalculAverage() error");
|
||||||
exit(1);
|
// exit(1);
|
||||||
}
|
// }
|
||||||
|
|
||||||
// pthread_t calculGrowthRate;
|
// pthread_t calculGrowthRate;
|
||||||
// if (pthread_create(&calculGrowthRate, NULL, threadCalculGrowthRate, "threadCalculGrowthRate"))
|
// if (pthread_create(&calculGrowthRate, NULL, threadCalculGrowthRate, "threadCalculGrowthRate"))
|
||||||
|
@ -188,7 +180,7 @@ int main(int argc, char **argv)
|
||||||
// exit(1);
|
// exit(1);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
pthread_exit(NULL);
|
// pthread_exit(NULL);
|
||||||
|
|
||||||
sqlite3_shutdown();
|
sqlite3_shutdown();
|
||||||
}
|
}
|
BIN
Code-C/robotgowest.db
Normal file
BIN
Code-C/robotgowest.db
Normal file
Binary file not shown.
Loading…
Reference in a new issue