Fork of gmoccapy
18 Jun 2016 12:45 #76258
by pippin88
Fork of gmoccapy was created by pippin88
Hi,
I did some work on creating a fork of gmoccapy some time ago. I think gmoccapy is great, but I use mouse and keyboard and think the layout could be better.
I also want to add some features, like a gcode quick guide and gcode translation.
I'm trying to do this the 'right' way and actually make this something other people can use, rather than just replacing the gmoccapy files with my customised ones. To do this, I've created a fork on github (github.com/pippin88/linuxcnc/tree/LCNCScreen-dev).
I've set up a virtual machine with git checkout of that branch, with run in place (so I'm getting 2.8 pre)
I've copied the gmoccapy directory in src\emc\usr_intf for my screen - lcncscreen
I'm getting error: "Can't execute DISPLAY program lcncscreen"
Essentially, I can't find any documentation about how to actually integrate a new GUI in to the LinuxCNC structure. I can find some documentation on the python / glade side of things, but not where files should go etc so that I can actually use them. I had success replacing gmoccapy.py and .glade on a standard livecd install.
Any help is appreciated.
I did some work on creating a fork of gmoccapy some time ago. I think gmoccapy is great, but I use mouse and keyboard and think the layout could be better.
I also want to add some features, like a gcode quick guide and gcode translation.
I'm trying to do this the 'right' way and actually make this something other people can use, rather than just replacing the gmoccapy files with my customised ones. To do this, I've created a fork on github (github.com/pippin88/linuxcnc/tree/LCNCScreen-dev).
I've set up a virtual machine with git checkout of that branch, with run in place (so I'm getting 2.8 pre)
I've copied the gmoccapy directory in src\emc\usr_intf for my screen - lcncscreen
I'm getting error: "Can't execute DISPLAY program lcncscreen"
Essentially, I can't find any documentation about how to actually integrate a new GUI in to the LinuxCNC structure. I can find some documentation on the python / glade side of things, but not where files should go etc so that I can actually use them. I had success replacing gmoccapy.py and .glade on a standard livecd install.
Any help is appreciated.
Please Log in or Create an account to join the conversation.
19 Jun 2016 20:57 #76293
by newbynobi
Replied by newbynobi on topic Fork of gmoccapy
You have to modify the Makefile and also the Submakefile, otherwise the files will not be copied to the corresponding locations.
Norbert
Norbert
Please Log in or Create an account to join the conversation.
15 Aug 2016 15:27 #78803
by kagouraki
Replied by kagouraki on topic Fork of gmoccapy
Hello i want to add this gcode reference tou have as user tab in the stock gmoccapy. Can you provide the code ?
Thank you
Thank you
Please Log in or Create an account to join the conversation.
17 Aug 2016 11:14 #78922
by pippin88
Replied by pippin88 on topic Fork of gmoccapy
It's been a while since I did this, and I've since given up on the fork. I now use normal gmoccapy, as it is very good now and the tabs feature is great.
I don't really have time / enough knowledge to help more than what follows. I don't know python at all - I just copy and paste and fiddle until I get something to work.
I think the relevant python and glade code was:
I don't really have time / enough knowledge to help more than what follows. I don't know python at all - I just copy and paste and fiddle until I get something to work.
I think the relevant python and glade code was:
# replace active G codes with explanation, e.g. G8 changes to G8 = Radius Mode
def _expand_active_gcodes(self):
# define our method
def replace_all(text, dic):
for i, j in dic.iteritems():
text = text.replace(i, j)
return text
active_codes = []
temp = []
for code in sorted(self.stat.gcodes[1:]):
if code == -1:
continue
if code % 10 == 0:
temp.append("%d" % (code / 10))
else:
temp.append("%d.%d" % (code / 10, code % 10))
for num, code in enumerate(temp):
active_codes.append("G" + code + " ")
self.active_gcodes = active_codes
self.gcodes = self.stat.gcodes
#change the list into a string so we can replace
active_codes = " ".join(self.active_gcodes)
# our text the replacement will take place
gcode_exp = active_codes
# our dictionary with our key:values.
reps = {'G1 ':'\nG1 = Coordinated motion ("Straight feed")',
'G4 ':'\nG4 = Dwell (no motion for P seconds)',
'G7 ':'\nG7 = Diameter Mode',
'G8 ':'\nG8 = Radius Mode',
'G17 ':'\nG17 = Select XY plane',
'G18 ':'\nG18 = Select XZ plane',
'G19 ':'\nG19 = Select YZ plane',
'G20 ':'\nG20 = Inches',
'G21 ':'\nG21 = Millimeters',
'G33 ':'\nG33 = Spindle-synchronized motion',
'G33.1 ':'\nG33.1 = Rigid tapping',
'G40 ':'\nG40 = Cancel cutter radius compensation',
'G49 ':'\nG49 = Cancel tool length offset',
'G53 ':'\nG53 = Motion in machine coordinate system',
'G54 ':'\nG54 = select coordinate system 1',
'G55 ':'\nG55 = select coordinate system 2',
'G56 ':'\nG56 = select coordinate system 3',
'G57 ':'\nG57 = select coordinate system 4',
'G58 ':'\nG58 = select coordinate system 5',
'G59 ':'\nG59 = select coordinate system 6',
'G59.1 ':'\nG59.1 = select coordinate system 7',
'G59.2 ':'\nG59.2 = select coordinate system 8',
'G59.3 ':'\nG59.3 = select coordinate system 9',
'G61 ':'\nG61 = Exact Path mode',
'G61.1 ':'\nG61.1 = Exact Stop mode',
'G64 ':'\nG64 = Continuous mode with optional path tolerance',
'G80 ':'\nG80 = Cancel motion mode',
'G90 ':'\nG90 = Absolute distance mode',
'G91 ':'\nG91 = Incremental distance mode',
'G90.1 ':'\nG90.1 = Arc centers I,J,K are absolute',
'G91.1 ':'\nG91.1 = Arc centers I,J,K are relative to the arc\'s starting point',
'G94 ':'\nG94 = Units per minute feed rate',
'G95 ':'\nG95 = Units per revolution',
'G96 ':'\nG96 = CSS mode (Constant Surface Speed)',
'G97 ':'\nG97 = RPM mode',
'G98 ':'\nG98 = Retract to prior position',
'G99 ':'\nG99 = Retract to R position'
}
# bind the returned text of the method
# to a variable and print it
txt = replace_all(gcode_exp, reps)
self.widgets.active_gcodes_exp.set_label("".join(txt))
# replace active M codes with explanation, e.g. M1 changes to M1 = Optional Pause
def _expand_active_mcodes(self):
# define our method
def replace_all(text, dic):
for i, j in dic.iteritems():
text = text.replace(i, j)
return text
# M codes
active_codes = []
temp = []
for code in sorted(self.stat.mcodes[1:]):
if code == -1:
continue
temp.append("%d" % code)
for code in (temp):
active_codes.append("M" + code + " ")
self.active_mcodes = active_codes
self.mcodes = self.stat.mcodes
#change the list into a string so we can replace
active_codes = " ".join(self.active_mcodes)
# our text the replacement will take place
mcode_exp = active_codes
# our dictionary with our key:values.
reps = {'M0 ':'\nM0 = Program Pause',
'M1 ':'\nM1 = Optional Pause',
'M2 ':'\nM2 = End Program',
'M3 ':'\nM3 = Turn spindle clockwise',
'M4 ':'\nM4 = Turn spindle counterclockwise',
'M5 ':'\nM5 = Stop spindle',
'M7 ':'\nM7 = Turn mist on',
'M8 ':'\nM8 = Turn flood on',
'M9 ':'\nM9 = Turn all coolant off',
'M19 ':'\nM19 = Orient spindle',
'M30 ':'\nM30 = End Program',
'M48 ':'\nM48 = Enable spindle and feed rate override controls',
'M49 ':'\nM49 = Disbale spindle and feed rate override controls',
'M50 ':'\nM50 = Feed Override Control (P0 = off, P1 = on)',
'M51 ':'\nM51 = Spindle Speed Override Control (P0 = off, P1 = on)',
'M52 ':'\nM52 = Adaptive Feed Control (P0 = off, P1 = on)',
'M53 ':'\nM53 = Feed Stop Control (P0 = off, P1 = on)',
'M60 ':'\nM60 = Pallet Change Pause'
}
# bind the returned text of the method
# to a variable and print it
txt = replace_all(mcode_exp, reps)
self.widgets.active_mcodes_exp.set_label("".join(txt))
<object class="GtkVBox" id="vbox6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkFrame" id="frm_gcode1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0.5</property>
<property name="shadow_type">out</property>
<child>
<object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">5</property>
<property name="bottom_padding">5</property>
<property name="left_padding">5</property>
<property name="right_padding">5</property>
<child>
<object class="GtkVBox" id="vbox11">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkHBox" id="hbox14">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="lbl_feed1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label">Feed</property>
<attributes>
<attribute name="style" value="normal"/>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_active_feed1">
<property name="width_request">50</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label">10000</property>
<attributes>
<attribute name="style" value="normal"/>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox15">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="lbl_speed1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="ypad">3</property>
<property name="label">Spindle</property>
<attributes>
<attribute name="style" value="normal"/>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="active_speed_label1">
<property name="width_request">50</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="ypad">3</property>
<property name="label">10000</property>
<attributes>
<attribute name="style" value="normal"/>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox7">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="active_mcodes_exp">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">active_mcodes_label</property>
<attributes>
<attribute name="style" value="normal"/>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="padding">2</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox11">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="active_gcodes_exp">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">active_gcodes_label</property>
<attributes>
<attribute name="style" value="normal"/>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="padding">2</property>
<property name="position">3</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="lbl_frame_code1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes"><b>Active G-Code Reference</b></property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<object class="GtkFrame" id="frame1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0.5</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
<object class="GtkNotebook" id="notebook2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkHBox" id="hbox4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
<child type="tab">
<object class="GtkLabel" id="label9">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">page 1</property>
</object>
<packing>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox12">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="gocde_ref_nonmodal">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Non-Modal</property>
</object>
<packing>
<property name="position">1</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox13">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="gocde_ref_motion">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Motion</property>
</object>
<packing>
<property name="position">2</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox17">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="gocde_ref_plane">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Plane</property>
</object>
<packing>
<property name="position">3</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox18">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="position">4</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="gocde_ref_distance">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Distance</property>
</object>
<packing>
<property name="position">4</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox20">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="position">5</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="gocde_ref_feed">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Feed</property>
</object>
<packing>
<property name="position">5</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox21">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="position">6</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="gocde_ref_units">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Units</property>
</object>
<packing>
<property name="position">6</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox22">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="position">7</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="gocde_ref_compensation">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Compensation</property>
</object>
<packing>
<property name="position">7</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox23">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="position">8</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="gocde_ref_tooloffset">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Tool Offset</property>
</object>
<packing>
<property name="position">8</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox24">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="position">9</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="gocde_ref_coord">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Coordinate System</property>
</object>
<packing>
<property name="position">9</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox25">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="position">10</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="gocde_ref_pathcontrol">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Path Control</property>
</object>
<packing>
<property name="position">10</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox26">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="position">11</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="gocde_ref_spindle">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Spindle</property>
</object>
<packing>
<property name="position">11</property>
<property name="tab_fill">False</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="gcode_reference">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="yalign">1</property>
<property name="label" translatable="yes"><b>GCode Quick Reference</b></property>
<property name="use_markup">True</property>
<property name="justify">center</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="padding">10</property>
<property name="position">2</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="position">5</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="gcode">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">GCode</property>
</object>
<packing>
<property name="position">5</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<placeholder/>
</child>
</object>
Please Log in or Create an account to join the conversation.
17 Aug 2016 11:30 #78923
by kagouraki
Replied by kagouraki on topic Fork of gmoccapy
Ok thank you ! i will figure this out !
Please Log in or Create an account to join the conversation.
Time to create page: 0.199 seconds