diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index acc4242a..b6961fda 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -3,8 +3,8 @@ from odoo import models, fields, api, _ from odoo.exceptions import ValidationError from odoo.modules import get_resource_path from odoo.addons.sf_base.commons.common import Common -#from OCC.Extend.DataExchange import read_step_file -#from OCC.Extend.DataExchange import write_stl_file +from OCC.Extend.DataExchange import read_step_file +from OCC.Extend.DataExchange import write_stl_file import logging import base64 import hashlib diff --git a/sf_sale/models/auto_quatotion_common.py b/sf_sale/models/auto_quatotion_common.py index 2d34a76e..09ea3f0f 100644 --- a/sf_sale/models/auto_quatotion_common.py +++ b/sf_sale/models/auto_quatotion_common.py @@ -2,7 +2,7 @@ import logging from odoo.modules import get_resource_path from odoo import fields, models, api -#from quatotion import readSql, feature_recognize, auto_quatotion +from quatotion import readSql, feature_recognize, auto_quatotion __author__ = 'jinling.yang' _logger = logging.getLogger(__name__) @@ -24,14 +24,14 @@ class AutoQuatotion(models.Model): def get_process_time_db_path(self): return get_resource_path('sf_sale', 'models', 'process_time.db') - # def get_auto_quatotion(self, stp_url, feature_full_path, process_time_db_path, model_code): - # ''' - # 通过打包好的.so库, - # 以调用autoQuatotion库中Quatotion类, - # 初始化后调用类的analyseShape方法对模型文件进行价格预测 - # ''' - # # 初始化自动报价类(输入特征数据库和加工时间数据库) - # reader = auto_quatotion.Quatotion(feature_full_path, process_time_db_path) - # # 获取价格、加工时间、尺寸、XYZ、翻面次数 - # feature_info = reader.analyseShape(stp_url, InfoJson={}) - # return feature_info + def get_auto_quatotion(self, stp_url, feature_full_path, process_time_db_path, model_code): + ''' + 通过打包好的.so库, + 以调用autoQuatotion库中Quatotion类, + 初始化后调用类的analyseShape方法对模型文件进行价格预测 + ''' + # 初始化自动报价类(输入特征数据库和加工时间数据库) + reader = auto_quatotion.Quatotion(feature_full_path, process_time_db_path) + # 获取价格、加工时间、尺寸、XYZ、翻面次数 + feature_info = reader.analyseShape(stp_url, InfoJson={}) + return feature_info diff --git a/sf_sale/models/quick_easy_order.py b/sf_sale/models/quick_easy_order.py index 310bbc7a..e9f152a8 100644 --- a/sf_sale/models/quick_easy_order.py +++ b/sf_sale/models/quick_easy_order.py @@ -1,7 +1,7 @@ from odoo import models, fields, api from odoo.modules import get_resource_path -#from OCC.Extend.DataExchange import read_step_file -#from OCC.Extend.DataExchange import write_stl_file +from OCC.Extend.DataExchange import read_step_file +from OCC.Extend.DataExchange import write_stl_file from odoo.exceptions import ValidationError, UserError from odoo.addons.sf_base.commons.common import Common from datetime import datetime