From e01d5b553b6978720cdd5cf2a364863f6096bb44 Mon Sep 17 00:00:00 2001 From: "theo.canaud" Date: Tue, 14 Jun 2022 14:43:43 +0200 Subject: [PATCH 1/2] Limites du graphique retirer --- Py-Script/courbe.py | 107 ++++++++++++-------------------------------- 1 file changed, 29 insertions(+), 78 deletions(-) diff --git a/Py-Script/courbe.py b/Py-Script/courbe.py index 392ff7d..9999f91 100644 --- a/Py-Script/courbe.py +++ b/Py-Script/courbe.py @@ -10,24 +10,24 @@ import sys # -*- coding: UTF-8 -*- csv_reader1 = csv.reader(open('./RawDataFiles/RawData1.csv')) #Ouvre le fichier .csv -bigx = float(-sys.maxsize-1) -bigy = float(-sys.maxsize-1) -smallx = float(sys.maxsize) -smally = float(sys.maxsize) +# bigx = float(-sys.maxsize-1) +# bigy = float(-sys.maxsize-1) +# smallx = float(sys.maxsize) +# smally = float(sys.maxsize) capteurs = [] -for ligne in csv_reader1: - capteurs.append(ligne) - if float(ligne[0]) > bigx: - bigx = float(ligne[0]) - if float(ligne[1]) > bigy: - bigy = float(ligne[1]) - if float(ligne[0]) < smallx: - smallx = float(ligne[0]) - if float(ligne[1]) < smally: - smally = float(ligne[1]) +# for ligne in csv_reader1: +# capteurs.append(ligne) +# if float(ligne[0]) > bigx: +# bigx = float(ligne[0]) +# if float(ligne[1]) > bigy: +# bigy = float(ligne[1]) +# if float(ligne[0]) < smallx: +# smallx = float(ligne[0]) +# if float(ligne[1]) < smally: +# smally = float(ligne[1]) -capteurs.sort() +# capteurs.sort() x_arr = [] y_arr = [] @@ -36,69 +36,20 @@ for capteur in capteurs: y_arr.append(capteur[1]) fig1 = plt.figure(1, figsize = (5.91, 2.758)) -fig2 = plt.figure(1, figsize = (5.91, 2.758)) -fig3 = plt.figure(1, figsize = (5.91, 2.758)) -fig4 = plt.figure(1, figsize = (5.91, 2.758)) -fig5 = plt.figure(1, figsize = (5.91, 2.758)) -fig6 = plt.figure(1, figsize = (5.91, 2.758)) -fig7 = plt.figure(1, figsize = (5.91, 2.758)) -fig8 = plt.figure(1, figsize = (5.91, 2.758)) -fig9 = plt.figure(1, figsize = (5.91, 2.758)) -fig10 = plt.figure(1, figsize = (5.91, 2.758)) +ax1 = plt.axes() +# fig2 = plt.figure(1, figsize = (5.91, 2.758)) +# fig3 = plt.figure(1, figsize = (5.91, 2.758)) +# fig4 = plt.figure(1, figsize = (5.91, 2.758)) +# fig5 = plt.figure(1, figsize = (5.91, 2.758)) +# fig6 = plt.figure(1, figsize = (5.91, 2.758)) +# fig7 = plt.figure(1, figsize = (5.91, 2.758)) +# fig8 = plt.figure(1, figsize = (5.91, 2.758)) +# fig9 = plt.figure(1, figsize = (5.91, 2.758)) +# fig10 = plt.figure(1, figsize = (5.91, 2.758)) -fig1.xlabel('Temps') -fig1.ylabel('Tension') -fig1.title("Données tableau 1") -fig1.plot(x_arr, y_arr, 'r') - -#fig, (ax1) = plt.subplots(2, 1) - -# Fe = 250000 #Fréquence d'échantillonage -# tstep = 1 / Fe -# y = capteur[:][0] -# y2 = capteur[:][0] -# N = len(y) -# t = np.linspace(0, (N-1) * tstep, N) - -#Légende des plot 1, 2, 3, 4, 5, 6, 7 et 8 -# ax1.set_xlabel('Temps') -# ax1.set_ylabel('Tension') -# ax1.set_title("Données du premier capteur") -# ax1.plot(t, y) - -# ax2.set_xlabel('Temps') -# ax2.set_ylabel('Tension') -# ax2.set_title("Données du deuxième capteur") -# ax2.plot(t, y2) - -# ax3.set_xlabel('Temps') -# ax3.set_ylabel('Tension') -# ax3.set_title("Données du troisième capteur") -# ax3.plot(t, y3) - -# ax4.set_xlabel('Temps') -# ax4.set_ylabel('Tension') -# ax4.set_title("Données du quatrième capteur") -# ax4.plot(t, y4) - -# ax5.set_xlabel('Temps') -# ax5.set_ylabel('Tension') -# ax5.set_title("Données du cinquième capteur") -# ax5.plot(t, y5) - -# ax6.set_xlabel('Temps') -# ax6.set_ylabel('Tension') -# ax6.set_title("Données du sixième capteur") -# ax6.plot(t, y6) - -# ax7.set_xlabel('Temps') -# ax7.set_ylabel('Tension') -# ax7.set_title("Données du septième capteur") -# ax7.plot(t, y7) - -# ax8.set_xlabel('Temps') -# ax8.set_ylabel('Tension') -# ax8.set_title("Données du huitième capteur") -# ax8.plot(t, y8) +ax1.set_xlabel('Temps') +ax1.set_ylabel('Tension') +ax1.title("Données tableau 1") +ax1.plot(x_arr, y_arr, color = 'r') plt.show() #Affiche le tableau à l'écran \ No newline at end of file From 7cc7533214ff941d2d2123906f939bd01dd67884 Mon Sep 17 00:00:00 2001 From: "theo.canaud" Date: Wed, 15 Jun 2022 16:25:43 +0200 Subject: [PATCH 2/2] RawDataFiles changed, start of tab --- Code-C/main | Bin 24800 -> 24800 bytes Code-C/main.c | 2 +- Py-Script/courbe.py | 55 +++++++++++++++----------------------------- 3 files changed, 19 insertions(+), 38 deletions(-) diff --git a/Code-C/main b/Code-C/main index 69213d78d46a50620a794cc57b661390d41c589d..7269e1e7afd384107a9fe5921b953103e9120832 100755 GIT binary patch delta 1674 zcmZ9Me@t6d6vyvv`}m=-N1^y=W>>a>Fvgq&%}|5d5XY^cvWuf^1Hdu|KdOM^tw*}uokuC$nsxl zjH%&7FkIo7wl;Y@fxih0Ykd496uGOp1}EH^yk8q~cg45;dRPrTyrc%tN6-GQ>uM0^ zv|hbvtmhWwBx!3l)(qXV1zjjLoP}dz2aYJ6Ym~D`8&&zKk>Ho2ifvxkL#a)Mq>dye zx%eB_quO4v*Ri2MN1Hq#T|n8lu`V{d0)tOnmO2|KWbbpBnYf{iN%ScgpUgV#Pc=O2dWn zdYn{ygO@yhZ}7UO$`f4itKm%y!D4TMb~2i?OINX1U^gB2Y0<-wV(Y{*I$ZZ z?9h^~ccK4I3+F46tH&t2D(PiQQDThcorGBI!R;7Zv@x~`A_Z-8>1}i+|>qVZU0;_duUovMHIZVvX1dVPBb!?Xfau zXHGU+VFqwN!C*O_z9umr=SJL0b@P}-Iz5&SmleBS#BWg8i>70lP>=L}qTjmAa1&A0sPMQk zwn7AzM@aeL8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Hg*WLUM?UJlDXUde7cq8g&R+C&?xY+c~o-I&ZNP$U2BhVgkngEV~5rnERc`EyKga zY=}GZGterx!?#Clg}ZH4q*%g%-LxfD%!BqSg*sumTA_t-7UMFUMxpg=RogL(b-AN} z7kf<9JOOu5dCF1_gBNo@vEnb;3Zd$hd^S1R97<#@!eF%${9V*s+ri;B!LAE@#mRx| z0+%G-LxqO}Ck5_cJ*ztfdoHQNGH}!=>f^{dY%Y?P)JX&Qk$r}-_>D*jFNqCUb`pA! zePy#U4#KRLJ8}j_Ym~k33bs_?aGPL16?m+O1FZu8%6h{KY<;`d1tqmEbwfy_d0f*a zq}QOmR#6EaTXqEIMC*7|EpxzGWL1lGk)uhU(+g9zN`J9nD+KEixd#wupOc8@z7Tk& z(EF0AX+j^|&4t$e!LUW(9eCZD{lFdR;JA|<@^Pe25M9tvr>OlR?IOE#XwP#;bQr8t z=zB~<$6yTC87uzLT7P3}!CjI2buLf3B673w_s9u;TQ2p2zh04waqqGA0qCh$)Mm!x z$bI-r!K{>W-wmV44hnX8D@Pl-BT<+~_I+g8o$(~SmJfi26!o&mZ5013M@8-&>V)58Q(Ttvq8wV#TaR6vt!e=^`Z35E9)~JZ4KCI S0tVY2NpC#N3#I}+;{FfgLz`d# diff --git a/Code-C/main.c b/Code-C/main.c index 9957208..967b025 100644 --- a/Code-C/main.c +++ b/Code-C/main.c @@ -57,7 +57,7 @@ void *threadCalculBoth(void *vargp){ fileName = queueGetTabChar(rawDataQueue); power(fileName,nRow,nCol,period,invTimeBandWidth); average(fileName,nRow,nCol); - remove(fileName); + //remove(fileName); } } } diff --git a/Py-Script/courbe.py b/Py-Script/courbe.py index 9999f91..eea86a1 100644 --- a/Py-Script/courbe.py +++ b/Py-Script/courbe.py @@ -3,53 +3,34 @@ import numpy as np import matplotlib.pyplot as plt import struct import csv -import sys #"C:\Users\quent\OneDrive\Bureau\ENSC\TransD\Framboisier\02400001.TXT" #! /usr/bin/env python3 # -*- coding: UTF-8 -*- -csv_reader1 = csv.reader(open('./RawDataFiles/RawData1.csv')) #Ouvre le fichier .csv -# bigx = float(-sys.maxsize-1) -# bigy = float(-sys.maxsize-1) -# smallx = float(sys.maxsize) -# smally = float(sys.maxsize) +csv_reader1 = csv.reader(open('../RawDataFiles/RawData1.csv')) #Ouvre le fichier .csv capteurs = [] -# for ligne in csv_reader1: -# capteurs.append(ligne) -# if float(ligne[0]) > bigx: -# bigx = float(ligne[0]) -# if float(ligne[1]) > bigy: -# bigy = float(ligne[1]) -# if float(ligne[0]) < smallx: -# smallx = float(ligne[0]) -# if float(ligne[1]) < smally: -# smally = float(ligne[1]) +for ligne in csv_reader1: + capteurs.append(ligne) -# capteurs.sort() -x_arr = [] -y_arr = [] +x = [] +y = [] for capteur in capteurs: - x_arr.append(capteur[0]) - y_arr.append(capteur[1]) + x.append(capteur[0]) + y.append(capteur[1]) -fig1 = plt.figure(1, figsize = (5.91, 2.758)) -ax1 = plt.axes() -# fig2 = plt.figure(1, figsize = (5.91, 2.758)) -# fig3 = plt.figure(1, figsize = (5.91, 2.758)) -# fig4 = plt.figure(1, figsize = (5.91, 2.758)) -# fig5 = plt.figure(1, figsize = (5.91, 2.758)) -# fig6 = plt.figure(1, figsize = (5.91, 2.758)) -# fig7 = plt.figure(1, figsize = (5.91, 2.758)) -# fig8 = plt.figure(1, figsize = (5.91, 2.758)) -# fig9 = plt.figure(1, figsize = (5.91, 2.758)) -# fig10 = plt.figure(1, figsize = (5.91, 2.758)) +# fig1, (ax1, ax2) = plt.subplots(2, 1) +# fig1 = plt.figure(1, figsize = (5.91, 2.758)) +# ax1 = fig1 -ax1.set_xlabel('Temps') -ax1.set_ylabel('Tension') -ax1.title("Données tableau 1") -ax1.plot(x_arr, y_arr, color = 'r') +np.empty([8, 500]) +np.array([[]]) -plt.show() #Affiche le tableau à l'écran \ No newline at end of file +plt.xlabel('Temps') +plt.ylabel('Tension') +plt.title("Données tableau 1") +plt.plot(x, y, color = 'r') + +plt.show() #Affichage du plot \ No newline at end of file