Temperature Object Improvements
ClosedPublic

Authored by rizzitello on Nov 18 2018, 2:15 PM.

Details

Summary
  • Initialize our temp variables.
  • Current Temps require a .
  • Use Static Consts
  • Use R"(....)" to reduce need to handle special chars in regex.

Reduces the chance of a return containing T: or B: at the end of a word such as "PRINT JOB:1" being treated as the current temperature.

Diff Detail

Repository
R232 AtCore
Branch
tempCheck
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 5255
Build 5273: arc lint + arc unit
rizzitello requested review of this revision.Nov 18 2018, 2:15 PM
rizzitello created this revision.
rizzitello edited the summary of this revision. (Show Details)Nov 18 2018, 2:17 PM
rizzitello added a project: Atelier: AtCore.
rizzitello added a subscriber: Atelier: AtCore.
patrickelectric requested changes to this revision.Nov 18 2018, 2:28 PM
patrickelectric added inline comments.
src/core/temperature.cpp
37–40

why not just 0 ?

96

static const

96

Use R( string literal to avoid \ in special characters.

112

static const

This revision now requires changes to proceed.Nov 18 2018, 2:28 PM
rizzitello marked 4 inline comments as done.Nov 18 2018, 3:22 PM
rizzitello added inline comments.
src/core/temperature.cpp
37–40

just 0 or 0.0 is either a int or double so just using float to avoid the a clutter warning of implicit type conversion from (int, double) to float.

rizzitello updated this revision to Diff 45727.Nov 18 2018, 3:22 PM
rizzitello marked an inline comment as done.
  • Split commits
  • Patrick's Suggestions
rizzitello retitled this revision from Make Current Temps checks more strict to Temperature Object Improvements.Nov 19 2018, 11:15 AM
rizzitello edited the summary of this revision. (Show Details)
tcanabrava accepted this revision.Nov 21 2018, 12:09 PM

I don't understand why patrick wanted all regular expressions to be static const (I would create them as non-static, but that's a non issue)

src/core/temperature.cpp
37–41

but 0f is float.

rizzitello marked an inline comment as done.Nov 21 2018, 12:48 PM

I don't understand why patrick wanted all regular expressions to be static const (I would create them as non-static, but that's a non issue)

static makes sense to me in the case of Atelier with multi atcore instances there is no reason they all can't share that same static RegEx.

src/core/temperature.cpp
37–41

float(0) is my personal preference.

rizzitello updated this revision to Diff 46023.Nov 22 2018, 4:15 PM
rizzitello marked an inline comment as done.
  • Initilize our temps with 0.0
rizzitello marked an inline comment as done.Nov 22 2018, 4:15 PM
patrickelectric accepted this revision.Nov 23 2018, 9:48 AM
This revision is now accepted and ready to land.Nov 23 2018, 9:48 AM
rizzitello closed this revision.Nov 23 2018, 2:22 PM