本文整理汇总了Python中TestData类的典型用法代码示例。如果您正苦于以下问题:Python TestData类的具体用法?Python TestData怎么用?Python TestData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TestData类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setTestData
def setTestData( self ):
self.grid.ClearGrid()
testData = TestData.getTestData()
for row, data in enumerate(testData):
for col, d in enumerate(data):
self.grid.SetCellValue( row, col,u' {}'.format(d) )
# Fix up the column and row sizes.
self.grid.AutoSizeColumns( False )
self.grid.AutoSizeRows( False )
示例2: setTestData
def setTestData( self ):
self.grid.ClearGrid()
testData = TestData.getTestData()
Utils.AdjustGridSize( self.grid, rowsRequired = len(testData) )
for row, data in enumerate(testData):
bib = data[0]
name = data[1] + ' ' + data[2]
team = data[3]
time = data[-1]
for col, d in enumerate([bib, name, team, time]):
self.grid.SetCellValue( row, col,u' {}'.format(d) )
# Fix up the column and row sizes.
self.grid.AutoSizeColumns( False )
self.grid.AutoSizeRows( False )
示例3: APOGEEQLWdg
self.expLogWdg = ExposureTableWdg.ExposureTableWdg(master=self, helpURL=_HelpURL)
self.expLogWdg.grid(row=row, column=2, sticky="news")
row += 1
self.statusBar = TUI.Base.Wdg.StatusBar(master=self)
self.statusBar.grid(row=row, column=0, columnspan=3, sticky="ew")
row += 1
self.snrGraphWdg = SNRGraphWdg.SNRGraphWdg(master=self, width=_Width, height=_Height, helpURL=_HelpURL)
self.snrGraphWdg.grid(row=row, column=0, columnspan=3, sticky="news")
self.grid_rowconfigure(row, weight=1)
self.grid_columnconfigure(2, weight=1)
row += 1
if __name__ == '__main__':
root = RO.Wdg.PythonTk()
import TestData
tuiModel = TestData.tuiModel
testFrame = APOGEEQLWdg(tuiModel.tkRoot)
testFrame.pack(side="top", expand="yes")
Tkinter.Button(text="Demo", command=TestData.animate).pack(side="top")
TestData.start()
tuiModel.reactor.run()
示例4: clearCharts
self.stripChartWdg.plotKeyVar(
label = "focus",
subplotInd = subplotInd,
keyVar = self.tccModel.secFocus,
keyInd = 0,
color = "green",
)
self.stripChartWdg.subplotArr[subplotInd].yaxis.set_label_text("Sec Focus Offset")
self.stripChartWdg.subplotArr[subplotInd].legend(loc=3, frameon=False)
self.clearWdg = RO.Wdg.Button(master = self, text = "C", callFunc = self.clearCharts)
self.clearWdg.grid(row=0, column=0, sticky = "sw")
def clearCharts(self, wdg=None):
"""Clear all strip charts
"""
self.stripChartWdg.clear()
if __name__ == "__main__":
import TestData
import RO.Wdg
addWindow(TestData.tuiModel.tlSet)
TestData.tuiModel.tlSet.makeVisible(WindowName)
TestData.runTest()
TestData.tuiModel.reactor.run()
示例5: _cmdFailed
stateStr = "Off"
ctrlWdg["text"] = stateStr
lampCmdVar = RO.KeyVariable.CmdVar(
actor = self.model.actor,
cmdStr = "%s %d" % (stateStr.lower(), lampNum),
timeLim = _TimeLim,
callFunc = self._cmdFailed,
callTypes = RO.KeyVariable.FailTypes,
)
self.statusBar.doCmd(lampCmdVar)
def _cmdFailed(self, *args, **kargs):
self.after(10, self.refresh)
if __name__ == '__main__':
root = RO.Wdg.PythonTk()
import TestData
statusBar = RO.Wdg.StatusBar(root, dispatcher=TestData.dispatcher)
testFrame = StatusCommandWdg (root, statusBar)
testFrame.pack()
statusBar.pack(expand="yes", fill="x")
Tkinter.Button(root, text="Demo", command=TestData.animate).pack()
TestData.dispatch()
root.mainloop()
示例6: _updObjXYOff
objOff = objOffPVT[ii].getPos()
self.objOffWdgSet[ii].set(objOff, isCurrent)
self._updObjXYOff()
def _updObjXYOff(self, *args, **kargs):
objInstAngPVT, isCurrent = self.tccModel.objInstAng.getInd(0)
objInstAng = objInstAngPVT.getPos()
objOff = [None, None]
for ii in range(2):
objOff[ii], arcCurr = self.objOffWdgSet[ii].get()
isCurrent = isCurrent and arcCurr
try:
objXYOff = RO.MathUtil.rot2D(objOff, objInstAng)
except (TypeError, ValueError):
objXYOff = (None, None)
for ii in range(2):
self.objXYOffWdgSet[ii].set(objXYOff[ii], isCurrent)
if __name__ == "__main__":
import TestData
tuiModel = TestData.tuiModel
testFrame = OffsetWdg(tuiModel.tkRoot)
testFrame.pack()
TestData.init()
tuiModel.tkRoot.mainloop()
示例7: StatusWdg
self.axisStatusWdg = AxisStatus.AxisStatusWdg(
master=self,
borderwidth=1,
relief="ridge",
)
self.axisStatusWdg.grid(row=row, column=0, columnspan=2, sticky="ew")
row += 1
# set up status bar; this is only for showing help,
# not command status, so we can omit dispatcher and prefs
self.statusBar = RO.Wdg.StatusBar(
master = self,
helpURL = _HelpPrefix + "StatusBar",
)
self.statusBar.grid(row=row, column=0, columnspan=2, sticky="ew")
row += 1
if __name__ == "__main__":
import TestData
root = TestData.tuiModel.tkRoot
testFrame = StatusWdg(TestData.tuiModel.tkRoot)
testFrame.pack()
TestData.init()
TestData.runTest()
root.mainloop()
示例8: restoreDefault
"""Makes sure all input fields are neatened up.
"""
self.inputWdg.neatenDisplay()
self.focus_set()
def restoreDefault(self):
self.inputWdg.restoreDefault()
if __name__ == "__main__":
import TestData
tuiModel = TestData.tuiModel
def printDict():
print testFrame.inputWdg.getValueDict()
testFrame = SlewWdg(tuiModel.tkRoot)
testFrame.pack()
tuiModel.tkRoot.resizable(width=0, height=0)
debugFrame = Tkinter.Frame(tuiModel.tkRoot)
Tkinter.Label(debugFrame, text="Debug:").pack(side="left", anchor="w")
Tkinter.Button(debugFrame, text="PrintValueDict", command=printDict).pack(side="left", anchor="w")
debugFrame.pack(anchor="w")
Tkinter.Button(debugFrame, text="RotAvail", command=TestData.setDIS).pack(side="left", anchor="w")
Tkinter.Button(debugFrame, text="RotNotAvail", command=TestData.setEchelle).pack(side="left", anchor="w")
TestData.setDIS()
tuiModel.reactor.run()
示例9: ExposureStateWdg
# print "hide timer"
self.expTimer.grid_remove()
self.expTimer.clear()
# play sound, if appropriate
if self.wasExposing != None \
and self.wasExposing != isExposing \
and self.winfo_ismapped():
# play the appropriate sound
if isExposing:
TUI.PlaySound.exposureBegins()
else:
TUI.PlaySound.exposureEnds()
self.wasExposing = isExposing
if __name__ == '__main__':
root = RO.Wdg.PythonTk()
import TestData
tuiModel = TestData.tuiModel
testFrame = ExposureStateWdg(tuiModel.tkRoot)
testFrame.pack(side="top", expand="yes")
Tkinter.Button(text="Demo", command=TestData.exposeAnimate).pack(side="top")
TestData.exposeStart()
tuiModel.reactor.run()
示例10: restoreDefault
"""
self.inputWdg.neatenDisplay()
self.focus_set()
def restoreDefault(self):
self.inputWdg.restoreDefault()
if __name__ == "__main__":
import TestData
root = RO.Wdg.PythonTk()
root.resizable(width=0, height=0)
tuiModel = TUI.TUIModel.getModel(True)
TestData.setModel(tuiModel)
def printDict():
print testFrame.inputWdg.getValueDict()
testFrame = SlewWdg(master=root)
testFrame.pack()
debugFrame = Tkinter.Frame(root)
Tkinter.Label(debugFrame, text="Debug:").pack(side="left", anchor="w")
Tkinter.Button(debugFrame, text="PrintValueDict", command=printDict).pack(side="left", anchor="w")
debugFrame.pack(anchor="w")
Tkinter.Button(debugFrame, text="RotAvail", command=TestData.setDIS).pack(side="left", anchor="w")
Tkinter.Button(debugFrame, text="RotNotAvail", command=TestData.setEchelle).pack(side="left", anchor="w")
TestData.setDIS()
示例11: Int
Int(units="ticks", help="error in reported position")),
"""
if not keyVar.isGenuine:
# ignore cached info
return
logWdg = self.logWdgDict[axisName]
timeStr = getTAITimeStr()
logWdg.addOutput("\n%8s %2i %6.1f %5d" % (timeStr, keyVar[0], keyVar[1], keyVar[3]))
if __name__ == "__main__":
import sys
import random
import TestData
tuiModel = TestData.tuiModel
root = tuiModel.tkRoot
testFrame = FiducialsWdg(
master=root,
)
testFrame.grid(row=0, column=0, sticky="nsew")
root.grid_rowconfigure(0, weight=1)
root.grid_columnconfigure(0, weight=1)
TestData.start()
TestData.animate()
tuiModel.reactor.run()
示例12: addWindow
import TUI.TUIModel
_HelpURL = "Misc/EnclosureWin.html"
def addWindow(tlSet):
tlSet.createToplevel (
name = "Misc.Enclosure",
defGeom = "+676+280",
resizable = False,
wdgFunc = StatusCommandWdg.StatusCommandWdg,
visible = (__name__ == "__main__"),
)
if __name__ == "__main__":
import TestData
root = TestData.tuiModel.tkRoot
root.resizable(width=0, height=0)
tlSet = TestData.tuiModel.tlSet
addWindow(tlSet)
tlSet.makeVisible("Misc.Enclosure")
TestData.init()
TestData.runDemo()
root.mainloop()