npiegdon / bed-inspector

A small tool to evaluate 3D printer bed flatness
MIT License
56 stars 5 forks source link

Fixed error because system used comma as decimal separator and z1 was… #13

Closed mattiasaronsson closed 4 years ago

mattiasaronsson commented 4 years ago

… used to measure point instead of z2

npiegdon commented 4 years ago

Nice catch on the Z1 vs. Z2 (and feed speed) thing. Those differences were from the earliest prototyping code (when I was adding G-code nearly at random 😄 ) and I don't have a strong reason for preferring one over the other. Unifying them sounds good.

For the decimal separator, this is a partial fix that breaks some cases and fixes others... but on the whole it should fix more than it breaks.

The issue is that the printer's firmware has its own decimal separator preference separate from the host OS. I've already heard from a user with a Polish version of Windows (comma separator) but an English printer firmware (dot separator). Hopefully those cases are rarer than matched separators, but the longer-term answer is to offer an option in the UI, perhaps trying to auto-detect first so the user doesn't have to worry about it unless we get it wrong.

I haven't taken the time to think it through, but my gut reaction is that this line creeps me out because we've got decimal separators in very close proximity to list separators. I'd have to sit down and try a few combinations to convince myself it's fine, but if it's working on your side--I don't have access to a non-comma decimal separator OS or printer firmware--I'll take it on faith for now.

Nice work!

mattiasaronsson commented 4 years ago

Yeah, kind of naive implementation. My problem was as you describe that my system use comma as decimal separator (Sweden) while printer firmware is in English and uses dot as decimal separator. Solution totally misses if the firmware does not use dot as a comma separator. So not a complete solution but thought it would be a waste to just throw it away ;)