def setUp(self): self.symbols = Symbols.generateSymbols() self.identifiers = Symbols.generateIdentifiers() self.frames = Frames.generate() simulator = TwoOfFiveSimulator() simulator.addSymbols(symbols=Symbols.generateSymbols(),identifiers=Symbols.generateIdentifiers()) simulator.addFrames(frames=Frames.generate()) self.simulator = simulator
def generateSequence(timeStamp): sim = TwoOfFiveSimulator() sim.addSymbols(symbols=Symbols.generateSymbols(),identifiers=Symbols.generateIdentifiers()) sequence = [sim.identifiers[-1]] for i in range(random.randint(0,10)): sequence.append(sim.symbols[i]) pulses,timeStamp = sim.make(sequence,timeStamp) return pulses,timeStamp
def generateSequence(timeStamp): sim = TwoOfFiveSimulator() sim.addSymbols(symbols=Symbols.generateSymbols(), identifiers=Symbols.generateIdentifiers()) sequence = [sim.identifiers[-1]] for i in range(random.randint(0, 10)): sequence.append(sim.symbols[i]) pulses, timeStamp = sim.make(sequence, timeStamp) return pulses, timeStamp