• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python eyesj.open函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中expeyes.eyesj.open函数的典型用法代码示例。如果您正苦于以下问题:Python open函数的具体用法?Python open怎么用?Python open使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了open函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __init__

 def __init__(self, parent=None):
     """
     Constructor: creates an instance of MyWindow
     """
     #########################################
     # Necessary actions, which must be done #
     # for any project                       #
     #########################################
     # first, calling the ancestor's creator
     QtGui.QMainWindow.__init__(self, parent)
     # get the User Interface from the module UI_p1
     self.ui=Ui_MainWindow()
     # initialize the user interface
     self.ui.setupUi(self)
     #########################################
     # Custom actions, which can be written  #
     # in other ways for other projects.     #
     #########################################
     # aliases for some parts of the user interface
     self.plotWidget    = self.ui.qwtPlot
     self.measureButton = self.ui.measureButton
     self.closeButton   = self.ui.closeButton
     # connect methods to buttons' click signals
     self.measureButton.clicked.connect(self.measure)
     self.closeButton.clicked.connect(self.close)
     # initialize an empty curve for the plot widget
     self.curve         = QwtPlotCurve()
     self.curve.attach(self.plotWidget)
     # initialize the driver for expEYES Junior
     self.p             = ej.open()
     return
开发者ID:georgesk,项目名称:course-affordable-science,代码行数:31,代码来源:p2.py


示例2: __init__

 def __init__(self, parent=None):
     QtGui.QMainWindow.__init__(self, parent)
     self.ui=Ui_MainWindow()
     self.ui.setupUi(self)
     # connect methods to buttons' click signals
     self.ui.wakeUpButton.clicked.connect(self.wakeUp)
     self.ui.stopButton.clicked.connect(self.stop)
     self.ui.closeButton.clicked.connect(self.close)
     self.ui.saveButton.clicked.connect(self.save)
     self.ui.immediateButton.clicked.connect(self.immediate)
     self.ui.finalButton.clicked.connect(self.final)
     self.ui.fitButton.clicked.connect(self.fit)
     self.ui.action_Save_Ctrl_S.triggered.connect(self.save)
     self.ui.action_Quit_Ctrl_Q.triggered.connect(self.close)
     self.ui.actionManual.triggered.connect(self.manual)
     self.ui.actionAbout.triggered.connect(self.about)
     # initialize an empty curve for the plot widget
     self.curve         = QwtPlotCurve()
     self.curve.attach(self.ui.qwtPlot)
     # expEYESdetection and initialization
     try:
         self.p             = ej.open()
         assert(self.p.fd)
         self.setWindowTitle("expEYES Junior found on port {}".format(
             self.p.fd.port
         ))
     except:
         self.setWindowTitle("ERROR: expEYES Junior NOT FOUND!")
         self.wakeUpButton.setEnabled(False)
     # custom properties
     self.isImmediate=True
     return
开发者ID:georgesk,项目名称:course-affordable-science,代码行数:32,代码来源:oscill2.py


示例3: run_expt

def run_expt(expt):
    global p
    if expt == '': return
    p.fd.close()	# Free the device from this program, the child will open it
    cmd = sys.executable + ' ' + eyeplot.abs_path() + expt+'.py'
    os.system(cmd)
    msg(_('Finished "')+expt+'.py"')
    p = eyes.open()	# Establish hardware communication again, for the parent
    p.disable_actions()
开发者ID:manoj-s-nair,项目名称:expeyes-programs,代码行数:9,代码来源:croplus.py


示例4: __init__

 def __init__(self, parent=None):
     QtGui.QMainWindow.__init__(self, parent)
     self.ui=Ui_MainWindow()
     self.ui.setupUi(self)
     # connect methods to buttons' click signals
     self.ui.wakeUpButton.clicked.connect(self.wakeUp)
     self.ui.stopButton.clicked.connect(self.stop)
     self.ui.closeButton.clicked.connect(self.close)
     self.ui.saveButton.clicked.connect(self.save)
     self.ui.immediateButton.clicked.connect(self.immediate)
     self.ui.finalButton.clicked.connect(self.final)
     self.ui.fitButton.clicked.connect(self.fit)
     self.ui.action_Save_Ctrl_S.triggered.connect(self.save)
     self.ui.action_Quit_Ctrl_Q.triggered.connect(self.close)
     self.ui.actionManual.triggered.connect(self.manual)
     self.ui.actionAbout.triggered.connect(self.about)
     self.ui.durationEdit.textChanged.connect(self.durationChanged)
     # create a timer
     self.stopTime=time.time()
     self.timer=QtCore.QTimer()
     # connect the timer to the "tick" callback method
     self.timer.timeout.connect(self.tick)
     # 20 times per second
     self.timer.start(50)
     # initialize an empty curve for the plot widget
     self.curve         = QwtPlotCurve()
     self.curve0        = QwtPlotCurve()
     self.fitCurve1     = QwtPlotCurve()
     self.fitCurve2     = QwtPlotCurve()
     self.fitCurve3     = QwtPlotCurve()
     self.curve.attach(self.ui.qwtPlot)
     self.curve0.attach(self.ui.qwtPlot)
     self.fitCurve1.attach(self.ui.qwtPlot)
     self.fitCurve2.attach(self.ui.qwtPlot)
     self.fitCurve3.attach(self.ui.qwtPlot)
     # adjust the axis scales based on duration = 15 s
     self.durationChanged(15, ampl=5)
     # set the maxvalue for the threshold rate (in V/s)
     self.maxthreshold=150/15 # = 150/duration
     # expEYESdetection and initialization
     try:
         self.p             = ej.open()
         assert(self.p.fd)
         self.setWindowTitle("expEYES Junior found on port {}".format(
             self.p.fd.port
         ))
     except:
         self.setWindowTitle("ERROR: expEYES Junior NOT FOUND!")
         self.ui.wakeUpButton.setEnabled(False)
     # custom properties
     self.isImmediate=True
     return
开发者ID:georgesk,项目名称:course-affordable-science,代码行数:52,代码来源:oscill4.py


示例5: __init__

 def __init__(self, parent=None):
     """
     Constructor: creates an instance of MyWindow
     """
     #########################################
     # Necessary actions, which must be done #
     # for any project                       #
     #########################################
     # first, calling the ancestor's creator
     QtGui.QMainWindow.__init__(self, parent)
     # get the User Interface from the module UI_p1
     self.ui=Ui_MainWindow()
     # initialize the user interface
     self.ui.setupUi(self)
     #########################################
     # Custom actions, which can be written  #
     # in other ways for other projects.     #
     #########################################
     # aliases for some parts of the user interface
     self.plotWidget    = self.ui.qwtPlot
     self.measureButton = self.ui.measureButton
     self.closeButton   = self.ui.closeButton
     # connect methods to buttons' click signals
     self.measureButton.clicked.connect(self.measure)
     self.closeButton.clicked.connect(self.close)
     # initialize 4 empty curves for the plot widget
     self.curves=[]
     colors=[
       QtGui.QColor("#000000"), #black
       QtGui.QColor("#ff0000"), #red
       QtGui.QColor("#0000ff"), #blue
       QtGui.QColor("#00cc00"), #dark green
     ]
     for i in range(4):
         c=QwtPlotCurve()
         c.setPen(colors[i])
         self.curves.append(c)
         c.attach(self.plotWidget)
     # initialize the driver for expEYES Junior
     # prevent an error if the box is not detected
     try:
         self.p             = ej.open()
         assert(self.p.fd)
         self.setWindowTitle("expEYES Junior found on port {}".format(
             self.p.fd.port
         ))
     except:
         self.setWindowTitle("ERROR: expEYES Junior NOT FOUND!")
         self.measureButton.setEnabled(False)
     return
开发者ID:georgesk,项目名称:course-affordable-science,代码行数:50,代码来源:p1.py


示例6: clear

	def clear(self):
		if self.running == True:
			return
		self.nt = [ [], [] ]
		g.delete_lines()
		self.msg(_('Cleared Data and Trace'))

	def msg(self,s, col = 'blue'):
		msgwin.config(text=s, fg=col)

	def quit(self):
		p.set_state(10,0)
		sys.exit()

p = eyes.open()
p.disable_actions()

root = Tk()
Canvas(root, width = WIDTH, height = 5).pack(side=TOP)  

g = eyeplot.graph(root, width=WIDTH, height=HEIGHT, bip=False)
pt = LM35()

cf = Frame(root, width = WIDTH, height = 10)
cf.pack(side=TOP,  fill = BOTH, expand = 1)

b3 = Label(cf, text = _('Read Every'))
b3.pack(side = LEFT, anchor = SW)
TGAP = StringVar()
Dur =Entry(cf, width=5, bg = 'white', textvariable = TGAP)
开发者ID:fossasia,项目名称:Pocket-Science-Lab,代码行数:30,代码来源:temp-LM35-GUI.py


示例7: clear

def clear():
    global history, trial, running
    if running == True:
        return
    g.delete_lines()
    history = []
    trial = 0


def quit():
    ph.set_sqr1(0)
    sys.exit()


ph = eyes.open()
root = Tk()
Canvas(root, width=WIDTH, height=5).pack(side=TOP)  # Some space at the top
g = eyeplot.graph(root, width=WIDTH, height=HEIGHT)  # make plot objects using draw.disp
g.setWorld(fmin, 0, fmax, 5.0, _("Freq"), _("Amp"))

cf = Frame(root, width=WIDTH, height=10)
cf.pack(side=TOP, fill=BOTH, expand=1)

b1 = Button(cf, text=_("START"), command=start)
b1.pack(side=LEFT, anchor=N)
b3 = Button(cf, text=_("SAVE to"), command=save)
b3.pack(side=LEFT, anchor=N)
filename = StringVar()
e1 = Entry(cf, width=15, bg="white", textvariable=filename)
filename.set("freq-response.dat")
开发者ID:emnik,项目名称:expeyes-programs,代码行数:30,代码来源:freq-response.py


示例8: print

from __future__ import print_function

'''
Connect pickup coil to A1 and Fit the sine wave for getting frequency.
From frequency of rotation of anemometer wind speed can be calculated
'''
import gettext
gettext.bindtextdomain("expeyes")
gettext.textdomain('expeyes')
_ = gettext.gettext

import expeyes.eyesj as ej
import expeyes.eyemath as em
from pylab import plot, show

p = ej.open()
t,v= p.capture(1,400,100)
try:
    vfit, par = em.fit_sine(t,v)
    print (par[1]) # second parameter is frequency
    print((t,v))
    plot(t, vfit)
    show()
except:
    print("No alternative signal, please make another try.")

开发者ID:fossasia,项目名称:Pocket-Science-Lab,代码行数:25,代码来源:Anemometer-Speed-magneticpickup.py



注:本文中的expeyes.eyesj.open函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python matcher.matcher函数代码示例发布时间:2022-05-24
下一篇:
Python eyeplot.pop_image函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap