James Kuszmaul | 61a971f | 2020-01-01 15:06:18 -0800 | [diff] [blame] | 1 | syntax = "proto2"; |
| 2 | |
| 3 | package frc971.analysis; |
| 4 | |
| 5 | // Specification fo a Channel to pull from the logfile. The name and type will |
| 6 | // be the full name/type of the channel to pull from the logfile. The alias is a |
| 7 | // shorter, easier to type, name that the rest of the logfile will use to refer |
| 8 | // to the channel. |
| 9 | message Channel { |
| 10 | optional string name = 1; |
| 11 | optional string type = 2; |
| 12 | optional string alias = 3; |
| 13 | } |
| 14 | |
| 15 | // A specification for a single signal within a Channel. |
| 16 | message Signal { |
| 17 | // Alias for the channel to pull the signal from--this should match an alias |
| 18 | // specified in one of the Channels. |
| 19 | optional string channel = 1; |
| 20 | // Specification of the field to plot. Currently, this only supports simple |
| 21 | // submessages, using dots. To access, e.g., the "bar" member of the "foo" |
| 22 | // submessage, field would be "foo.bar". This does not currently support |
| 23 | // working with repeated fields. |
| 24 | optional string field = 2; |
| 25 | } |
| 26 | |
James Kuszmaul | 14dad03 | 2020-01-19 17:56:59 -0800 | [diff] [blame] | 27 | // A single line to plot. |
| 28 | message Line { |
| 29 | // The signal to plot on the y-axis. |
| 30 | optional Signal y_signal = 1; |
| 31 | // If set, we will use this signal for the x-axis of the plot. By default, we |
| 32 | // will use the monotonic sent time of the message. This is helpful for both |
| 33 | // plotting against non-time based signals (e.g., plotting x/y robot position) |
| 34 | // as well as plotting against times other than the message sent time (e.g., |
| 35 | // for the IMU where the sample capture time is separate from the actual |
| 36 | // sent time. |
| 37 | // Note that the x and y signals should have exactly the same number of |
| 38 | // entries--otherwise, we need to write logic to handle resampling one signal |
| 39 | // to a different rate. |
| 40 | optional Signal x_signal = 2; |
| 41 | } |
| 42 | |
James Kuszmaul | 61a971f | 2020-01-01 15:06:18 -0800 | [diff] [blame] | 43 | // Message representing a single pyplot Axes, with specifications for exactly |
| 44 | // which signals to show in the supplied subplot. |
| 45 | message Axes { |
James Kuszmaul | 14dad03 | 2020-01-19 17:56:59 -0800 | [diff] [blame] | 46 | repeated Line line = 1; |
James Kuszmaul | 61a971f | 2020-01-01 15:06:18 -0800 | [diff] [blame] | 47 | optional string ylabel = 2; |
James Kuszmaul | 9031d1b | 2020-02-11 17:01:57 -0800 | [diff] [blame] | 48 | optional string xlabel = 3 [default = "Monotonic Time (sec)"]; |
| 49 | // Whether to share an x-axis with all the other axes. |
| 50 | optional bool share_x_axis = 4 [default = true]; |
James Kuszmaul | 61a971f | 2020-01-01 15:06:18 -0800 | [diff] [blame] | 51 | } |
| 52 | |
| 53 | // Message representing a single pyplot figure. |
| 54 | message Figure { |
| 55 | repeated Axes axes = 1; |
| 56 | } |
| 57 | |
| 58 | // This configuration specifies what to plot when reading from a logfile. |
| 59 | message PlotConfig { |
| 60 | // List of channels and their aliases to use in the plot. |
| 61 | repeated Channel channel = 1; |
| 62 | // Figures to plot. |
| 63 | repeated Figure figure = 2; |
| 64 | } |