Kermit script to capture HP 8591 spectrum analyzer screen image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/kermit + | |
# Fetches screen shot from HP8591E spectrum analyzer | |
# Presumes it's set up for plotter output... | |
# Converts HPGL to PNG image | |
# use raw-socket to disable telnet termination chars | |
set host 192.168.1.40 7002 /raw-socket | |
set modem none | |
# Make sure we have a param | |
if not defined \%1 ask \%1 {File name? } | |
set input echo off | |
set input buffer-length 200000 | |
# Tell it what size to plot | |
echo Triggering plot output... | |
output plot 0,0,60000,40000; | |
log session "\%1.hgl" | |
# Wait for end of data stream | |
input 400 SP; | |
echo ... HPGL data captured | |
close session | |
close | |
echo Converting HPGL in | |
echo --\%1.hgl | |
echo to PNG in | |
echo --\%1.png | |
run hp2xx -q -m png -c 1436 "\%1.hgl" | |
echo Cropping and resizing | |
#run mogrify -crop "515x395+0+0!" "\%1.png" | |
run mogrify -density 300 -resize 200% "\%1.png" | |
echo Finished! | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
More details on my blog at https://wp.me/poZKh-7qI