Skip to content

Decouple values and graphs? #11

Description

@usbalbin

As is now, we have metrics which both specifies a value to send to the host and the graph to plot. Let's consider we have one metric for voltage and one metric for current. What if we want a third graph for power that is just the multiplication of voltage * current?

If we split the values and the plots we can let there be more graphs than there are values etc.

For example (assuming #8)

let duty = make_setting!(DUTY: u16 = 0, 0..=90, 1);
let v_target = make_setting!(TARGET: u16 = 0, 42..=123, 1);

let voltage = make_metric!(V: u16 = 0);
let current = make_metric!(I: u16 = 0);

make_graph!(Voltage = "V / 4095 * 42"); // Creates a graph with title `Voltage`
make_graph!(Current = "I / 4095 * 123"); // One metric
make_graph!(Power = "(V * I) / 1337"); // Two metrics
make_graph!(Duty = "DUTY"); // One setting
make_graph!(Error = "TARGET - V"); // Expression with both one setting and one metric

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions