@@ -343,6 +343,7 @@ FeedRotaryButtonCodes::FeedRotaryButtonCodes() :
343343 {percent_60.code , &percent_60},
344344 {percent_100.code , &percent_100},
345345 {lead.code , &lead},
346+ {lead9B.code , &lead9B},
346347 {undefined.code , &undefined}
347348 }
348349{
@@ -586,6 +587,11 @@ void FeedRotaryButton::setStepMode(HandwheelStepmodes::Mode stepMode)
586587 update ();
587588}
588589// ----------------------------------------------------------------------
590+ void FeedRotaryButton::setStepMode_5_10 (bool enable)
591+ {
592+ mIsStepMode_5_10 = enable;
593+ }
594+ // ----------------------------------------------------------------------
589595HandwheelStepmodes::Mode FeedRotaryButton::stepMode () const
590596{
591597 return mStepMode ;
@@ -625,7 +631,7 @@ void FeedRotaryButton::update()
625631 mStepSize = mStepSizeMapper .getStepSize (second);
626632 mIsPermitted = mStepSizeMapper .isPermitted (second);
627633
628- if (mIsStepMode_5_10 && mStepSize > 2 ) {mStepSize = 0 ;} // TODO DOES NOT WORK bool variable seems to be not synched inside pendant.h
634+ if (! mIsStepMode_5_10 && mStepSize > 2 ) {mStepSize = 1. 0 ;}
629635
630636 }
631637 else if (mStepMode == HandwheelStepmodes::Mode::CON)
@@ -730,11 +736,6 @@ void Handwheel::enableVerbose(bool enable)
730736 }
731737}
732738// ----------------------------------------------------------------------
733- void Handwheel::setMode (HandWheelCounters::CounterNameToIndex activeCounterMode)
734- {
735- mCounters .setActiveCounter (activeCounterMode);
736- }
737- // ----------------------------------------------------------------------
738739void Handwheel::count (int8_t delta)
739740{
740741 assert (mEventListener != nullptr );
@@ -1475,11 +1476,17 @@ bool Pendant::onJogDialEvent(const HandWheelCounters& counters, int8_t delta)
14751476 {
14761477 mHal .toggleFeedrateDecrease ();
14771478 }
1478- }
1479- else if (!counters.isLeadCounterActive () && (feedButton.stepMode () == HandwheelStepmodes::Mode::CON || feedButton.stepMode () == HandwheelStepmodes::Mode::STEP))
1480- { // Normal Mode
1481- mHal .setJogCounts (counters);
1482- }
1479+ }
1480+
1481+ if (!counters.isLeadCounterActive ())
1482+ {
1483+ // The counters must be set always if not in lead mode
1484+ // Otherwhise, the machine will move, sometimes a long distance in the following case:
1485+ // MGP mode -> Wheel turned -> CON or STEP mode -> After first wheel pulse
1486+ // due to the counters are increased in MPG mode but not set until the first wheel count event
1487+ // Setting them does not create a move in MPG mode due to the scale is zero
1488+ mHal .setJogCounts (counters);
1489+ }
14831490 }
14841491 mDisplay .onJogDialEvent (counters, delta);
14851492 return true ;
@@ -1563,19 +1570,19 @@ void Pendant::dispatchAxisEventToHal(const KeyCode& axis, bool isActive)
15631570 }
15641571}
15651572// ----------------------------------------------------------------------
1566- void Pendant::setLeadModeSpindle (bool /* enable*/ )
1573+ void Pendant::setLeadModeSpindle (bool enable)
15671574{
1568- mIsLeadModeSpindle = true ;
1575+ mIsLeadModeSpindle = enable ;
15691576}
15701577// ----------------------------------------------------------------------
1571- void Pendant::setLeadModeFeed (bool /* enable*/ )
1578+ void Pendant::setLeadModeFeed (bool enable)
15721579{
1573- mIsLeadModeFeed = true ;
1580+ mIsLeadModeFeed = enable ;
15741581}
15751582// ----------------------------------------------------------------------
1576- void Pendant::setStepMode_5_10 (bool /* enable*/ )
1583+ void Pendant::setStepMode_5_10 (bool enable)
15771584{
1578- mIsStepMode_5_10 = true ;
1585+ mCurrentButtonsState . feedButton (). setStepMode_5_10 (enable) ;
15791586}
15801587// ----------------------------------------------------------------------
15811588Display::Display (const ButtonsState& currentButtonsState, Hal& hal, UsbOutPackageData& displayData) :
0 commit comments