On Saturday 13 October 2018 10:25:26 andy pugh wrote:
> On Fri, 12 Oct 2018 at 22:22, Gene Heskett <[email protected]>
wrote:
> > How hard would it be to either make QTVCP either use the current xml
> > and matching hal files, or to write a one-time translator that
> > would?
>
> Which XML? Do you mean the PyVCP (hand coded) file or the Glade file?
>
> Even Glade struggles to parse the Glade files....
Tell me about it... Both of these files have mixed tabs and spaces. And
us a 2 space indent pattern to help me keep organized.
This xml file from the GO704 for instance:
================pyvcp-tach-status.xml===============
<?xml version='1.0' encoding='UTF-8'?>
<pyvcp>
<!--
Include your PyVCP panel here.
The contents of this file will not be overwritten when you run stepconf
again.
-->
<!-- the RPM meter -->
<hbox>
<relief>RAISED</relief>
<bd>2</bd>
<meter>
<halpin>"spindle_rpm"</halpin>
<text>"Spindle"</text>
<subtext>"RPM"</subtext>
<size>240</size>
<min_>0</min_>
<max_>3000</max_>
<majorscale>500</majorscale>
<minorscale>100</minorscale>
<region1>0,2450,"green"</region1>
<region2>2450,2800,"yellow"</region2>
<region3>2800,3000,"red"</region3>
</meter>
</hbox>
<!-- The spindle power tally led -->
<hbox>
<vbox>
<relief>RAISED</relief>
<bd>2</bd>
<label>
<text>"SPWR"</text>
<font>("Helvetica",8)</font>
</label>
<rectled>
<halpin>"on-led"</halpin>
<height>"6"</height>
<width>"72"</width>
<on_color>"green"</on_color>
<off_color>"red"</off_color>
</rectled>
</vbox>
<!-- The spindle forward led -->
<vbox>
<relief>RAISED</relief>
<bd>2</bd>
<label>
<text>"FWD"</text>
<font>("Helvetica",8)</font>
</label>
<rectled>
<halpin>"fwd-led"</halpin>
<height>"6"</height>
<width>"72"</width>
<on_color>"green"</on_color>
<off_color>"red"</off_color>
</rectled>
</vbox>
<!-- The spindle reversed led -->
<vbox>
<relief>RAISED</relief>
<bd>2</bd>
<label>
<text>"REV"</text>
<font>("Helvetica",8)</font>
</label>
<rectled>
<halpin>"rev-led"</halpin>
<height>"6"</height>
<width>"72"</width>
<on_color>"green"</on_color>
<off_color>"red"</off_color>
</rectled>
</vbox>
</hbox>
<!-- The following is added to your .xml file inside the <pyvcp> </pyvcp>
tags -->
<!-- here we have to re-invent the camview missing stuffs -->
<!-- This button moves the machine so the camera is looking at the tools
location -->
<!-- And back, condition tallied by an led used to underline the
button -->
<labelframe text="Calibrate machine">
<hbox>
<button>
<halpin>"checkbutton1"</halpin>
<text>"CamSW"</text>
<font>('Helvetica',10)</font>
</button>
<!-- 2nd button in middle of horizontal row, for store a
coordinate -->
<button>
<halpin>"button1"</halpin>
<text>"CamStor"</text>
<font>('Helvetica',10)</font>
</button>
<!-- now, 4 small vertical leds to tally how many coordinates have
been stored -->
<rectled>
<halpin>"stored1"</halpin>
<height>"32"</height>
<width>"14"</width>
<on_color>"green"</on_color>
<off_color>"red"</off_color>
</rectled>
<rectled>
<halpin>"stored2"</halpin>
<height>"32"</height>
<width>"14"</width>
<on_color>"green"</on_color>
<off_color>"red"</off_color>
</rectled>
<rectled>
<halpin>"stored3"</halpin>
<height>"32"</height>
<width>"14"</width>
<on_color>"green"</on_color>
<off_color>"red"</off_color>
</rectled>
<rectled>
<halpin>"stored4"</halpin>
<height>"32"</height>
<width>"14"</width>
<on_color>"green"</on_color>
<off_color>"red"</off_color>
</rectled>
</hbox>
<!-- an led used to underline the CamSW button to tally state, -->
<!--red=machine normal,green=machine is in camera offset position-->
<hbox>
<rectled>
<halpin>"camactive"</halpin>
<height>"6"</height>
<width>"75"</width>
<on_color>"green"</on_color>
<off_color>"red"</off_color>
</rectled>
<!-- an underline under the CamStor sub button but function runs to fast
to register green -->
<!-- an G4p.5 in that subroutine might be enough to blink it -->
<rectled>
<halpin>"camstored"</halpin>
<height>"6"</height>
<width>"75"</width>
<on_color>"green"</on_color>
<off_color>"red"</off_color>
</rectled>
</hbox>
</labelframe>
<!-- next row of buttons down -->
<labelframe text="Center machine">
<vbox>
<hbox>
<!-- runs camcenter3 sub -->
<button>
<halpin>"button2"</halpin>
<text>"CamCtr3"</text>
<font>('Helvitica',10)</font>
</button>
<!-- runs camcenter4 sub -->
<button>
<halpin>"button3"</halpin>
<text>"CamCtr4"</text>
<font>('Helvetica',10)</font>
</button>
</hbox>
<!-- tally camcenter3 having been run -->
<hbox>
<rectled>
<halpin>"camcentered3"</halpin>
<height>"6"</height>
<width>"80"</width>
<on_color>"green"</on_color>
<off_color>"red"</off_color>
</rectled>
<!-- tally camcenter4 sub has been run -->
<rectled>
<halpin>"camcentered4"</halpin>
<height>"6"</height>
<width>"80"</width>
<on_color>"green"</on_color>
<off_color>"red"</off_color>
</rectled>
</hbox>
</vbox>
</labelframe>
<!-- and last, the alignment stuff -->
<labelframe text="Align Sheet">
<!-- button to set starting point for alignment calcs -->
<button>
<halpin>"align_startb"</halpin>
<text>"Align Start"</text>
<font>('Helvetica',10)</font>
</button>
<!-- and underline tally to indicate the starting point has been
recorded -->
<rectled>
<halpin>"align_enabled"</halpin>
<height>"6"</height>
<width>"238"</width>
<on_color>"green"</on_color>
<off_color>"red"</off_color>
</rectled>
</labelframe>
<labelframe text="Mark x OR y">
<vbox>
<hbox>
<!-- mark along x axis -->
<button>
<halpin>"align_xb"</halpin>
<text>"Align _Y"</text>
<font>('Helvetica',10)</font>
</button>
<!-- mark along y axis -->
<button>
<halpin>"align_yb"</halpin>
<text>"Align X"</text>
<font>('Helvetica',10)</font>
</button>
</hbox>
<hbox>
<!-- indicate is aligned along X axis, mutually exclusive -->
<rectled>
<halpin>"align2_xt"</halpin>
<height>"6"</height>
<width>"74"</width>
<on_color>"green"</on_color>
<off_color>"red"</off_color>
</rectled>
<!-- indicate is aligned along Y axis, mutually exclusive -->
<rectled>
<halpin>"align2_yt"</halpin>
<height>"6"</height>
<width>"68"</width>
<on_color>"green"</on_color>
<off_color>"red"</off_color>
</rectled>
</hbox>
</vbox>
</labelframe>
<!-- And finally, a button to restore normal coordination to machine
square -->
<vbox>
<hbox>
<button>
<halpin>"clear_offsetsb"</halpin>
<text>" Clear Offsets "</text>
<font>('Helvetica',12)</font>
</button>
</hbox>
</vbox>
</pyvcp>
====================
looks fairly normal, but I'm more used to looking at pyvcp stuffs,
And this one, from the Sheldon, run by the pi3, is getting complex too.
============Sheldon-pyvcp-panel.xml==========
<?xml version='1.0' encoding='UTF-8'?>
<pyvcp>
<!--
Include your PyVCP panel here.
The contents of this file will not be overwritten when you run stepconf
again. FWIW, its not been run yet.
This is the tachometer and the three status buttons for overall motor
power, and the spindles direction, if its running. The hal file is
going to be reconfigured so that when the machine is enabled, signals
will be sent to turn on 2 SSR's, enabling the 127 volts for the xy
motors and one side of the vfd, 254 feed with one of them, and the other
leg of the 254 volt to the vfd with the 2nd one. Yet to be wired up,
but might as well have it ready when the SSR's are ready to be put to
work. Wired up and controlling all motor power now. This must be
executed before the postgui.hal that hooks these hal-pins up.
-->
<!-- the RPM meter -->
<hbox>
<relief>RAISED</relief>
<bd>2</bd>
<meter>
<halpin>"spindle_rpm"</halpin>
<text>"Spindle"</text>
<subtext>"RPM"</subtext>
<!-- was 240 -->
<size>268</size>
<min_>0</min_>
<max_>1200</max_>
<majorscale>100</majorscale>
<minorscale>25</minorscale>
<region1>0,600,"green"</region1>
<region2>601,800,"yellow"</region2>
<region3>801,1200,"red"</region3>
</meter>
</hbox>
<!-- End of the tach dial, good, all in one hbox -->
<!-- start of spindle status -->
<hbox> <!-- start a new hbox -->
<vbox> <!-- put each of these 3 in vboxes -->
<relief>RAISED</relief>
<bd>2</bd>
<label>
<text>"MOTPWR"</text>
<font>("Helvetica",10)</font>
</label>
<rectled>
<halpin>"on-led"</halpin>
<height>"12"</height>
<width>"81"</width>
<on_color>"green"</on_color>
<off_color>"red"</off_color>
</rectled>
</vbox>
<!-- 2nd spindle tally for FWD rotation -->
<vbox>
<relief>RAISED</relief>
<bd>2</bd>
<label>
<text>"FWD"</text>
<font>("Helvetica",10)</font>
</label>
<rectled>
<halpin>"fwd-led"</halpin>
<height>"12"</height>
<width>"81"</width>
<on_color>"green"</on_color>
<off_color>"red"</off_color>
</rectled>
</vbox>
<!-- end of FWD, now do REV in new vbox -->
<vbox>
<relief>RAISED</relief>
<bd>2</bd>
<label>
<text>"REV"</text>
<font>("Helvetica",10)</font>
</label>
<rectled>
<halpin>"rev-led"</halpin>
<height>"12"</height>
<width>"81"</width>
<on_color>"green"</on_color>
<off_color>"red"</off_color>
</rectled>
</vbox>
</hbox>
<!-- end of spindle status, lines them all up in a row -->
<!-- start of spindle gearshift status, commented out for now -->
<!-- <hbox>
<vbox>
<relief>RAISED</relief>
<bd>2</bd>
<label>
<text>"LOWER"</text>
<font>("Helvetica",10)</font>
</label>
<rectled>
<halpin>"gear-lower-led"</halpin>
<height>"12"</height>
<width>"72"</width>
<on_color>"green"</on_color>
<off_color>"red"</off_color>
</rectled>
</vbox>
<vbox>
<relief>RAISED</relief>
<bd>2</bd>
<label>
<text>"GOOD"</text>
<font>("Helvetica",10)</font>
</label>
<rectled>
<halpin>"gear-good-led"</halpin>
<height>"12"</height>
<width>"72"</width>
<on_color>"green"</on_color>
<off_color>"red"</off_color>
</rectled>
</vbox>
<vbox>
<relief>RAISED</relief>
<bd>2</bd>
<label>
<text>"HIGHER"</text>
<font>("Helvetica",10)</font>
</label>
<rectled>
<halpin>"gear-higher-led"</halpin>
<height>"12"</height>
<width>"72"</width>
<on_color>"green"</on_color>
<off_color>"red"</off_color>
</rectled>
</vbox>
</hbox>-->
<!-- end of spindle gearshift status and again,
3 vboxes inside an hbox-->
<!-- start of jog size per click display -->
<hbox> <!-- start a new hbox -->
<vbox>
<label>
<text>"X-Jog Size"</text>
<font>("Helvetica",12)</font>
</label>
<rectled>
<halpin>"x-rng-active"</halpin>
<height>"8"</height>
<width>"130"</width>
<on_color>"green"</on_color>
<off_color>"red"</off_color>
</rectled>
<number>
<relief>"raised"</relief>
<bd>2</bd>
<padx>20</padx>
<halpin>"X-Jog"</halpin>
<font>("Helvetica",18)</font>
<format>".5f"</format>
</number>
</vbox> <!-- all in one vbox -->
<vbox>
<label>
<text>"Z-Jog Size"</text>
<font>("Helvetica",12)</font>
</label>
<rectled>
<halpin>"z-rng-active"</halpin>
<height>"8"</height>
<width>"130"</width>
<on_color>"green"</on_color>
<off_color>"red"</off_color>
</rectled>
<number>
<relief>"raised"</relief>
<bd>2</bd>
<padx>20</padx>
<halpin>"Z-Jog"</halpin>
<font>("Helvetica",18)</font>
<format>".5f"</format>
</number>
</vbox>
</hbox> <!-- good to here -->
<!-- And many thanks to Chris Morely, this now works as advertised.
<multilabel>
<legends>["Label1", "Label2", "Label3", "Label4", "Label5", "Label6"]</legends>
<font>("Helvetica",20)</font>
<disable_pin>False</disable_pin>
</multilabel> -->
<!-- Add 2 more number boxes, one to show g33.1 overshoot in turns
and one to show overshoot in distance once the thread pitch is
known and exported from the gcode with an M68E0Q#<_tpmm>
or recip of #<_tpi>
-->
<hbox>
<vbox>
<label>
<text>"ovrtrvl turns"</text>
<font>("Helvetica",12)</font>
</label>
<number>
<relief>"raised"</relief>
<bd>2</bd>
<padx>24</padx>
<halpin>"ovrturns"</halpin>
<font>("Helvetica",18)</font>
<format>".5f"</format>
</number>
</vbox>
<vbox>
<label>
<text>"ovrtrvl dist"</text>
<font>("Helvetica",12)</font>
</label>
<number>
<relief>"raised"</relief>
<bd>2</bd>
<padx>24</padx>
<halpin>"ovrtvldist"</halpin>
<font>("Helvetica",18)</font>
<format>".5f"</format>
</number>
</vbox>
</hbox>
</pyvcp>
====================
So there's a couple pyvcp *.xml files to practice on once QTVCP works :)
Thanks Andy.
--
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers