add some data

def add_data(self, t, msg, vars, flightmode):
        '''add some data'''
        mtype = msg.get_type()
        if self.flightmode is not None and (len(self.modes) == 0 or self.modes[-1][1] != flightmode):
            self.modes.append((t, flightmode))
        for i in range(0, len(self.fields)):
            if mtype not in self.field_types[i]:
                continue
            f = self.fields[i]
            if f.endswith(":2"):
                self.axes[i] = 2
                f = f[:-2]
            if f.endswith(":1"):
                self.first_only[i] = True
                f = f[:-2]
            v = mavutil.evaluate_expression(f, vars)
            if v is None:
                continue
            if self.xaxis is None:
                xv = t
            else:
                xv = mavutil.evaluate_expression(self.xaxis, vars)
                if xv is None:
                    continue
            self.y[i].append(v)
            self.x[i].append(xv)