Sponsored Content
Top Forums Programming Python Screen Capture of RIGOL 1054Z on macOS Catalina Using NI-VISA Post 303043049 by Neo on Thursday 16th of January 2020 08:29:03 AM
Old 01-16-2020
Update:

I find this works best if we enter the pip environment:

Code:
pipenv shell
(rigol-grab) bash-3.2$ python --version
Python 3.7.5

and we get better screen grabs if we edit the rigol_grab.py script and change the image format to JPG instead of PNG. However, so far, I cannot get 100% perfect images each time without disconnecting and reconnecting the USB cable.

This is a known bug with this script, and I'm not sure how much time I will spend debugging this at this time.

FYI (seems buggy):

Code:
(rigol-grab) bash-3.2$ pyvisa-info
Machine Details:
   Platform ID:    Darwin-19.2.0-x86_64-i386-64bit
   Processor:      i386

Python:
   Implementation: CPython
   Executable:     /Users/Tim/.local/share/virtualenvs/rigol-grab-UTG9DSmW/bin/python3.7
   Version:        3.7.5
   Compiler:       Clang 11.0.0 (clang-1100.0.33.8)
   Bits:           64bit
   Build:          Nov  1 2019 02:16:23 (#default)
   Unicode:        UCS4

PyVISA Version: 1.10.1

Backends:
   ni:
      Version: 1.10.1 (bundled with PyVISA)
      #1: /Library/Frameworks/visa.framework/visa:
         found by: auto
         bitness: 64
         Vendor: National Instruments
         Impl. Version: 19922944
         Spec. Version: 5244928
   py:
      Version: 0.3.1
      ASRL INSTR:
         Please install PySerial (>=3.0) to use this resource type.
         No module named 'serial'
      USB INSTR: Available via PyUSB (1.0.2). Backend: libusb1
      USB RAW: Available via PyUSB (1.0.2). Backend: libusb1
      TCPIP INSTR: Available 
      TCPIP SOCKET: Available 
      GPIB INSTR:
         Please install linux-gpib to use this resource type.
         No module named 'gpib'

(rigol-grab) bash-3.2$

Python Screen Capture of RIGOL 1054Z on macOS Catalina Using NI-VISA-hello_invertedjpg
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

screen capture

I was wondering is there something out there for Solaris 7 for screen capture? Also it would really help if there was some software out there that can record whats happens on the screen for like 10 seconds or how ever long I need it to. I did a search but doesn't seem to be alot out there. (10 Replies)
Discussion started by: merlin
10 Replies

2. Solaris

Solaris 10 screen capture

We are using Solaris 10 for our Radiation Treatment Planning and need to create a simulation for our service engineers. I need a screen capture tool that can not only capture screens, but create movies of mouse movements (similar to Captivate). I have contacted Oracle and talked to several people... (2 Replies)
Discussion started by: TomH
2 Replies

3. OS X (Apple)

Python script to do simple audio capture...

This site is the first to get this snippet. It will capture an audio recording of any time length within the limits of OSX's QuickTime Player's capablility... A shell script derivative of this will be used as a further capture for CygWin's AudioScope.sh. Thoroughly read ALL the comments in... (0 Replies)
Discussion started by: wisecracker
0 Replies

4. UNIX for Beginners Questions & Answers

Capture power button press on MacOs High Sierra?

Hello everyone! I'm developing a MacOs Application in python and I'm having some issues trying to find information related to the power button pressed event. I know that in Ubuntu 14.04 you can find information about it on the acpi folders, but I realized that here in Mac that process is... (0 Replies)
Discussion started by: xedge
0 Replies

5. OS X (Apple)

MacOS 10.15 (Catalina) switches from bash to zsh

Interestingly Apple has decided to switch the default shell for new users from bash to zsh in MacOS Catalina (10.15) Use zsh as the default shell on your Mac - Apple Support Another interesting fact is that Catalina also comes with /bin/dash (5 Replies)
Discussion started by: Scrutinizer
5 Replies

6. OS X (Apple)

MacOS 10.15 Catalina Crashes and Freezes on Boot

Sadly, I have turned off my access to the Apple Developers Beta program after installing macOS 10.15 Catalina a few days ago. After the install, I rebooted by MacBook Air and it "hard froze" and we were heading out of town so I grabbed a backup MBA running Mojave. Then, after getting back at... (10 Replies)
Discussion started by: Neo
10 Replies

7. Windows & DOS: Issues & Discussions

Poor Windows 10 Performance of Parallels Desktop 15 on macOS Catalina

Just a quick note for macOS users. I just installed (and removed) Parallels Desktop 15 Edition on my MacPro (2013) with 64GB memory and 12-cores, which is running the latest version of macOS Catalina as of this post. The reason for this install was to test some RIGOL test gear software which... (6 Replies)
Discussion started by: Neo
6 Replies

8. Programming

A Slightly Better NTP Client for the ESP32 (ESPWROOM32) on macOS Catalina

Currently have two ESP8266 modules testing some Blynk apps, whereI'm not so happy with the Blynk business model for developers, but that's another story. So, with two of my ESP8266s currently "busy", I decided to work on the ESP32, and in particular the ESPWROOM32. I installed the... (0 Replies)
Discussion started by: Neo
0 Replies

9. OS X (Apple)

MacOS 10.15.2 Catalina display crash and system panic

MacPro (2013) 12-Core, 64GB RAM (today's crash): panic(cpu 2 caller 0xffffff7f8b333ad5): userspace watchdog timeout: no successful checkins from com.apple.WindowServer in 120 seconds service: com.apple.logd, total successful checkins since load (318824 seconds ago): 31883, last successful... (3 Replies)
Discussion started by: Neo
3 Replies
grab(n) 						       Tk Built-In Commands							   grab(n)

__________________________________________________________________________________________________________________________________________________

NAME
grab - Confine pointer and keyboard events to a window sub-tree SYNOPSIS
grab ?-global? window grab option ?arg arg ...? _________________________________________________________________ DESCRIPTION
This command implements simple pointer and keyboard grabs for Tk. Tk's grabs are different than the grabs described in the Xlib documenta- tion. When a grab is set for a particular window, Tk restricts all pointer events to the grab window and its descendants in Tk's window hierarchy. Whenever the pointer is within the grab window's subtree, the pointer will behave exactly the same as if there had been no grab at all and all events will be reported in the normal fashion. When the pointer is outside window's tree, button presses and releases and mouse motion events are reported to window, and window entry and window exit events are ignored. The grab subtree ``owns'' the pointer: windows outside the grab subtree will be visible on the screen but they will be insensitive until the grab is released. The tree of win- dows underneath the grab window can include top-level windows, in which case all of those top-level windows and their descendants will con- tinue to receive mouse events during the grab. Two forms of grabs are possible: local and global. A local grab affects only the grabbing application: events will be reported to other applications as if the grab had never occurred. Grabs are local by default. A global grab locks out all applications on the screen, so that only the given subtree of the grabbing application will be sensitive to pointer events (mouse button presses, mouse button releases, pointer motions, window entries, and window exits). During global grabs the window manager will not receive pointer events either. During local grabs, keyboard events (key presses and key releases) are delivered as usual: the window manager controls which application receives keyboard events, and if they are sent to any window in the grabbing application then they are redirected to the focus window. During a global grab Tk grabs the keyboard so that all keyboard events are always sent to the grabbing application. The focus command is still used to determine which window in the application receives the keyboard events. The keyboard grab is released when the grab is released. Grabs apply to particular displays. If an application has windows on multiple displays then it can establish a separate grab on each dis- play. The grab on a particular display affects only the windows on that display. It is possible for different applications on a single display to have simultaneous local grabs, but only one application can have a global grab on a given display at once. The grab command can take any of the following forms: grab ?-global? window Same as grab set, described below. grab current ?window? If window is specified, returns the name of the current grab window in this application for window's display, or an empty string if there is no such window. If window is omitted, the command returns a list whose elements are all of the windows grabbed by this application for all displays, or an empty string if the application has no grabs. grab release window Releases the grab on window if there is one, otherwise does nothing. Returns an empty string. grab set ?-global? window Sets a grab on window. If -global is specified then the grab is global, otherwise it is local. If a grab was already in effect for this application on window's display then it is automatically released. If there is already a grab on window and it has the same global/local form as the requested grab, then the command does nothing. Returns an empty string. grab status window Returns none if no grab is currently set on window, local if a local grab is set on window, and global if a global grab is set. BUGS
It took an incredibly complex and gross implementation to produce the simple grab effect described above. Given the current implementa- tion, it isn't safe for applications to use the Xlib grab facilities at all except through the Tk grab procedures. If applications try to manipulate X's grab mechanisms directly, things will probably break. If a single process is managing several different Tk applications, only one of those applications can have a local grab for a given display at any given time. If the applications are in different processes, this restriction doesn't exist. KEYWORDS
grab, keyboard events, pointer events, window Tk grab(n)
All times are GMT -4. The time now is 04:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy