pi-scripts/dipole

33 lines
863 B
Text
Raw Permalink Normal View History

2020-03-29 19:37:18 -05:00
#!/bin/bash
2020-04-23 07:44:00 -05:00
#determine dipole length
2020-03-29 19:37:18 -05:00
#20200329 km4ack
2020-04-23 07:44:00 -05:00
FREQ=$(yad --form --width=400 --text="<b>1/2 Wave Dipole Calculator</b> by KM4ACK" --text-align=center --center --title="Dipole Calculator" \
--field="Desired Frequency?" "7.200" \
--button=Quit:1 \
--button=Calculate:2)
if [ $? = 1 ]; then
exit
2020-03-29 19:37:18 -05:00
fi
2020-04-23 07:44:00 -05:00
FREQ=$(echo $FREQ | awk -F "|" '{print $1}')
2020-03-29 19:37:18 -05:00
LEN=$(awk "BEGIN {print 234/$FREQ}")
2020-04-23 07:44:00 -05:00
TOTAL=$(awk "BEGIN {print 468/$FREQ}")
2020-03-29 19:37:18 -05:00
LEN1=$(echo $LEN | sed 's/.*\.//')
FEET=$(echo $LEN | sed 's/\..*$//')
INCH=$(awk "BEGIN {print .$LEN1*12}")
ROUND=$(printf "%.0f\n" $INCH)
2020-04-23 07:44:00 -05:00
ANS="$FEET feet $ROUND inches long"
yad --center --width=400 --wrap --title="Dipole Calculator" --text="<b>Length of Dipole</b>" --text-align=center \
--form --separator="|" --item-separator="," \
--field="Each Leg":RO "$ANS" \
--field="Total Length":RO "$TOTAL feet" \
--button=gtk-quit:1
2020-03-29 19:37:18 -05:00