本文整理匯總了Python中pylabcontrol.core.Script.get_script_module方法的典型用法代碼示例。如果您正苦於以下問題:Python Script.get_script_module方法的具體用法?Python Script.get_script_module怎麽用?Python Script.get_script_module使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pylabcontrol.core.Script
的用法示例。
在下文中一共展示了Script.get_script_module方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_iterator_default_script
# 需要導入模塊: from pylabcontrol.core import Script [as 別名]
# 或者: from pylabcontrol.core.Script import get_script_module [as 別名]
def get_iterator_default_script(iterator_type):
"""
Returns:
sub_scripts: a dictionary with the default scripts for the script_iterator
script_settings: a dictionary with the script_settingsfor the default scripts
"""
sub_scripts = {}
script_settings = {}
package = 'b26_toolkit' # todo JG: mabye find a dynamic whay to get this
# for point iteration we add some default scripts
if iterator_type == 'iter nvs':
module = Script.get_script_module('SelectPoints')# Select points is actually in pylabcontrol
sub_scripts.update(
{'select_points': getattr(module, 'SelectPoints')}
)
module = Script.get_script_module('FindNV', package)
sub_scripts.update(
# {'find_nv': getattr(module, 'FindNV_cDAQ')}
{'find_nv': getattr(module, 'FindNV')}
)
module = Script.get_script_module('Take_And_Correlate_Images', package)
sub_scripts.update(
{'correlate_iter': getattr(module, 'Take_And_Correlate_Images', package)}
)
script_settings['script_order'] = {'select_points': -3, 'correlate_iter': -2, 'find_nv': -1}
elif iterator_type == 'iter points':
module = Script.get_script_module('SelectPoints', 'pylabcontrol')
sub_scripts.update(
{'select_points': getattr(module, 'SelectPoints')}
)
module = Script.get_script_module('SetLaser', package)
sub_scripts.update(
{'set_laser': getattr(module, 'SetLaser')}
)
module = Script.get_script_module('Take_And_Correlate_Images', package)
sub_scripts.update(
{'correlate_iter': getattr(module, 'Take_And_Correlate_Images')}
)
script_settings['script_order']={'select_points': -3, 'correlate_iter': -2, 'set_laser': -1}
elif iterator_type == 'test':
module = Script.get_script_module('Wait', 'pylabcontrol')
sub_scripts.update(
{'wait': getattr(module, 'Wait')}
)
return sub_scripts, script_settings