天筹求解器服务 OPTVERSE-创建任务:示例

时间:2024-06-26 15:19:03

示例

  • 请求示例
    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所示。

    表4 参数说明

    参数

    参数类型

    说明

    task_id

    String

    任务ID

  • 失败响应示例
    {
        "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"
    }
support.huaweicloud.com/api-optverse/optverse_04_0303.html