QT_Vismach
- cakeslob
- Offline
- Platinum Member
Less
More
- Posts: 789
- Thank you received: 230
20 Dec 2020 07:48 - 20 Dec 2020 07:51 #192508
by cakeslob
QT_Vismach was created by cakeslob
Good stuff cmorley, qt_vismach is pretty cool. it has indeed, allowed embedding into other projects.
I thought this configuration would be useful for 5axis stuff.only problem is losing keyboard jog and vismach at the same time, and it will make all your user tabs go to the left side. minor details. just a bit of usercommand.py
I thought this configuration would be useful for 5axis stuff.only problem is losing keyboard jog and vismach at the same time, and it will make all your user tabs go to the left side. minor details. just a bit of usercommand.py
W = root_window.tk.call
def _dynamic_tab(name, text):
tab = widgets.tabs.insert("end", name, text=text)
tab.configure(borderwidth=1, highlightthickness=0)
return tab
W('.pane.top.tabs','configure','-width','800','-arcradius','8','-tabpady','1''1')
Attachments:
Last edit: 20 Dec 2020 07:51 by cakeslob.
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
Less
More
- Posts: 7760
- Thank you received: 2055
20 Dec 2020 08:37 #192509
by cmorley
Replied by cmorley on topic QT_Vismach
Glad it worked for someone in the real world!
embedding placement is up to AXIS.
It would be nice if AXIS honored INI's {DISPLAY] EMBED_TAB_LOCATION
Maybe an AXIS expert will take that on.
If you build a nice vismach machine that you want to share let me know and I'll add it to qtvcp.
It shouldn't be hard to convert the other existing samples.
What would be really cool is if one could build a vismach machine that reads the INI and modifies it's sizes to suit a config.
I don;t think that would be too hard either.
just time
Thanks for the post.
Chris
embedding placement is up to AXIS.
It would be nice if AXIS honored INI's {DISPLAY] EMBED_TAB_LOCATION
Maybe an AXIS expert will take that on.
If you build a nice vismach machine that you want to share let me know and I'll add it to qtvcp.
It shouldn't be hard to convert the other existing samples.
What would be really cool is if one could build a vismach machine that reads the INI and modifies it's sizes to suit a config.
I don;t think that would be too hard either.
just time
Thanks for the post.
Chris
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
Less
More
- Posts: 7760
- Thank you received: 2055
20 Dec 2020 08:40 #192510
by cmorley
Replied by cmorley on topic QT_Vismach
Would a 'tear away' window be better? I think Pyqt has a widget that does that.
You click the top and it pop off as a separate window that you can put back.
Chris
You click the top and it pop off as a separate window that you can put back.
Chris
Please Log in or Create an account to join the conversation.
- cakeslob
- Offline
- Platinum Member
Less
More
- Posts: 789
- Thank you received: 230
20 Dec 2020 21:15 - 20 Dec 2020 21:23 #192574
by cakeslob
for anyone else doing vismach sims, mastercam's machsim seems like an nice tool for setting up a simulation file and constraints, and outputs all the coordinates to an xml file that can be transferred over to a vismach py file. the educational version of mastercam is free and as far as i know, does everything except post gcode, so the simulator portion should be available to play with without doing anything illegal
probably the best option. as soon as i was playing with the embedding, i realized embedding is great, but its limiting.
edit. might as well post it now so theres less confusion later, qt_vismach will not work on pi4. on the embedded version the error destroys before you can read it, but it says the same thing ,more or less, as the gcode graphics error , and will only display an empty tab
Replied by cakeslob on topic QT_Vismach
having it change side via INI file is no problem, , only issue im having is getting them to load in more than 1 spot. i can only get it to do left or right and not both.It would be nice if AXIS honored INI's {DISPLAY] EMBED_TAB_LOCATION
def _dynamic_tab(name, text):
if inifile.find("DISPLAY", "EMBED_TAB_POSITION") == "LEFT":
tab = widgets.right.insert("end", name, text=text)
else:
tab = widgets.tabs.insert("end", name, text=text)
tab.configure(borderwidth=1, highlightthickness=0)
return tab
well, i do, kinda. I noticed recently that the one of the leading cam software does their machine simulation similar to how (the older) vismach , except instead of a python file, it uses an xml file to layout all the all the stl files. there are over 20 machine configs , i just dont know if it will cause legal issues to post them. ill have to find some open examples of their sim and use those probably.If you build a nice vismach machine that you want to share let me know and I'll add it to qtvcp.
It shouldn't be hard to convert the other existing samples.
for anyone else doing vismach sims, mastercam's machsim seems like an nice tool for setting up a simulation file and constraints, and outputs all the coordinates to an xml file that can be transferred over to a vismach py file. the educational version of mastercam is free and as far as i know, does everything except post gcode, so the simulator portion should be available to play with without doing anything illegal
Would a 'tear away' window be better? I think Pyqt has a widget that does that.
You click the top and it pop off as a separate window that you can put back.
probably the best option. as soon as i was playing with the embedding, i realized embedding is great, but its limiting.
edit. might as well post it now so theres less confusion later, qt_vismach will not work on pi4. on the embedded version the error destroys before you can read it, but it says the same thing ,more or less, as the gcode graphics error , and will only display an empty tab
Attachments:
Last edit: 20 Dec 2020 21:23 by cakeslob.
The following user(s) said Thank You: Aciera
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
Less
More
- Posts: 7760
- Thank you received: 2055
20 Dec 2020 21:38 #192582
by cmorley
Replied by cmorley on topic QT_Vismach
AXIS only looks for one set of INI EMBED settings.
GMoccapy,Gscreen and Qtvcp allow many.
Here is the search code from GMoccapy:
Then they are processed separately.
Again Gmoccapy:
GMoccapy,Gscreen and Qtvcp allow many.
Here is the search code from GMoccapy:
def get_embedded_tabs(self):
# Check INI file for embed commands
# NAME is used as the tab label if a notebook is used
# LOCATION is the widgets name from the gladefile.
# COMMAND is the actual program command
# if no location is specified the main notebook is used
tab_names = self.inifile.findall("DISPLAY", "EMBED_TAB_NAME")
tab_location = self.inifile.findall("DISPLAY", "EMBED_TAB_LOCATION")
tab_cmd = self.inifile.findall("DISPLAY", "EMBED_TAB_COMMAND")
if len(tab_names) != len(tab_cmd):
return False, False, False
if len(tab_location) != len(tab_names):
for num, i in enumerate(tab_names):
try:
if tab_location[num]:
continue
except:
tab_location.append("notebook_mode")
return tab_names, tab_location, tab_cmd
Then they are processed separately.
Again Gmoccapy:
def _init_dynamic_tabs(self):
# dynamic tabs setup
self._dynamic_childs = {}
# register all tabs, so they will be closed together with the GUI
atexit.register(self._kill_dynamic_childs)
tab_names, tab_locations, tab_cmd = self.get_ini_info.get_embedded_tabs()
if not tab_names:
print (_("**** GMOCCAPY INFO ****"))
print (_("**** Invalid embedded tab configuration ****"))
print (_("**** No tabs will be added! ****"))
return
try:
for t, c, name in zip(tab_names, tab_cmd, tab_locations):
nb = self.widgets[name]
xid = self._dynamic_tab(nb, t)
if not xid: continue
cmd = c.replace('{XID}', str(xid))
child = subprocess.Popen(cmd.split())
self._dynamic_childs[xid] = child
nb.show_all()
except:
print(_("ERROR, trying to initialize the user tabs or panels, check for typos"))
self.set_up_user_tab_widgets(tab_locations)
# adds the embedded object to a notebook tab or box
def _dynamic_tab(self, widget, text):
s = gtk.Socket()
try:
widget.append_page(s, gtk.Label(" " + text + " "))
except:
try:
widget.pack_end(s, True, True, 0)
except:
return None
return s.get_id()
# Gotta kill the embedded processes when gmoccapy closes
def _kill_dynamic_childs(self):
for child in list(self._dynamic_childs.values()):
child.terminate()
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
Less
More
- Posts: 7760
- Thank you received: 2055
20 Dec 2020 21:46 #192584
by cmorley
Replied by cmorley on topic QT_Vismach
Qtvcp uses the same process to build vismach then the Tk version does.
There is just a couple differences for embedding capability.
For standalone there is one import difference.
I see vismach can read STL files of some capacity.
If we can add the capability to read a common XML system that would be probably be useful - even if we don't supply the XML files because of legality.
More documentation I guess would be helpful.
Chris
There is just a couple differences for embedding capability.
For standalone there is one import difference.
I see vismach can read STL files of some capacity.
If we can add the capability to read a common XML system that would be probably be useful - even if we don't supply the XML files because of legality.
More documentation I guess would be helpful.
Chris
Please Log in or Create an account to join the conversation.
- cakeslob
- Offline
- Platinum Member
Less
More
- Posts: 789
- Thank you received: 230
21 Dec 2020 01:10 #192588
by cakeslob
so, something like the vcpparse.py and pyvcp but for vismach? cool. sorry, i didnt expect to be talking about it with anyone so I came unprepared initially. I found some links on the pocketnc website, so that should be kosher. the postprocessor they provide for mastercam also seems useful as it relates to linuxcnc, if anyone is interested.
pocketnc.com/pages/mastercam-information
the first link doesnt work, but this one has the files, its" v1 machine simulation"
cdn.shopify.com/s/files/1/0077/5477/6623...ineSim9-1-16.zip?992
this has all the stl files for the pocketnc model and the xml file for assembling it and the constraints
a lot of it seems to be defining colour and stuff like reflective bitmap can be ignored, but the axis id and the transform values should be what we are looking for. it appears to build in the opposite direction is vismach, as to my understanding
, ill see if i can find some docs on the context of the xml file
ok, bear with my ignorance for a moment, if I just take those to definitions, and change them to relate to axis dynamic tabs and tkinter, would that do what we are looking for?
Replied by cakeslob on topic QT_Vismach
Qtvcp uses the same process to build vismach then the Tk version does.
There is just a couple differences for embedding capability.
For standalone there is one import difference.
I see vismach can read STL files of some capacity.
If we can add the capability to read a common XML system that would be probably be useful - even if we don't supply the XML files because of legality.
More documentation I guess would be helpful.
Chris
so, something like the vcpparse.py and pyvcp but for vismach? cool. sorry, i didnt expect to be talking about it with anyone so I came unprepared initially. I found some links on the pocketnc website, so that should be kosher. the postprocessor they provide for mastercam also seems useful as it relates to linuxcnc, if anyone is interested.
pocketnc.com/pages/mastercam-information
the first link doesnt work, but this one has the files, its" v1 machine simulation"
cdn.shopify.com/s/files/1/0077/5477/6623...ineSim9-1-16.zip?992
this has all the stl files for the pocketnc model and the xml file for assembling it and the constraints
Warning: Spoiler!
<?xml version="1.0" encoding="UTF-8" ?>
<machine_definition>
<machine_data name="Unnamed" version="1.8" units="inch">
<view_transform initialvalue="1.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1.00000000" />
</machine_data>
<geometry name="BALL_SCREWS" geo="base ball screws.stl" clrr="0.50196081" clrg="0.50196081" clrb="0.50196081" alpha="0.0" reflectivity="0.0" reflectivityBitmapFileName="" objtype="geometry" />
<geometry name="BASE" geo="base.stl" clrr="0.00000000" clrg="0.50196081" clrb="0.00000000" alpha="0.0" reflectivity="0.0" reflectivityBitmapFileName="" objtype="geometry" />
<geometry name="EMBLEM" geo="emblem on base.stl" clrr="1.00000000" clrg="1.00000000" clrb="1.00000000" alpha="0.0" reflectivity="0.0" reflectivityBitmapFileName="" objtype="geometry" />
<axis id="X" type="translation" x="1.00000000" y="0.00000000" z="0.00000000" minvalue="-2.175000" maxvalue="2.520000" valuetype="cont" initial_value="0.000000">
<geometry name="BALLSCREW" geo="z axis ball screw mounted on x.stl" clrr="0.50196081" clrg="0.50196081" clrb="0.50196081" alpha="0.0" reflectivity="0.0" reflectivityBitmapFileName="" objtype="geometry" />
<axis id="Z" type="translation" x="0.00000000" y="0.00000000" z="1.00000000" minvalue="3.062953" maxvalue="6.262953" valuetype="cont" initial_value="3.062953">
<geometry name="'CAM'" geo="cam on spindle.stl" clrr="1.00000000" clrg="0.00000000" clrb="0.00000000" alpha="0.0" reflectivity="0.0" reflectivityBitmapFileName="" objtype="geometry" />
<geometry name="'MASTER'" geo="mastercam on spindle.stl" clrr="0.00000000" clrg="0.00000000" clrb="0.00000000" alpha="0.0" reflectivity="0.0" reflectivityBitmapFileName="" objtype="geometry" />
<geometry name="HOLDER-SPINDLE-NOSE" geo="holder_spindle nose.stl" clrr="0.50196081" clrg="0.50196081" clrb="0.50196081" alpha="0.0" reflectivity="0.8" reflectivityBitmapFileName="" objtype="geometry" />
<geometry name="SPINDLE" geo="spindle-motor.stl" clrr="0.17647059" clrg="0.17647059" clrb="0.17647059" alpha="0.0" reflectivity="0.0" reflectivityBitmapFileName="" objtype="geometry" />
<transform id="holder_transform" initialvalue="1.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1.00000000">
<geometry name="Tool Set" geo="tool.stl" alpha="0.0" reflectivity="0.1" reflectivityBitmapFileName="" objtype="tool" cuttr="0.82745099" cuttg="0.78039217" cuttb="0.67450982" noncuttr="0.50196081" noncuttg="0.50196081" noncuttb="0.50196081" arborr="0.39215687" arborg="0.39215687" arborb="0.39215687" holderr="0.36862746" holderg="0.57254905" holderb="0.69019610" />
</transform>
</axis>
<geometry name="Z-AXIS-WAY" geo="z axis way mounted on x.stl" clrr="0.50196081" clrg="0.50196081" clrb="0.50196081" alpha="0.0" reflectivity="1.0" reflectivityBitmapFileName="" objtype="geometry" />
<geometry name="Z_AXIS_STEPPER" geo="z_axis_stepper.stl" clrr="0.00000000" clrg="0.00000000" clrb="0.00000000" alpha="0.0" reflectivity="0.0" reflectivityBitmapFileName="" objtype="geometry" />
<geometry name="x-AXIS" geo="x_axis.stl" clrr="0.17647059" clrg="0.17647059" clrb="0.17647059" alpha="0.0" reflectivity="0.0" reflectivityBitmapFileName="" objtype="geometry" />
</axis>
<axis id="Y" type="translation" x="0.00000000" y="-1.00000000" z="0.00000000" minvalue="-2.350000" maxvalue="2.520000" valuetype="cont" initial_value="0.000000">
<axis id="A" type="rotation" x="1.00000000" y="0.00000000" z="0.00000000" minvalue="-5.000000" maxvalue="95.000000" valuetype="cont" initial_value="0.000000" rzx="0.00000000" rzy="0.00000000" rzz="0.00000000">
<geometry name="A-AXIS" geo="a_axis.stl" clrr="0.00000000" clrg="0.50196081" clrb="0.00000000" alpha="0.0" reflectivity="0.0" reflectivityBitmapFileName="" objtype="geometry" />
<geometry name="A_PLATTER" geo="b_axis.stl" clrr="0.17647059" clrg="0.17647059" clrb="0.17647059" alpha="0.0" reflectivity="0.0" reflectivityBitmapFileName="" objtype="geometry" />
<axis id="B" type="rotation" x="0.00000000" y="1.00000000" z="0.00000000" minvalue="-10000.000000" maxvalue="10000.000000" valuetype="cont" initial_value="0.000000" rzx="0.00000000" rzy="0.00000000" rzz="0.00000000">
<geometry name="PLATTER" geo="b_axis rotary table.stl" clrr="0.00000000" clrg="0.50196081" clrb="0.00000000" alpha="0.0" reflectivity="0.0" reflectivityBitmapFileName="" objtype="geometry" />
<transform id="workpiece_transform" initialvalue="1.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1.00000000">
<geometry name="Fixture" geo="fixture.stl" clrr="0.50196081" clrg="0.50196081" clrb="0.50196081" alpha="0.0" reflectivity="0.0" reflectivityBitmapFileName="" objtype="fixture" />
<geometry name="Initial Stock" geo="initial stock.stl" clrr="0.75294119" clrg="0.75294119" clrb="0.75294119" alpha="0.8" reflectivity="0.0" reflectivityBitmapFileName="" objtype="initialstock" />
<geometry name="Stock" geo="stock.stl" clrr="0.75294119" clrg="0.75294119" clrb="0.75294119" alpha="0.0" reflectivity="0.4" reflectivityBitmapFileName="" objtype="stock" />
<geometry name="Workpiece" geo="workpiece.stl" clrr="0.75294119" clrg="0.75294119" clrb="0.75294119" alpha="0.0" reflectivity="0.4" reflectivityBitmapFileName="" objtype="workpiece" />
<geometry name="toolpath" geo="toolpath.asc" clrr="0.80000001" clrg="0.80000001" clrb="0.80000001" alpha="0.0" reflectivity="0.0" reflectivityBitmapFileName="" objtype="toolpath" />
</transform>
</axis>
<geometry name="b-EMBLEM" geo="emblem on b axis.stl" clrr="1.00000000" clrg="1.00000000" clrb="1.00000000" alpha="0.0" reflectivity="0.0" reflectivityBitmapFileName="" objtype="geometry" />
</axis>
<geometry name="Y_EMBLEM" geo="emblem on a axis.stl" clrr="1.00000000" clrg="1.00000000" clrb="1.00000000" alpha="0.0" reflectivity="0.0" reflectivityBitmapFileName="" objtype="geometry" />
<geometry name="yAXIS" geo="y_axis.stl" clrr="0.17647059" clrg="0.17647059" clrb="0.17647059" alpha="0.0" reflectivity="0.0" reflectivityBitmapFileName="" objtype="geometry" />
</axis>
<geometry name="feet" geo="feet.stl" clrr="0.00000000" clrg="0.00000000" clrb="0.00000000" alpha="0.0" reflectivity="0.0" reflectivityBitmapFileName="" objtype="geometry" />
<geometry name="mh_CAM" geo="cam on table_laptop.stl" clrr="1.00000000" clrg="0.00000000" clrb="0.00000000" alpha="0.0" reflectivity="0.0" reflectivityBitmapFileName="" objtype="geometry" />
<geometry name="mh_EMBLEM2" geo="emblem on laptop.stl" clrr="1.00000000" clrg="1.00000000" clrb="1.00000000" alpha="0.0" reflectivity="0.0" reflectivityBitmapFileName="" objtype="geometry" />
<geometry name="mh_LAPTOP" geo="laptop.stl" clrr="0.29411766" clrg="0.29411766" clrb="0.29411766" alpha="0.0" reflectivity="0.0" reflectivityBitmapFileName="" objtype="geometry" />
<geometry name="mh_MASTER" geo="master on table_laptop.stl" clrr="0.00000000" clrg="0.00000000" clrb="0.00000000" alpha="0.0" reflectivity="0.0" reflectivityBitmapFileName="" objtype="geometry" />
<geometry name="mh_TABLE" geo="table.stl" clrr="0.62745100" clrg="0.32156864" clrb="0.17647059" alpha="0.0" reflectivity="0.0" reflectivityBitmapFileName="" objtype="geometry" />
<geometry name="outlet" geo="outlet and button.stl" clrr="0.17647059" clrg="0.17647059" clrb="0.17647059" alpha="0.0" reflectivity="0.0" reflectivityBitmapFileName="" objtype="geometry" />
<geometry name="servos" geo="base servo motors.stl" clrr="0.00000000" clrg="0.00000000" clrb="0.00000000" alpha="0.0" reflectivity="0.0" reflectivityBitmapFileName="" objtype="geometry" />
</machine_definition>
a lot of it seems to be defining colour and stuff like reflective bitmap can be ignored, but the axis id and the transform values should be what we are looking for. it appears to build in the opposite direction is vismach, as to my understanding
, ill see if i can find some docs on the context of the xml file
AXIS only looks for one set of INI EMBED settings.
GMoccapy,Gscreen and Qtvcp allow many.
Here is the search code from GMoccapy:
ok, bear with my ignorance for a moment, if I just take those to definitions, and change them to relate to axis dynamic tabs and tkinter, would that do what we are looking for?
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
Less
More
- Posts: 7760
- Thank you received: 2055
21 Dec 2020 10:57 #192619
by cmorley
Replied by cmorley on topic QT_Vismach
Qtvcp uses the same process to build vismach then the Tk version does.
AXIS only looks for one set of INI EMBED settings.
GMoccapy,Gscreen and Qtvcp allow many.
Here is the search code from GMoccapy:
ok, bear with my ignorance for a moment, if I just take those to definitions, and change them to relate to axis dynamic tabs and tkinter, would that do what we are looking for?
Those functions were based on the AXIS code, so shouldn't be too hard to convert back.
The main difference would be GMoccapy uses the actual name of the widget to embed into.
For AXIS, I think it would be better to pick some key words like LEFT, CENTER, RIGHT, BOTTOM.
Chris
Please Log in or Create an account to join the conversation.
Moderators: cmorley
Time to create page: 0.097 seconds