You use integrated development environment like Eclipse or codeblocks? In such case usually with some luck it if possible to rightclick or shortcut key on variable/type and show declaration. It also possible variables, type maybe with hierachy is a available in extra tab.
I tried to program Linuxcnc in Eclipse and it works relatively well but it is written in Java so sometimes the coffe ring appear and keystrokes may be a little bit delayed but it's a small problem. I recently also download and tried codeblocks which make relatively good impression. gnat-gps is another option. In the code I could see a typecast which I usually only use if there is a good reason for it. Most usually is I come by a number and have figured out it shoul repsent som kind of type, most usually serially received data in some kind of message protocol. On Sat, 8 Dec 2018 16:51:11 +0000 Chris Morley <chrisinnana...@hotmail.com> wrote: > > ________________________________ > From: Nicklas SB Karlsson <nicklas.karlsso...@gmail.com> > Sent: December 8, 2018 4:23 PM > To: EMC developers > Subject: Re: [Emc-developers] how to catch errors with waitcomplete command > in python > > >No real idea but an exception is a common method to handle errors, it might > >however be a problem in a real time system. > > In this case the python is a bit of a red herring... > I'm using python to call the wait_complete() function but it actually is > programmed in C++ > Here is the function: > > static int emcWaitCommandComplete(pyCommandChannel *s, double timeout) { > double start = etime(); > > do { > double now = etime(); > if(s->s->peek() == EMC_STAT_TYPE) { > EMC_STAT *stat = (EMC_STAT*)s->s->get_address(); > int serial_diff = stat->echo_serial_number - s->serial; > if (serial_diff > 0) { > return RCS_DONE; > } > if (serial_diff == 0 && > ( stat->status == RCS_DONE || stat->status == RCS_ERROR )) { > return stat->status; > } > } > esleep(fmin(timeout - (now - start), EMC_COMMAND_DELAY)); > } while (etime() - start < timeout); > return -1; > } > > It seems to decide if the command is done by it's serial number. > But it does check it's status. > It seems the RCS is probably a message frame that NML uses. > so maybe we could inject the commands error code into the > stat-> structure. > I just haven't been able to follow the code enough. > > Thanks > Chris M > > _______________________________________________ > Emc-developers mailing list > Emc-developers@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/emc-developers _______________________________________________ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers