Le changement du fichier de donné pour le tracé Gnuplot est fonctionnel

This commit is contained in:
Guyot 2020-04-21 23:41:21 +02:00
parent 041a5ed412
commit 548ff3c522
6 changed files with 56 additions and 11 deletions

View File

@ -12,5 +12,5 @@ set x2tics format "%Y"
set xtics nomirror
set datafile separator '|'
plot 'data.csv' using 3:1 pt '.' title ''
plot 'data2.csv' using 3:1 pt '.' title ''
#pause -1 'En attente de RETURN'

16
Fonctionnel_back.txt Normal file
View File

@ -0,0 +1,16 @@
#set term dumb 50 20
set term dumb #nofeed
set title 'Courbe de poids'
set timefmt "%Y-%m-%d %H:%M:%S"
set xdata time
set xmtics
set xlabel "Mois"
#set xtics format "%Y-%d-%m"
set x2data time
set x2label "Années"
set x2tics format "%Y"
set xtics nomirror
set datafile separator '|'
plot 'data.csv' using 3:1 pt '.' title ''
#pause -1 'En attente de RETURN'

View File

@ -1,3 +1,5 @@
6|WEIGHT|2020-04-15 11:16:58|True| |6e test|
7|WEIGHT|2020-04-15 11:18:06|True| |7e test|
6|WEIGHT|2020-02-15 11:16:58|True| |6e test|
7|WEIGHT|2020-03-15 11:18:06|True| |7e test|
13.0|WEIGHT|2020-04-20 17:39:31|true||8e test|
15.0|WEIGHT|2020-06-21 22:34:56|true|| |
16.0|WEIGHT|2020-08-21 22:35:00|true|| |

1 6 WEIGHT 2020-04-15 11:16:58 2020-02-15 11:16:58 True 6e test
2 7 WEIGHT 2020-04-15 11:18:06 2020-03-15 11:18:06 True 7e test
3 13.0 WEIGHT 2020-04-20 17:39:31 2020-04-20 17:39:31 true 8e test
4 15.0 WEIGHT 2020-06-21 22:34:56 true
5 16.0 WEIGHT 2020-08-21 22:35:00 true

View File

@ -1,6 +1,15 @@
6|WEIGHT|2020-04-15 11:16:58
7|WEIGHT|2020-04-15 11:18:06
8|WEIGHT|2020-04-15 11:26:06
9|WEIGHT|2020-04-15 11:27:45
10|WEIGHT|2020-04-15 11:39:12
10.1|WEIGHT|2020-04-15 15:22:22
#set term dumb 50 20
set term dumb #nofeed
set title 'Courbe de poids'
set timefmt "%Y-%m-%d %H:%M:%S"
set xdata time
set xmtics
set xlabel "Mois"
#set xtics format "%Y-%d-%m"
set x2data time
set x2label "Années"
set x2tics format "%Y"
set xtics nomirror
set datafile separator '|'
plot 'data3.csv' using 3:1 pt '.' title ''#pause -1 'En attente de RETURN'

Can't render this file because it contains an unexpected character in line 4 and column 13.

View File

@ -1 +1 @@
2 13.0|WEIGHT|2020-04-20 17:39:31|true||8e test|
3 14.0|WEIGHT|2020-04-21 22:34:40|true|| |

View File

@ -50,6 +50,22 @@ Une mesure est caractérisée par :
- autre
"""
def save_file_data():
f = open("Fonctionnel.txt", "r")
contents = f.readlines()
f.close()
linenum = 0
for row in contents:
if row.split(' ',1)[0] == 'plot':
contents.insert(linenum, "plot '"+args.data+"' using 3:1 pt '.' title ''\n")
del(contents[linenum+1])
linenum += 1
f = open("Fonctionnel.txt", "w")
contents = "".join(contents)
f.write(contents)
f.close()
def save_mesure():
""" Affichage et enregistrement d'une mesure """
print("Votre mesure a été enregistrée : ")
@ -113,7 +129,7 @@ def undo_remove():
g = open('remove.txt', 'r')
store_temp = g.readline().split(' ',1)
g.close()
# insert the line item from list, by line number, starts from 0
# insert the line item from list, by its line number
contents.insert(int(store_temp[0]), store_temp[1])
f = open(args.data, "w")
@ -208,6 +224,8 @@ parser.add_argument('-v', '--version',
# Récupération des arguments
args = parser.parse_args()
# Lancement des actions
if args.data != -1:
save_file_data()
if args.weight != -1:
save_mesure()
if args.read: