fix going to coordinate array
This commit is contained in:
parent
33b755efd1
commit
a506e6b815
|
@ -31,7 +31,8 @@ class ArmCtlListener(ArmControlListener):
|
|||
# Exit a parse tree produced by ArmControlParser#Go.
|
||||
def exitGo(self, ctx: ArmControlParser.GoContext):
|
||||
if ctx.coords() is not None:
|
||||
self.r.move(ctx.coords().values)
|
||||
self.r.target = ctx.coords().values
|
||||
self.r.move()
|
||||
return
|
||||
if ctx.name() is None:
|
||||
logger.error("ERROR: Go command with no name?")
|
||||
|
@ -69,13 +70,14 @@ class ArmCtlListener(ArmControlListener):
|
|||
|
||||
# Enter a parse tree produced by ArmControlParser#coords.
|
||||
def enterCoords(self, ctx: ArmControlParser.CoordsContext):
|
||||
self.values = []
|
||||
self.index = 0
|
||||
ctx.values = self.r.target
|
||||
ctx.index = 0
|
||||
|
||||
# Exit a parse tree produced by ArmControlParser#value.
|
||||
def exitValue(self, ctx: ArmControlParser.ValueContext):
|
||||
if isinstance(ctx.parentCtx, ArmControlParser.CoordsContext):
|
||||
ctx.parentCtx.values.insert(ctx.parentCtx.index, ctx.value)
|
||||
if ctx.parentCtx.index < len(ctx.parentCtx.values):
|
||||
ctx.parentCtx.values[ctx.parentCtx.index] = ctx.value
|
||||
|
||||
# Exit a parse tree produced by ArmControlParser#number.
|
||||
def exitNumber(self, ctx: ArmControlParser.NumberContext):
|
||||
|
|
Loading…
Reference in New Issue