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 <nie...@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-developers@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-developers@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-developers@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-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to