python编程控制示波器设备_基于Python的示波器的截屏GUI界面[通俗易懂]

python编程控制示波器设备_基于Python的示波器的截屏GUI界面[通俗易懂]importtimeimporttkinterastkfromtkinterimport*fromtkinterimportttkclassScreenCapture(object):def__init__(self):self.idn=self.__class__.__name__#InstrumentInitialisation#self.instr=MyIn…

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE稳定放心使用

importtime

importtkinter astk

fromtkinter import*

fromtkinter importttk

classScreenCapture(object):

def__init__(self):

self.idn = self.__class__.__name__

# Instrument Initialisation

# self.instr = MyInstruments()

self.timestamp = time.strftime(‘%d-%b-%Y_%I.%M.%S_%p’)

self.results_folder = ‘%s%s%s’% (‘./EvalData/’, self.timestamp, ‘/’)

defgui_setup(self):

# Title and window size

win = tk.Tk()

win.title(“Screen Capture GUI”)

win.geometry(‘550×400’)

# CH Name Setting

label1 = ttk.Label(win, text=’CH1:LABEL:NAME’).grid(column=0, row=0)

text1 = tk.Text(width = 10, height = 1)

text1.grid(column=1, row=0)

text1.insert(INSERT,’LX1′)

label2 = ttk.Label(win, text=’CH2:LABEL:NAME’).grid(column=0, row=1)

text2 = tk.Text(width = 10, height = 1)

text2.grid(column=1, row=1)

text2.insert(INSERT,’VOUT’)

label3 = ttk.Label(win, text=’CH3:LABEL:NAME’).grid(column=0, row=2)

text3 = tk.Text(width = 10, height = 1)

text3.grid(column=1, row=2)

text3.insert(INSERT,’LX2′)

label4 = ttk.Label(win, text=’CH4:LABEL:NAME’).grid(column=0, row=3)

text4 = tk.Text(width = 10, height = 1)

text4.grid(column=1, row=3)

text4.insert(INSERT, ‘IOUT’)

# CH Offset Setting

ttk.Label(win, text=”CH1 Offset”).grid(column=2, row=0)

ch1offset = StringVar()

ch1offset_set = Scale(win, from_=0, to=2, orient=HORIZONTAL, resolution=0.01, tickinterval=100, length=100, variable=ch1offset)

ch1offset_set.grid(column=3, row=0)

ttk.Label(win, text=”CH2 Offset”).grid(column=2, row=1)

ch2offset = StringVar()

ch2offset_set = Scale(win, from_=0, to=2, orient=HORIZONTAL, resolution=0.01, tickinterval=10, length=100, variable=ch2offset)

ch2offset_set.grid(column=3, row=1)

ttk.Label(win, text=”CH3 Offset”).grid(column=2, row=2)

ch3offset = StringVar()

ch3offset_set = Scale(win, from_=0, to=2, orient=HORIZONTAL, resolution=0.01, tickinterval=10, length=100, variable=ch2offset)

ch3offset_set.grid(column=3, row=2)

ttk.Label(win, text=”CH4 Offset”).grid(column=2, row=3)

ch4offset = StringVar()

ch4offset_set = Scale(win, from_=0, to=2, orient=HORIZONTAL, resolution=0.01, tickinterval=10, length=100, variable=ch4offset)

ch4offset_set.grid(column=3, row=3)

# Input Voltage setting

ttk.Label(win, text=”INPUT VOLTAGE[V]”).grid(column=0, row=4)

vin = tk.StringVar()

vin_set = ttk.Combobox(win, width=10, textvariable=vin)

vin_set[‘values’] = (2.5, 3.0, 3.5, 3.7, 4.0, 4.5, 5.0, 5.5)

vin_set.grid(column=1, row=4)

vin_set.current(3)

# Output Current Setting

ttk.Label(win, text=”LOAD CURRENT[A]”).grid(column=0, row=5)

iout = tk.StringVar()

iout_set = ttk.Combobox(win, width=10, textvariable=iout)

iout_set[‘values’] = (0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0)

iout_set.grid(column=1, row=5)

iout_set.current(0)

# Trigger choose and type setting

ttk.Label(win, text=”CH Num of Trigger”).grid(column=0, row=6)

number = tk.StringVar()

numberChosen = ttk.Combobox(win, width=10, textvariable=number)

numberChosen[‘values’] = (‘CH1′,’CH2’, ‘CH3’, ‘CH4’)

numberChosen.grid(column=1, row=6)

numberChosen.current(3)

riseorfall = tk.StringVar()

riseorfallChosen = ttk.Combobox(win, width=10, textvariable=riseorfall)

riseorfallChosen[‘values’] = (‘Rise’,’Fall’)

riseorfallChosen.grid(column=2, row=6)

riseorfallChosen.current(1)

# Screen Capture button

action = ttk.Button(win, text=”Screen Capture”)

action.grid(column=1, row=10)

tk.mainloop()

if__name__ == ‘__main__’:

meas = ScreenCapture()

try:

meas.gui_setup()

finally:

pass

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/182883.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 单片机结构_单片机原理读书笔记

    单片机结构_单片机原理读书笔记文章目录Chapter1:51单片机结构1.1MCS-51单片机内部结构1.1.151单片机内部结构1.1.2核心部件CPU1.2存储器1.2.1ROM和RAM1.2.2普林斯顿结构、哈佛结构1.2.3片内存储器、片外存储器1.2.4程序存储器、外部数据、内部数据存储器1.3特殊功能寄存器1.4时钟电路和复位电路1.4.1时钟电路1.4.2基本时序单位1.4.3复位…

    2022年10月4日
    0
  • MongoDB 使用场景_mongodb使用教程

    MongoDB 使用场景_mongodb使用教程开机指定数据库位置mongod–dbpathd:\data\db–dbpath选择数据库文档所在的文件夹根据网络参考知识,应使用:mongod –storageEnginemmapv1–dbpath d:\data\db1.用mongoVue直接打开连接即可2.用命令行另外开一个cmd输入mongo 连接数据库showd

    2022年8月21日
    4
  • 怎么新建pytest的ini文件_pytest.ini配置

    怎么新建pytest的ini文件_pytest.ini配置前言pytest配置文件可以改变pytest的运行方式,它是一个固定的文件pytest.ini文件,读取配置信息,按指定的方式去运行查看pytest.ini的配置选项pytest-h找到以下

    2022年7月30日
    1
  • boot sector与superblock

    boot sector与superblock

    2021年7月31日
    50
  • java经典源码_java经典源代码[通俗易懂]

    java经典源码_java经典源代码[通俗易懂]Java100个经典小程序_计算机软件及应用_IT/计算机_专业资料。Java100个经典小程序【程序1】题目:有1、2、3、4个数字,能组成多少个互不相同且无重复数字……()A、编写源代码B、编写HTML文件调用该小程序,以.html为扩展名存入相同文件夹C、编译过程D、解释执行85.Java的字符类型采用的是Unicode编码方案……15个经典…

    2022年7月9日
    19
  • java主要包括哪几种开发平台_成熟的java开发平台

    java主要包括哪几种开发平台_成熟的java开发平台1java都有哪些开发平台Java编程语言是流行的开发语言,也是IT行业非常火的就业方向,当然难度也是相对较大的。即使那些有计算机基础的小伙们参加java培训,不认真的学习,也会显得吃力。下面小编给大家说说java都有哪些开发平台,希望能对你有些帮助。Eclipse是最有名也最广泛使用的Java集成开发环境(IDE),允许开发者结合语言支持和其他功能到任何的默认包中,而且Eclipse市场有许多定…

    2022年8月23日
    4

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号