feat: 提交
This commit is contained in:
58
samples/moduleManager/module_demoCallback.ts
Normal file
58
samples/moduleManager/module_demoCallback.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
import { Processor, ProcessorModule } from "../../src/device";
|
||||
|
||||
import { ErrorInfo } from "../../src/device";
|
||||
|
||||
/** 模块 开料顺序
|
||||
*
|
||||
* input 入参
|
||||
|
||||
*/
|
||||
|
||||
/** 开料顺序 */
|
||||
export const AutoCalcCutOrder: ProcessorModule<any, any> = {
|
||||
moduleName: "CheckMaterial",
|
||||
moduleVersion: '20250714',
|
||||
config: {
|
||||
boardWidth: 0,
|
||||
boardLength: 0,
|
||||
placeStyle:1,
|
||||
},
|
||||
setConfig(config) {
|
||||
this.config = { ...this.config, ...config };
|
||||
},
|
||||
|
||||
// 会在处理器自动执行
|
||||
/**
|
||||
*
|
||||
* @param input 输入数据
|
||||
* @param next 下一个流程的函数
|
||||
* @param context 上下文
|
||||
* @returns
|
||||
*/
|
||||
|
||||
process(input, next, context) {
|
||||
const { materialList } = input
|
||||
// if (pb.isLocked) return;
|
||||
// let blocks = pb.blockList;
|
||||
|
||||
// if (blocks.length == 0) return;
|
||||
// if (blocks.length == 1) {
|
||||
// blocks[0].cutOrder = 1;
|
||||
// }
|
||||
// else {
|
||||
// this.autoSortBlockNew(pm, pb);
|
||||
// }
|
||||
return next ? next(input) : input;
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
onError(error) {
|
||||
|
||||
console.error('出错了哦', error);
|
||||
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user