完善扫描流式预览、成果归档与PLY/STL查看、补扫历史、执行步骤及日志展示,支持局域网访问和改名节点的原始组件识别。修复试运行终止后的占用释放及未采集时重复暂停SDK的问题,增加终止中交互与回归验证。 验证:后端1114项通过、18项既有跳过;前端109项通过,类型检查及构建通过;Python脚本54项通过;模拟扫描设备7组试运行/终止接口回归通过。
32 lines
1.8 KiB
Python
32 lines
1.8 KiB
Python
import json
|
|
import unittest
|
|
from prepare_user_scan_pair import graph
|
|
|
|
|
|
class UserScanPairTest(unittest.TestCase):
|
|
def test_both_variants_pause_acquisition_before_creating_project(self):
|
|
for export in (False,True):
|
|
with self.subTest(export=export):
|
|
g=graph(export);actions=[n['properties']['action'] for n in g['nodes']]
|
|
self.assertLess(actions.index('SCANNER_STOP'),actions.index('SCANNER_CREATE_PROJECT'))
|
|
self.assertLess(actions.index('SCANNER_CREATE_PROJECT'),actions.index('SCANNER_START'))
|
|
self.assertNotIn('SCANNER_SNAPSHOT',actions)
|
|
self.assertEqual(len(g['edges']),len(g['nodes'])-1)
|
|
for a,b,edge in zip(g['nodes'],g['nodes'][1:],g['edges']):
|
|
self.assertEqual((edge['sourceNodeId'],edge['targetNodeId']),(a['id'],b['id']))
|
|
|
|
def test_preview_variant_stops_after_capture_and_has_no_model_processing(self):
|
|
actions=[n['properties']['action'] for n in graph(False)['nodes']]
|
|
self.assertEqual(actions[-2:],['SCANNER_STOP','END'])
|
|
self.assertNotIn('SCANNER_MESH',actions);self.assertNotIn('SCANNER_EXPORT',actions)
|
|
|
|
def test_export_only_after_stop_mesh_and_confirmation(self):
|
|
nodes=graph(True)['nodes'];actions=[n['properties']['action'] for n in nodes]
|
|
self.assertEqual(actions[-5:],['SCANNER_STOP','SCANNER_MESH','SCANNER_MESH_CONFIRM','SCANNER_EXPORT','END'])
|
|
export=next(n for n in nodes if n['properties']['action']=='SCANNER_EXPORT')
|
|
params={p['name']:p['input'] for p in export['properties']['nodeParams']}
|
|
self.assertEqual(json.loads(params['requestJson'])['formats'],['PLY','STL']);self.assertEqual(params['timeoutMs'],600000)
|
|
|
|
|
|
if __name__=='__main__':unittest.main()
|