mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-03 22:45:13 +08:00
优化bp结点
This commit is contained in:
@@ -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{})
|
||||
|
||||
@@ -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())
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user