axis.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:PPPLCalibrationFramework 作者: timothyhollabaugh 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号