Debian Codegraph @

Aircraft/Instruments-3d/FG1000/GDU104X/verify.bash

raw symbols SCIP
1 #!/usr/bin/bash
2 #
3 # Simple check that any animations for FG1000HardKeyPushed have the correct elements
4
5 echo "Checking for notification element"
6 for i in *.xml;
7 do
8 foo=$(xmllint --xpath "PropertyList/animation//binding[command[text()=\"FG1000HardKeyPushed\"]][not(notification)]" $i 2>&1)
9 if [[ $? -eq 0 ]]
10 then
11 echo "$i : FG1000HardKeyPushed animation missing \<name\> element."
12 else
13 echo "$i : OK"
14 fi
15 done
16
17 echo "Checking for device element"
18 for i in *.xml;
19 do
20 foo=$(xmllint --xpath "PropertyList/animation//binding[command[text()=\"FG1000HardKeyPushed\"]][not(device)]" $i 2>&1)
21 if [[ $? -eq 0 ]]
22 then
23 echo "$i : FG1000HardKeyPushed animation missing \<device\> element. (Should match \"N\" in GDUXXXX.N.xml"
24 else
25 echo "$i : OK"
26 fi
27 done
28
29 # This checks for offset, which should be present for anything other than a "knob" animation.
30 echo "Checking for offset element"
31 for i in *.xml;
32 do
33 foo=$(xmllint --xpath "PropertyList/animation[type[text()!=\"knob\"]]//binding[command[text()=\"FG1000HardKeyPushed\"]][not(offset)]" $i 2>&1)
34 if [[ $? -eq 0 ]]
35 then
36 echo "$i : FG1000HardKeyPushed pick animation missing \<offset\>1\</offset\>"
37 else
38 echo "$i : OK"
39 fi
40 done
41