Files
HPI/record_system_v24/delete.py
tangchao0503 98cf134cca 第一次提交
1、hpi的可用代码;
2、修复了多次点击曝光后,福亮度数据错误的问题;
3、定标方式为大的蓝菲积分球的标准能量曲线,而不是基于asd的能量曲线;
2022-09-06 22:54:14 +08:00

43 lines
1.3 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import os, subprocess, time, traceback
print('开始马达')
try:
# D:\software\Anaconda3\envs\py27_32\
python2_command = r'python2.exe ' + os.path.dirname(__file__) + '/ArcusDevice.py' + ' CLR PX=0 EO=1 J+'
print(python2_command)
print(python2_command.split())
process = subprocess.Popen(python2_command.split(), stdout=subprocess.PIPE)
try:
output, error = process.communicate(timeout=1)
except subprocess.TimeoutExpired:
print('有错1')
process.kill()
output, error = process.communicate()
except:
traceback.print_exc()
print('有错2')
pass
print('转动5秒')
time.sleep(5)
print('返回马达')
try:
# D:\software\Anaconda3\envs\py27_32\
# 打包https://stackoverflow.com/questions/58995937/using-pyinstaller-to-convert-python3-and-python2-to-exe
python2_command = r'python2.exe ' + os.path.dirname(__file__) + '/ArcusDevice.py' + ' CLR STOP X0'
print(python2_command)
process = subprocess.Popen(python2_command.split(), stdout=subprocess.PIPE)
try:
output, error = process.communicate(timeout=1)
except subprocess.TimeoutExpired:
print('有错3')
process.kill()
output, error = process.communicate()
except:
traceback.print_exc()
print('有错4')
pass