Page 1 of 1

Changing Metric DROs to 3 digit resolution

Posted: Wed Jun 02, 2021 7:33 pm
by RogerFroud
I'd like to change the DRO resolution on my Metric machine. My machine has 1 micron resolution, and it makes no sense and it confusing to display more digits than that.
I've found a file C:\KMotion434\PC VC Examples\KMotionCNC\KMotionCNCDlg.cpp that has a procedure names CKMotionCNCDlg::SetBigValues which has the following line...

s.Format(" X:%10.4f ",x);

... which looks to me like it only needs to be changed to read .3f instead of .4f

I changed that, but it didn't change anything, so I assume this has to be compiled to make a new executable.

It would be better if the procedure automatically changed to three decimal places when Metric was selected. I very much doubt if anyone would ever need 0.0001mm resolution when the Imperial 4 places only goes to 0.00254mm

Re: Changing Metric DROs to 3 digit resolution

Posted: Wed Jun 02, 2021 9:24 pm
by TomKerekes
Hi Roger,
I changed that, but it didn't change anything, so I assume this has to be compiled to make a new executable.
Correct. See here.

That change was made in Version 4.35e

Re: Changing Metric DROs to 3 digit resolution

Posted: Mon Jun 21, 2021 9:31 am
by RogerFroud
For anyone else who's interested in making any changes to KMotionCNC, this is what I did...

The code is compiled with Microsoft Visual Studio 2015 which is out of date. Download the free Connunity version of the latest software and select just the Desktop Development with C++ option and the latest SDK from the list on the right.
Also install the MFC libraries from the list.
Open the KmotionCNC.vcxproj project file and then change the version to the latest in the drop down list.
This successfully built the project and loaded the correct screen set.

If you get this error when building...
if multiple CL.EXE write to the same .PDB file, please use /FS
... go into Debug>KMotionCNC debug properties>C/C++>Command Line and add /FS in the Additional Options box, clean and build again.

KMotionCNC is found in this folder...

C:\Users\Roger\Dropbox\Denford Mill\Dynomotion\KMotionCNC\KMotion434\PC VC Examples\KMotionCN

The thing I wanted to change was the resolution for Metric DROs which is in 4 digits, not three.
KMotionCNCDlg.cpp that has a procedure named CKMotionCNCDlg::SetBigValues which has the following line...

s.Format(" X:%10.4f ",x);

If looks like m_RealTimeSetup->CANON_UNITS_MM is the flag that tells the function what units you're using, so you can selectively use 3 or 4 digits of precision if you're switching between Inch and Metric. Since I'm never going to use Inches, changing it to 3 digits is all that's required.