![]() |
WP 34S adding own conversions - Printable Version +- HP Forums (https://archived.hpcalc.org/museumforum) +-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html) +--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html) +--- Thread: WP 34S adding own conversions (/thread-215255.html) |
WP 34S adding own conversions - Lourensk - 03-23-2012 Dear All,
Working in a electronics testlab i use a lot of conversions like: I examined the source code and tried to add a dBuv <-> Volts conversion to both compile_cats.c and compile_consts.c
This works fine but i only see the dB part dBuV in the display,
Next challenge is to get a short calculation like: I used to make short programs for each conversion, but it would be nice to have them under the conversions in the WP 34S. To get more room in the upper graphical screen i removed at line 1395 of display.c "\177\006\006" now the up down arrows are gone.. Some ideas to get this realized ??
Best regards, Re: WP 34S adding own conversions - Dominic Richens - 03-23-2012 I pondered the same thing a month ago, but I found it didn't make sense to add the conversions I wanted for a couple of reasons:
Generally from a design perspective W&P avoid adding conversions that are just specializations or combinations of existing conversions.
Re: WP 34S adding own conversions - Paul Dale - 03-23-2012 Conversions that are simply a scale factor can be added to compile_cats.c and compile_consts.c You have to add the conversion twice to compile_cats.c (once for each direction) so you were close. These conversions have a two character limit on the left side in the definition and six (I think) on the right. This is hard coded but the arrow in the middle is free. To add a conversion that isn't a simple multiplication or division, things get a lot more involved. You have to add a (presumably) monadic function or two. The new function IDs got in xeq.h, the function itself can live anywhere that seems sensible & the appropriate header file also needs a prototype line. Then you'll have to add the definitions to commands.c and finally put the extra catalogue entries in compile_cats.c. Not exactly for the faint of heart :-) Probably the easiest would be to follow one of the existing weird conversions e.g. one of the temperature conversion routines (OP_DEGC_F & convC2F). Oh, conversions done this way have a six character hard limit for their name (no free arrow).
Re: WP 34S adding own conversions - Lourensk - 03-24-2012 Hi Pauli, Thanks for all the information. I totaly overlooked excisting Ar to dB conversion now i understand how to add my own!
Thanks!
Re: WP 34S adding own conversions - Walter B - 03-24-2012 And there also exists a power ratio to dB conversion :-) Just for your information ...
|