def _on_save_axis(self):
"""
Save an axis to a file
"""
data = {}
data['name'] = self._axis_list.get_currentrow_value()[0]
data['hw_type'] = self._axis_hw_type.value
data['min'] = {}
self._min.save_form(data['min'])
data['max'] = {}
self._max.save_form(data['max'])
data['norm_min'] = {}
self._norm_min.save_form(data['norm_min'])
data['norm_max'] = {}
self._norm_max.save_form(data['norm_max'])
data['special_axis'] = {}
self._special_axis.value.save_form(data['special_axis'])
if self._axis_custom.value is not None:
data['axis-specific'] = {}
self._axis_custom.value.save_form(data['axis-specific'])
print(data)
filename = QFileDialog.getSaveFileName(
self, 'Save Axis', filter='JSON Files (*.json)')
if filename[0] is not None and filename[0] != '':
with open(filename[0], 'w') as output_file:
json.dump(data, output_file, indent=2)
axis.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录