techninja / cncserver

A RESTful API server for driving serial based CNC devices
133 stars 39 forks source link

Fix issues with string vs float type #63

Closed docprofsky closed 9 years ago

docprofsky commented 9 years ago

Fix problems with the speeds from the config file being strings.

techninja commented 9 years ago

Do you actually test these things? yea! Sheesh. Everything from the config comes in as strings because it's parsed directly from the text INI files. Just turn these into converted variables then do the math on them, will work faster and look cleaner, even if it is a few more lines.

When/If this ever becomes something else, conversion won't be needed, but right now, you should likely be doing a conversion to a number type with ANY concatenation or math. Actually makes it faster anyways.

techninja commented 9 years ago

That should also help immediately below for this line: https://github.com/techninja/cncserver/blob/master/cncserver.js#L1561

docprofsky commented 9 years ago

WIth the string fixing the bounding works as expected.

docprofsky commented 9 years ago

This should be good.

techninja commented 9 years ago

Alright, alright, You've done what I've asked. Thank you. Here's your gold star :star2: :)