Skip to content

Commit cac8b1b

Browse files
authored
Merge pull request #2756 from tjtr33/barWidgets
Bar widgets
2 parents 2217582 + 6e84469 commit cac8b1b

File tree

17 files changed

+4664
-122
lines changed

17 files changed

+4664
-122
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
to run a config using the new pyvcp bar widgets
2+
is like othe configs
3+
4+
you will create an .ini, a custon.hal, and xnl
5+
and
6+
uf you want graphical thumbs ( the marker that moves aloong the bar)
7+
you will need to create a small python tkinter .py file that draws the marker
8+
( and set the tag' dwgf to that file spec )
9+
or creates/copy a suitible png file
10+
( and set the tag 'imgf' to that file spec )
11+
12+
i used a full file spec for imgf
13+
i placed my .dwg file alomgside pyvcp_widgets.py
14+
which is in /lib/python3/dist_packages/ for NON RIP
15+
and is in ~/linuxcnc-dev/configs/tomp/NuPyvcpBars/ for me ( ymmv)
16+
17+
my test .imi is pyTktab04.ini
18+
the .ini will use AXIS gui and create a pyvcp tab with many aniumated bars
19+
the ini expects local file bars.xml ( same dir as .ini)
20+
the .ini's PROGRAM_PREFIX must be adapted to your situation
21+
the .ini [FILTER} section was chamghed to py - python3 izzat necc/good?
22+
the .ini [HAL] section has POSTGUI_HALFILE = custom4.hal
23+
24+
place bars.xml in same dir as .ini
25+
26+
place custom4.hal in same dir as .ini
27+
28+
custom4.gal requires rand9
29+
a python hal comp that is a random number generator
30+
used to to drive bar widgets
31+
so ramd9 must be with the other hal comps
32+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
to test the pyvcp bars
2+
3+
edit bars1.xml to change tag values
4+
use <!--tag?value</tag--> to hide trials
5+
6+
edit bars1.hal to change driver propetries
7+
the drive for the bardemo is a siggen
8+
the amplitude and offset must agree with the xml min and max
9+
for example in min is 0 and max is 100
10+
then the siggen sin amplitude is *max-min)/2 = 60
11+
and the offset would be -
12+
for example, if min is -125 and max is -32
13+
then the amplitude is (-32 - -125)/2 = 45.5
14+
and the offset will be ( -32 - 42/.5 ) = -74.5
15+
( the sinus will oscillate about -74.5,
16+
rising towards Min od -32
17+
and falling towards -125
18+
You can adjust the freq as desired but note
19+
there seems to be a beat freq on my system,
20+
you mayt experience it too,
21+
so use freqs od 10 20 30 40 50 60 etc
22+
It maybe my monitor or the thread speed or both. oi dunno
23+
It is not an error of the program
24+
25+
to run your test on a RIP
26+
cd
27+
cd path/to/your/linuxcncdev/dir
28+
mine is ~/linuxcnc-barwidgets/configs/tomp/nuPyvcpBars$
29+
yours will be something like the following
30+
cd ~/linuxcnc-dev/configs/<dirwhere you have your test .xml and .hal >
31+
32+
halrun -I -f bars1.hal
33+
34+
have fun
35+
tomp
36+
37+

0 commit comments

Comments
 (0)