Scripting-Lad / GPS-Tracking-Script

Bash based script used to track which GPS block is currently within view.
1 stars 1 forks source link

Enhancment Suggestions #1

Open leyersc2 opened 2 months ago

leyersc2 commented 2 months ago

Not bad at all!

Could consider adding either a multi-dimensional array or an advanced data type like a dictonary to capture the SV PRN // SV # identification. (neither of which are supported in bash natively and the frankenstien versions of them are not pretty, could just create a supplementary XML to be read in that stores that data in lieu of a more formal language framework)

XML Example:

<?xml version="1.0" encoding="UTF-8"?>
<root>
    <dataType name="GPS_IIR">
        <entry key="1">12</entry>
        <entry key="2">23</entry>
    </dataType>
    <dataType name="GPS_IIF">
        <entry key="44">1</entry>
        <entry key="24">4</entry>
        <entry key="2">214</entry>
    </dataType>
    <dataType name="GPS_III">
        <entry key="41">1</entry>
        <entry key="23">21</entry>
    </dataType>
</root>

if [ $sv -eq 13 ]

Could be restructured to

for values in SV_Dict where PRN == x
print SV_Dict.SV# 

would consolidate the conditionals a fair bit with one single control structure. but what you have in place now works equally as well. Just food for thought.

Looking forward to giving this a try once I get my hands on one of those receivers!

Scripting-Lad commented 2 months ago

@leyersc2 v1.1 has been released. Took recommendations for adding an array and restructuring the for loop. Consolidated from 212 lines to 59 lines. Opening a new issue to work on sorting in SV order. Let me know what your thoughts are.