-void ShuttleThread::jog(unsigned int value) {
- // We should generate a synthetic event for the shuttle going
- // to the home position if we have not seen one recently
- //check_synthetic();
-
+void ShuttleThread::jog(unsigned int value)
+{
+ // generate a synthetic event for the shuttle going
+ // to the home position if we have not seen one recently.
+ //if (shuttlevalue != 0) {
+ // QApplication::postEvent(m_parent, new QEvent((QEvent::Type) JOG_STOP));
+ // shuttlevalue = 0;
+ //}
+
+ // This code takes care of wrapping around the limits of the jog dial number (it is represented as a single byte, hence
+ // wraps at the 0/255 boundary). I used 25 as the difference to make sure that even in heavy load, with the jog dial
+ // turning fast and we miss some events that we do not mistakenly reverse the direction.
+ // Note also that at least the Contour ShuttlePRO v2 does not send an event for the value 0, so at the wrap it will
+ // need 2 events to go forward. But that is nothing we can do about...