Skip to content

Commit 59a19ba

Browse files
committed
hal bridget - add jog rate and increment in pins
1 parent 2d9da86 commit 59a19ba

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/hal/user_comps/hal_bridge.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,13 @@ def init_hal(self):
6767
QHAL = Qhal(comp=self.comp, hal=hal)
6868

6969
self.jogRate = QHAL.newpin("jog-rate", hal.HAL_FLOAT, hal.HAL_OUT)
70+
self.jogRateIn = QHAL.newpin("jog-rate-in", hal.HAL_FLOAT, hal.HAL_IN)
71+
self.jogRateIn.pinValueChanged.connect(self.pinChanged)
72+
7073
self.jogRateAngular = QHAL.newpin("jog-rate-angular", hal.HAL_FLOAT, hal.HAL_OUT)
74+
self.jogRateAngularIn = QHAL.newpin("jog-rate-angular-in", hal.HAL_FLOAT, hal.HAL_OUT)
75+
self.jogRateAngularIn.pinValueChanged.connect(self.pinChanged)
76+
7177
self.jogIncrement = QHAL.newpin("jog-increment", hal.HAL_FLOAT, hal.HAL_OUT)
7278
self.jogIncrementAngular = QHAL.newpin("jog-increment-angular", hal.HAL_FLOAT, hal.HAL_OUT)
7379
self.activeJoint = QHAL.newpin('joint-selected', hal.HAL_S32, hal.HAL_OUT)
@@ -182,6 +188,14 @@ def pinChanged(self, pinObject, value):
182188
#if value:
183189
self.writeMsg('request_cycle_pause', value)
184190

191+
# linear jog rate
192+
elif self.jogRateIn == pinObject:
193+
self.writeMsg('set_jograte', value)
194+
195+
# angular jog rate
196+
elif self.jogRateAngularIn == pinObject:
197+
self.writeMsg('set_jograte_angular', value)
198+
185199
# catch all default
186200
else:
187201
self.writeMsg(pinObject.text(),value)

0 commit comments

Comments
 (0)