Hello Guest it is March 28, 2024, 07:31:58 AM

Author Topic: horizontal slider  (Read 1489 times)

0 Members and 1 Guest are viewing this topic.

horizontal slider
« on: March 26, 2021, 10:45:10 PM »
I found a way to make a pseudo horizontal slider. It uses a combination of a dro, leds, and transparent buttons. The dro is the value of the slider. The value can be entered by clicking on the slider, or with code. There are a series of leds with custom graphics that show the position of the slider. On top of the leds are transparent buttons that when clicked on set the dro to a set percentage. The macropump monitors the dro and updates the leds to show the correct slider position.

The slider can't actually be slid like a real slider. Though just clicking on the approximate percent should be close enough. If finer adjustment is needed the dro can be edited for the correct amount.

The screenset uploaded has sliders for the feedrate and rpm. The rpm slider can only be edited by changing the dro. The feedrate sider can be edited with the dro or by clicking on the slider. The feedrate slider is duplicated above with the leds on top and the transparent buttons below the slider.

In the macropump if the feed rate is set over 200% percent it sets the dro to 200%. If the rpm is set over it is set to 100%. The macro pump then divides the dro by 20 or 10 and then sets the according led.

The leds are from 0 to 9 in a series range. The left side of the image is the slider's bar and the right side is the slider. The image can't be transparent or it won't overwrite the previous state when updated.


Macropump code
 A=((GetDRO(21)/10/2)-1)
If A<0 Then
A=0
End If
If GetDRO(21)>200 Then
SetDRO(21,200)
End If
B=1060
D=1
E=10
Call Led_Off
Call Led_On

A=((GetOEMDRO(74)/10)-1)
If A<0 Then
A=0
End If
If GetOEMDRO(74)>100 Then
SetOEMDRO(74,100)
End If
B=1070
D=1
E=10
Call Led_Off
Call Led_On



Sub Led_Off
C=0
Do Until C=E
SetUserLed((B+C),0)
C=C+D
Loop
End Sub

Sub Led_On
SetUserLED((B+A),1)
End Sub
return
« Last Edit: March 26, 2021, 10:46:47 PM by Punisher »