Example #1
0
def add_data(t, msg, vars):
    '''add some data'''
    mtype = msg.get_type()
    if mtype not in msg_types:
        return
    for i in range(0, len(fields)):
        if mtype not in field_types[i]:
            continue
        f = fields[i]
        if f.endswith(":2"):
            axes[i] = 2
            f = f[:-2]
        if f.endswith(":1"):
            first_only[i] = True
            f = f[:-2]
        v = mavutil.evaluate_expression(f, vars)
        if v is None:
            continue
        if opts.xaxis is None:
            xv = t
        else:
            xv = mavutil.evaluate_expression(opts.xaxis, vars)
            if xv is None:
                continue
        y[i].append(v)
        x[i].append(xv)
Example #2
0
def add_data(t, msg, vars):
    '''add some data'''
    mtype = msg.get_type()
    if mtype not in msg_types:
        return
    for i in range(0, len(fields)):
        if mtype not in field_types[i]:
            continue
        f = fields[i]
        if f.endswith(":2"):
            axes[i] = 2
            f = f[:-2]
        if f.endswith(":1"):
            first_only[i] = True
            f = f[:-2]
        v = mavutil.evaluate_expression(f, vars)
        if v is None:
            continue
        if opts.xaxis is None:
            xv = t
        else:
            xv = mavutil.evaluate_expression(opts.xaxis, vars)
            if xv is None:
                continue
        y[i].append(v)            
        x[i].append(xv)
Example #3
0
 def mavlink_packet(self, msg):
     """add data to the graph"""
     mtype = msg.get_type()
     if mtype not in self.msg_types:
         return
     for i in range(len(self.fields)):
         if mtype not in self.field_types[i]:
             continue
         f = self.fields[i]
         self.values[i] = mavutil.evaluate_expression(f, mpstate.master().messages)
     if self.livegraph is not None:
         self.livegraph.add_values(self.values)
Example #4
0
 def mavlink_packet(self, msg):
     '''add data to the graph'''
     mtype = msg.get_type()
     if mtype not in self.msg_types:
         return
     for i in range(len(self.fields)):
         if mtype not in self.field_types[i]:
             continue
         f = self.fields[i]
         self.values[i] = mavutil.evaluate_expression(
             f,
             mpstate.master().messages)
     if self.livegraph is not None:
         self.livegraph.add_values(self.values)