Probe Basic - jog slider & status
- spumco
- Offline
- Platinum Member
- 
				  
		Less
		More
		
			
	
		- Posts: 1954
- Thank you received: 792
			
	
						19 Jan 2023 23:09				#262440
		by spumco
	
	
		
			
	
			
			 		
													
	
				Probe Basic - jog slider & status was created by spumco			
			
				I was able to connect my MPG & selector to halui.axis.jog-speed so now I've got a physical adjustment for jog speed. Same thing for FRO, SRO, and RRO.
Problem is that while the FRO, SRO, and RRO UI sliders and status DRO's are all responding to external inputs (i.e. move on screen with my encoders), the on-screen jog adjustment does not respond to external inputs.
Even though I have not connected to any of the qtpyvcp exported hal pins the overrides mentioned still work on screen. Nor did I put anything in the post-gui hal file. They just seem to work ok.
I'd like to connect the jog slider as well. How can I do this?
Thanks,
R
					Problem is that while the FRO, SRO, and RRO UI sliders and status DRO's are all responding to external inputs (i.e. move on screen with my encoders), the on-screen jog adjustment does not respond to external inputs.
Even though I have not connected to any of the qtpyvcp exported hal pins the overrides mentioned still work on screen. Nor did I put anything in the post-gui hal file. They just seem to work ok.
I'd like to connect the jog slider as well. How can I do this?
Thanks,
R
Please Log in or Create an account to join the conversation.
- Lcvette
- 
				  
- Offline
- Moderator
- 
				  
		Less
		More
		
			
	
		- Posts: 1490
- Thank you received: 712
			
	
						20 Jan 2023 07:31				#262464
		by Lcvette
	
	
		
			
	
	
		
			
			 		
													
	
				Replied by Lcvette on topic Probe Basic - jog slider & status			
			
					Attachments:
Please Log in or Create an account to join the conversation.
- spumco
- Offline
- Platinum Member
- 
				  
		Less
		More
		
			
	
		- Posts: 1954
- Thank you received: 792
			
	
						20 Jan 2023 20:41				#262522
		by spumco
	
	
		
			
	
			
			 		
													
	
				Replied by spumco on topic Probe Basic - jog slider & status			
			
				Thanks.
Connect to machine.jog.linear-speed-percentage in postgui? Is that pin name exposed to hal like qtpyvcp.rapid-override-reset?
Reason I ask is that I didn't see any qtpyvcp jog related pins exposed in halshow.
					Connect to machine.jog.linear-speed-percentage in postgui? Is that pin name exposed to hal like qtpyvcp.rapid-override-reset?
Reason I ask is that I didn't see any qtpyvcp jog related pins exposed in halshow.
Please Log in or Create an account to join the conversation.
- Lcvette
- 
				  
- Offline
- Moderator
- 
				  
		Less
		More
		
			
	
		- Posts: 1490
- Thank you received: 712
			
	
						21 Jan 2023 02:32				#262538
		by Lcvette
	
	
		
			
	
			
			 		
													
	
				Replied by Lcvette on topic Probe Basic - jog slider & status			
			
					Please Log in or Create an account to join the conversation.
- spumco
- Offline
- Platinum Member
- 
				  
		Less
		More
		
			
	
		- Posts: 1954
- Thank you received: 792
			
	
						21 Jan 2023 04:49				#262552
		by spumco
	
	
		
			
	
			
			 		
													
	
				Replied by spumco on topic Probe Basic - jog slider & status			
			
				Sorry if I wasn't clear but I've already got the hal pins exported in my custom_config.yml file.  Same config as from the post you linked.
That's what I was referring to earlier when I wrote that I can see the qtpyvcp RRO/SRO/MVO reset pins in halshow.
It's the jog slider that doesn't appear to have an exported hal pin connection.
					That's what I was referring to earlier when I wrote that I can see the qtpyvcp RRO/SRO/MVO reset pins in halshow.
It's the jog slider that doesn't appear to have an exported hal pin connection.
Please Log in or Create an account to join the conversation.
- Lcvette
- 
				  
- Offline
- Moderator
- 
				  
		Less
		More
		
			
	
		- Posts: 1490
- Thank you received: 712
			
	
						21 Jan 2023 05:53				#262554
		by Lcvette
	
	
		
			
	
			
			 		
													
	
				Replied by Lcvette on topic Probe Basic - jog slider & status			
			
				can you show how you have your other overrides connected?  im looking into it but  would help to see what you have setup.			
					Please Log in or Create an account to join the conversation.
- Lcvette
- 
				  
- Offline
- Moderator
- 
				  
		Less
		More
		
			
	
		- Posts: 1490
- Thank you received: 712
			
	
						21 Jan 2023 06:08				#262555
		by Lcvette
	
	
		
			
	
			
			 		
													
	
				Replied by Lcvette on topic Probe Basic - jog slider & status			
			
				ok so the other overrides are coded and exposed already the jog percentage slider is not, so will need to expose it probably in the back end to make it easy to access, need to see what is needed there to accomplish.			
					Please Log in or Create an account to join the conversation.
- Lcvette
- 
				  
- Offline
- Moderator
- 
				  
		Less
		More
		
			
	
		- Posts: 1490
- Thank you received: 712
			
	
						21 Jan 2023 06:26				#262556
		by Lcvette
	
	
		
			
	
			
			 		
													
	
				Replied by Lcvette on topic Probe Basic - jog slider & status			
			
				try this in the postgui hal file, but with your naming for the net input of course, this is just generic:
# *** Set Line Below for ui Jog Slider hal connection ***
net linear-jog-speed-external-input => qtpyvcp.machine.jog.linear-speed-percentage
					# *** Set Line Below for ui Jog Slider hal connection ***
net linear-jog-speed-external-input => qtpyvcp.machine.jog.linear-speed-percentage
Please Log in or Create an account to join the conversation.
- spumco
- Offline
- Platinum Member
- 
				  
		Less
		More
		
			
	
		- Posts: 1954
- Thank you received: 792
			
	
						21 Jan 2023 16:24				#262588
		by spumco
	
	
		
			
	
			
			 		
													
	
				Replied by spumco on topic Probe Basic - jog slider & status			
			
				Thanks, but no joy.
LCNC throws up with 'pin doesn't exist'
Looking at halshow there are only three exposed override-related pins:
qtpyvcp.feed-override.reset
qtpyvcp.rapid-override.reset
qtpyvcp.spindle-override.reset
On the other hand, what I don't understand is if only the xxx.override.reset pins are exposed, why do the RRO/FRO/SRO status dro's displays and sliders follow external inputs?
My (naive) common-sense tells me only the reset function should work as there's no obvious connection between halui.xxx-override.counts (in) ot halui.xxx-override.value (out).
					LCNC throws up with 'pin doesn't exist'
Looking at halshow there are only three exposed override-related pins:
qtpyvcp.feed-override.reset
qtpyvcp.rapid-override.reset
qtpyvcp.spindle-override.reset
On the other hand, what I don't understand is if only the xxx.override.reset pins are exposed, why do the RRO/FRO/SRO status dro's displays and sliders follow external inputs?
My (naive) common-sense tells me only the reset function should work as there's no obvious connection between halui.xxx-override.counts (in) ot halui.xxx-override.value (out).
Please Log in or Create an account to join the conversation.
- spumco
- Offline
- Platinum Member
- 
				  
		Less
		More
		
			
	
		- Posts: 1954
- Thank you received: 792
			
	
						21 Jan 2023 16:47				#262591
		by spumco
	
	
		
			
	
			
			 		
													
	
				Replied by spumco on topic Probe Basic - jog slider & status			
			
				The plot thickens...
It looks like rapid/feed/max-vel/spindle overrides are linked(?) to value changes in machine_actions.py and spindle_actions.py
	
		
			
		
		
			
				
def _rapid_override_bindOk(value=100, widget=None):
# This will work for any widget
STATUS.task_state.onValueChanged(lambda: _rapid_override_ok(widget=widget))
try:
# these will only work for QSlider or QSpinBox
widget.setMinimum(0)
widget.setMaximum(100)
try:
widget.setSliderPosition(100)
STATUS.rapidrate.onValueChanged(
lambda v: widget.setSliderPosition(v * 100))
except AttributeError:
STATUS.rapidrate.onValueChanged(
lambda v: widget.setValue(v * 100))
widget.setValue(100)
rapid_override.set(100)
except AttributeError:
pass
except:
LOG.exception('Error in rapid_override bindOk')
rapid_override.set.ok = rapid_override.reset.ok = _rapid_override_ok
rapid_override.set.bindOk = rapid_override.reset.bindOk = _rapid_override_bindOk
			
		
	
But the jog-override section of machine_actions.py doesn't appear to have the same 'onValueChanged' functions:
	
		
			
		
		
			
	
I don't understand python, but it looks like the jog control was written differently than the other overrides.
					It looks like rapid/feed/max-vel/spindle overrides are linked(?) to value changes in machine_actions.py and spindle_actions.py
			Warning: Spoiler!		
		def _rapid_override_bindOk(value=100, widget=None):
# This will work for any widget
STATUS.task_state.onValueChanged(lambda: _rapid_override_ok(widget=widget))
try:
# these will only work for QSlider or QSpinBox
widget.setMinimum(0)
widget.setMaximum(100)
try:
widget.setSliderPosition(100)
STATUS.rapidrate.onValueChanged(
lambda v: widget.setSliderPosition(v * 100))
except AttributeError:
STATUS.rapidrate.onValueChanged(
lambda v: widget.setValue(v * 100))
widget.setValue(100)
rapid_override.set(100)
except AttributeError:
pass
except:
LOG.exception('Error in rapid_override bindOk')
rapid_override.set.ok = rapid_override.reset.ok = _rapid_override_ok
rapid_override.set.bindOk = rapid_override.reset.bindOk = _rapid_override_bindOk
But the jog-override section of machine_actions.py doesn't appear to have the same 'onValueChanged' functions:
			Warning: Spoiler!		
		
				def _jog_speed_slider_bindOk(widget): try:# these will only work for QSlider or QSpinBoxwidget.setMinimum(0)widget.setMaximum(100)widget.setValue((jog.linear_speed.getValue() / jog.max_linear_speed) * 100) # jog.linear_speed.connect(lambda v: widget.setValue(v * 100))except AttributeError:pass def _jog_angular_speed_slider_bindOk(widget): try:# these will only work for QSlider or QSpinBoxwidget.setMinimum(0)widget.setMaximum(100)widget.setValue((jog.angular_speed.getValue() / jog.max_angular_speed) * 100) # jog.linear_speed.connect(lambda v: widget.setValue(v * 100))except AttributeError:pass  jog.set_linear_speed.ok = jog.set_angular_speed.ok = lambda *a, **k: Truejog.set_linear_speed.bindOk = jog.set_angular_speed.bindOk = lambda *a, **k: True jog.set_linear_speed_percentage.ok = lambda *a, **k: Truejog.set_linear_speed_percentage.bindOk = _jog_speed_slider_bindOk jog.set_angular_speed_percentage.ok = lambda *a, **k: Truejog.set_angular_speed_percentage.bindOk = _jog_angular_speed_slider_bindOk
			
		I don't understand python, but it looks like the jog control was written differently than the other overrides.
Please Log in or Create an account to join the conversation.
		Moderators: KCJ, Lcvette	
		Time to create page: 0.390 seconds	
 
													