本文整理匯總了Python中sparkle.stim.stimulus_model.StimulusModel.index方法的典型用法代碼示例。如果您正苦於以下問題:Python StimulusModel.index方法的具體用法?Python StimulusModel.index怎麽用?Python StimulusModel.index使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sparkle.stim.stimulus_model.StimulusModel
的用法示例。
在下文中一共展示了StimulusModel.index方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: PureTone
# 需要導入模塊: from sparkle.stim.stimulus_model import StimulusModel [as 別名]
# 或者: from sparkle.stim.stimulus_model.StimulusModel import index [as 別名]
import sys
from sparkle.stim.auto_parameter_model import AutoParameterModel
from sparkle.stim.stimulus_model import StimulusModel
from sparkle.stim.types.stimuli_classes import *
app = QtGui.QApplication(sys.argv)
tone0 = PureTone()
tone0.setDuration(0.02)
stim = StimulusModel()
stim.insertComponent(tone0)
tuning_curve = stim.autoParams()
tuning_curve.insertRows(0,2)
selection_model = tuning_curve.data(tuning_curve.index(0,0), role=AutoParameterModel.SelectionModelRole)
selection_model.select(stim.index(0,0))
selection_model = tuning_curve.data(tuning_curve.index(1,0), role=AutoParameterModel.SelectionModelRole)
selection_model.select(stim.index(0,0))
tuning_curve.setData(tuning_curve.index(0,0), 'frequency', role=QtCore.Qt.EditRole)
tuning_curve.setData(tuning_curve.index(0,1), 0, role=QtCore.Qt.EditRole)
tuning_curve.setData(tuning_curve.index(0,2), 150, role=QtCore.Qt.EditRole)
tuning_curve.setData(tuning_curve.index(0,3), 10, role=QtCore.Qt.EditRole)
tuning_curve.setData(tuning_curve.index(1,0), 'intensity', role=QtCore.Qt.EditRole)
tuning_curve.setData(tuning_curve.index(1,1), 0, role=QtCore.Qt.EditRole)
tuning_curve.setData(tuning_curve.index(1,2), 100, role=QtCore.Qt.EditRole)
tuning_curve.setData(tuning_curve.index(1,3), 5, role=QtCore.Qt.EditRole)
stim.setEditor(TuningCurveEditor)
e = stim.showEditor()
e.show()