summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-03-18 22:12:59 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-03-18 22:12:59 +0100
commit4c6b0def2da27635e593192ba1a2a604a824f6ab (patch)
treea3818dd40c434a7dfb387f67271896f108da1155 /bin
parent9f7c8ca6f58b37cdad278468568c48fd057f1328 (diff)
show an error message when a power plot request cannot be fulfilled
Diffstat (limited to 'bin')
-rwxr-xr-xbin/dlog-viewer14
1 files changed, 10 insertions, 4 deletions
diff --git a/bin/dlog-viewer b/bin/dlog-viewer
index 7600446..fd5b923 100755
--- a/bin/dlog-viewer
+++ b/bin/dlog-viewer
@@ -583,11 +583,17 @@ def main():
export_json(dlog, args.json_export, extra_data)
if args.plot:
- if args.plot == "P" and dlog.all_data_slots_have_power():
- if args.pelt:
- show_power_plot(dlog, changepoints)
+ if args.plot == "P":
+ if dlog.all_data_slots_have_power():
+ if args.pelt:
+ show_power_plot(dlog, changepoints)
+ else:
+ show_power_plot(dlog)
else:
- show_power_plot(dlog)
+ print(
+ "Error: power plot requested, but neither power nor voltage*current readings present.",
+ file=sys.stderr,
+ )
elif args.plot == "all":
show_raw_plot(dlog)
else: