KMotionCNC modifications
Posted: Sun Jul 04, 2021 10:30 am
I've been experimenting with some changes to KMotionCNC to make it more to my liking. My DROs now show 3 digit resolution when Metric mode is selected and I've also modified the default 'Set' values for the X & Y DROs to offer half the current DRO reading for the Set value. This is really useful for a milling machine where you often use a centre finder on one side of the work, clear the DRO and then touch the other side. While at the second side, the DRO needs to be set to half the value you've travelled, so that's now offered as the default when I go to set the DRO.
So far so good. However, I'd also really like to change the Feedrate slider override to be say 4x the feedrate.
KMotionCNCDlg.cpp has the following declaration which I've changed from 2 to 4...
#define OVERRIDE_MAX 4.0
... however this doesn't change it. Tracing the code into this procedure reveals that low and high don't receive the values passed to them.
/****************************************************************************
* CLogSlider::SetRange
* Inputs:
* double low: Low value for range
* double high: High value for range
* UINT resolution: Number of points between low and high
* Result: void
*
* Effect:
* Sets the range
****************************************************************************/
void CLogSlider::SetRange(double L, double H, UINT resolution, int offset, int color)
{
ASSERT(L < H);
low = L;
high = H; <------------- high remains 0 even though H = 4
m_offset=offset; <------ this works though.
m_color=color;
CSliderCtrl::SetRange(0, (int)resolution);
SetTic(20);
} // CLogSlider::SetRange
So I really can't figure out how it seems to still know that 2 is the maximum. OVERRIDE_MAX isn't referenced anywhere else.
I don't know this well enough to fix it myself, so some assistance would be most welcome.
So far so good. However, I'd also really like to change the Feedrate slider override to be say 4x the feedrate.
KMotionCNCDlg.cpp has the following declaration which I've changed from 2 to 4...
#define OVERRIDE_MAX 4.0
... however this doesn't change it. Tracing the code into this procedure reveals that low and high don't receive the values passed to them.
/****************************************************************************
* CLogSlider::SetRange
* Inputs:
* double low: Low value for range
* double high: High value for range
* UINT resolution: Number of points between low and high
* Result: void
*
* Effect:
* Sets the range
****************************************************************************/
void CLogSlider::SetRange(double L, double H, UINT resolution, int offset, int color)
{
ASSERT(L < H);
low = L;
high = H; <------------- high remains 0 even though H = 4
m_offset=offset; <------ this works though.
m_color=color;
CSliderCtrl::SetRange(0, (int)resolution);
SetTic(20);
} // CLogSlider::SetRange
So I really can't figure out how it seems to still know that 2 is the maximum. OVERRIDE_MAX isn't referenced anywhere else.
I don't know this well enough to fix it myself, so some assistance would be most welcome.