Axis Modifications

More
4 years 11 months ago #227695 by cmorley
Replied by cmorley on topic Axis Modifications
Have you tested other screens? glcannon is used in other screens.

I personally don't think having spindle stats in EMC Stat is the way to go.
You can read spindle HAL pins directly in python - a much more flexible way.

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

More
4 years 11 months ago #227713 by cakeslob
Replied by cakeslob on topic Axis Modifications

Have you tested other screens? glcannon is used in other screens.

I personally don't think having spindle stats in EMC Stat is the way to go.
You can read spindle HAL pins directly in python - a much more flexible way.

yeah i wasnt sure why that was needed either,I agree, as i just connect mine to spindle.0.speed-out, and other existing motion pins

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

More
4 years 11 months ago #227727 by D.L.
Replied by D.L. on topic Axis Modifications

cmorley post=227695 userid=482
Have you tested other screens? glcannon is used in other screens.

I personally don't think having spindle stats in EMC Stat is the way to go.
You can read spindle HAL pins directly in python - a much more flexible way.

Only gmoccapy, mod does not affect it.
How to read encoder position(for display spindle angle) hal pin directly in python, without python interface?
Need example.

cakeslob post=227713 userid=25269
yeah i wasnt sure why that was needed either,I agree, as i just connect mine to spindle.0.speed-out, and other existing motion pins

It is necessary to transfer speed and angle values to the python interface.
Signal source will select the user in the hal file(e.g. spindle.N.speed-out-abs => motion.spindle-display-speed or from spindle encoder).
I think this(dedicated hal pins) is a more flexible solution.
About another way i know: use speed(commanded, not real) from spindle dictionary and spindle num(select spindle to display speed) from ini file.
The following user(s) said Thank You: besriworld

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

More
4 years 11 months ago #227756 by cakeslob
Replied by cakeslob on topic Axis Modifications
Yeah, im using commanded speed as well 
Code:
#####  Add spindle speed lable to axis                              ########################################## #####  Figure out where you want to place it, we will place it in the manual tab for now.      ######################## # saves typing W = root_window.tk.call # this creates the spindle speed lable in the manual tab, with text SPEED W('label','.pane.top.tabs.fmanual.spindlef.spindle-speed','-text','SPEED') # this is where we put it W('grid','.pane.top.tabs.fmanual.spindlef.spindle-speed','-column','0','-row','3','-sticky','w') # we want it to update the speed more than once def user_live_update():   W('.pane.top.tabs.fmanual.spindlef.spindle-speed','configure','-text','SPEED %3.0f' % (comp['spindle-speed']))    # this makes it an offical axis hal pin and links it to spindle-vel-cmd-rpm def user_hal_pins():     # create new hal pins     #mycomp = hal.component('feed')     comp.newpin('spindle-speed', hal.HAL_FLOAT, hal.HAL_IN)          hal.connect('axisui.spindle-speed','spindle-vel-cmd-rpm')
The following user(s) said Thank You: D.L.

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

More
4 years 11 months ago #227758 by cakeslob
Replied by cakeslob on topic Axis Modifications
I took this from archeye's posts from a long time ago, and his work on machinekit and made it usercommand-able

Axis loads the most recent file opened on startup, so what ever you closed with, it opens with.
Add one of these to your usercommand file or axisrc and under [DISPLAY] in ini, add
LOAD_LASTFILE = YES
Code:
########################################################## ######## LOAS_LAST FILE PY2 for 2.8 ########## ######## In ini file under [DISPLAY] ################## ######## LOAD_LASTFILE = YES ################ ########################################################## loadlast = inifile.find('USER_COMMANDS', 'LOAD_LASTFILE') if loadlast == "YES" : load_lastfile = True else: load_lastfile = False lastfile = "" recent = ap.getpref('recentfiles', [], repr) if len(recent): lastfile = recent.pop(0) code = [] addrecent = True if args: initialfile = args[0] elif os.environ.has_key("AXIS_OPEN_FILE"): initialfile = os.environ["AXIS_OPEN_FILE"] elif inifile.find("DISPLAY", "OPEN_FILE"): initialfile = inifile.find("DISPLAY", "OPEN_FILE") elif os.path.exists(lastfile) and load_lastfile: initialfile = lastfile print "Loading " print initialfile elif lathe: initialfile = os.path.join(BASE, "share", "axis", "images","axis-lathe.ngc") addrecent = False else: initialfile = os.path.join(BASE, "share", "axis", "images", "axis.ngc") addrecent = False if os.path.exists(initialfile): open_file_guts(initialfile, False, addrecent)

Code:
########################################################## ######## LOAS_LAST FILE PY3 for 2.9 ############ ######## In ini file under [DISPLAY] ################## ######## LOAD_LASTFILE = YES ################ ########################################################## loadlast = inifile.find('DISPLAY', 'LOAD_LASTFILE') if loadlast == "YES" : load_lastfile = True else: load_lastfile = False lastfile = "" recent = ap.getpref('recentfiles', [], repr) if len(recent): lastfile = recent.pop(0) code = [] addrecent = True if args: initialfile = args[0] elif "AXIS_OPEN_FILE" in os.environ: initialfile = os.environ["AXIS_OPEN_FILE"] elif inifile.find("DISPLAY", "OPEN_FILE"): initialfile = inifile.find("DISPLAY", "OPEN_FILE") elif os.path.exists(lastfile) and load_lastfile: initialfile = lastfile print ("Loading ") print (initialfile) elif lathe: initialfile = os.path.join(BASE, "share", "axis", "images","axis-lathe.ngc") addrecent = False else: initialfile = os.path.join(BASE, "share", "axis", "images", "axis.ngc") addrecent = False if os.path.exists(initialfile): open_file_guts(initialfile, False, addrecent)

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

More
4 years 11 months ago #227762 by D.L.
Replied by D.L. on topic Axis Modifications
cakeslob, thanks for this good idea - use hal.component and hal.get_value.

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

Time to create page: 1.309 seconds
Powered by Kunena Forum