Tool Diameter in py script

More
7 years 3 months ago #140873 by phillc54
Replied by phillc54 on topic Tool Diameter in py script
I don't think you can read numbered parameters from python.

Please Log in or Create an account to join the conversation.

More
7 years 3 months ago #140906 by newbynobi
Just curious,

what GUI are you planing? Just because I believe this thread is wrong here in the gmoccapy area. Should I move it to other GUI?

Norbert

Please Log in or Create an account to join the conversation.

More
7 years 3 months ago #140967 by MatthiasF1210
Hi,

what GUI are you planing? Just because I believe this thread is wrong here in the gmoccapy area. Should I move it to other GUI?


I am doing an small panel inside gmoccapy, where i want to display and calculate some cutting parameters. I found inside the gmoccapy.py file something like this and was wondering if I can use this inside my py-script.
Code:
def _update_toolinfo( self, tool ): toolinfo = self.widgets.tooledit1.get_toolinfo( tool ) if toolinfo: # Doku # toolinfo[0] = cell toggle # toolinfo[1] = tool number # toolinfo[2] = pocket number # toolinfo[3] = X offset # toolinfo[4] = Y offset # toolinfo[5] = Z offset # toolinfo[6] = A offset # toolinfo[7] = B offset # toolinfo[8] = C offset # toolinfo[9] = U offset # toolinfo[10] = V offset # toolinfo[11] = W offset # toolinfo[12] = tool diameter # toolinfo[13] = frontangle # toolinfo[14] = backangle # toolinfo[15] = tool orientation # toolinfo[16] = tool info self.widgets.lbl_tool_no.set_text( str( toolinfo[1] ) ) self.widgets.lbl_tool_dia.set_text( toolinfo[12] ) self.widgets.lbl_tool_name.set_text( toolinfo[16] ) # we do not allow touch off with no tool mounted, so we set the # coresponding widgets unsensitive and set the description acordingly if tool <= 0: self.widgets.lbl_tool_no.set_text( "0" ) self.widgets.lbl_tool_dia.set_text( "0" ) self.widgets.lbl_tool_name.set_text( _( "No tool description available" ) ) self.widgets.btn_tool_touchoff_x.set_sensitive( False ) self.widgets.btn_tool_touchoff_z.set_sensitive( False ) else: self.widgets.btn_tool_touchoff_x.set_sensitive( True ) self.widgets.btn_tool_touchoff_z.set_sensitive( True )

@Mike_Eitel

halui.tool.diameter float out
Current tool diameter, or 0 if no tool is loaded.


in my machine the is no parameter like this (just offsets and number).

@phillc54

thanks I will try this....

Please Log in or Create an account to join the conversation.

More
7 years 3 months ago #140970 by Mike_Eitel
I remember now.
The tool diameter is shown in halui but only for short time going, either with T or when M6 is recognized. Then back to 0.
In my comp (calculating some cutting parameters and showing via LCD) I therefore store the value if it is not zero..
Sorry that I didn't remember that...
Mike

Please Log in or Create an account to join the conversation.

More
7 years 3 months ago #141015 by MatthiasF1210
@phillc54
Code:
import linuxcnc self.stat = linuxcnc.stat() print self.stat.tool_table[0].diameter

is working ;)

thanks for the hint....

Please Log in or Create an account to join the conversation.

Moderators: newbynobi, HansU
Time to create page: 0.266 seconds
Powered by Kunena Forum