Last change
on this file since 762 was
762,
checked in by moutardier, 6 years ago
|
Code written by Alexandre Moutardier
|
File size:
1.1 KB
|
Line | |
---|
1 | __author__ = 'delerue' |
---|
2 | |
---|
3 | from PIL import Image |
---|
4 | import subprocess |
---|
5 | import time |
---|
6 | import urllib |
---|
7 | from datetime import datetime |
---|
8 | #from sparc_constants import * |
---|
9 | from writeclient import writeclient |
---|
10 | |
---|
11 | global SCOPE_IP |
---|
12 | SCOPE_IP = '10.0.1.112' |
---|
13 | scope_image_url="http://"+SCOPE_IP+"/crt_print.png" |
---|
14 | |
---|
15 | def read_image(image_name_and_path): |
---|
16 | p = subprocess.Popen(["display",image_name_and_path]) |
---|
17 | print "tic" |
---|
18 | time.sleep(10) |
---|
19 | print "toc" |
---|
20 | p.kill() |
---|
21 | |
---|
22 | |
---|
23 | def read_images_from_scope(nimages): |
---|
24 | iimage=1 |
---|
25 | subproc=0 |
---|
26 | start_time_str=datetime.now().strftime("%Y%m%d_%H%M%S") |
---|
27 | for iimage in range(nimages): |
---|
28 | image_name_and_path=data_dir+"scope_image_"+start_time_str+"_"+str(iimage)+".png" |
---|
29 | urllib.urlretrieve(scope_image_url,image_name_and_path) |
---|
30 | if (subproc !=0): |
---|
31 | subproc.kill() |
---|
32 | subproc = subprocess.Popen(["display",image_name_and_path]) |
---|
33 | time.sleep(2) |
---|
34 | time.sleep(10) |
---|
35 | if (subproc !=0): |
---|
36 | subproc.kill() |
---|
37 | |
---|
38 | |
---|
39 | def scpi_command(command): |
---|
40 | reply=writeclient(SCOPE_IP,5025,command+chr(10),1) |
---|
41 | print "SCPI: ",command," => ", reply |
---|
Note: See
TracBrowser
for help on using the repository browser.