Compare commits
3 Commits
imes-cutOr
...
1.1.0
Author | SHA1 | Date | |
---|---|---|---|
b09ac98b56 | |||
61e47e24b7 | |||
8c00def696 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
*.tgz
|
*.tgz
|
||||||
node_modules/*
|
node_modules/*
|
||||||
*.yaml
|
*.yaml
|
||||||
|
dist/*
|
16
.vscode/launch.json
vendored
16
.vscode/launch.json
vendored
@@ -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}"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
@@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
// libs工作区必须使用相对路径进行导入!
|
|
||||||
"typescript.preferences.importModuleSpecifier": "relative",
|
|
||||||
"javascript.preferences.importModuleSpecifier": "relative"
|
|
||||||
}
|
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@imes-procesor/libs",
|
"name": "@imes-procesor/libs",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
"./utils": "./src/utils/index.ts"
|
"./utils": "./src/utils/index.ts"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"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.2/cut-abstractions-0.2.1.tgz"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^24.0.10",
|
"@types/node": "^24.0.10",
|
||||||
|
@@ -28,7 +28,7 @@ export class CutOrderProc extends ProcessorBase<CutOrderInput, CutorderOutput, C
|
|||||||
let beginId = 0;
|
let beginId = 0;
|
||||||
let dt = context.input?.gap || 6;
|
let dt = context.input?.gap || 6;
|
||||||
let k = context.input?.boardWidth || 0;
|
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++) {
|
for (let i = 0; i < length; i++) {
|
||||||
let block = context.input?.blocks[i];
|
let block = context.input?.blocks[i];
|
||||||
@@ -110,9 +110,9 @@ export class CutOrderProc extends ProcessorBase<CutOrderInput, CutorderOutput, C
|
|||||||
} else if (input.boardWidth == undefined) {
|
} else if (input.boardWidth == undefined) {
|
||||||
info.isOk = false
|
info.isOk = false
|
||||||
info.msg = 'context.input.boardWidth is undefind'
|
info.msg = 'context.input.boardWidth is undefind'
|
||||||
} else if (input.boardHeight == undefined) {
|
} else if (input.boardLength == undefined) {
|
||||||
info.isOk = false
|
info.isOk = false
|
||||||
info.msg = 'context.input.boardHeight is undefind'
|
info.msg = 'context.input.boardLength is undefind'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -47,7 +47,7 @@ test('cutOrderTest', async () => {
|
|||||||
|
|
||||||
let input: CutOrderInput = {
|
let input: CutOrderInput = {
|
||||||
boardWidth: 1220,
|
boardWidth: 1220,
|
||||||
boardHeight: 2440,
|
boardLength: 2440,
|
||||||
gap: 6,
|
gap: 6,
|
||||||
blocks
|
blocks
|
||||||
}
|
}
|
||||||
@@ -55,7 +55,61 @@ test('cutOrderTest', async () => {
|
|||||||
input,
|
input,
|
||||||
params
|
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中显示结果
|
// 将在context的output中显示结果
|
||||||
console.log(context);
|
console.log(demo);
|
||||||
})
|
})
|
Reference in New Issue
Block a user