Browse Source

Deprecate 'PIL' and use 'pillow' instead of 'PIL'.

On a clean Python 2.7.12, 'pillow' must be installed manually.

IMPORTANT !
If you previously had 'PIL' installed, then 'PIL' must be uninstalled.
Install 'pillow' only after uninstalling 'PIL'.
RoGeorge 7 years ago
parent
commit
f025bca67e
3 changed files with 45 additions and 45 deletions
  1. 4
    4
      OscScreenGrabLAN.py
  2. 37
    37
      README.md
  3. 4
    4
      Rigol_functions.py

+ 4
- 4
OscScreenGrabLAN.py View File

18
 from telnetlib_receive_all import Telnet
18
 from telnetlib_receive_all import Telnet
19
 from Rigol_functions import *
19
 from Rigol_functions import *
20
 import time
20
 import time
21
-import Image
21
+from PIL import Image
22
 import StringIO
22
 import StringIO
23
 import sys
23
 import sys
24
 import os
24
 import os
177
 
177
 
178
         # Set WAVE parameters
178
         # Set WAVE parameters
179
         tn.write("waveform:source " + channel)
179
         tn.write("waveform:source " + channel)
180
-        time.sleep(0.2)
180
+        time.sleep(1)
181
 
181
 
182
         tn.write("waveform:form asc")
182
         tn.write("waveform:form asc")
183
-        time.sleep(0.2)
183
+        time.sleep(1)
184
 
184
 
185
         # Maximum - only displayed data when osc. in RUN mode, or full memory data when STOPed
185
         # Maximum - only displayed data when osc. in RUN mode, or full memory data when STOPed
186
         tn.write("waveform:mode max")
186
         tn.write("waveform:mode max")
187
-        time.sleep(0.2)
187
+        time.sleep(1)
188
 
188
 
189
         # Get all possible data
189
         # Get all possible data
190
         buff = ""
190
         buff = ""

+ 37
- 37
README.md View File

12
 no IVI (Interchangeable Virtual Instrument) and no Rigol drivers are required.
12
 no IVI (Interchangeable Virtual Instrument) and no Rigol drivers are required.
13
 Python 2 is required. Python 3 is not supported.
13
 Python 2 is required. Python 3 is not supported.
14
 
14
 
15
-Tested with Windows 7, Python 2.7.9 and Rigol DS1104Z (a fully upgraded DS1054Z oscilloscope).
16
-
17
-Tested in a VMware machine with Linux Debian 7.7.0, Python 2.7.3 and PIL.
15
+Tested with Windows 10, Python 2.7.12, pillow and Rigol DS1104Z (a fully upgraded DS1054Z oscilloscope).
16
+Tested with Linux Ubuntu 16.04.1, Python 2.7.12 and pillow.
18
 
17
 
19
 
18
 
20
 User Manual:
19
 User Manual:
21
 -----------
20
 -----------
22
-Usage:
23
-
24
-    python OscScreenGrabLAN.py png|bmp|csv [oscilloscope_IP [save_path]]
25
-
26
-Usage examples:
27
-
28
-    python OscScreenGrabLAN.py png
29
-    python OscScreenGrabLAN.py csv 192.168.1.3
30
-
31
-The following usage case is not yet implemented:
32
-
33
-    python OscScreenGrabLAN.py bmp 192.168.1.3 my_place_for_captures
34
-
35
 This program captures either the waveform or the whole screen
21
 This program captures either the waveform or the whole screen
36
     of a Rigol DS1000Z series oscilloscope, then save it on the computer
22
     of a Rigol DS1000Z series oscilloscope, then save it on the computer
37
     as a CSV, PNG or BMP file with a timestamp in the file name.
23
     as a CSV, PNG or BMP file with a timestamp in the file name.
41
     USB and/or GPIB connections are not used by this software.
27
     USB and/or GPIB connections are not used by this software.
42
 
28
 
43
     No VISA, IVI or Rigol drivers are needed.
29
     No VISA, IVI or Rigol drivers are needed.
30
+	
31
+Installation:
32
+
33
+    Installation on a clean Windows 10 machine
34
+	    1. download and install Python 2.7.12 from https://www.python.org/downloads/
35
+		2. to install pillow, open a Command Prompt and type
36
+		    pip install pillow
37
+		3. download and unzip 'DS1054Z_screen_capture-master.zip' from https://github.com/RoGeorge/DS1054Z_screen_capture
38
+		4. connect the oscilloscope to the LAN (in this example, the oscilloscope have fix IP=192.168.1.3)
39
+		5. in the Command Prompt, change the directory (CD) to the path were 'OscScreenGrabLAN.py' was un-zipped
40
+		    cd path_where_the_OscScreenGrabLAN.py_was_unzipped
41
+		6. to run the OscScreenGrabLAN.py in the Command Prompt, type
42
+		    python OscScreenGrabLAN.py png 192.168.1.3
43
+			
44
+	Installation on a clean Ubuntu 16.04.1
45
+	    1. Python is already installed in Ubuntu 16.04.1 desktop
46
+	    2. to install pillow, open a Terminal and type:
47
+		    sudo add-apt-repository universe
48
+			sudo apt-get update
49
+			sudo apt-get install python-pip
50
+			pip install pillow
51
+		3. download and unzip 'DS1054Z_screen_capture-master.zip' from https://github.com/RoGeorge/DS1054Z_screen_capture
52
+		4. connect the oscilloscope to the LAN (in this example, the oscilloscope have fix IP=192.168.1.3)
53
+		5. in the Terminal, change the directory (CD) to the path were 'OscScreenGrabLAN.py' was un-zipped
54
+		    cd path_where_the_OscScreenGrabLAN.py_was_unzipped
55
+		6. to run the OscScreenGrabLAN.py in the Terminal, type
56
+		    python OscScreenGrabLAN.py png 192.168.1.3			
57
+	
58
+Other usages syntax:
59
+
60
+    python OscScreenGrabLAN.py png|bmp|csv oscilloscope_IP
61
+
62
+Usage examples:
44
 
63
 
64
+    python OscScreenGrabLAN.py png 192.168.1.3
65
+    python OscScreenGrabLAN.py csv 192.168.1.3
45
 
66
 
46
-Windows Usage:
47
--------------
48
-Install Python 2.7.9 from https://www.python.org/downloads.
49
-Install "Python Imaging Library 1.1.7 for Python 2.7" from http://www.pythonware.com/products/pil.
50
-Run the PIL (Python Imaging Library) installer as Administrator, otherwise it won't be installed properly.
51
-Connect together the computer and the oscilloscope (by LAN).
52
-In order to capture an image from the oscilloscope display and save it to the computer disk,
53
-open a Command Prompt as Administrator and run "OscScreenGrabLAN.py".
54
 
67
 
55
-Example:
56
 
68
 
57
-    C:\Python27\python.exe OscScreenGrabLAN.py png 192.168.1.3
58
-    C:\Python27\python.exe OscScreenGrabLAN.py csv 192.168.1.3
59
-    
60
-Linux Usage:
61
------------
62
-Python and PIL are already present in the default Debian 7.7.0 installation, 
63
-so it is not necessary to manually install them.
64
-Connect together the computer and the oscilloscope (by LAN), download the project from GitHub, open a Terminal, 
65
-go to the project's directory and run "OscScreenGrabLAN.py". 
66
 
69
 
67
-Example:
68
 
70
 
69
-    python OscScreenGrabLAN.py png 192.168.1.3
70
-    python OscScreenGrabLAN.py csv 192.168.1.3
71
     
71
     

+ 4
- 4
Rigol_functions.py View File

46
 	elif n2_d < n1_c:
46
 	elif n2_d < n1_c:
47
 		# first set n1_d then set n2_d
47
 		# first set n1_d then set n2_d
48
 		tn.write("WAV:STAR " + str(n1_d))
48
 		tn.write("WAV:STAR " + str(n1_d))
49
-		time.sleep(0.3)
49
+		time.sleep(1)
50
 		tn.write("WAV:STOP " + str(n2_d))
50
 		tn.write("WAV:STOP " + str(n2_d))
51
-		time.sleep(0.3)
51
+		time.sleep(1)
52
 
52
 
53
 	else:
53
 	else:
54
 		# first set n2_d then set n1_d
54
 		# first set n2_d then set n1_d
55
 		tn.write("WAV:STOP " + str(n2_d))
55
 		tn.write("WAV:STOP " + str(n2_d))
56
-		time.sleep(0.3)
56
+		time.sleep(1)
57
 		tn.write("WAV:STAR " + str(n1_d))
57
 		tn.write("WAV:STAR " + str(n1_d))
58
-		time.sleep(0.3)
58
+		time.sleep(1)
59
 
59
 
60
 	# read achieved n2
60
 	# read achieved n2
61
 	tn.write("WAV:STOP?")
61
 	tn.write("WAV:STOP?")

Loading…
Cancel
Save