Skip to content

Commit

Permalink
Add screenshot to AgilentE8357A
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLutton authored Apr 13, 2024
1 parent 99cbea9 commit 193a96d
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/labtoolkit/NetworkAnalyser/AgilentE8357A.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from ..SCPI import SCPI
import numpy as np
import pandas as pd
import PIL.Image as Image
import io


class AgilentE8357A(IEEE488, SCPI):
Expand Down Expand Up @@ -142,7 +144,20 @@ def reference(self):
"""
return self.query('SENSe:ROSCillator:SOURce?')


def screenshot(self):
self.write('HCOPY:FILE \'screen.png\'')

image = Image.open(io.BytesIO(
self.query_binary_values(
':MMEMory:TRANsfer? \'screen.png\'',
datatype='B',
is_big_endian=False,
container=bytearray
)
))
self.write('MMEMory:DELete \'screen.png\'')
return image

'''
@property
def form(self):
Expand Down

0 comments on commit 193a96d

Please sign in to comment.