________________________________
From: Kurt Jacobson <kurtcjacob...@gmail.com>
Sent: April 27, 2017 3:22 PM
To: EMC developers
Subject: Re: [Emc-developers] Error channel missing errors

>
> A change recently in master has Gstat poll for errors.


Does it poll even if I am not using Gstat?


> Are you using Gstat or are you using gladevcp (it uses Gstat) ?


I am not using Gstat. The only GladeVCP widgets I am using are Gremlin and
Sourceveiw. Do these use Gstat now?


> Are you also polling separately for errors?


Yes, I have my GUI polling for errors.


> Are you using axis for the main GUI?


No, it is a completely stand alone GUI.


> Errors can only be read by _ONE_ source,.
> if using multiply programs to read error stats It's unpredictable who gets
> them.


So do errors "get popped from the stack" when they are polled or is there
some other reason why only one source can poll errors?
I guess I assumed that error.poll() would be like stat.poll(), which as far
as I know can be polled by multiple sources.


> Ideally I would recommend using Gstat.
> I have noticed GStat doesn't seem to send the error messages all the time
> too.
> I have not figured out the problem nor confirmed if it's just my system.


So it seems like you have noticed that same behavior I have. Could this
problem be elsewhere, maybe in the python interface, or deeper?


> In the end I may need to remove error polling from GStat.



Chris M


Thank you very much Chris, and sorry for all the questions!

Kurt



Any gladevcp widget that uses linuxcnc status uses Gstat (gremlin and 
sourceview use it)
This somewhat explains the situation:
http://linuxcnc.org/docs/2.7/html/config/python-interface.html#_reading_the_error_channel
I am sure that it is done this way so you can't poll and get a 'stale' error 
message.

<http://linuxcnc.org/docs/2.7/html/config/python-interface.html#_reading_the_error_channel>Gladevcp
 uses Gstat in a way that only uses one instance between all the widgets, 
unfortunately if another
python program (even another instance of gladevcp) uses Gstat then there will 
be two polling of the error channel.

The more I explain this the more I realize I think I need to remove error 
polling.
That would be too bad as using Gstat with error polling was simple and clean.
It seems a rethink of error status in linuxcnc is in order.

One check to see if it this is the problem is edit the lib/python/hal_glib.py 
file.
remove these line from def update:

        try:
            e = self.error.poll()
            if e:
                kind, text = e
                if kind in (linuxcnc.NML_ERROR, linuxcnc.OPERATOR_ERROR):
                    self.emit('error-message',text)
                elif kind in (linuxcnc.NML_TEXT, linuxcnc.OPERATOR_TEXT):
                    self.emit('text-message',text)
                elif kind in (linuxcnc.NML_DISPLAY, linuxcnc.OPERATOR_DISPLAY):
                    self.emit('display-message',text)
        except:
            pass

No need to recompile after this.
Then try your program again.
If all is well then that is the problem.

Chris M

<http://linuxcnc.org/docs/2.7/html/config/python-interface.html#_reading_the_error_channel>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to