对模型进行上色和特征识别及自动报价
This commit is contained in:
37
sf_sale/models/auto_quatotion_common.py
Normal file
37
sf_sale/models/auto_quatotion_common.py
Normal file
@@ -0,0 +1,37 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import logging
|
||||
from odoo.modules import get_resource_path
|
||||
from odoo import fields, models, api
|
||||
from quatotion import readSql, feature_recognize, auto_quatotion
|
||||
|
||||
__author__ = 'jinling.yang'
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class AutoQuatotion(models.Model):
|
||||
_name = 'sf.auto_quatotion.common'
|
||||
_description = u'自动报价公用类'
|
||||
|
||||
# 获取feature.sqlite的地址
|
||||
def get_feature_full_path(self):
|
||||
return get_resource_path('sf_sale', 'models', 'feature.sqlite')
|
||||
|
||||
# 获取price.sqlite的地址
|
||||
def get_price_full_path(self):
|
||||
return get_resource_path('sf_sale', 'models', 'price.sqlite')
|
||||
|
||||
# 获取price.sqlite的地址
|
||||
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
|
||||
Reference in New Issue
Block a user