Improve the Plotwidget
ClosedPublic

Authored by rizzitello on Jun 6 2018, 5:43 AM.

Details

Summary
  • newPlot -> addPlot
  • deletePlot -> removePlot
  • update is now called when appendPoint is called and is private.
  • QStringList plots () returns list of plots.
  • setMaximumTemperature to set the Y cap
  • setMaximumPoints to set how much data to hold
  • Solve memory leak (by holding only so much data per point)
  • No longer start with any point. (this frees clients to add them based on the device)
  • Adjust test gui for these changes.

Diff Detail

Repository
R232 AtCore
Branch
plotImprove
Lint
No Linters Available
Unit
No Unit Test Coverage
rizzitello requested review of this revision.Jun 6 2018, 5:43 AM
rizzitello created this revision.
rizzitello edited the summary of this revision. (Show Details)Jun 6 2018, 5:50 AM
rizzitello added a reviewer: Atelier: AtCore.
rizzitello added a project: Atelier: AtCore.
rizzitello added a subscriber: Atelier: AtCore.
tcanabrava added inline comments.
src/widgets/plotwidget.cpp
27–29

those can be on the stack?

70–71

I really don't like the double map.
each map is a tree and this is slow to append.
can we use a enum instead of a name for the map, thus moving from map to vector?

82–85

everytime you call .keys() you generate a new list appending things in a temporary. if the keys never change we should store this value somewhere.

src/widgets/plotwidget.h
63–76

const

81

why explicit when it has no parameters?

129–130

QByteArray on the hash if used without UTF8 strings

rizzitello updated this revision to Diff 35711.Jun 6 2018, 8:18 PM
rizzitello marked 2 inline comments as done.
  • Remove the double map
rizzitello marked an inline comment as done.Jun 6 2018, 8:18 PM
rizzitello added inline comments.
src/widgets/plotwidget.cpp
82–85

This widget is created with no keys. We do not know how many clients will add.

rizzitello marked 3 inline comments as done.Jun 6 2018, 8:24 PM
rizzitello added inline comments.
src/widgets/plotwidget.h
81

I can not answer that since i didn't write this . It doesn't like when i give it a parent so it remains unchanged.

129–130

QString is for label names as well as the key.

rizzitello updated this revision to Diff 35713.Jun 6 2018, 8:24 PM
rizzitello marked 2 inline comments as done.
  • rest of tomaz' suggestions
rizzitello updated this revision to Diff 35726.Jun 6 2018, 11:38 PM
  • Remove plots correctly
rizzitello updated this revision to Diff 35727.Jun 6 2018, 11:41 PM
  • remove unneeded call to update
tcanabrava added inline comments.Jun 7 2018, 6:45 AM
src/widgets/plotwidget.cpp
32–33

dude, move this back to the initializer list, and pass 'this' there. :)

rizzitello updated this revision to Diff 35750.Jun 7 2018, 12:19 PM
rizzitello marked an inline comment as done.
  • tomaz suggestion
tcanabrava accepted this revision.Jun 7 2018, 1:21 PM
This revision is now accepted and ready to land.Jun 7 2018, 1:21 PM
rizzitello closed this revision.Jun 7 2018, 1:23 PM