def __init__(self): super().__init__() self.VerticalGroups = int(Arms.MaxChannels / 3) print(self.VerticalGroups) self.PageWidth = min(Arms.num(), 32) self.mode = 1 # index into self.Modes self.ixCursor = 0 self.iyCursor = 0 self.inc = LinearStateMachine([1, 5, 20])
def __init__(self, duration, timestep, armData): self.armData = armData self.target = [] self.current = [] self.vel = [] # map each address to an index for address, arm in self.armData.items(): i = Arms.arms.index(Arms.findArm(address)) self.target.append(arm.get('channels', [])) for i in range(Arms.num()): self.current.append(Arms.getChannels(i)) # calculate delta for each timestep # -1 means don't change for i in range(len(self.target)): self.vel.append([]) for j in range(len(self.target[i])): if self.target[i][j] >= 0: self.vel[i].append((self.target[i][j] - self.current[i][j]) * (timestep / duration)) else: self.vel[i].append(0)
def numArms(self): return Arms.num() # returns a list of the selected arms' indices def selected(self):