Cool reactance slide rule replacement GUI for linux

For PC type software that runs under some PC opsys.

Cool reactance slide rule replacement GUI for linux

Postby Doug Coulter » Sat Jun 01, 2019 8:33 pm

See title - we have the original slide rule up here somewhere, and I've pondered for a long time just how a computer gui could match it. I think I got pretty close, and better in some ways, and here it is.
reactance.tar.gz
zip of main code and accessories
(6.38 KiB) Downloaded 206 times

reactance.png
What it looks like running
reactance.png (17.38 KiB) Viewed 1976 times


There are a couple pieces here. getperlmods.sh - is how you gather up all the perl modules I use all the time. It pretty much hammers the collection. Unlike some modern languages that need lots of megs or come with it all in one enormous module, perl is, um, modular. Many of the modules have been made into .deb packages, and fwiw, that's a better way to get them and all their dependencies, especially the older ones, so that's what this shell script does where possible. I suggest it be run on any debian based system before trying any of my GUI or database code because, well, this is the dependencies for that sort of thing and they all go in clean and relatively effortlessly this way. Note the .deb packages have different names than the underlying perl modules - I've sorted all that out for us (helps me too - my old main squeeze computer kinda fried and this one's new...so since I had to work all that out anyway...here we are).
Both apt and cpanminus are good about handling things already present - they'll maybe upgrade to the latest, or just skip them. In other words, you can run this script over and over and no harm done.

I supply the .glade file separately, but that's only so you can open it and mess around in the glade GUI editor. The actual in-use glade-xml is already contained in the perl program after the __END__ tag - so if you change the .glade file and want the real thing to change, you have two options. Change the call in "initialize" to use the .glade file - or copy the modified glade xml into the perl file after the __END__ in place of the stuff that's there.
All you really need is reactance and those modules.


Oh, for those so inclined to use the main menu customizer (Mint has this anyway) to make a menu or panel entry, I found a little pic that makes a nice icon. I put them (I'm doing a lot of these little custom thingies) in /usr/share/icons/gnome - mainly because it was uncluttered and it's easy to navigate to from where the editor expects to find things for your current desktop theme.
You do have to be root to write to there. The location isn't really important, it's a matter of keeping the room organized, so to speak.
LC.png
Cute? icon for your menu
LC.png (2.55 KiB) Viewed 1976 times



The title and tooltips mostly say all you need to know. But there are a couple special tricks that you'll either love or despise - let me know.
This computes all four of inductance, capacitance, frequency, and Z of an element, from any two of them being known and entered. 1 won't work, and 3 is over-specified and will get you a humorous error dialog and a start over (well, maybe I have a lousy sense of humor).

Special things include - typing enter while in any edit box also pushes the "Calculate" button. Typing escape in the same boxes will clear them all in case of oops - a shortcut so you don't need a mouse to work this (tabbing, mousing, and so on work as usual in GUIs).

Changing the units in the dropdown before all four are filled in simply changes how the thing interprets your inputs - handy as you can say, for example 1 tab dropdown microhenry and it'll work as you'd expect.
After all four are full, probably via doing the compute - hitting the dropdowns will change the numbers. As if you had 1 henry in the L boxes - and change the dropdown to millihenries - the number will change to 1000. Handy if your first guess as to what magnitudes are going to be is a bit off...

This is my replacement for the old Shure calculator given to government engineers in 1943 to aid in the war effort. The originals were riveted cardboard, and began to fall apart in the '70s or so (my family had a few) and while I worked at Bunker-Ramo for ARPA, we disassembled them and xeroxed them to make more, and an old scan of one of those is up here, complete with nicotine stains from the old days. This, unlike that, isn't quite as slick for showing you the perspective of scales at a glance - but instead does have accuracy and the ability to quickly fix any misconceptions in that regard. I'll call it a tie. It looks good here with my dark mint theme...
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA

Re: Cool reactance slide rule replacement GUI for linux

Postby Doug Coulter » Sat Jun 01, 2019 8:46 pm

So, if you ever wanted a boot camp example of how to do all this GUI stuff with something like perl (python works much the same way, names changed slightly to protect the guilty) - and a couple tricks of making GTK3 do a lot of the grunt work by careful speccing in the glade editor (you can also edit that xml by hand directly if you are into self-flagellation) - here you go.
Note in the above I put in real numbers for my fusor - 115 uH (measured) and 2.65 MHz measured - and hit Calculate, and it came up with the capacity of the fusor grid in exponential notation because I didn't spec the unit nicely - but if I had put the dropdown for C into picofarads either before or after, it'd have come out right and easier to read as 31.365 pf instead.
Which I think is cool, YMMV :mrgreen:
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA


Return to PC

Who is online

Users browsing this forum: No registered users and 4 guests