自动化TonCut用于1D和2D材料的切割优化。 但是,它没有用户界面。用于优化的数据以JSON格式传送给Toncut。生成的结果也是这种格式。
该程序可以在批处理模式下使用,也可作为Websocket服务器。 由于数据格式简单清晰,易于与其他系统集成。 在服务器模式下,一个非常简单的API扩展了集成的可能性。
自动化TonCut可作为Windows服务运行。在这种情况下,可以通过Websocket (ws)或Websocket Secure (wss)协议进行连接。
该程序也可以作为批处理工具从命令行启动。在这种情况下,通过文件或标准输入将输入数据提供给程序。 结果可以写成标准输出或文件。
{ "version": 1, "defaultUnits": { "time": "s", "percent": "%", "length": "mm", "field": "sqmm", "angle": "deg" }, "devices": [ { "id": 1, "title": "2D设备", "materialKind": "2d", "canCrossCuts": false, "fullCutsOnly": true, "stripCuts": true, "minCutWidth": 0, "edgingCuts": "optimal", "originEdgingCuts": "default", "firstCutDirection": "any" } ], "materials": [ { "id": 1, "deviceId": 1, "title": "2D 材料", "kind": "2d", "thickness": 18, "canHaveStructure": true, "surplus": 0, "surplusEditable": true, "margin": 0, "marginEditable": true, "defaultEdging": 0, "cuttingDimensions": "net", "canBeVeneered": true, "kerf": 3, "allowEdgeCuts": true, "reuseWaste": { "minShorterLength": 200, "minLongerLength": 200 } } ], "pieces": [ { "id": 1, "materialId": 1, "length": 922, "width": 688, "quantity": 10, "structure": ["byLength", "byWidth", "none"], "priority": "normal", "description": "", "surplus": 0, "margin": 0 }, { "id": 2, "materialId": 1, "length": 1220, "width": 740, "quantity": 20, "structure": ["byLength", "byWidth", "none"], "priority": "normal", "description": "", "surplus": 0, "margin": 0 } ], "stock": [ { "id": 1, "materialId": 1, "length": 3210, "width": 2245, "quantity": 1, "structure": "none", "priority": "normal", "description": "", "edging": { "left": 20, "right": 20, "top": 20, "bottom": 20 } } ] }
{ "version": 2, "units": { "length": "mm", "field": "sqm", "angle": "rad" }, "statistics": { "2d": { "field": 7.20645, "usedField": 6.514416, "wasteField": 0.692034, "unusedField": 0, "cutCount": 20, "cutsLength": 21335 }, "1d": { "length": 0, "usedLength": 0, "wasteLength": 0, "unusedLength": 0, "cutCount": 0, "cutsLength": 0 } }, "cuttings": [ { "stockItemId": 1, "quantity": 1, "statistics": { "2d": { "field": 7.20645, "usedField": 6.514416, "wasteField": 0.692034, "unusedField": 0, "cutCount": 20, "cutsLength": 21335 } }, "pieces": [ { "pieceId": 1, "x": 23, "y": 23, "rotated": false }, { "pieceId": 1, "x": 23, "y": 714, "rotated": false }, { "pieceId": 1, "x": 23, "y": 1405, "rotated": false }, { "pieceId": 2, "x": 948, "y": 23, "rotated": true }, { "pieceId": 2, "x": 1691, "y": 23, "rotated": true }, { "pieceId": 2, "x": 2434, "y": 23, "rotated": true }, { "pieceId": 1, "x": 948, "y": 1246, "rotated": true }, { "pieceId": 1, "x": 1639, "y": 1246, "rotated": true }, { "pieceId": 1, "x": 2330, "y": 1246, "rotated": true } ], "rest": [ { "x": 0, "y": 2096, "length": 945, "width": 149, "identifier": "", "usable": false }, { "x": 3177, "y": 0, "length": 33, "width": 1243, "identifier": "", "usable": false }, { "x": 948, "y": 2171, "length": 1379, "width": 74, "identifier": "", "usable": false }, { "x": 2330, "y": 2171, "length": 688, "width": 74, "identifier": "", "usable": false }, { "x": 3021, "y": 1246, "length": 189, "width": 999, "identifier": "", "usable": false }, { "x": 0, "y": 0, "length": 945, "width": 20, "identifier": "", "usable": false }, { "x": 948, "y": 0, "length": 740, "width": 20, "identifier": "", "usable": false }, { "x": 1691, "y": 0, "length": 740, "width": 20, "identifier": "", "usable": false }, { "x": 2434, "y": 0, "length": 740, "width": 20, "identifier": "", "usable": false }, { "x": 0, "y": 23, "length": 20, "width": 688, "identifier": "", "usable": false }, { "x": 0, "y": 714, "length": 20, "width": 688, "identifier": "", "usable": false }, { "x": 0, "y": 1405, "length": 20, "width": 688, "identifier": "", "usable": false } ], "cuts": [ { "startX": 948, "startY": 0, "endX": 948, "endY": 2245 }, { "startX": 0, "startY": 23, "endX": 948, "endY": 23 }, { "startX": 0, "startY": 714, "endX": 948, "endY": 714 }, { "startX": 23, "startY": 23, "endX": 23, "endY": 714 }, { "startX": 0, "startY": 1405, "endX": 948, "endY": 1405 }, { "startX": 23, "startY": 714, "endX": 23, "endY": 1405 }, { "startX": 0, "startY": 2096, "endX": 948, "endY": 2096 }, { "startX": 23, "startY": 1405, "endX": 23, "endY": 2096 }, { "startX": 948, "startY": 1246, "endX": 3210, "endY": 1246 }, { "startX": 1691, "startY": 0, "endX": 1691, "endY": 1246 }, { "startX": 948, "startY": 23, "endX": 1691, "endY": 23 }, { "startX": 2434, "startY": 0, "endX": 2434, "endY": 1246 }, { "startX": 1691, "startY": 23, "endX": 2434, "endY": 23 }, { "startX": 3177, "startY": 0, "endX": 3177, "endY": 1246 }, { "startX": 2434, "startY": 23, "endX": 3177, "endY": 23 }, { "startX": 2330, "startY": 1246, "endX": 2330, "endY": 2245 }, { "startX": 948, "startY": 2171, "endX": 2330, "endY": 2171 }, { "startX": 1639, "startY": 1246, "endX": 1639, "endY": 2171 }, { "startX": 3021, "startY": 1246, "endX": 3021, "endY": 2245 }, { "startX": 2330, "startY": 2171, "endX": 3021, "endY": 2171 } ] } ] }
服务器版本允许使用基于Websocket协议的简易便捷的API进行通信。
服务器和客户端之间交换的所有消息均以JSON格式保存。
示例命令:{ "cmd":"cmdListJobs","id":9222}示例响应:
{ "id":9222,"jobs":[{ "id":1,"state":"sDone","progress":100,"combinationCount":1042885,"createDate":"2023-04-18T12:31:43.133+02:00","startDate":"2023-04-18T12:31:43.166+02:00","endDate":"2023-04-18T12:31:44.739+02:00"}],"success":true}示例事件:
{ "event":"JobProgress","jobId":1,"progress":74,"combinationCount":668878}
命令发送给服务器。示例命令包括"add job"、"get list of jobs"、"get status"、"get job data"等。
服务器发送响应给客户端。 根据命令的类型,响应可能具有不同的格式。
服务器还自行发送各种事件,如"job added"、"optimization progress"、"optimization completed"等。
该程序一次只能执行一次优化。 在此期间,可以接受新的作业优化,但将按照添加的顺序排队并依次执行。
每个作业任务都是一个单独的优化订单。 作业任务是相互独立的,包含一整套输入数据,即工件、库存、材料组、饰面和切割设备。
结果包括所有切割。每次切割包括工件和废料的处理,以及切割列表。
要更新程序,只需安装新版本即可。切勿在升级前卸载旧程序版本!