Yeah, that's definitely an option as well depending on how the latency turns out. Logic-wise it could also be simpler as well.
The first problem to tackle is how to get the signals from a qWidget into HAL.
From what I can see, I'd essentially I'd be implementing a custom HAL widget with out pins to pass the values I need to HAL, or modifying an existing widget to add this functionality (which is basically the same thing)?
I can see the source code for a hal widget containing an out pin, for example Hal Slider, which is a qSlider qWidget.(
www.qtpyvcp.com/_modules/qtpyvcp/widgets...gets/hal_slider.html
)
(
doc.qt.io/qt-6/qslider.html
)
From what I can see a member function (if I'm using the correct terminology) can be referenced as follows, for example:
def mouseDoubleClickEvent(self, event):
self.setValue(100)
But I'm still a little unsure right now how I'd directly connect a member function and a hal pin. In that qSlider example it references 'val':
def onValueChanged(self, val):
if self._s32_value_pin is not None:
self._s32_value_pin.value = val
self._float_value_pin.value = val / 100.0
But I can't see how this is linked to an attribute of the slider. Is an alias defined in another location? Can I use this to directly reference the member function I want to use e.g.
def onValueChanged(self, QMouseEvent::pos()):
self._s32_value_pin.value = QMouseEvent::pos()
(I know the number format might be different from this example, that said I can't easily see what the format would be
doc.qt.io/qt-6/qwidget.html#mouseMoveEvent
)
If you are able to give an example it would be very useful.
Thanks so much for the help!