4 Commits

Author SHA1 Message Date
14796d4d9c feat: 提交 2025-08-25 09:16:31 +08:00
b09ac98b56 feat: 提交 2025-08-04 17:16:07 +08:00
61e47e24b7 feat:提交--更新字段 boardHeight=>boardLength 2025-08-01 10:28:13 +08:00
8c00def696 feat:提交 2025-07-31 09:19:22 +08:00
6 changed files with 64 additions and 30 deletions

3
.gitignore vendored
View File

@@ -1,3 +1,4 @@
*.tgz
node_modules/*
*.yaml
*.yaml
dist/*

16
.vscode/launch.json vendored
View File

@@ -1,16 +0,0 @@
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "针对 localhost 启动 Chrome",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}

View File

@@ -1,5 +0,0 @@
{
// libs工作区必须使用相对路径进行导入
"typescript.preferences.importModuleSpecifier": "relative",
"javascript.preferences.importModuleSpecifier": "relative"
}

View File

@@ -1,6 +1,6 @@
{
"name": "@imes-procesor/libs",
"version": "0.1.0",
"version": "1.1.0",
"description": "",
"type": "module",
"scripts": {
@@ -21,7 +21,7 @@
"./utils": "./src/utils/index.ts"
},
"dependencies": {
"cut-abstractions": "http://gitea.cf/MES-FE/cut-abstractions/releases/download/0.2/cut-abstractions-0.2.0.tgz"
"cut-abstractions": "http://gitea.cf/MES-FE/cut-abstractions/releases/download/0.3/cut-abstractions-0.3.4.tgz"
},
"devDependencies": {
"@types/node": "^24.0.10",

View File

@@ -28,7 +28,7 @@ export class CutOrderProc extends ProcessorBase<CutOrderInput, CutorderOutput, C
let beginId = 0;
let dt = context.input?.gap || 6;
let k = context.input?.boardWidth || 0;
let g = context.input?.boardHeight || 0;
let g = context.input?.boardLength || 0;
for (let i = 0; i < length; i++) {
let block = context.input?.blocks[i];
@@ -110,9 +110,9 @@ export class CutOrderProc extends ProcessorBase<CutOrderInput, CutorderOutput, C
} else if (input.boardWidth == undefined) {
info.isOk = false
info.msg = 'context.input.boardWidth is undefind'
} else if (input.boardHeight == undefined) {
} else if (input.boardLength == undefined) {
info.isOk = false
info.msg = 'context.input.boardHeight is undefind'
info.msg = 'context.input.boardLength is undefind'
}

View File

@@ -47,7 +47,7 @@ test('cutOrderTest', async () => {
let input: CutOrderInput = {
boardWidth: 1220,
boardHeight: 2440,
boardLength: 2440,
gap: 6,
blocks
}
@@ -55,7 +55,61 @@ test('cutOrderTest', async () => {
input,
params
}
await cutOrderProc.exec(context)
let demo = {
"input": {
"boardWidth": 1220,
"boardLength": 2440,
"gap": 6,
"blocks": [
{
"id": "1905521077598027776",
"width": 600,
"length": 400,
"waveType": 0,
"x": 3,
"y": 3
},
{
"id": "1905521077635776512",
"width": 600,
"length": 400,
"waveType": 0,
"x": 404,
"y": 3
},
{
"id": "1905521077656748032",
"width": 600,
"length": 400,
"waveType": 0,
"x": 805,
"y": 3
},
{
"id": "1905521077681913856",
"width": 600,
"length": 400,
"waveType": 0,
"x": 1206,
"y": 3
},
{
"id": "1905521077707079680",
"width": 600,
"length": 400,
"waveType": 0,
"x": 1607,
"y": 3
}
]
},
"params": {
"name": "",
"version": "1.0.0"
}
}
await cutOrderProc.exec(demo)
// 将在context的output中显示结果
console.log(context);
console.log(demo);
})