Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/优化刀具基本参数同步
This commit is contained in:
@@ -4,3 +4,4 @@ from . import tool_base_new
|
||||
from . import fixture
|
||||
from . import functional_fixture
|
||||
from . import tool_other_features
|
||||
from . import basic_parameters_fixture
|
||||
|
||||
68
sf_base/models/basic_parameters_fixture.py
Normal file
68
sf_base/models/basic_parameters_fixture.py
Normal file
@@ -0,0 +1,68 @@
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class BasicParametersFixture(models.Model):
|
||||
_name = 'sf.fixture.materials.basic.parameters'
|
||||
_description = '夹具物料基本参数'
|
||||
|
||||
fixture_model_id = fields.Many2one('sf.fixture.model', '夹具型号')
|
||||
name = fields.Char('物料号', size=20)
|
||||
length = fields.Float('长度(mm)', digits=(16, 2))
|
||||
width = fields.Float('宽度(mm)', digits=(16, 2))
|
||||
height = fields.Float('高度(mm)', digits=(16, 2))
|
||||
diameter = fields.Float('直径(mm)', digits=(16, 2))
|
||||
|
||||
# '零点卡盘' 字段
|
||||
weight = fields.Float('重量(mm)', digits=(16, 2))
|
||||
orientation_dish_diameter = fields.Float('定位盘直径(mm)', digits=(16, 2))
|
||||
clamping_diameter = fields.Float('装夹直径(mm)', digits=(16, 2))
|
||||
clamping_num = fields.Selection([('1', '1'), ('2', '2'), ('4', '4'), ('6', '6'), ('8', '8')], string='夹装单元数')
|
||||
chucking_power_max = fields.Float('最大夹持力(KN)', digits=(16, 2))
|
||||
repeated_positioning_accuracy = fields.Char('重复定位精度(mm)', size=20)
|
||||
boolean_transposing_hole = fields.Boolean('是否有转位孔')
|
||||
unlocking_method = fields.Selection(
|
||||
[('手动', '手动'), ('气动', '气动'), ('液压', '液压'), ('电动', '电动'), ('其他', '其他')], string='解锁方式')
|
||||
boolean_chip_blowing_function = fields.Boolean('是否有吹屑功能')
|
||||
carrying_capacity_max = fields.Float('最大承载重量(kg)', digits=(16, 2))
|
||||
rigidity = fields.Integer('硬度HRC')
|
||||
materials_model_id = fields.Many2one('sf.materials.model', '夹具材质')
|
||||
machine_tool_type_id = fields.Many2one('sf.machine_tool.type', '适用机床型号')
|
||||
|
||||
# ’零点托盘‘ 字段
|
||||
connector_diameter = fields.Selection([('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6'), ('8', '8')],
|
||||
string='连接头直径(mm)')
|
||||
way_to_install = fields.Selection(
|
||||
[('接口式', '接口式'), ('螺栓固定', '螺栓固定'), ('磁吸式', '磁吸式'), ('其他', '其他')], string='安装方式')
|
||||
type_of_drive = fields.Selection(
|
||||
[('气动式', '气动式'), ('液压式', '液压式'), ('机械式', '机械式'), ('电动式', '电动式'), ('其他', '其他')],
|
||||
string='驱动方式')
|
||||
|
||||
# ’气动夹具‘ 字段
|
||||
gripper_length_min = fields.Float('夹持工件最小长度(mm)', digits=(16, 2))
|
||||
gripper_width_min = fields.Float('夹持工件最小宽度(mm)', digits=(16, 2))
|
||||
gripper_height_min = fields.Float('夹持工件最小高度(mm)', digits=(16, 2))
|
||||
gripper_diameter_min = fields.Float('夹持工件最小直径(mm)', digits=(16, 2))
|
||||
gripper_length_max = fields.Float('夹持工件最大长度(mm)', digits=(16, 2))
|
||||
gripper_width_max = fields.Float('夹持工件最大宽度(mm)', digits=(16, 2))
|
||||
gripper_height_max = fields.Float('夹持工件最大高度(mm)', digits=(16, 2))
|
||||
gripper_diameter_max = fields.Float('夹持工件最大直径(mm)', digits=(16, 2))
|
||||
rated_air_pressure = fields.Float('额定气压(Mpa)', digits=(16, 2))
|
||||
interface_materials_model_id = fields.Many2one('sf.materials.model', '接口类型')
|
||||
|
||||
# ‘虎钳夹具' 字段
|
||||
transverse_groove = fields.Float('横向配合槽n(mm)', digits=(16, 2))
|
||||
longitudinal_fitting_groove = fields.Float('纵向配合槽l(mm)', digits=(16, 2))
|
||||
|
||||
# '磁吸夹具' 字段
|
||||
height_tolerance_value = fields.Char('高度公差(mm)')
|
||||
rated_adsorption_force = fields.Float('额定吸附力(N/cm²)', digits=(16, 2))
|
||||
magnetic_field_height = fields.Float('磁场高度(mm)', digits=(16, 2))
|
||||
magnetic_pole_plate_grinding_allowance = fields.Float('磁极板磨削余量(mm)', digits=(16, 2))
|
||||
|
||||
# '转接板(锁板)夹具' 字段
|
||||
screw_size = fields.Float('螺牙大小(mm)', digits=(16, 2))
|
||||
via_hole_diameter = fields.Float('过孔直径(mm)', digits=(16, 2))
|
||||
|
||||
# '三爪卡盘' 字段
|
||||
mounting_hole_depth = fields.Float('安装孔深度(mm)', digits=(16, 2))
|
||||
centering_diameter = fields.Float('定心直径(mm)', digits=(16, 2))
|
||||
@@ -26,33 +26,28 @@ class FixtureModel(models.Model):
|
||||
_name = 'sf.fixture.model'
|
||||
_description = "夹具型号"
|
||||
|
||||
name = fields.Char(string="名称", size=15)
|
||||
fixture_material_id = fields.Many2one('sf.fixture.material', string="夹具物料", )
|
||||
fixture_material_type = fields.Char(string="夹具物料类型", related='fixture_material_id.name', store=True)
|
||||
multi_mounting_type_id = fields.Many2one('sf.multi_mounting.type', string="联装类型")
|
||||
brand_id = fields.Many2one('sf.machine.brand', string="品牌", domain="[('tag_ids.name', 'ilike', '夹具')]")
|
||||
clamping_way = fields.Char(string="装夹方式")
|
||||
port_type = fields.Char(string="接口类型")
|
||||
name = fields.Char(string="名称", size=50, required=True)
|
||||
fixture_material_id = fields.Many2one('sf.fixture.material', string="夹具物料", required=True)
|
||||
fixture_material_type = fields.Char(string="夹具物料类型", related='fixture_material_id.name')
|
||||
multi_mounting_type_id = fields.Many2one('sf.multi_mounting.type', string="联装类型", required=True)
|
||||
brand_id = fields.Many2one('sf.machine.brand', string="品牌")
|
||||
model_file = fields.Binary(string="3D模型图")
|
||||
active = fields.Boolean('有效', default=False)
|
||||
|
||||
length = fields.Char(string="长度(mm)")
|
||||
width = fields.Char(string="宽度(mm)")
|
||||
height = fields.Char(string="高度(mm)")
|
||||
weight = fields.Char(string="重量(kg)")
|
||||
clamp_workpiece_length_max = fields.Integer(string="夹持工件长度max(mm)")
|
||||
clamp_workpiece_width_max = fields.Integer(string="夹持工件宽度max(mm)")
|
||||
clamp_workpiece_height_max = fields.Integer(string="夹持工件高度max(mm)")
|
||||
clamp_workpiece_diameter_max = fields.Float(string="夹持工件直径max(mm)")
|
||||
maximum_carrying_weight = fields.Float(string="最大承载重量(kg)")
|
||||
maximum_clamping_force = fields.Integer(string="最大夹持力(n)")
|
||||
|
||||
materials_model_id = fields.Many2one('sf.materials.model', string="材料型号")
|
||||
driving_way = fields.Selection([('气动', '气动'), ('液压', '液压'), ('机械', '机械')], string="驱动方式")
|
||||
apply_machine_tool_type_ids = fields.Many2many('sf.machine_tool.type', 'rel_fixture_model_machine_tool_type',
|
||||
string="适用机床型号")
|
||||
through_hole_size = fields.Integer(string="过孔大小[mm]")
|
||||
screw_size = fields.Integer(string="螺牙大小[mm]")
|
||||
active = fields.Boolean('有效', default=True)
|
||||
zero_chuck_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||
string='零点卡盘基本参数')
|
||||
zero_tray_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||
string='零点托盘基本参数')
|
||||
pneumatic_fixture_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||
string='气动夹具基本参数')
|
||||
jaw_vice_fixture_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||
string='虎钳夹具基本参数')
|
||||
magnet_fixture_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||
string='磁吸夹具基本参数')
|
||||
adapter_board_fixture_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||
string='转接板(锁板)夹具基本参数')
|
||||
scroll_chuck_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||
string='三爪卡盘基本参数')
|
||||
|
||||
def _get_code(self, fixture_model_type_code):
|
||||
fixture_model = self.env['sf.fixture.model'].sudo().search(
|
||||
@@ -70,14 +65,18 @@ class FixtureModel(models.Model):
|
||||
|
||||
def _onchange_fixture_material_id(self, fixture_material_id):
|
||||
if fixture_material_id:
|
||||
if fixture_material_id.name == "气动夹具":
|
||||
if self.fixture_material_id.name == "气动夹具":
|
||||
code = self._get_code("JKM-C-JJWL-QDJJ-")
|
||||
elif fixture_material_id.name == "转接板(锁板)夹具":
|
||||
code = self._get_code("JKM-C-JJWL-ZJBJJ-")
|
||||
elif fixture_material_id.name == "磁吸夹具":
|
||||
elif self.fixture_material_id.name == "转接板(锁板)夹具":
|
||||
code = self._get_code("JKM-C-JJWL-ZJJJ-")
|
||||
elif self.fixture_material_id.name == "磁吸夹具":
|
||||
code = self._get_code("JKM-C-JJWL-CXJJ-")
|
||||
elif fixture_material_id.name == "虎钳夹具":
|
||||
elif self.fixture_material_id.name == "虎钳夹具":
|
||||
code = self._get_code("JKM-C-JJWL-HQJJ-")
|
||||
elif self.fixture_material_id.name == "零点托盘":
|
||||
code = self._get_code("JKM-C-JJWL-LDTP-")
|
||||
elif self.fixture_material_id.name == "三爪卡盘":
|
||||
code = self._get_code("JKM-C-JJWL-SZKP-")
|
||||
else:
|
||||
code = self._get_code("JKM-C-JJWL-LDKP-")
|
||||
return code
|
||||
|
||||
@@ -75,6 +75,8 @@ class CuttingToolModel(models.Model):
|
||||
integral_coarse_medium_fine = fields.Selection([('粗', '粗'), ('中', '中'), ('精', '精')], '粗/中/精')
|
||||
integral_run_out_accuracy_max = fields.Char('整体式刀具端跳精度max')
|
||||
integral_run_out_accuracy_min = fields.Char('整体式刀具端跳精度min')
|
||||
ramping_angle_ids = fields.One2many('sf.ramping.angle', 'standard_library_id', '坡铣角度',
|
||||
domain=lambda self: [('standard_library_id', '=', self.id)])
|
||||
|
||||
fit_blade_shape_id = fields.Many2one('maintenance.equipment.image',
|
||||
'适配刀片形状', domain=[('type', '=', '刀片形状')])
|
||||
@@ -106,12 +108,9 @@ class CuttingToolModel(models.Model):
|
||||
cutting_speed_ids = fields.One2many('sf.cutting.speed', 'standard_library_id', string='切削速度Vc')
|
||||
feed_per_tooth_ids = fields.One2many('sf.feed.per.tooth', 'standard_library_id', '每齿走刀量fz',
|
||||
domain=[('cutting_speed', '!=', False)])
|
||||
feed_per_tooth_ids_2 = fields.One2many('sf.feed.per.tooth', 'standard_library_id', '每齿走刀量fz',
|
||||
domain=[('machining_method', '!=', False)])
|
||||
feed_per_tooth_ids_3 = fields.One2many('sf.feed.per.tooth', 'standard_library_id', '每齿走刀量fz',
|
||||
domain=[('cutting_speed', '!=', False)])
|
||||
feed_per_tooth_ids_4 = fields.One2many('sf.feed.per.tooth', 'standard_library_id', '每齿走刀量fz',
|
||||
domain=[('machining_method', '!=', False)])
|
||||
|
||||
material_model_id = fields.Many2one('sf.materials.model', '材料型号')
|
||||
# 适用夹头型号可以多选
|
||||
chuck_ids = fields.Many2many(
|
||||
@@ -157,6 +156,12 @@ class CuttingToolModel(models.Model):
|
||||
active = fields.Boolean('有效', default=True)
|
||||
is_cloud = fields.Boolean('云端数据', default=False)
|
||||
|
||||
# 无用字段
|
||||
feed_per_tooth_ids_2 = fields.One2many('sf.feed.per.tooth', 'standard_library_id', '每齿走刀量fz',
|
||||
domain=[('machining_method', '!=', False)])
|
||||
feed_per_tooth_ids_4 = fields.One2many('sf.feed.per.tooth', 'standard_library_id', '每齿走刀量fz',
|
||||
domain=[('machining_method', '!=', False)])
|
||||
|
||||
def _get_ids(self, cutting_tool_type_code, factory_short_name):
|
||||
cutting_tool_type_ids = []
|
||||
for item in cutting_tool_type_code:
|
||||
|
||||
@@ -299,14 +299,28 @@ class CuttingSpeed(models.Model):
|
||||
|
||||
product_template_id = fields.Many2one('product.template')
|
||||
standard_library_id = fields.Many2one('sf.cutting_tool.standard.library', string='标准库')
|
||||
|
||||
execution_standard_id = fields.Many2one('sf.international.standards', string='执行标准', store=True)
|
||||
material_code = fields.Char('材料代号')
|
||||
material_name_id = fields.Many2one('sf.materials.model', '材料名称',
|
||||
domain="[('standards_id', '=', execution_standard_id)]")
|
||||
material_grade = fields.Char('材料牌号')
|
||||
tensile_strength = fields.Char('拉伸强度 (N/mm²)')
|
||||
hardness = fields.Integer('硬度(hrc)')
|
||||
ability_feature_library = fields.Many2one('maintenance.equipment.image', '加工方式',
|
||||
domain="[('type', '=', '加工能力')]")
|
||||
cutting_width_depth_id = fields.Many2one('sf.cutting.width.depth', '切削宽度和深度')
|
||||
process_capability = fields.Selection([('粗加工', '粗加工'), ('精加工', '精加工')], string='粗/精加工')
|
||||
cutting_speed = fields.Char('切削速度', required=True)
|
||||
cutting_speed_max = fields.Float('最大值')
|
||||
cutting_speed_min = fields.Float('最小值')
|
||||
|
||||
application = fields.Selection([('主应用', '主应用'), ('次应用', '次应用')], '主/次应用')
|
||||
|
||||
# ===============待删除字段==============
|
||||
material_id = fields.Many2one('sf.materials.model', '材料名称',
|
||||
domain="[('standards_id', '=', execution_standard_id)]")
|
||||
slope_milling_angle = fields.Integer('坡铣角度(°)')
|
||||
material_grade = fields.Char('材料牌号')
|
||||
tensile_strength = fields.Char('拉伸强度 (N/mm²)')
|
||||
hardness = fields.Integer('硬度(HRC)')
|
||||
cutting_speed_n1 = fields.Char('径向切宽 ae=100%D1 ap=1*D1 切削速度Vc')
|
||||
cutting_speed_n2 = fields.Char('径向切宽 ae=50%D1 ap=1.5*D1 切削速度Vc')
|
||||
cutting_speed_n3 = fields.Char('径向切宽 ae=25%D1 ap=L1max 切削速度Vc')
|
||||
@@ -314,7 +328,8 @@ class CuttingSpeed(models.Model):
|
||||
cutting_speed_n5 = fields.Char('径向切宽 ae=5%D1 ap=L1max 切削速度Vc')
|
||||
rough_machining = fields.Char('粗加工 Vc(m/min)')
|
||||
precision_machining = fields.Char('精加工 Vc(m/min)')
|
||||
application = fields.Selection([('主应用', '主应用'), ('次应用', '次应用')], '主/次应用')
|
||||
|
||||
# ======================================
|
||||
|
||||
def _json_cutting_speed(self, obj):
|
||||
cutting_speed_str = (0, '', {
|
||||
@@ -340,15 +355,20 @@ class CuttingSpeed(models.Model):
|
||||
class FeedPerTooth(models.Model):
|
||||
_name = 'sf.feed.per.tooth'
|
||||
_description = '每齿走刀量fz'
|
||||
_order = 'machining_method desc, blade_diameter, materials_type_id'
|
||||
_order = 'blade_diameter,cutting_width_depth_id,materials_type_id'
|
||||
|
||||
product_template_id = fields.Many2one('product.template')
|
||||
standard_library_id = fields.Many2one('sf.cutting_tool.standard.library', string='标准库')
|
||||
blade_diameter = fields.Integer('刃部直径(mm)', readonly=True)
|
||||
materials_type_id = fields.Many2one('sf.materials.model', string='材料名称', readonly=True)
|
||||
cutting_width_depth_id = fields.Many2one('sf.cutting.width.depth', '切削宽度和深度', readonly=True)
|
||||
feed_per_tooth = fields.Char('每齿走刀量 (mm/z)', size=20)
|
||||
|
||||
# =============待删除字段===========
|
||||
cutting_speed = fields.Char('径向切宽 ae(mm)')
|
||||
machining_method = fields.Selection([('直铣', '直铣'), ('坡铣', '坡铣')], string='加工方式')
|
||||
materials_type_id = fields.Many2one('sf.materials.model', string='材料型号')
|
||||
blade_diameter = fields.Integer('刃部直径(mm)', readonly=True)
|
||||
feed_per_tooth = fields.Char('每齿走刀量 (mm/z)')
|
||||
|
||||
# ================================
|
||||
|
||||
def _json_feed_per_tooth(self, obj):
|
||||
feed_per_tooth_str = (0, '', {
|
||||
@@ -388,3 +408,19 @@ class FeedPerTooth(models.Model):
|
||||
# def _compute_product_template_id(self):
|
||||
# if self.product_template_id is not None:
|
||||
# self.blade_diameter = self.product_template_id.cutting_tool_blade_diameter
|
||||
|
||||
|
||||
class CuttingWidthDepth(models.Model):
|
||||
_name = 'sf.cutting.width.depth'
|
||||
_description = '切削宽度和深度'
|
||||
|
||||
name = fields.Char('名称')
|
||||
|
||||
|
||||
class RampingAngle(models.Model):
|
||||
_name = 'sf.ramping.angle'
|
||||
_description = '坡铣角度'
|
||||
|
||||
standard_library_id = fields.Many2one('sf.cutting_tool.standard.library', '刀具标准库')
|
||||
|
||||
name = fields.Char('坡铣角度')
|
||||
|
||||
Reference in New Issue
Block a user