Message Component - Reset?

More
7 years 3 months ago #140150 by phillc54
Replied by phillc54 on topic Message Component - Reset?
You would need to net the axisui.notifications-clear pin in the postgui halfile
The following user(s) said Thank You: DeckelHead

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

More
7 years 3 months ago #140186 by DeckelHead
Ah! That makes sense... I had looked at ordering in my INI file, but I didn't even consider that the GUI had a postgui HAL file. I'll try that.... Thanks for the heads up!

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

More
6 years 10 months ago - 6 years 9 months ago #152272 by chimeno
Replied by chimeno on topic Message Component - Reset?
Hi, I found this old thread, and I'm looking for a HAL pin output that notifies me when a message appears in the AXIS guide, any idea if it exists? does not exist.

I have to create a new output pin, I must look at the file
Code:
./src/emc/usr_intf/axis/scripts
Code:
if hal_present == 1:     comp = hal.component ("axisui")     comp.newpin ("jog.x", hal.HAL_BIT, hal.HAL_OUT)     comp.newpin ("jog.y", hal.HAL_BIT, hal.HAL_OUT)     comp.newpin ("jog.z", hal.HAL_BIT, hal.HAL_OUT)     comp.newpin ("jog.a", hal.HAL_BIT, hal.HAL_OUT)     comp.newpin ("jog.b", hal.HAL_BIT, hal.HAL_OUT)     comp.newpin ("jog.c", hal.HAL_BIT, hal.HAL_OUT)     comp.newpin ("jog.u", hal.HAL_BIT, hal.HAL_OUT)     comp.newpin ("jog.v", hal.HAL_BIT, hal.HAL_OUT)     comp.newpin ("jog.w", hal.HAL_BIT, hal.HAL_OUT)     comp.newpin ("jog.increment", hal.HAL_FLOAT, hal.HAL_OUT)     comp.newpin ("notifications-out", hal.HAL_BIT, hal.HAL_OUT)     comp.newpin ("notifications-clear", hal.HAL_BIT, hal.HAL_IN)     comp.newpin ("notifications-clear-info", hal.HAL_BIT, hal.HAL_IN)     comp.newpin ("notifications-clear-error", hal.HAL_BIT, hal.HAL_IN)     comp.newpin ("resume-inhibit", hal.HAL_BIT, hal.HAL_IN)

added this line
Code:
comp.newpin ("notifications-out", hal.HAL_BIT, hal.HAL_OUT)

now I must connect it, I guess I should look at the
Code:
class Notification (Tkinter.Frame):

but I don't have much experience in phyton, if someone can guide me or help me ?, thanks

greeting
Chimeno
Last edit: 6 years 9 months ago by chimeno. Reason: more information

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

More
6 years 9 months ago #154007 by chimeno
Replied by chimeno on topic Message Component - Reset?
Hello again,
I am trying that when an error message occurs to be able to activate an output pin, warning, I think it would be good for linuxcnc, now I have it worked as I show in the image img2477, but when I close the application an error appears, I will not program python so I'm trying, if someone can tell me what I did wrong or how I should do it, the changes are in this fil
Code:
./src/emc/usr_intf/axis/scripts/axis.py

the lines that added
Code:
comp ['notifications'] = False
Code:
comp ["notifications"] = True
Code:
comp.newpin ("notifications", hal.HAL_BIT, hal.HAL_OUT)

in which section:
Code:
 def remove (self, widgets):         self.widgets.remove (widgets)         if len (self.cache) <10:             widgets [0] .pack_forget ()             self.cache.append (widgets)         else:             widgets [0] .destroy ()         if len (self.widgets) == 0:             self.place_forget ()             comp ['notifications'] = False   def error_task (self):         error = e.poll ()         while error:             kind, text = error             if kind in (linuxcnc.NML_ERROR, linuxcnc.OPERATOR_ERROR):                 icon = "error"             else:                 icon = "info"             notifications.add (icon, text)             comp ["notifications"] = True             error = e.poll ()         self.error_after = self.win.after (200, self.error_task) if hal_present == 1:     comp = hal.component ("axisui")     comp.newpin ("jog.x", hal.HAL_BIT, hal.HAL_OUT)     comp.newpin ("jog.y", hal.HAL_BIT, hal.HAL_OUT)     comp.newpin ("jog.z", hal.HAL_BIT, hal.HAL_OUT)     comp.newpin ("jog.a", hal.HAL_BIT, hal.HAL_OUT)     comp.newpin ("jog.b", hal.HAL_BIT, hal.HAL_OUT)     comp.newpin ("jog.c", hal.HAL_BIT, hal.HAL_OUT)     comp.newpin ("jog.u", hal.HAL_BIT, hal.HAL_OUT)     comp.newpin ("jog.v", hal.HAL_BIT, hal.HAL_OUT)     comp.newpin ("jog.w", hal.HAL_BIT, hal.HAL_OUT)     comp.newpin ("jog.increment", hal.HAL_FLOAT, hal.HAL_OUT)     comp.newpin ("notifications-clear", hal.HAL_BIT, hal.HAL_IN)     comp.newpin ("notifications-clear-info", hal.HAL_BIT, hal.HAL_IN)     comp.newpin ("notifications-clear-error", hal.HAL_BIT, hal.HAL_IN)     comp.newpin ("resume-inhibit", hal.HAL_BIT, hal.HAL_IN)     comp.newpin ("notifications", hal.HAL_BIT, hal.HAL_OUT)

greeting
Chimeno

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

More
6 years 9 months ago #154074 by phillc54
Replied by phillc54 on topic Message Component - Reset?
You will get that error if you have the HAL Configuration window open while Axis is exiting. The error is because HAL Configuration cannot find the pin because it was removed by Axis when it was exiting.

You could also achieve the same with the following in the .axisrc file in your home directory which allows you to update LinuxCNC without have to edit axis.py again.
Code:
def user_hal_pins(): comp.newpin('notifications', hal.HAL_BIT, hal.HAL_OUT) comp.ready() def user_live_update(): if len(notifications.widgets): comp ["notifications"] = True else: comp ["notifications"] = False
You could have a USER_COMMAND_FILE instead of .axisrc.

See sections 12.3, 12.4, 12.5 & 12.6 here: linuxcnc.org/docs/devel/html/gui/axis.html#_axisrc
The following user(s) said Thank You: chimeno

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

More
6 years 9 months ago #154235 by chimeno
Replied by chimeno on topic Message Component - Reset?
Hi Phill,
  Thank you very much for the answer, modify the code because the .axisrc file does not work for me, it is in the directory where I have the configuration files .ini and .hal, formerly if it worked for me, something else I should do, anyway add your code via USER_COMMAND_FILE and it works very well, I admire your work here in the forum!
thanks
Chimeno

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

Time to create page: 0.132 seconds
Powered by Kunena Forum