blob: 61355b0cb56550f679a49c413d22dcb2c22b7a05 [file] [log] [blame]
Lee Mracek3e16a862019-01-24 11:15:36 -05001package(default_visibility = ["//visibility:public"])
2
James Kuszmaul61a971f2020-01-01 15:06:18 -08003load("@com_google_protobuf//:protobuf.bzl", "py_proto_library")
4
Lee Mracek3e16a862019-01-24 11:15:36 -05005py_binary(
6 name = "plot_action",
7 srcs = [
James Kuszmaul41fa78a2019-12-14 20:53:14 -08008 "logentry.py",
Austin Schuh8e17be92019-12-24 09:32:11 -08009 "logreader.py",
10 "plot_action.py",
11 "plotter.py",
Lee Mracek3e16a862019-01-24 11:15:36 -050012 ],
13 legacy_create_init = False,
Philipp Schraderdada1072020-11-24 11:34:46 -080014 target_compatible_with = ["@platforms//os:linux"],
Lee Mracek3e16a862019-01-24 11:15:36 -050015 deps = [
16 ":python_init",
James Kuszmaul910f92b2020-01-01 15:30:38 -080017 "@matplotlib_repo//:matplotlib2.7",
Lee Mracek3e16a862019-01-24 11:15:36 -050018 ],
19)
20
21py_library(
22 name = "python_init",
23 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -080024 target_compatible_with = ["@platforms//os:linux"],
Lee Mracek3e16a862019-01-24 11:15:36 -050025 deps = ["//frc971:python_init"],
26)
James Kuszmaul7daef362019-12-31 18:28:17 -080027
28cc_binary(
29 name = "py_log_reader.so",
30 srcs = ["py_log_reader.cc"],
31 linkshared = True,
Philipp Schraderdada1072020-11-24 11:34:46 -080032 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul7daef362019-12-31 18:28:17 -080033 deps = [
34 "//aos:configuration",
35 "//aos:json_to_flatbuffer",
36 "//aos/events:shm_event_loop",
37 "//aos/events:simulated_event_loop",
38 "//aos/events/logging:logger",
39 "@com_github_google_glog//:glog",
40 "@python_repo//:python3.5_lib",
41 ],
42)
43
44py_test(
45 name = "log_reader_test",
46 srcs = ["log_reader_test.py"],
47 data = [
48 ":py_log_reader.so",
49 "@sample_logfile//file",
50 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080051 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul7daef362019-12-31 18:28:17 -080052 deps = ["//aos:configuration_fbs_python"],
53)
James Kuszmaul61a971f2020-01-01 15:06:18 -080054
55py_proto_library(
56 name = "plot_config_proto",
57 srcs = ["plot_config.proto"],
Philipp Schraderdada1072020-11-24 11:34:46 -080058 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul61a971f2020-01-01 15:06:18 -080059)
60
61py_binary(
62 name = "plot",
63 srcs = ["plot.py"],
64 data = [
65 ":py_log_reader.so",
66 ] + glob(["plot_configs/**"]),
Philipp Schraderdada1072020-11-24 11:34:46 -080067 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul61a971f2020-01-01 15:06:18 -080068 deps = [
69 ":plot_config_proto",
70 ":python_init",
71 "@matplotlib_repo//:matplotlib3",
72 ],
73)
James Kuszmaul469fd4e2020-01-01 15:49:10 -080074
75py_test(
76 name = "plot_test",
77 srcs = ["plot_test.py"],
78 data = [
79 "@sample_logfile//file",
80 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080081 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul469fd4e2020-01-01 15:49:10 -080082 deps = [":plot"],
83)