laymanshex-files/Sports/Concept2/PM5/pm5conv.bash
2020-04-28 22:44:24 +02:00

49 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
cmd="/home/alexander/Spielewiese/laymanshex/laymanshex"
accTable="LogDataAccessTbl.bin"
storage="LogDataStorage.bin"
i=0
while : ; do
offset=$(($i*32))
output="$($cmd -nopadding -fvar=offset=$offset $accTable.layhex $accTable 2>/dev/null)"
status=$?
if [ $status -ne 0 ]; then
break
else
while read -r line; do
typeset -x "$line"
done <<< "$output"
echo "Workout $Index"
echo "============="
outputHeader="$($cmd -nopadding -fvar=offset=$Offset $storage-HeaderWorkout$WorkoutType.layhex $storage 2>/dev/null)"
status=$?
if [ $status -eq 0 ]; then
while read -r line; do
typeset -x "$line"
done <<< $outputHeader
echo "TotalDuration=$HeaderTotalDuration"
echo "TotalDistance=$HeaderTotalDistance"
echo "SplitSize=$HeaderSplitSize"
echo "SPM=$HeaderSPM"
j=0
while [ "$j" -lt "$NoSplits" ]; do
splitOffset=$((Offset+50+j*32))
outputSplit="$($cmd -nopadding -fvar=offset=$splitOffset $storage-FrameWorkout$WorkoutType.layhex $storage 2>/dev/null)"
status=$?
if [ $status -eq 0 ]; then
echo
echo "Split $((j+1))"
echo "----------"
echo "$outputSplit"
fi
j=$((j+1))
done
echo
fi
fi
i=$((i+1))
done