优化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_ArrayParam{})
bm.RegExecNode(&Entrance_IntParam{}) bm.RegExecNode(&Entrance_IntParam{})
bm.RegExecNode(&Entrance_Timer{}) bm.RegExecNode(&Entrance_Timer{})
bm.RegExecNode(&Output{}) bm.RegExecNode(&DebugOutput{})
bm.RegExecNode(&Sequence{}) bm.RegExecNode(&Sequence{})
bm.RegExecNode(&Foreach{}) bm.RegExecNode(&Foreach{})
bm.RegExecNode(&ForeachIntArray{}) bm.RegExecNode(&ForeachIntArray{})

View File

@@ -155,7 +155,7 @@ func (en *execNode) Do(gr *Graph, outPortArgs ...any) error {
startOutIdx := en.execNode.GetOutPortParamStartIndex() startOutIdx := en.execNode.GetOutPortParamStartIndex()
for i := 0; i < len(outPortArgs); i++ { 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()) 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 return 0, nil
} }
type Output struct { type DebugOutput struct {
BaseExecNode BaseExecNode
} }
func (em *Output) GetName() string { func (em *DebugOutput) GetName() string {
return "Output" return "DebugOutput"
} }
func (em *Output) Exec() (int, error) { func (em *DebugOutput) Exec() (int, error) {
val, ok := em.GetInPortInt(1) val, ok := em.GetInPortInt(1)
if !ok { if !ok {
return 0, fmt.Errorf("output Exec inParam not found") 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") 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 return 0, nil
} }