御坂初琴
Articles133
Tags48
Categories12
【原创软件】力科示波器网线存图

【原创软件】力科示波器网线存图

# 简介

力科最近也在进军低端示波器市场了。不过其部分示波器存图功能很不方便。故站长编写了该工具。

该工具用 python 编写,代码开源,需要事先安装驱动 ActiveDSO 2.36。


# 软件截图


# 功能介绍

需要事先安装驱动 ActiveDSO 2.36。


# 代码分享

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import win32com.client
import easygui as g
import winreg
#import subprocess

scope=win32com.client.Dispatch("LeCroy.ActiveDSOCtrl.1")

def get_desktop():
key = winreg.OpenKey(winreg.HKEY_CURRENT_USER,
r'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders',)
return winreg.QueryValueEx(key, "Desktop")[0]

print("DESKTOP PATH: ",get_desktop())
desktop = get_desktop()
path = g.diropenbox(msg="请选择保存截图的路径", title=None)
if path != None :
path = path +"\\"
else :
path = desktop
print("CHOOSE PATH: ",path)
msg = "请填写如下内容"
title = "Lecroy PNG Saver By: 御坂初琴"
fieldNames = ["示波器IP","保存路径","文件名"]
fieldValues = ["", path, ""] #初始化结束
while True:
lastip = fieldValues[0]
lastpath = fieldValues[1]
lastname = fieldValues[2]
print("LASTIP: ",lastip)
print("LASTPATH: ",lastpath)
print("LASTNAME: ",lastname)

fieldValues = g.multenterbox(msg,title,fieldNames,[lastip,lastpath,lastname])
print("VALUES: ",fieldValues)
#判断循环
while True:
if fieldValues == None :
break
errmsg = ""
if fieldValues[0] == "" :
errmsg = "IP值不能为空"
if fieldValues[1] == "" :
errmsg = "路径不能为空"
if fieldValues[2] == "" :
errmsg = "文件名不能为空"
if errmsg == "":
break
fieldValues = g.multenterbox(errmsg,title,fieldNames,fieldValues)
#判断循环
if fieldValues == None :
break
if fieldValues[0] != lastip :
scope.Disconnect()
scope.MakeConnection("IP:"+fieldValues[0]) #IP地址
scope.StoreHardcopyToFile("PNG", "", fieldValues[1] + fieldValues[2] + ".png")
#subprocess.call('cscript ./msg.vbs')
g.msgbox('已保存图片,路径为:' + fieldValues[1] + fieldValues[2] + ".png", title)

scope.Disconnect()

# MD5

文件: SaveLecroy.exe

大小: 13413591 字节

修改时间: 2020 年 9 月 4 日 星期五,11:20:52

MD5: E9938AB066FD96BD760F63CAC8223987

SHA1: 6D53EAEF2EE541068703B2A03AF62E8D3655F729

CRC32: 711A912C


# 下载地址

蓝奏云

Author:御坂初琴
Link:https://ybcq.github.io/2020/10/03/%E3%80%90%E5%8E%9F%E5%88%9B%E8%BD%AF%E4%BB%B6%E3%80%91%E5%8A%9B%E7%A7%91%E7%A4%BA%E6%B3%A2%E5%99%A8%E7%BD%91%E7%BA%BF%E5%AD%98%E5%9B%BE/
版权声明:本文采用 CC BY-NC-SA 3.0 CN 协议进行许可
×