Python interface states of the home switches?

More
7 years 4 months ago #137726 by rodw

cmorley wrote: AttributeError: Pin 'panelinterface.pyvcp.rapid-machine-zero' does not exist

maybe:

AttributeError: Pin 'panelinterface.pyvcp.rapid-machine-zero' does not exist in the component panelinterface.

would be better?

Chris M


I've not really followed this thread, but to me, you are adding verbosity for no reason. Doesn't:
panelinterface.pyvcp.rapid-machine-zero
Say the same thing? It clearly identifies the component where the pin lives.
The following user(s) said Thank You: lorenzn

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

More
7 years 4 months ago #137727 by andypugh

rodw wrote: I've not really followed this thread, but to me, you are adding verbosity for no reason. Doesn't:
panelinterface.pyvcp.rapid-machine-zero
Say the same thing? It clearly identifies the component where the pin lives.


That's the point. It's clear to you, but it wasn't clear to the original poster.
The new phrasing would be clear to both you _and_ the OP. So I think that's a win.

Bear in mind, rodw, that you are now a LinuxCNC expert and what is obvious to you now wasn't always so.
The following user(s) said Thank You: lorenzn

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

More
7 years 4 months ago #137728 by lorenzn
Yes 'panelinterface.pyvcp.rapid-machine-zero' does identify where the component lives.

The issue is that the error message says the pin doesn't exist (actually it does exist if we consider the full path to the pin).

I would have better understood the error message if it was something like:

SomeError: Pin 'panelinterface.panelinterface.pyvcp.rapid-machine-zero' does not exist

When you check the status of a pin from inside a Python component you must not provide the component name itself.

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

More
7 years 4 months ago #137729 by lorenzn
More verbosity in error messages is not typically a bad thing. Sure more verbosity in API usage is bad as it's more work for the user to get something done. Verbosity in error messages can be good in order to help the user overcome the error. There are other software products that I work with that enforce error message standards that say you must not only tell the user what went wrong but must also provide the 'why' and suggestions to overcome the error.
The following user(s) said Thank You: rodw

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

More
7 years 4 months ago #137730 by rodw

andypugh wrote: Bear in mind, rodw, that you are now a LinuxCNC expert and what is obvious to you now wasn't always so.


Maybe so, but I learnt very quickly how to identify missing pins because I took the time to study the error messages and look for clues. No offence to the OP but sometimes I think people on this forum want solutions laid out on a platter and don't stop, analyse and think for themselves.

Sure I still get stuck and ask for help but not before I've had a go at it myself, just like I did in my early days. I still use hal code, Todd wrote for me right at the beginning when I was trying something cool but could not get it working. I was blown away by his generosity.

And I'm only an expert on a very small corner of the LinuxCNC ecosystem. So much more to learn. Whats a spindle for instance!

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

More
7 years 4 months ago #137735 by Clive S

Whats a spindle for instance!


Here you go: spindle. The definition of a spindle is a thin rod used for spinning, or a yarn measurement. An example of a spindle is what sewing thread is spun around. An example of a spindle is 15,120 yards of cotton yarn.
:evil:

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

Time to create page: 0.097 seconds
Powered by Kunena Forum