Skip to content

Commit

Permalink
Merge pull request LinuxCNC#2756 from tjtr33/barWidgets
Browse files Browse the repository at this point in the history
Bar widgets
  • Loading branch information
andypugh authored Dec 11, 2023
2 parents 2217582 + 6e84469 commit cac8b1b
Show file tree
Hide file tree
Showing 17 changed files with 4,664 additions and 122 deletions.
32 changes: 32 additions & 0 deletions configs/tomp/nuPyvcpBars/NuHbarRun.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
to run a config using the new pyvcp bar widgets
is like othe configs

you will create an .ini, a custon.hal, and xnl
and
uf you want graphical thumbs ( the marker that moves aloong the bar)
you will need to create a small python tkinter .py file that draws the marker
( and set the tag' dwgf to that file spec )
or creates/copy a suitible png file
( and set the tag 'imgf' to that file spec )

i used a full file spec for imgf
i placed my .dwg file alomgside pyvcp_widgets.py
which is in /lib/python3/dist_packages/ for NON RIP
and is in ~/linuxcnc-dev/configs/tomp/NuPyvcpBars/ for me ( ymmv)

my test .imi is pyTktab04.ini
the .ini will use AXIS gui and create a pyvcp tab with many aniumated bars
the ini expects local file bars.xml ( same dir as .ini)
the .ini's PROGRAM_PREFIX must be adapted to your situation
the .ini [FILTER} section was chamghed to py - python3 izzat necc/good?
the .ini [HAL] section has POSTGUI_HALFILE = custom4.hal

place bars.xml in same dir as .ini

place custom4.hal in same dir as .ini

custom4.gal requires rand9
a python hal comp that is a random number generator
used to to drive bar widgets
so ramd9 must be with the other hal comps

37 changes: 37 additions & 0 deletions configs/tomp/nuPyvcpBars/NuNarTest.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
to test the pyvcp bars

edit bars1.xml to change tag values
use <!--tag?value</tag--> to hide trials

edit bars1.hal to change driver propetries
the drive for the bardemo is a siggen
the amplitude and offset must agree with the xml min and max
for example in min is 0 and max is 100
then the siggen sin amplitude is *max-min)/2 = 60
and the offset would be -
for example, if min is -125 and max is -32
then the amplitude is (-32 - -125)/2 = 45.5
and the offset will be ( -32 - 42/.5 ) = -74.5
( the sinus will oscillate about -74.5,
rising towards Min od -32
and falling towards -125
You can adjust the freq as desired but note
there seems to be a beat freq on my system,
you mayt experience it too,
so use freqs od 10 20 30 40 50 60 etc
It maybe my monitor or the thread speed or both. oi dunno
It is not an error of the program

to run your test on a RIP
cd
cd path/to/your/linuxcncdev/dir
mine is ~/linuxcnc-barwidgets/configs/tomp/nuPyvcpBars$
yours will be something like the following
cd ~/linuxcnc-dev/configs/<dirwhere you have your test .xml and .hal >

halrun -I -f bars1.hal

have fun
tomp


Loading

0 comments on commit cac8b1b

Please sign in to comment.