-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlog.sh
executable file
·149 lines (130 loc) · 3.01 KB
/
log.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#!/bin/bash
echo "WELCOME TO ToppLog - GM5AUG'S LOGGING PROGRAM"
echo "-----------------------------"
echo "Station Callsign"
read station
filename=$(echo $station | sed 's/^\///;s/\//_/g')
echo "Station Locator"
read stationLocator
echo "Station Operator"
read op
echo "CAT control = 1, manual = 0"
read catcont
if [ "$catcont" -eq 1 ]
then
echo "Maximum TXCVR Power (W)"
echo "(Here enter the maximum power the radio can provide)"
read maxPower
fi
echo "Contest = 1, non contest = 0"
read contest
echo "Live log = 1 or post log = 0 ?"
read livepost
if [ "$livepost" -eq 1 ]
then
date=$(date +%Y%m%d)
elif [ "$livepost" -ne 1 ]
then
echo "Date YYYYMMDD"
read date
fi
if [ "$contest" -eq 1 ]
then
echo "Callsign,Frequency,Mode,TX-RST,TX-SER,RX-RST,RX-SER,UTC-On,UTC-Off,Operator,Station,Date,Power,StationLocator,Locator" >> contest_log_$filename\_$date.csv
declare -i txser=1
elif [ "$contest" -ne 1 ]
then
echo "Callsign,Frequency,Mode,TX-RST,RX-RST,UTC-On,UTC-Off,Operator,Station,Date,Power,StationLocator,Locator" >> log_$filename\_$date.csv
fi
declare -i y=0
while true
do
echo "-----------------------------"
echo "Callsign"
read call
if [ "$livepost" -eq 1 ]
then
utcon=$(date -u +%H%M%S)
elif [ "$livepost" -ne 1 ]
then
echo "QSO UTC time HHMMSS"
read utcon
fi
if [ "$catcont" -eq 1 ]
then
rawFreq=$(rigctl -m2 \get_freq)
freq=$(echo "scale=4; $rawFreq / 1000000" | bc)
mode=$(rigctl -m2 \get_mode|awk 'NR==1{print $1}')
tempPower=$(rigctl -m2 \get_level 'RFPOWER')
power=$(echo "scale=1; ($maxPower * $tempPower * 100) / 100" | bc)
echo "Freq, mode and power from radio"
echo "$freq $mode $power"
elif [ "$catcont" -ne 1 ]
then
echo "Same Freq and Mode = 1 Diff Freq and Mode = 0"
read same
if [ "$same" -ne 1 ]
then
echo "Frequency in MHz"
read freq
echo "Mode"
read mode
echo "Power (in W)"
read power
elif [ "$same" -eq 1 ]
then
echo "Freq, Mode and Power"
echo "$freq $mode $power"
fi
fi
if [ "$contest" -eq 1 ]
then
declare -i tx=599
declare -i rx=599
echo "TX Serial $txser"
echo "RX Serial"
read rxser
elif [ "$contest" -ne 1 ]
then
echo "TX RST"
read tx
echo "RX RST"
read rx
locator=""
echo "Log location? 1/0"
read binaryLocator
if [ "$binaryLocator" -eq 1 ]
then
echo "Locator"
read locator
fi
fi
if [ "$livepost" -eq 1 ]
then
utcoff=$(date -u +%H%M%S)
elif [ "$livepost" -ne 1 ]
then
echo "QSO UTC time off HHMMSS"
read utcoff
fi
echo "Correct? 1 or 0"
echo "$call $freq $mode $tx $rx $utc $op $locator"
read confirm
if [ "$confirm" -eq 1 ]
then
if [ "$contest" -eq 1 ]
then
echo "$call,$freq,$mode,$tx,$txser,$rx,$rxser,$utcon,$utcoff,$op,$station,$date,$power,$stationLocator,$locator" >> contest_log_$filename\_$date.csv
txser=$((txser+1))
elif [ "$contest" -ne 1 ]
then
echo "$call,$freq,$mode,$tx,$rx,$utcon,$utcoff,$op,$station,$date,$power,$stationLocator,$locator" >> log_$filename\_$date.csv
fi
y=$((y+1))
echo "$y Logged"
elif [ "$confirm" -ne 1 ]
then
echo "re-enter details"
fi
sleep 1
done