From 6ebb0f15314f40952c9b074a4cd19a220b68e764 Mon Sep 17 00:00:00 2001 From: KM4ACK Date: Thu, 10 Mar 2022 07:59:24 -0600 Subject: [PATCH 01/20] update --- changelog | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/changelog b/changelog index 31a349c..ef9b452 100644 --- a/changelog +++ b/changelog @@ -1,7 +1,10 @@ -release=2.7.0 - +release=2.8.0 Changelog +2.8.0 redesign layout of main screen + add new modem menu + add vara modem start (beta) + add vara FM modem start (beta) 2.7.0 add mobi-pair script to assist with pairing mobilinkd devices add mobilinkd wired modem connection (Doesn't work with version 2) improve mobilinkd modem start From aeab913a016c5052301734f006ac63f7002e0c1f Mon Sep 17 00:00:00 2001 From: KM4ACK Date: Thu, 10 Mar 2022 07:59:43 -0600 Subject: [PATCH 02/20] redesign main screen --- patmenu | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/patmenu b/patmenu index e5be81a..2f9d4ac 100755 --- a/patmenu +++ b/patmenu @@ -1,6 +1,6 @@ #!/bin/bash -#Pat Catalog +#Pat Menu #20200427 KM4ACK #side note: written during covid-19 outbreak of 2020 @@ -44,11 +44,7 @@ fi yad --form --width=420 --text-align=center --center --title="Pat Menu" --text-align=center \ --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \ --text="Pat Menu by KM4ACK\rv$VERSION" \ ---field="Start ARDOP Modem":fbtn 'bash -c "$MYPATH/start-pat-ardop"' \ ---field="Start Packet Modem":fbtn 'bash -c "$MYPATH/start-pat2m"' \ ---field="Start Mobilinkd Modem Bluetooth":fbtn 'bash -c "$MYPATH/mobilink"' \ ---field="Start Mobilinkd Modem Wired":fbtn 'bash -c "$MYPATH/mobi-wired"' \ ---field="Stop Modems":fbtn 'bash -c "$MYPATH/stop-modems"' \ +--field="Start/Stop Modem":fbtn 'bash -c "kill -USR1 $YAD_PID; $MYPATH/modems"' \ --field="Find Winlink Gateways":fbtn 'bash -c "kill -USR1 $YAD_PID; $MYPATH/find2"' \ --field="Pat Auto Connect":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/pat-functions; AUTOPAT"' \ --field="Pat Catalog":fbtn 'bash -c "kill -USR1 $YAD_PID; $MYPATH/catalog"' \ From f680262b30633b2ae1424e6771f72e3f7152d941 Mon Sep 17 00:00:00 2001 From: KM4ACK Date: Thu, 10 Mar 2022 07:59:54 -0600 Subject: [PATCH 03/20] initial commit --- modems | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 modems diff --git a/modems b/modems new file mode 100755 index 0000000..4b578ff --- /dev/null +++ b/modems @@ -0,0 +1,33 @@ +#!/bin/bash + +#Pat Modems +#20220309 KM4ACK + + + +export MYPATH=$HOME/patmenu2 +LOGO=$MYPATH/pmlogo.png +MAIN=$MYPATH/./patmenu +VERSION=$(cat $MYPATH/changelog | grep release | head -1 | sed 's/release=//') + +source $MYPATH/config + + + +yad --form --width=420 --text-align=center --center --title="Pat Menu" --text-align=center \ +--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \ +--text="Pat Menu by KM4ACK\rv$VERSION" \ +--field="Start ARDOP Modem":fbtn 'bash -c "$MYPATH/start-pat-ardop"' \ +--field="Start Packet Modem":fbtn 'bash -c "$MYPATH/start-pat2m"' \ +--field="Start Mobilinkd Modem Bluetooth":fbtn 'bash -c "$MYPATH/mobilink"' \ +--field="Start Mobilinkd Modem Wired":fbtn 'bash -c "$MYPATH/mobi-wired"' \ +--field="Start VARA Modem (BETA)":fbtn 'bash -c "$MYPATH/start-vara-hf"' \ +--field="Start VARA FM Modem (BETA)":fbtn 'bash -c "$MYPATH/start-vara-fm"' \ +--field="Stop Modems":fbtn 'bash -c "$MYPATH/stop-modems"' \ +--button="Main Menu":1 +BUT=$? + +if [ $BUT = 1 ]; then +$MAIN & +exit +fi \ No newline at end of file From bd9579f3454efd5e1b66745fc3a53f2c58fb0aab Mon Sep 17 00:00:00 2001 From: KM4ACK Date: Thu, 10 Mar 2022 08:00:08 -0600 Subject: [PATCH 04/20] initial commit --- start-vara-hf | 134 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100755 start-vara-hf diff --git a/start-vara-hf b/start-vara-hf new file mode 100755 index 0000000..937d1b1 --- /dev/null +++ b/start-vara-hf @@ -0,0 +1,134 @@ +#!/bin/bash + +#script to start vara hf modem +#10MARCH2022 KM4ACK + +MYPATH=$HOME/patmenu2 +LOGO=$MYPATH/pmlogo.png +source $MYPATH/config + +#Check if FLRIG is running if user has it set in config file +if [ "$RIGCONTROL" = 'yes' ]; then +echo "rig control is on" +FLRIG=$(echo $RIG | grep "\-m 4") + if [ ! -z "$FLRIG" ]; then + FLRIG=$(pidof flrig) + if [ -z "$FLRIG" ]; then + yad --title="FAILED" --width=400 --height=100 \ + --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \ + --center --form --text="Please start FLRIG and try again" \ + --button=gtk-ok + exit + fi + fi +fi + +#Check if modem is already running +MODEMCHECK=$(ps aux | grep -i box86 | grep -i varafm) + if [ ! -z "$MODEMCHECK" ]; then + yad --title="FAILED" --width=400 --height=100 \ + --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \ + --center --form --text="Packet Modem is already running" \ + --button=gtk-ok + exit + fi + +#check if piardopc is running +PIDDW=$(pidof piardopc) + if [ ! -z "$PIDDW" ]; then + yad --title="FAILED" --width=400 --height=100 \ + --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \ + --center --form --text="It looks like the ARDOP modem is running.\rStop all modems and try again" \ + --button=gtk-ok + exit 0 + fi + +#check if direwolf is running +PIDDW=$(pidof direwolf) + if [ ! -z "$PIDDW" ]; then + yad --title="FAILED" --width=400 --height=100 \ + --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \ + --center --form --text="It looks like direwolf is running.\rStop all modems and try again" \ + --button=gtk-ok + exit 0 + fi + +#give user some feedback +yad --width=350 --height=75 --title="Starting Modem" --timeout=20 --timeout-indicator=top --no-buttons --center \ +--image $LOGO --window-icon=$LOGO --image-on-top --text-align=center --text="Modem Starting....standby" & + +#Set Mode +RIGFM=$RIG" M $MODEHF" + +SETRIG () { + +#set radio frequency & mode +$RIGFM + +sleep 1 + +#check rig is in correct mode +MODE=$($RIG m | grep $MODE2M) + +sleep 1 + + MODECHECK() { + #check rig is in correct mode + MODE=$($RIG m | grep $MODE2M) + } + +sleep 1 + + if [ -z $MODE ] + then + $RIGFM + MODECHECK + fi +} + + +#see if rig control is used +if [ $RIGCONTROL == 'yes' ]; then +PIDCTL=$(pidof rigctld) + if [ -z "$PIDCTL" ]; then + CONTROL=$(cat $MYPATH/config | grep '^RIG="' | sed 's/RIG="//' | sed 's/"//' | sed 's/rigctl/rigctld/') + $CONTROL & + rigpid=`echo $!` + fi +SETRIG +fi + +echo "starting VARA-FM" +/usr/local/bin/wine /home/pi/.wine/drive_c/VARA/VARA.exe > /dev/null 2>&1 & +sleep 7 #give vara time to start + +#verify vara has started +PIDVARA=$(ps aux | grep -i box86 | grep VARA.exe) +if [ -z "$PIDVARA" ] +then +yad --title="FAILED" --width=400 --height=100 \ + --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \ + --center --form --text="The VARA Modem FAILED to Start" \ + --button=gtk-ok + +else + +yad --title="VARA MODEM" --width=400 --height=100 \ + --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center --on-top \ + --center --form --text="\r\r\r\rThe VARA Modem has Started\rJust a few more seconds" \ + --button=gtk-ok & +fi + +sleep 1 +#restart pat so terminal window correctly reflects rig control +sudo systemctl restart pat@`whoami` + +echo "starting browser" +#open pat inbox in browser +export DISPLAY=:0 && xdg-open http://127.0.0.1:$PORT > /dev/null 2>&1 + +#echo "cleaning up and closing" +#varapid=`ps aux | grep -i box86 | grep VARA.exe` +#kill $varapid > /dev/null 2>&1 +#kill $rigpid > /dev/null 2>&1 + From db60b0601a6139d9e47cc84924024eea978a4d2b Mon Sep 17 00:00:00 2001 From: KM4ACK Date: Thu, 10 Mar 2022 08:00:16 -0600 Subject: [PATCH 05/20] initial commit --- start-vara-fm | 134 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100755 start-vara-fm diff --git a/start-vara-fm b/start-vara-fm new file mode 100755 index 0000000..c6378d4 --- /dev/null +++ b/start-vara-fm @@ -0,0 +1,134 @@ +#!/bin/bash + +#script to start vara fm modem +#10MARCH2022 KM4ACK + +MYPATH=$HOME/patmenu2 +LOGO=$MYPATH/pmlogo.png +source $MYPATH/config + +#Check if FLRIG is running if user has it set in config file +if [ "$RIGCONTROL" = 'yes' ]; then +echo "rig control is on" +FLRIG=$(echo $RIG | grep "\-m 4") + if [ ! -z "$FLRIG" ]; then + FLRIG=$(pidof flrig) + if [ -z "$FLRIG" ]; then + yad --title="FAILED" --width=400 --height=100 \ + --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \ + --center --form --text="Please start FLRIG and try again" \ + --button=gtk-ok + exit + fi + fi +fi + +#Check if modem is already running +MODEMCHECK=$(ps aux | grep -i box86 | grep -i varafm) + if [ ! -z "$MODEMCHECK" ]; then + yad --title="FAILED" --width=400 --height=100 \ + --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \ + --center --form --text="Packet Modem is already running" \ + --button=gtk-ok + exit + fi + +#check if piardopc is running +PIDDW=$(pidof piardopc) + if [ ! -z "$PIDDW" ]; then + yad --title="FAILED" --width=400 --height=100 \ + --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \ + --center --form --text="It looks like the ARDOP modem is running.\rStop all modems and try again" \ + --button=gtk-ok + exit 0 + fi + +#check if direwolf is running +PIDDW=$(pidof direwolf) + if [ ! -z "$PIDDW" ]; then + yad --title="FAILED" --width=400 --height=100 \ + --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \ + --center --form --text="It looks like direwolf is running.\rStop all modems and try again" \ + --button=gtk-ok + exit 0 + fi + +#give user some feedback +yad --width=350 --height=75 --title="Starting Modem" --timeout=20 --timeout-indicator=top --no-buttons --center \ +--image $LOGO --window-icon=$LOGO --image-on-top --text-align=center --text="Modem Starting....standby" & + +#Set Mode +RIGFM=$RIG" M $MODE2M" + +SETRIG () { + +#set radio frequency & mode +$RIGFM + +sleep 1 + +#check rig is in correct mode +MODE=$($RIG m | grep $MODE2M) + +sleep 1 + + MODECHECK() { + #check rig is in correct mode + MODE=$($RIG m | grep $MODE2M) + } + +sleep 1 + + if [ -z $MODE ] + then + $RIGFM + MODECHECK + fi +} + + +#see if rig control is used +if [ $RIGCONTROL == 'yes' ]; then +PIDCTL=$(pidof rigctld) + if [ -z "$PIDCTL" ]; then + CONTROL=$(cat $MYPATH/config | grep '^RIG="' | sed 's/RIG="//' | sed 's/"//' | sed 's/rigctl/rigctld/') + $CONTROL & + rigpid=`echo $!` + fi +SETRIG +fi + +echo "starting VARA-FM" +/usr/local/bin/wine /home/pi/.wine/drive_c/VARA\ FM/VARAFM.exe > /dev/null 2>&1 & +sleep 7 #give vara time to start + +#verify vara has started +PIDVARA=$(ps aux | grep -i box86 | grep -i varafm) +if [ -z "$PIDVARA" ] +then +yad --title="FAILED" --width=400 --height=100 \ + --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \ + --center --form --text="The VARA Modem FAILED to Start" \ + --button=gtk-ok + +else + +yad --title="VARA MODEM" --width=400 --height=100 \ + --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center --on-top \ + --center --form --text="\r\r\r\rThe VARA Modem has Started\rJust a few more seconds" \ + --button=gtk-ok & +fi + +sleep 1 +#restart pat so terminal window correctly reflects rig control +sudo systemctl restart pat@`whoami` + +echo "starting browser" +#open pat inbox in browser +export DISPLAY=:0 && xdg-open http://127.0.0.1:$PORT > /dev/null 2>&1 + +#echo "cleaning up and closing" +#varapid=`ps aux | grep -i box86 | grep -i varafm` +#kill $varapid > /dev/null 2>&1 +#kill $rigpid > /dev/null 2>&1 + From 45a14d1aea1ff924e7b421f762d603562f932093 Mon Sep 17 00:00:00 2001 From: KM4ACK Date: Fri, 11 Mar 2022 10:37:55 -0600 Subject: [PATCH 06/20] update --- .getardoplist-cron | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.getardoplist-cron b/.getardoplist-cron index 3c2f7d8..67692fb 100755 --- a/.getardoplist-cron +++ b/.getardoplist-cron @@ -93,13 +93,11 @@ if [ -f $PACKET ]; then rm $PACKET fi -#put date on top line of each file -echo "List Last Downloaded $(date)" >> $FILE -echo "List Last Downloaded $(date)" >> $FORTY -echo "List Last Downloaded $(date)" >> $EIGHTY -echo "List Last Downloaded $(date)" >> $TWENTY -echo "List Last Downloaded $(date)" >> $THIRTY -echo "List Last Downloaded $(date)" >> $PACKET +#create file that has grid variable used in calculations +touch $HOME/patmenu2/ardop-list/grid.txt +MYGRID=$(grep locator $HOME/.config/pat/config.json | sed 's/.*": //;s/"//g;s/,//') +echo "GRID=$MYGRID" > $HOME/patmenu2/ardop-list/grid.txt +echo "LASTDL=List downloaded `date`" >> $HOME/patmenu2/ardop-list/grid.txt #download list to individual files. DL(){ From ab78138f382bc9eb05313560e4a7facc5025e638 Mon Sep 17 00:00:00 2001 From: KM4ACK Date: Fri, 11 Mar 2022 10:38:25 -0600 Subject: [PATCH 07/20] add grid recalculation --- FA-functions | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 116 insertions(+), 1 deletion(-) diff --git a/FA-functions b/FA-functions index a04e76d..e013079 100644 --- a/FA-functions +++ b/FA-functions @@ -296,6 +296,9 @@ xdg-open $MAP #-------------------------------- # Alternate Grid Download #-------------------------------- + +#THIS FUNCTION DEPRECATED BUT LEFT FOR REFERENCE 11MARCH2022 + #make new dir in pat menu dir if needed mkdir -p $HOME/patmenu2/alt-ardop-list @@ -355,6 +358,10 @@ exit #-------------------------------- # Load Alternate Grid List #-------------------------------- + +#THIS FUNCTION DEPRECATED BUT LEFT FOR REFERENCE 11MARCH2022 + + LOADALTGRID(){ OUTFILE=/run/user/$UID/alt-grid.list @@ -411,7 +418,115 @@ $MAIN & exit } - +#-------------------------------- +# Recalculate Distance & Bearings +#-------------------------------- + +NEWCALC(){ +#Function to update the distance and bearing between +#your current grid and the winlink gateways. +#this is necessary because the calculations are initially +#based on the grid in the pat config file at the time the +#list is downloaded. +#10MARCH2022 KM4ACK + +DIR=/run/user/$UID +TMPFILE=$DIR/tempfile +TMPFILE2=$DIR/tempfile2 +TMPFILE3=$DIR/tempfile3 +MYGRID=$(cat /run/user/$UID/gridinfo.txt | cut -c1-6) + +MYGRID=$(yad --form --width=450 --text="Recalculate Distance and Bearings to Gateways\rThis takes 2-3 minutes to complete" \ +--text-align=center --center --title="Recalculate" --text-align=center --separator="|" --item-separator="|" \ +--image=$LOGO --window-icon=$LOGO --image-on-top \ +--field="Current Grid Square" "$MYGRID" \ +--button="Recalculate":2 \ +--button="Cancel":1) +BUT=$? +MYGRID=`echo $MYGRID | awk -F "|" '{print $1}'` + +if [ $BUT = 252 ]; then +exit +elif [ $BUT = 1 ]; then +$MAIN & +exit +fi + +#create file that has grid variable used in calculations +touch $HOME/patmenu2/ardop-list/grid.txt +echo "GRID=$MYGRID" > $HOME/patmenu2/ardop-list/grid.txt +echo "LASTDL=Recalculated `date`" >> $HOME/patmenu2/ardop-list/grid.txt + +MAIN(){ +echo "Recalculating 20M List" +RECALC 20mardoplist.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \ +--text="Recalculating 20M List\rDO NOT CLOSE THIS WINDOW\rDoing so will abort the process\rand leave you with a corrupt list." + +echo "Recalculating 30M List" +RECALC 30mardoplist.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \ +--text="Recalculating 30M List\rDO NOT CLOSE THIS WINDOW\rDoing so will abort the process\rand leave you with a corrupt list." + +echo "Recalculating 40M List" +RECALC 40mardoplist.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \ +--text="Recalculating 40M List\rDO NOT CLOSE THIS WINDOW\rDoing so will abort the process\rand leave you with a corrupt list." + +echo "Recalculating 80M List" +RECALC 80mardoplist.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \ +--text="Recalculating 80M List\rDO NOT CLOSE THIS WINDOW\rDoing so will abort the process\rand leave you with a corrupt list." + +echo "Recalculating Packet list" +RECALC packet.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \ +--text="Recalculating Packet List\rDO NOT CLOSE THIS WINDOW\rDoing so will abort the process\rand leave you with a corrupt list." +} + +RECALC(){ +FILE=$HOME/patmenu2/ardop-list/$1 +#check for and remove existing temp file +if [ -f $TMPFILE3 ]; then +rm $TMPFILE3 +fi + +#create temp list to work with and remove headers/blank lines +cp $FILE $TMPFILE +sed -i 's/.*information...//;s/.*succeeded.//;s/.*url//' $TMPFILE +sed -i '/^$/d' $TMPFILE + + + +#read file, calculate new distance, and update +while read LINE; +do +GRID=`echo $LINE | awk '{print $2}' | sed 's/\[//;s/\]//'` +DISTANCE=`echo $LINE | awk '{print $3 }'` +BEARING=`echo $LINE | awk '{print $4 }'` +CALC=`/usr/bin/wwl $MYGRID $GRID` +NEWDISTANCE=`echo $CALC | awk '{print $2}'` +NEWBEARING=`echo $CALC | awk '{print $5}'` +echo $LINE | sed "s/$DISTANCE/$NEWDISTANCE/;s/$BEARING/$NEWBEARING/" >> $TMPFILE2 +done < $TMPFILE +rm $TMPFILE + +#pad distance with zeros for sorting +while read LINE + do + DISTANCE=$(echo $LINE | awk '{ print $3 }') + NEWDISTANCE=$(echo $LINE | awk '{ print $3 }' | sed -e :a -e 's/^.\{1,4\}$/0&/;ta') + echo $LINE | sed "s/$DISTANCE/$NEWDISTANCE/" >> $TMPFILE3 +done < $TMPFILE2 +rm $TMPFILE2 + +#sort list by distance +sort -k3 -o $TMPFILE3 $TMPFILE3 + +cp $TMPFILE3 $HOME/patmenu2/ardop-list/$1 +} + +#call main function +MAIN +#return to pat menu +$MAIN + +} From 3d97e401570f8da05633c45df84feff3f5c6394e Mon Sep 17 00:00:00 2001 From: KM4ACK Date: Fri, 11 Mar 2022 10:38:31 -0600 Subject: [PATCH 08/20] update --- changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/changelog b/changelog index ef9b452..d6b8d16 100644 --- a/changelog +++ b/changelog @@ -5,6 +5,9 @@ Changelog add new modem menu add vara modem start (beta) add vara FM modem start (beta) + deprecate alternate grid list download function + deprecate load alternate grid funtion + add gateway distance/bearing recalculation 2.7.0 add mobi-pair script to assist with pairing mobilinkd devices add mobilinkd wired modem connection (Doesn't work with version 2) improve mobilinkd modem start From 1ed32fe58faf55bc4c113c2b18e6f79ff78fea21 Mon Sep 17 00:00:00 2001 From: KM4ACK Date: Fri, 11 Mar 2022 10:38:52 -0600 Subject: [PATCH 09/20] add grid recalculation --- find2 | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/find2 b/find2 index e9fbb75..1cdbdf7 100755 --- a/find2 +++ b/find2 @@ -4,18 +4,13 @@ #20200425 KM4ACK #side note: written during covid-19 outbreak of 2020 -#######DEV NOTES############# -############################# - - -############################# - MYPATH=$HOME/patmenu2 PATMENU=$MYPATH/patmenu LOGO=$MYPATH/pmlogo.png CURRENT=$(crontab -l | grep getardoplist | awk '{print $2":"$1}') source $MYPATH/.grid -GRID=$GRID +GRID=$(grep GRID $HOME/patmenu2/ardop-list/grid.txt | sed 's/GRID=//') +LASTDOWNLOAD=$(grep LASTDL $HOME/patmenu2/ardop-list/grid.txt | tail -1 | sed 's/LASTDL=//') source $MYPATH/FA-functions @@ -25,11 +20,10 @@ yad --form --width=480 --text="Find Gateways by KM4ACK" --text-align=cent --field="Search for Gateway":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/FA-functions; GRIDSEARCH"' \ --field="View Grid Map":fbtn 'bash -c "source $MYPATH/FA-functions; MAP"' \ --field="Download Home Grid Gateway List":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/FA-functions; DOWNLIST"' \ ---field="Download Alternate Grid Gateway List":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/FA-functions; ALTGRID"' \ ---field="Load Alternate Grid Gateway List":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/FA-functions; LOADALTGRID"' \ --field="Auto Download Home Grid List $CURRENT":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/FA-functions; AUTODOWN"' \ ---field="Home $LASTDL":LBL \ ---field="Grid List Currently Loaded $GRID":LBL \ +--field="Recalculate Distance and Bearings":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/FA-functions; NEWCALC"' \ +--field="$LASTDOWNLOAD":LBL \ +--field="Current calculations based on grid $GRID":LBL \ --button="Main Menu":1 QUIT=$? @@ -39,4 +33,9 @@ $PATMENU & exit elif [ $QUIT = 252 ]; then exit -fi \ No newline at end of file +fi + + +#left for reference +#--field="Download Alternate Grid Gateway List":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/FA-functions; ALTGRID"' \ +#--field="Load Alternate Grid Gateway List":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/FA-functions; LOADALTGRID"' \ From 2fa3013d4381f2a3f46c46ce1a7a5043669ecf49 Mon Sep 17 00:00:00 2001 From: KM4ACK Date: Fri, 11 Mar 2022 10:39:02 -0600 Subject: [PATCH 10/20] update --- getardoplist | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/getardoplist b/getardoplist index 8eb7c42..7d7df2d 100755 --- a/getardoplist +++ b/getardoplist @@ -87,15 +87,13 @@ if [ -f $PACKET ]; then rm $PACKET fi -#put date on top line of each file -echo "List Last Downloaded $(date)" >> $FILE -echo "List Last Downloaded $(date)" >> $FORTY -echo "List Last Downloaded $(date)" >> $EIGHTY -echo "List Last Downloaded $(date)" >> $TWENTY -echo "List Last Downloaded $(date)" >> $THIRTY -echo "List Last Downloaded $(date)" >> $PACKET -#yad --center --progress --pulsate --timeout-indicator=top --auto-close --no-buttons --text="Start Download" +#create file that has grid variable used in calculations +touch $HOME/patmenu2/ardop-list/grid.txt +MYGRID=$(grep locator $HOME/.config/pat/config.json | sed 's/.*": //;s/"//g;s/,//') +echo "GRID=$MYGRID" > $HOME/patmenu2/ardop-list/grid.txt +echo "LASTDL=List downloaded `date`" >> $HOME/patmenu2/ardop-list/grid.txt + #download list to individual files. DL(){ From bfafeae4aa74211563dc6a20022527de7d835144 Mon Sep 17 00:00:00 2001 From: KM4ACK Date: Fri, 11 Mar 2022 10:53:26 -0600 Subject: [PATCH 11/20] update wording --- find2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/find2 b/find2 index 1cdbdf7..59f3130 100755 --- a/find2 +++ b/find2 @@ -19,8 +19,8 @@ yad --form --width=480 --text="Find Gateways by KM4ACK" --text-align=cent --text="Find Gateways by KM4ACK" \ --field="Search for Gateway":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/FA-functions; GRIDSEARCH"' \ --field="View Grid Map":fbtn 'bash -c "source $MYPATH/FA-functions; MAP"' \ ---field="Download Home Grid Gateway List":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/FA-functions; DOWNLIST"' \ ---field="Auto Download Home Grid List $CURRENT":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/FA-functions; AUTODOWN"' \ +--field="Download Gateway List":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/FA-functions; DOWNLIST"' \ +--field="Auto Download Gateway List $CURRENT":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/FA-functions; AUTODOWN"' \ --field="Recalculate Distance and Bearings":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/FA-functions; NEWCALC"' \ --field="$LASTDOWNLOAD":LBL \ --field="Current calculations based on grid $GRID":LBL \ From 971aee97589ea03e3bd9ffd288d2d3e1464bd5e8 Mon Sep 17 00:00:00 2001 From: KM4ACK Date: Fri, 11 Mar 2022 12:43:11 -0600 Subject: [PATCH 12/20] add complete notification --- FA-functions | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/FA-functions b/FA-functions index e013079..6d7fc00 100644 --- a/FA-functions +++ b/FA-functions @@ -436,6 +436,11 @@ TMPFILE2=$DIR/tempfile2 TMPFILE3=$DIR/tempfile3 MYGRID=$(cat /run/user/$UID/gridinfo.txt | cut -c1-6) +#backup current lists +BKDIR=$MYPATH/ardop-list/bkup-`date +%F.%H%M` +mkdir -p $BKDIR +cp -r $HOME/patmenu2/ardop-list/*.txt $BKDIR/ + MYGRID=$(yad --form --width=450 --text="Recalculate Distance and Bearings to Gateways\rThis takes 2-3 minutes to complete" \ --text-align=center --center --title="Recalculate" --text-align=center --separator="|" --item-separator="|" \ --image=$LOGO --window-icon=$LOGO --image-on-top \ @@ -477,6 +482,8 @@ RECALC 80mardoplist.txt | yad --center --progress --pulsate --auto-close --no-bu echo "Recalculating Packet list" RECALC packet.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \ --text="Recalculating Packet List\rDO NOT CLOSE THIS WINDOW\rDoing so will abort the process\rand leave you with a corrupt list." + +yad --center --timeout=2 --timeout-indicator=top --no-buttons --text="New Calculations Complete" } RECALC(){ From c2d8b98638ff60e6075a023b777ec158a1c4ff3b Mon Sep 17 00:00:00 2001 From: KM4ACK Date: Tue, 5 Apr 2022 08:51:58 -0500 Subject: [PATCH 13/20] update --- changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog b/changelog index d6b8d16..86282e8 100644 --- a/changelog +++ b/changelog @@ -8,6 +8,7 @@ Changelog deprecate alternate grid list download function deprecate load alternate grid funtion add gateway distance/bearing recalculation + add "save as" to current config file see https://github.com/km4ack/patmenu2/issues/48 2.7.0 add mobi-pair script to assist with pairing mobilinkd devices add mobilinkd wired modem connection (Doesn't work with version 2) improve mobilinkd modem start From 63f93809bb29ec242eed7b2b63611e101faaf345 Mon Sep 17 00:00:00 2001 From: KM4ACK Date: Tue, 5 Apr 2022 08:52:52 -0500 Subject: [PATCH 14/20] resolve issue #48 --- manage-menu-functions | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/manage-menu-functions b/manage-menu-functions index 484837c..0ac20ee 100644 --- a/manage-menu-functions +++ b/manage-menu-functions @@ -206,9 +206,11 @@ SETTINGS=$(yad --form --width=600 --text-align=center --center --title="Pat Menu --field="AmRRON":CB "$AMRRON" \ --field="Custom Warning":CB "$WARN" \ --field="Warning Message" "$WARNMSG" \ +--button="Save As":3 \ --button="Update":2 \ --button="Cancel":1) BUT=$? + if [ $BUT = 1 ]; then $MAIN elif [ $BUT = 252 ]; then @@ -253,6 +255,30 @@ cp $CONFIGTMP $CONFIG rm $CONFIGTMP $MAIN & exit +elif [ $BUT = 3 ]; then +NEWNAME=$(yad --form --width=600 --text-align=center --center --title="Name?" --text-align=center \ +--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \ +--text="Pat Menu Settings by KM4ACK" \ +--field="New Config Name") +BUT=$? +if [ $BUT = 1 ]; then +$MAIN & exit +elif [ $BUT = 252 ]; then +exit +fi + +NEWNAME=$(echo $NEWNAME | awk -F "|" '{print $1}') +NEWNAME=$NEWNAME.config #add .config to filename +NEWNAME=$(echo $NEWNAME | sed 's/ /-/g') #remove spaces in file name + +cp $CONFIG $HOME/patmenu2/$NEWNAME + +yad --title="Config Created" --width=400 --height=200 \ +--image $LOGO --window-icon=$LOGO --image-on-top \ +--center --text="$NEWNAME created\r\rDon't forget to load the new config file" \ +--button=gtk-ok +$MAIN & +exit fi } From c30d56621e0162f5801bd7d65d9a6e11966ab8bb Mon Sep 17 00:00:00 2001 From: KM4ACK Date: Wed, 6 Apr 2022 18:30:12 -0500 Subject: [PATCH 15/20] update --- changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog b/changelog index 86282e8..13787ad 100644 --- a/changelog +++ b/changelog @@ -9,6 +9,7 @@ Changelog deprecate load alternate grid funtion add gateway distance/bearing recalculation add "save as" to current config file see https://github.com/km4ack/patmenu2/issues/48 + add config file name to bottom of main menu 2.7.0 add mobi-pair script to assist with pairing mobilinkd devices add mobilinkd wired modem connection (Doesn't work with version 2) improve mobilinkd modem start From c0a5a56d2c23231d09d09377134563380b39724b Mon Sep 17 00:00:00 2001 From: KM4ACK Date: Wed, 6 Apr 2022 18:30:29 -0500 Subject: [PATCH 16/20] write config name to file --- manage-menu-functions | 1 + 1 file changed, 1 insertion(+) diff --git a/manage-menu-functions b/manage-menu-functions index 0ac20ee..e783026 100644 --- a/manage-menu-functions +++ b/manage-menu-functions @@ -147,6 +147,7 @@ elif [ $BUT = 2 ]; then exit else cp $MYPATH/$NEWCONFIG $MYPATH/config + echo "CONF=$NEWCONFIG" > $MYPATH/.currentconf #write config file name to a file rm $OUTFILE yad --title="Config Loaded" --width=400 --height=200 \ --image $LOGO --window-icon=$LOGO --image-on-top \ From 4a3b50f4e18c7b20f9b66ff772581fac142e1e38 Mon Sep 17 00:00:00 2001 From: KM4ACK Date: Wed, 6 Apr 2022 18:30:51 -0500 Subject: [PATCH 17/20] add conf name to bottom --- patmenu | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/patmenu b/patmenu index 2f9d4ac..0f51b3d 100755 --- a/patmenu +++ b/patmenu @@ -41,6 +41,13 @@ yad --title="N0CALL" --width=400 --height=100 \ --button=gtk-ok fi +#get name of current config file +source $MYPATH/.currentconf +CONFIG=$(echo $CONF | sed 's/.config//') +if [ -z $CONFIG ]; then +CONFIG=default +fi + yad --form --width=420 --text-align=center --center --title="Pat Menu" --text-align=center \ --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \ --text="Pat Menu by KM4ACK\rv$VERSION" \ @@ -54,6 +61,7 @@ yad --form --width=420 --text-align=center --center --title="Pat Menu" --text-al --field="Settings/Config":fbtn 'bash -c "kill -USR1 $YAD_PID; $MYPATH/manage-menu"' \ --field="Quick Stats":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/pat-functions; STATS"' \ --field="My Call - $MYCALLSIGN":LBL \ +--field="Config=$CONFIG":LBL \ --button="QUIT":1 BUT=$? From c1cbbf488e2b7748d66e3f3c658683cf8a18d843 Mon Sep 17 00:00:00 2001 From: KM4ACK Date: Tue, 12 Apr 2022 08:12:41 -0500 Subject: [PATCH 18/20] update menu shortcut --- setup | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/setup b/setup index 9c89f5a..b243051 100644 --- a/setup +++ b/setup @@ -38,8 +38,19 @@ rm -rf $HOME/patmenu fi -#copy new desktop link -sudo cp $MYPATH/patmenu2.desktop /usr/share/applications/patmenu.desktop +#create new desktop link +cat < /run/user/$UID/patmenu.desktop +[Desktop Entry] +Name=Pat Menu +GenericName=Amateur Radio Digital Modem +Comment=Amateur Radio Sound Card Communications +Exec=/home/`whoami`/patmenu2/patmenu +Icon=/home/`whoami`/patmenu2/pmlogo.png +Terminal=false +Type=Application +Categories=Network;HamRadio; +EOF +sudo cp /run/user/$UID/patmenu.desktop /usr/share/applications/patmenu.desktop #download RMS List $MYPATH/getardoplist From 91a53fd742f082f75ec6b0b1594eb33a9866c113 Mon Sep 17 00:00:00 2001 From: KM4ACK Date: Tue, 12 Apr 2022 08:14:00 -0500 Subject: [PATCH 19/20] update --- changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog b/changelog index 13787ad..a7a74b6 100644 --- a/changelog +++ b/changelog @@ -10,6 +10,7 @@ Changelog add gateway distance/bearing recalculation add "save as" to current config file see https://github.com/km4ack/patmenu2/issues/48 add config file name to bottom of main menu + update menu shortcut to support non-pi usernames 2.7.0 add mobi-pair script to assist with pairing mobilinkd devices add mobilinkd wired modem connection (Doesn't work with version 2) improve mobilinkd modem start From 15bccf271deeeb979fabee0285ea3a2e1a914e6b Mon Sep 17 00:00:00 2001 From: KM4ACK Date: Tue, 12 Apr 2022 08:24:33 -0500 Subject: [PATCH 20/20] remove space --- setup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup b/setup index b243051..d22326a 100644 --- a/setup +++ b/setup @@ -49,7 +49,7 @@ Icon=/home/`whoami`/patmenu2/pmlogo.png Terminal=false Type=Application Categories=Network;HamRadio; -EOF +EOF sudo cp /run/user/$UID/patmenu.desktop /usr/share/applications/patmenu.desktop #download RMS List