Discussion:
Error channel missing errors
(too old to reply)
Kurt Jacobson
2017-04-27 03:11:32 UTC
Permalink
Raw Message
Hello all,

I am using the Python interface and have noticed recently that the error
channel appears to catch errors only about 50% of the time. The errors get
printed to the terminal but don't show up when polling the error channel. I
did not have this problem when using 2.7, only since switching to 2.8, and
I have not made any changes to that part of my UI code so I don't think the
problem is in my code. Is it just me or is there a known problem here?

Thanks,
Kurt
Chris Morley
2017-04-27 04:19:25 UTC
Permalink
Raw Message
A change recently in master has Gstat poll for errors.

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

Are you also polling separately for errors?

Are you using axis for the main GUI?


Errors can only be read by _ONE_ source,.

if using multiply programs to read error stats It's unpredictable who gets them.


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.


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


Chris M


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

Hello all,

I am using the Python interface and have noticed recently that the error
channel appears to catch errors only about 50% of the time. The errors get
printed to the terminal but don't show up when polling the error channel. I
did not have this problem when using 2.7, only since switching to 2.8, and
I have not made any changes to that part of my UI code so I don't think the
problem is in my code. Is it just me or is there a known problem here?

Thanks,
Kurt
------------------------------------------------------------------------------
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-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers
Emc-developers Info Page - SourceForge<https://lists.sourceforge.net/lists/listinfo/emc-developers>
lists.sourceforge.net
The Enhanced Machine Controller (EMC) is a CNC machine controller that runs on Linux and is available under the terms of the GNU General Public License.
Kurt Jacobson
2017-04-27 15:22:15 UTC
Permalink
Raw Message
>
> 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



On Thu, Apr 27, 2017 at 12:19 AM, Chris Morley <***@hotmail.com>
wrote:

> A change recently in master has Gstat poll for errors.
>
> Are you using Gstat or are you using gladevcp (it uses Gstat) ?
>
> Are you also polling separately for errors?
>
> Are you using axis for the main GUI?
>
>
> Errors can only be read by _ONE_ source,.
>
> if using multiply programs to read error stats It's unpredictable who gets
> them.
>
>
> 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.
>
>
> In the end I may need to remove error polling from GStat.
>
>
> Chris M
>
>
> ________________________________
> From: Kurt Jacobson <***@gmail.com>
> Sent: April 27, 2017 3:11 AM
> To: EMC developers
> Subject: [Emc-developers] Error channel missing errors
>
> Hello all,
>
> I am using the Python interface and have noticed recently that the error
> channel appears to catch errors only about 50% of the time. The errors get
> printed to the terminal but don't show up when polling the error channel. I
> did not have this problem when using 2.7, only since switching to 2.8, and
> I have not made any changes to that part of my UI code so I don't think the
> problem is in my code. Is it just me or is there a known problem here?
>
> Thanks,
> Kurt
> ------------------------------------------------------------
> ------------------
> 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-***@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
> Emc-developers Info Page - SourceForge<https://lists.
> sourceforge.net/lists/listinfo/emc-developers>
> lists.sourceforge.net
> The Enhanced Machine Controller (EMC) is a CNC machine controller that
> runs on Linux and is available under the terms of the GNU General Public
> License.
>
>
> ------------------------------------------------------------
> ------------------
> 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-***@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>
Chris Morley
2017-04-27 16:09:04 UTC
Permalink
Raw Message
________________________________
From: Kurt Jacobson <***@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>
Kurt Jacobson
2017-04-27 16:29:13 UTC
Permalink
Raw Message
Chris, I commented out those lines and sure enough I now get all the errors
in my UI again.
I guess I have two options: Stop using HAL gremlin and sourceview or use
Gstat exclusively.

Gstat

one solution would be for my to stop using the HAL_

On Thu, Apr 27, 2017 at 12:09 PM, Chris Morley <***@hotmail.com>
wrote:

>
>
>
> ________________________________
> From: Kurt Jacobson <***@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-***@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>
Kurt Jacobson
2017-04-27 16:39:09 UTC
Permalink
Raw Message
Sorry, my fat fingers somehow hit a key combo that sent the previous
message before it was ready!

Chris, I commented out those lines and sure enough I now get all the errors
in my UI again.
I guess I have two options: Stop using HAL gremlin and sourceview or use
Gstat exclusively.

I don't see any reason to remove the error polling from Gstat if it works
in most other situations, so i think I will see about embedding gremlin
directly (which I assume would not then use Gstat) and make my own
sourceview, which I was planning to do anyway.

Thanks a bunch Chris.


On Thu, Apr 27, 2017 at 12:29 PM, Kurt Jacobson <***@gmail.com>
wrote:

> Chris, I commented out those lines and sure enough I now get all the
> errors in my UI again.
> I guess I have two options: Stop using HAL gremlin and sourceview or use
> Gstat exclusively.
>
> Gstat
>
> one solution would be for my to stop using the HAL_
>
> On Thu, Apr 27, 2017 at 12:09 PM, Chris Morley <***@hotmail.com
> > wrote:
>
>>
>>
>>
>> ________________________________
>> From: Kurt Jacobson <***@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.ht
>> ml#_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.h
>> tml#_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.h
>> tml#_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-***@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/emc-developers
>>
>
>
andy pugh
2017-04-27 17:33:23 UTC
Permalink
Raw Message
On 27 April 2017 at 17:09, Chris Morley <***@hotmail.com> wrote:
> The more I explain this the more I realize I think I need to remove error polling.

Could there be two (duplicated) error channels?

--
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1916
Kurt Jacobson
2017-04-27 17:44:14 UTC
Permalink
Raw Message
On Thu, Apr 27, 2017 at 1:33 PM, andy pugh <***@gmail.com> wrote:

> On 27 April 2017 at 17:09, Chris Morley <***@hotmail.com>
> wrote:
> > The more I explain this the more I realize I think I need to remove
> error polling.
>
> Could there be two (duplicated) error channels?
>

Yes Andy, I think there are two. Gstat has created one error channel and I
have created another in my GUI code.
When I comment out the code in Gstat that polls the error channel the
problem goes away, so I need to use one or the other, but not both.
Chris Morley
2017-04-27 18:42:54 UTC
Permalink
Raw Message
yes I guess ideally linuxcnc would create duplicate error channels.

This is what I was trying to do with GObject messaging - each user registers and the messages are sent to all.

I'm just a software layer or two too high.

Unfortunately I don't think I have the chops to fix that layer and I'm not sure how one would add

register-ablity to it. - maybe embedded python coponent? I'm not sure.


Actually since linuxcnc was designed for multiply GUI use. I'm surprised it wasn't addressed.

________________________________
From: andy pugh <***@gmail.com>
Sent: April 27, 2017 5:33 PM
To: EMC developers
Subject: Re: [Emc-developers] Error channel missing errors

On 27 April 2017 at 17:09, Chris Morley <***@hotmail.com> wrote:
> The more I explain this the more I realize I think I need to remove error polling.

Could there be two (duplicated) error channels?

--
atp
Chris Morley
2017-04-27 18:59:18 UTC
Permalink
Raw Message
I removed error message polling from gstat.

I also added the math import (Thanks Norrbert)


Chris M

________________________________
From: Chris Morley <***@hotmail.com>
Sent: April 27, 2017 6:42 PM
To: EMC developers
Subject: Re: [Emc-developers] Error channel missing errors


yes I guess ideally linuxcnc would create duplicate error channels.

This is what I was trying to do with GObject messaging - each user registers and the messages are sent to all.

I'm just a software layer or two too high.

Unfortunately I don't think I have the chops to fix that layer and I'm not sure how one would add

register-ablity to it. - maybe embedded python coponent? I'm not sure.


Actually since linuxcnc was designed for multiply GUI use. I'm surprised it wasn't addressed.

________________________________
From: andy pugh <***@gmail.com>
Sent: April 27, 2017 5:33 PM
To: EMC developers
Subject: Re: [Emc-developers] Error channel missing errors

On 27 April 2017 at 17:09, Chris Morley <***@hotmail.com> wrote:
> The more I explain this the more I realize I think I need to remove error polling.

Could there be two (duplicated) error channels?

--
atp

------------------------------------------------------------------------------
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-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers
Emc-developers Info Page - SourceForge<https://lists.sourceforge.net/lists/listinfo/emc-developers>
lists.sourceforge.net
The Enhanced Machine Controller (EMC) is a CNC machine controller that runs on Linux and is available under the terms of the GNU General Public License.
Niemand Sonst
2017-04-27 17:36:18 UTC
Permalink
Raw Message
Am 27.04.2017 um 05:11 schrieb Kurt Jacobson:
> Hello all,
>
> I am using the Python interface and have noticed recently that the error
> channel appears to catch errors only about 50% of the time. The errors get
> printed to the terminal but don't show up when polling the error channel. I
> did not have this problem when using 2.7, only since switching to 2.8, and
> I have not made any changes to that part of my UI code so I don't think the
> problem is in my code. Is it just me or is there a known problem here?
>
> Thanks,
> Kurt
> ------------------------------------------------------------------------------
> 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-***@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>
I have been reported,, that this happen also to gmoccapy.

Unfortunately I am not able to reproduce that on my computer creating
errors on purpose, that ones are reported correctly.

rodw reported about not reported errors after hitting a limit switch on
homing.


Norbert
Niemand Sonst
2017-04-27 17:54:44 UTC
Permalink
Raw Message
Hallo Chris,

I just tested also with a simulated limit switch and as reported
previously not all errors are reported. After I commented out GStat
lines for error polling, I got the errors reported correctly.

So in deed it is caused by double polling errors.

So we have to discus, if the error polling should be part og GStat, or
the GUI's.
If the developer list decide, it should belong to GStat, I will need to
change some stuff in gmoccapy.

By the way:
Look in hal_glib.py line 559 in get_position
It is using math.radians, but math is not imported, so if you use
rotation, a exception is raised!

I found that, because on my real machine I have a rotation on G57 and
selecting that coordinate system kills linuxcnc / gmoccapy.

Norbert

Am 27.04.2017 um 19:36 schrieb Niemand Sonst:
> Am 27.04.2017 um 05:11 schrieb Kurt Jacobson:
>> Hello all,
>>
>> I am using the Python interface and have noticed recently that the error
>> channel appears to catch errors only about 50% of the time. The errors get
>> printed to the terminal but don't show up when polling the error channel. I
>> did not have this problem when using 2.7, only since switching to 2.8, and
>> I have not made any changes to that part of my UI code so I don't think the
>> problem is in my code. Is it just me or is there a known problem here?
>>
>> Thanks,
>> Kurt
>> ------------------------------------------------------------------------------
>> 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-***@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/emc-developers
>>
> I have been reported,, that this happen also to gmoccapy.
>
> Unfortunately I am not able to reproduce that on my computer creating
> errors on purpose, that ones are reported correctly.
>
> rodw reported about not reported errors after hitting a limit switch on
> homing.
>
>
> Norbert
>
>
> ------------------------------------------------------------------------------
> 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-***@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>
Kurt Jacobson
2017-04-27 18:23:20 UTC
Permalink
Raw Message
Norbert, thank you for confirming that the problem is not specific to my
GUI.

I don't know what the best solution is, but I would vote for changing the
error channel behavior so that it is analogous to the stat channel. This
would mean that the most recent error is returned when polling for errors.
Then the GUI or whatever code needs to know about errors would check if the
error is new or not, just like we do with stat:

Here is an example of how the GUI or Gstat might poll for errors in a
periodic function:

error = e.poll()

if error != self.previous_error:
self.previous_error = error
self._update_error_messages(error) # Some function that does something
with the error

This would allow any number of functions to poll for errors and it seems
intuitive since it is just like stat then.
The only problem I see with this is that we would miss repeated errors of
the same type. A solution to this would be to add a timestamp to the error,
which could be useful anyway.

I'm just thinking out loud here.

Were is the error channel code located? I would like to have a look at it
but can't seem to fine it. I'm sure it is hiding in plain sight!

Cheers, Kurt

On Thu, Apr 27, 2017 at 1:54 PM, Niemand Sonst <***@web.de> wrote:

> Hallo Chris,
>
> I just tested also with a simulated limit switch and as reported
> previously not all errors are reported. After I commented out GStat
> lines for error polling, I got the errors reported correctly.
>
> So in deed it is caused by double polling errors.
>
> So we have to discus, if the error polling should be part og GStat, or
> the GUI's.
> If the developer list decide, it should belong to GStat, I will need to
> change some stuff in gmoccapy.
>
> By the way:
> Look in hal_glib.py line 559 in get_position
> It is using math.radians, but math is not imported, so if you use
> rotation, a exception is raised!
>
> I found that, because on my real machine I have a rotation on G57 and
> selecting that coordinate system kills linuxcnc / gmoccapy.
>
> Norbert
>
> Am 27.04.2017 um 19:36 schrieb Niemand Sonst:
> > Am 27.04.2017 um 05:11 schrieb Kurt Jacobson:
> >> Hello all,
> >>
> >> I am using the Python interface and have noticed recently that the error
> >> channel appears to catch errors only about 50% of the time. The errors
> get
> >> printed to the terminal but don't show up when polling the error
> channel. I
> >> did not have this problem when using 2.7, only since switching to 2.8,
> and
> >> I have not made any changes to that part of my UI code so I don't think
> the
> >> problem is in my code. Is it just me or is there a known problem here?
> >>
> >> Thanks,
> >> Kurt
> >> ------------------------------------------------------------
> ------------------
> >> 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-***@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/emc-developers
> >>
> > I have been reported,, that this happen also to gmoccapy.
> >
> > Unfortunately I am not able to reproduce that on my computer creating
> > errors on purpose, that ones are reported correctly.
> >
> > rodw reported about not reported errors after hitting a limit switch on
> > homing.
> >
> >
> > Norbert
> >
> >
> > ------------------------------------------------------------
> ------------------
> > 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-***@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/emc-developers
> >
>
>
> ------------------------------------------------------------
> ------------------
> 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-***@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>
Loading...