优化bp结点

This commit is contained in:
boyce
2025-11-05 17:01:43 +08:00
parent fac7a323e1
commit f8953d1764
3 changed files with 7 additions and 7 deletions

View File

@@ -32,7 +32,7 @@ func (bm *Blueprint) regSysNode(){
bm.RegExecNode(&Entrance_ArrayParam{})
bm.RegExecNode(&Entrance_IntParam{})
bm.RegExecNode(&Entrance_Timer{})
bm.RegExecNode(&Output{})
bm.RegExecNode(&DebugOutput{})
bm.RegExecNode(&Sequence{})
bm.RegExecNode(&Foreach{})
bm.RegExecNode(&ForeachIntArray{})

View File

@@ -155,7 +155,7 @@ func (en *execNode) Do(gr *Graph, outPortArgs ...any) error {
startOutIdx := en.execNode.GetOutPortParamStartIndex()
for i := 0; i < len(outPortArgs); i++ {
if i >= len(outPorts) {
if i+startOutIdx >= len(outPorts) {
return fmt.Errorf("args %d not found in node %s", i, en.execNode.GetName())
}

View File

@@ -53,15 +53,15 @@ func (em *Entrance_Timer) Exec() (int, error) {
return 0, nil
}
type Output struct {
type DebugOutput struct {
BaseExecNode
}
func (em *Output) GetName() string {
return "Output"
func (em *DebugOutput) GetName() string {
return "DebugOutput"
}
func (em *Output) Exec() (int, error) {
func (em *DebugOutput) Exec() (int, error) {
val, ok := em.GetInPortInt(1)
if !ok {
return 0, fmt.Errorf("output Exec inParam not found")
@@ -77,7 +77,7 @@ func (em *Output) Exec() (int, error) {
return 0, fmt.Errorf("output Exec inParam not found")
}
fmt.Printf("output Exec inParam [%d] [%s] [%v]\n", val, valStr, valArray)
log.Debug("DebugOutput Exec",log.Any("param1",val),log.Any("param2",valStr),log.Any("param3",valArray))
return 0, nil
}