方形件-电子锯
创建任务
创建二维切割-方形件-电子锯任务, 该接口为异步操作,返回任务ID,任务的状态及结果请通过查询任务详情接口获取
URI
POST /v2/{project_id}/optverse/regular-plate/tasks
请求参数
二维切割前的原材料请求参数如表1所示。
参数 |
是否必须 |
参数类型 |
说明 |
---|---|---|---|
plate_id |
是 |
Int |
原材料ID |
plate_length |
是 |
Float |
原材料长 |
plate_width |
是 |
Float |
原材料宽 |
plate_thick |
是 |
Float |
原材料厚度 |
plate_material |
是 |
String |
原材料制作材料 |
plate_grain |
是 |
Bool |
原材料是否有纹路 |
plate_num |
是 |
Int |
原材料数量 |
is_offcut |
否 |
Bool |
是否为余料 |
plate_cost |
否 |
Float |
原材料成本 |
二维切割后的成品请求参数如表2所示。
参数 |
是否必须 |
参数类型 |
说明 |
---|---|---|---|
item_id |
是 |
int |
成品ID |
item_length |
是 |
Float |
成品长 |
item_width |
是 |
Float |
成品宽 |
item_thick |
是 |
Float |
成品厚度 |
item_num |
是 |
Int |
成品数量 |
item_turn |
是 |
Bool |
成品是否可以旋转(无纹路:true,有纹路:false) |
item_material |
是 |
String |
成品材料 |
item_name |
是 |
String |
成品名称 |
is_substitute |
否 |
Bool |
是否为替补板 |
label_info |
是(键值对内的信息可随意增加与删减) |
map<String,String> |
打印标签信息的键值对组合 |
二维切割条件参数的请求参数如表3所示。
参数 |
是否必须 |
参数类型 |
说明 |
---|---|---|---|
kerf_horizontal |
是 |
Float |
横向锯刀宽度 |
kerf_vertical |
是 |
Float |
纵向锯刀宽度 |
plate_trim_horizontal |
是 |
Float |
原材料横向修边量 |
plate_trim_vertical |
是 |
Float |
原材料纵向修边量 |
item_forward_trim |
是 |
Float |
再分锯切前向修边量 |
item_backward_trim |
是 |
Float |
再分锯切后部修边量 |
first_cut_direction |
是 |
Int |
进料方向(横向0,纵向1,任意方向2) |
max_stack_height |
是 |
Float |
最大叠板高度 |
calculate_time |
是 |
Int |
算法的最长计算时间 |
offcut_length |
否 |
Float |
余料长度下限 |
offcut_width |
否 |
Float |
余料宽度下限 |
offcut_area |
否 |
Float |
余料面积下限 |
time_cost |
否 |
Float |
每小时的锯切时间成本 |
max_cut_stage_num |
否 |
Int |
开始切割后,同一个方向上的切割,统计为一次,需在设置的转板次数内,将大板切割完毕 |
min_stack_utilization |
否 |
Float |
最小的叠板利用率 |
item_sort_location |
否 |
Bool |
长条板件中部件的放置顺序,true最大部件放在左侧,false最大部件放在右侧 |
item_num_limit |
否 |
Int |
锯切图上的小板种类数量限制 |
请求示例
POST https://{endpoint}/v2/{project_id}/optverse/regular-plate/tasks Request Header: Content-Type: application/json;charset=utf-8 Auth-Token: Body: { "items": [ { "item_id": 0, "item_material": "18MM_PLATE", "item_length": 60.0, "item_width": 553.0, "item_turn": true, "item_num": 1, "item_name": "底板", "item_thick": 18, "is_substitute": false, "label_info": { "order_code": "订单号", "plan_code": "批次号", "item_code": "小板标识" } }, { "item_id": 0, "item_material": "18MM_PLATE", "item_length": 60.0, "item_width": 553.0, "item_turn": true, "item_num": 1, "item_name": "底板", "item_thick": 18, "is_substitute": true, "label_info": { "order_code": "订单号", "plan_code": "批次号", "item_code": "小板标识" } } ], "parameters": [ { "calculate_time": 30, "first_cut_direction": 2, "item_backward_trim": 0.0, "item_forward_trim": 0.0, "kerf_horizontal": 4.4, "kerf_vertical": 4.4, "max_stack_height": 80, "plate_trim_horizontal": 10.0, "plate_trim_vertical": 10.0, "time_cost": 200, "max_cut_stage_num": 3, "min_stack_utilization": 0.8, "item_sort_location": false, "item_num_limit": 0 } ], "plates": [ { "plate_grain": true, "plate_id": 0, "plate_length": 2440.0, "plate_material": "18MM_PLATE", "plate_num": 9999, "plate_thick": 18.0, "plate_width": 1220.0, "plate_cost": 100 } ] }
响应示例
成功响应示例
{ "task_id": "40axxxx-701a-47cf-8b56-648xxxxxxd25" }
参数说明如表4所示。
{
"error_code": "optverse.00000006",
"error_msg": "Input data validate error: the item material is 18MM_PLATE, item_id is 0: Length and width are larger than plate.\n"
}
查询任务
该API用于查询并显示方形件-电子锯任务详情
URI
GET /v2/{project_id}/optverse/regular-plate/tasks/{task_id}
请求参数
参数 |
参数类型 |
说明 |
---|---|---|
task_id |
String |
任务ID |
响应参数
参数 |
参数类型 |
说明 |
---|---|---|
error_detail |
String |
如果运行出错会提示 |
result |
Object |
如果运行正常会在该属性内给出结果 |
status |
String |
任务运行状态,详情请参见表7 |
task_id |
String |
任务id |
result_list |
Array of objects |
切割方案列表 |
plan_info |
Array of objects |
切割方案的统计信息列表 |
cut_file |
String |
以字符串形式保存的切割方案文件 |
plan_name |
String |
此方案序号(根据参数设置可给出多组方案) |
material_info |
String |
统计信息,详情请参见表8 |
material_name |
String |
材料名称 |
problem_id |
Int |
按材料划分的问题序列号 |
状态 |
说明 |
---|---|
waiting |
在任务队列中,等待执行, 当等待时间超过一定时间,会超时,转为abnormal状态 |
running |
任务正在执行 |
finished |
任务成功运行结束,通过`result`获取结果 |
failed |
任务执行出错,通过`error_detail`获取错误信息 |
abnormal |
任务异常,可能是排队超时,可能是重试次数超时,可能是计算时间超时,通过`error_detail`获取错误信息 |
参数 |
单位 |
参数类型 |
说明 |
---|---|---|---|
cut_length |
米(m) |
float |
切割长度 |
cut_sum |
- |
Int |
切割刀数 |
cut_time |
分钟(min) |
float |
锯切时间 |
item_num |
- |
Int |
开料件数 |
material |
- |
String |
材料 |
program_num |
- |
Int |
锯切图数量 |
run_program_num |
- |
Int |
运行的锯切图数 |
rate |
百分比(%) |
float |
原材料利用率 |
sum_area |
平方米(m2) |
float |
原材料使用面积 |
sum_cost |
- |
Float |
锯切成本 |
sum_plate_num |
- |
Int |
原材料使用数量 |
sum_used_area |
平方米(m2) |
float |
原材料利用面积 |
响应示例
响应示例
{
"result": {
"result_list": [
{
"cut_file": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><AutoCut ver=\"100\"><Project Name=\"订单\" CutTime=\"999.99\" Selected=\"-1\" ApplictionVer=\"1.0.0\" Update=\"2020-4-22 11:14:00\"><Data Class=\"3\" TotalUnit=\"1000000\" Type=\"18.0_18MM_PLATE\" Ply=\"18.0\" Grain=\"True\"><Objective Type=\"Shape\" Count=\"1\"><Shape X=\"60.0\" Y=\"553.0\" Turn=\"True\" Count=\"1\" Name=\"底板\" TLType=\"18MM_PLATE_18.0mm\" FH=\"18.0\" item_code=\"小板标识\" order_code=\"订单号\" plan_code=\"批次号\"/></Objective><Substitute Type=\"Shape\" Count=\"1\"><Shape X=\"60.0\" Y=\"553.0\" Turn=\"True\" Count=\"1\" Name=\"底板\" TLType=\"18MM_PLATE_18.0mm\" FH=\"18.0\" item_code=\"小板标识\" order_code=\"订单号\" plan_code=\"批次号\"/></Substitute><Condition Type=\"Shape\" Count=\"1\"><Shape Name=\"18MM_PLATE\" X=\"2440.0\" Y=\"1220.0\" Turn=\"True\" Sx=\"10.0\" Sy=\"10.0\" Count=\"9999\"/></Condition><Solutions Selected=\"0\"><Solution SolverName=\"排料名称\" SolveGap=\"4.4\" SheetCounts=\"1\" SumUnitArea=\"66360.0\" SumSheetArea=\"2976800.0\" SumSpareArea=\"2910440.0\"><Layouts><Layout ID=\"0\" SheetID=\"0\" Count=\"1\" Cut=\"False\" X=\"2440.0\" Y=\"1220.0\" UnitArea=\"66360.0\" SheetArea=\"2976800.0\" SpareArea=\"2910440.0\"><Part X=\"1212.2\" Y=\"2432.2\" Px=\"7.8\" Py=\"7.8\"><Part X=\"2432.2\" Y=\"60.0\" Px=\"7.8\" Py=\"7.8\"><Part X=\"60.0\" Y=\"553.0\" Px=\"7.8\" Py=\"7.8\" Turn=\"False\" UID=\"0\" BID=\"0\" Angle=\"90\"/><Substitute X=\"60.0\" Y=\"553.0\" Px=\"565.2\" Py=\"7.8\" Turn=\"False\" SID=\"0\" BID=\"0\" Angle=\"90\"/></Part></Part></Layout></Layouts></Solution></Solutions></Data></Project></AutoCut>",
"plan_info": [
{
"material_info": {
"cut_length": 5.02,
"cut_sum": 5,
"cut_time": 1.1,
"item_num": 2,
"material": "18MM_PLATE",
"program_num": 1,
"rate": 0.02229,
"run_program_num": 1,
"sum_area": 2.98,
"sum_cost": 103.67,
"sum_plate_num": 1,
"sum_used_area": 0.07
},
"material_name": "18MM_PLATE",
"problem_id": 1
}
],
"plan_name": "方案1"
},
{
"cut_file": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><AutoCut ver=\"100\"><Project Name=\"订单\" CutTime=\"999.99\" Selected=\"-1\" ApplictionVer=\"1.0.0\" Update=\"2020-4-22 11:14:00\"><Data Class=\"3\" TotalUnit=\"1000000\" Type=\"18.0_18MM_PLATE\" Ply=\"18.0\" Grain=\"True\"><Objective Type=\"Shape\" Count=\"1\"><Shape X=\"60.0\" Y=\"553.0\" Turn=\"True\" Count=\"1\" Name=\"底板\" TLType=\"18MM_PLATE_18.0mm\" FH=\"18.0\" item_code=\"小板标识\" order_code=\"订单号\" plan_code=\"批次号\"/></Objective><Substitute Type=\"Shape\" Count=\"1\"><Shape X=\"60.0\" Y=\"553.0\" Turn=\"True\" Count=\"1\" Name=\"底板\" TLType=\"18MM_PLATE_18.0mm\" FH=\"18.0\" item_code=\"小板标识\" order_code=\"订单号\" plan_code=\"批次号\"/></Substitute><Condition Type=\"Shape\" Count=\"1\"><Shape Name=\"18MM_PLATE\" X=\"2440.0\" Y=\"1220.0\" Turn=\"True\" Sx=\"10.0\" Sy=\"10.0\" Count=\"9999\"/></Condition><Solutions Selected=\"0\"><Solution SolverName=\"排料名称\" SolveGap=\"4.4\" SheetCounts=\"1\" SumUnitArea=\"66360.0\" SumSheetArea=\"2976800.0\" SumSpareArea=\"2910440.0\"><Layouts><Layout ID=\"0\" SheetID=\"0\" Count=\"1\" Cut=\"False\" X=\"2440.0\" Y=\"1220.0\" UnitArea=\"66360.0\" SheetArea=\"2976800.0\" SpareArea=\"2910440.0\"><Part X=\"1212.2\" Y=\"2432.2\" Px=\"7.8\" Py=\"7.8\"><Part X=\"2432.2\" Y=\"60.0\" Px=\"7.8\" Py=\"7.8\"><Part X=\"60.0\" Y=\"553.0\" Px=\"7.8\" Py=\"7.8\" Turn=\"False\" UID=\"0\" BID=\"0\" Angle=\"90\"/><Substitute X=\"60.0\" Y=\"553.0\" Px=\"565.2\" Py=\"7.8\" Turn=\"False\" SID=\"0\" BID=\"0\" Angle=\"90\"/></Part></Part></Layout></Layouts></Solution></Solutions></Data></Project></AutoCut>",
"plan_info": [
{
"material_info": {
"cut_length": 5.02,
"cut_sum": 5,
"cut_time": 1.1,
"item_num": 2,
"material": "18MM_PLATE",
"program_num": 1,
"rate": 0.02229,
"run_program_num": 1,
"sum_area": 2.98,
"sum_cost": 103.67,
"sum_plate_num": 1,
"sum_used_area": 0.07
},
"material_name": "18MM_PLATE",
"problem_id": 1
}
],
"plan_name": "方案2"
},
{
"cut_file": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><AutoCut ver=\"100\"><Project Name=\"订单\" CutTime=\"999.99\" Selected=\"-1\" ApplictionVer=\"1.0.0\" Update=\"2020-4-22 11:14:00\"><Data Class=\"3\" TotalUnit=\"1000000\" Type=\"18.0_18MM_PLATE\" Ply=\"18.0\" Grain=\"True\"><Objective Type=\"Shape\" Count=\"1\"><Shape X=\"60.0\" Y=\"553.0\" Turn=\"True\" Count=\"1\" Name=\"底板\" TLType=\"18MM_PLATE_18.0mm\" FH=\"18.0\" item_code=\"小板标识\" order_code=\"订单号\" plan_code=\"批次号\"/></Objective><Substitute Type=\"Shape\" Count=\"1\"><Shape X=\"60.0\" Y=\"553.0\" Turn=\"True\" Count=\"1\" Name=\"底板\" TLType=\"18MM_PLATE_18.0mm\" FH=\"18.0\" item_code=\"小板标识\" order_code=\"订单号\" plan_code=\"批次号\"/></Substitute><Condition Type=\"Shape\" Count=\"1\"><Shape Name=\"18MM_PLATE\" X=\"2440.0\" Y=\"1220.0\" Turn=\"True\" Sx=\"10.0\" Sy=\"10.0\" Count=\"9999\"/></Condition><Solutions Selected=\"0\"><Solution SolverName=\"排料名称\" SolveGap=\"4.4\" SheetCounts=\"1\" SumUnitArea=\"66360.0\" SumSheetArea=\"2976800.0\" SumSpareArea=\"2910440.0\"><Layouts><Layout ID=\"0\" SheetID=\"0\" Count=\"1\" Cut=\"False\" X=\"2440.0\" Y=\"1220.0\" UnitArea=\"66360.0\" SheetArea=\"2976800.0\" SpareArea=\"2910440.0\"><Part X=\"1212.2\" Y=\"2432.2\" Px=\"7.8\" Py=\"7.8\"><Part X=\"2432.2\" Y=\"60.0\" Px=\"7.8\" Py=\"7.8\"><Part X=\"60.0\" Y=\"553.0\" Px=\"7.8\" Py=\"7.8\" Turn=\"False\" UID=\"0\" BID=\"0\" Angle=\"90\"/><Substitute X=\"60.0\" Y=\"553.0\" Px=\"565.2\" Py=\"7.8\" Turn=\"False\" SID=\"0\" BID=\"0\" Angle=\"90\"/></Part></Part></Layout></Layouts></Solution></Solutions></Data></Project></AutoCut>",
"plan_info": [
{
"material_info": {
"cut_length": 5.02,
"cut_sum": 5,
"cut_time": 1.1,
"item_num": 2,
"material": "18MM_PLATE",
"program_num": 1,
"rate": 0.02229,
"run_program_num": 1,
"sum_area": 2.98,
"sum_cost": 103.67,
"sum_plate_num": 1,
"sum_used_area": 0.07
},
"material_name": "18MM_PLATE",
"problem_id": 1
}
],
"plan_name": "方案3"
},
{
"cut_file": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><AutoCut ver=\"100\"><Project Name=\"订单\" CutTime=\"999.99\" Selected=\"-1\" ApplictionVer=\"1.0.0\" Update=\"2020-4-22 11:14:00\"><Data Class=\"3\" TotalUnit=\"1000000\" Type=\"18.0_18MM_PLATE\" Ply=\"18.0\" Grain=\"True\"><Objective Type=\"Shape\" Count=\"1\"><Shape X=\"60.0\" Y=\"553.0\" Turn=\"True\" Count=\"1\" Name=\"底板\" TLType=\"18MM_PLATE_18.0mm\" FH=\"18.0\" item_code=\"小板标识\" order_code=\"订单号\" plan_code=\"批次号\"/></Objective><Substitute Type=\"Shape\" Count=\"1\"><Shape X=\"60.0\" Y=\"553.0\" Turn=\"True\" Count=\"1\" Name=\"底板\" TLType=\"18MM_PLATE_18.0mm\" FH=\"18.0\" item_code=\"小板标识\" order_code=\"订单号\" plan_code=\"批次号\"/></Substitute><Condition Type=\"Shape\" Count=\"1\"><Shape Name=\"18MM_PLATE\" X=\"2440.0\" Y=\"1220.0\" Turn=\"True\" Sx=\"10.0\" Sy=\"10.0\" Count=\"9999\"/></Condition><Solutions Selected=\"0\"><Solution SolverName=\"排料名称\" SolveGap=\"4.4\" SheetCounts=\"1\" SumUnitArea=\"66360.0\" SumSheetArea=\"2976800.0\" SumSpareArea=\"2910440.0\"><Layouts><Layout ID=\"0\" SheetID=\"0\" Count=\"1\" Cut=\"False\" X=\"2440.0\" Y=\"1220.0\" UnitArea=\"66360.0\" SheetArea=\"2976800.0\" SpareArea=\"2910440.0\"><Part X=\"1212.2\" Y=\"2432.2\" Px=\"7.8\" Py=\"7.8\"><Part X=\"2432.2\" Y=\"60.0\" Px=\"7.8\" Py=\"7.8\"><Part X=\"60.0\" Y=\"553.0\" Px=\"7.8\" Py=\"7.8\" Turn=\"False\" UID=\"0\" BID=\"0\" Angle=\"90\"/><Substitute X=\"60.0\" Y=\"553.0\" Px=\"565.2\" Py=\"7.8\" Turn=\"False\" SID=\"0\" BID=\"0\" Angle=\"90\"/></Part></Part></Layout></Layouts></Solution></Solutions></Data></Project></AutoCut>",
"plan_info": [
{
"material_info": {
"cut_length": 5.02,
"cut_sum": 5,
"cut_time": 1.1,
"item_num": 2,
"material": "18MM_PLATE",
"program_num": 1,
"rate": 0.02229,
"run_program_num": 1,
"sum_area": 2.98,
"sum_cost": 103.67,
"sum_plate_num": 1,
"sum_used_area": 0.07
},
"material_name": "18MM_PLATE",
"problem_id": 1
}
],
"plan_name": "方案4"
}
]
},
"status": "finished",
"task_id": "40axxxxx-701a-47cf-8b56-648xxxxxxx25"
}