Example #1
0
    def update(self, sim):
        if not self.swlog:                     # Only update when logging started an traffic is selected
            return
        if abs(sim.simt - self.t0) < self.dt:  # Only do something when time is there
            return
        self.t0 = sim.simt                     # Update time for scheduler

        t = tim2txt(sim.simt)                  # Nicely formated time

        if self.aclist.ndim < 1:               # Write to buffer for one AC
            self.writebuffer(sim, t, self.aclist)
        else:                                  # Write to buffer for multiple AC
            for i in self.aclist:
                self.writebuffer(sim, t, self.aclist[i])
        return
Example #2
0
 def write(self,t,txt):
     # Add text to buffer with timestamp t
     self.buffer.append(tim2txt(t)+" > "+txt+chr(13)+chr(10))
     return