Last change
on this file since 770 was
770,
checked in by moutardier, 6 years ago
|
modification de motor controler pour afficher des graphiques (ne fonctionne pas)
|
File size:
1.5 KB
|
Line | |
---|
1 | import time |
---|
2 | import urllib |
---|
3 | import os |
---|
4 | from initialise_motors import * |
---|
5 | from scope_function import * |
---|
6 | import matplotlib.pyplot as plt |
---|
7 | |
---|
8 | # moteur 1 -> horizontal |
---|
9 | # moteur 2 -> verticale |
---|
10 | |
---|
11 | #motor_enable(1) |
---|
12 | |
---|
13 | #controller_hello() |
---|
14 | #move_motor_relative(1,1000,-1000) |
---|
15 | #time.sleep(1) |
---|
16 | #move_motor_relative(1,1000,1000) |
---|
17 | |
---|
18 | #urllib.urlretrieve('http://10.0.1.112/crt_print.png','../oscillo_17-05-2018_voltage5V_freq1MHz_signal_carre/test2.png') |
---|
19 | |
---|
20 | #if not os.path.exists(repertoire): |
---|
21 | #os.makedirs('./test') cree repertoir |
---|
22 | |
---|
23 | #position_test_horizontal() |
---|
24 | |
---|
25 | |
---|
26 | # creation graphique |
---|
27 | |
---|
28 | A = loadtxt('donnees.dat') |
---|
29 | X = [] |
---|
30 | Y1 = [] |
---|
31 | Y2 = [] |
---|
32 | Y3 = [] |
---|
33 | Y4 = [] |
---|
34 | |
---|
35 | for i in range(A): |
---|
36 | if (i%5) == 0: |
---|
37 | X.append(A[i]) |
---|
38 | elif (i%5) == 1: |
---|
39 | Y1.append(A[i]) |
---|
40 | elif (i%5) == 2: |
---|
41 | Y2.append(A[i]) |
---|
42 | elif (i%5) == 3: |
---|
43 | Y3.append(A[i]) |
---|
44 | else: |
---|
45 | Y4.append(A[i]) |
---|
46 | |
---|
47 | plt.plot(X,Y1) |
---|
48 | plt.show() |
---|
49 | |
---|
50 | |
---|
51 | """ |
---|
52 | turn_on() |
---|
53 | fichier = open("24-05-2018_aquisition_from_0_to_400000_step_of_1000.txt", "w") |
---|
54 | horizontal_aquisition(0,400000,1000,fichier) |
---|
55 | fichier.close() |
---|
56 | turn_off() |
---|
57 | """ |
---|
58 | |
---|
59 | |
---|
60 | """ |
---|
61 | for i in range(3): |
---|
62 | move_motor_absolute(1,5000,i*10000) |
---|
63 | while motor_get(1, 'status') != 'READY': |
---|
64 | time.sleep(1) |
---|
65 | time.sleep(1) |
---|
66 | urllib.urlretrieve('http://10.0.1.112/crt_print.png','../oscillo_17-05-2018_voltage5V_freq1MHz_signal_carre/position_'+str(i*10000)+'.png') |
---|
67 | time.sleep(1) |
---|
68 | |
---|
69 | |
---|
70 | move_motor_absolute(1,5000,0) |
---|
71 | while motor_get(1, 'status') != 'READY': |
---|
72 | time.sleep(1) |
---|
73 | time.sleep(1) |
---|
74 | motor_disable(1) |
---|
75 | |
---|
76 | |
---|
77 | """ |
---|
78 | #motor_enable(2) |
---|
79 | |
---|
80 | #motor_disable(2) #commande dangeureuse |
---|
81 | |
---|
82 | |
---|
83 | |
---|
84 | |
---|
85 | |
---|
86 | |
---|
87 | |
---|
88 | |
---|
89 | |
---|
90 | |
---|
91 | |
---|
92 | |
---|
93 | |
---|
94 | |
---|
95 | |
---|
96 | |
---|
Note: See
TracBrowser
for help on using the repository browser.