Debian Codegraph @

Aircraft/c172p/Systems/control-lock.xml

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <!--
4 Copyright (c) 2016 onox
5
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18 -->
19
20 <PropertyList>
21
22 <filter>
23 <name>Control Lock Aileron</name>
24 <type>noise-spike</type>
25 <max-rate-of-change>1.0</max-rate-of-change>
26 <enable>
27 <property>/controls/flight/freeze-yoke</property>
28 </enable>
29 <input>
30 <property>/controls/flight/aileron-cmd</property>
31 </input>
32 <output>
33 <property>/controls/flight/aileron</property>
34 </output>
35 </filter>
36
37 <filter>
38 <name>Control Lock Elevator</name>
39 <type>noise-spike</type>
40 <max-rate-of-change>1.0</max-rate-of-change>
41 <enable>
42 <property>/controls/flight/freeze-yoke</property>
43 </enable>
44 <input>
45 <property>/controls/flight/elevator-cmd</property>
46 </input>
47 <output>
48 <property>/controls/flight/elevator</property>
49 </output>
50 </filter>
51
52 <state-machine>
53 <branch>/aircraft/fsm/control-lock</branch>
54
55 <!-- States -->
56 <state>
57 <name>unlocked</name>
58
59 <enter>
60 <command>property-assign</command>
61 <property>/sim/model/c172p/cockpit/control-lock-visible</property>
62 <value type="bool">false</value>
63 </enter>
64 <enter>
65 <command>property-assign</command>
66 <property>/controls/flight/freeze-yoke</property>
67 <value type="bool">false</value>
68 </enter>
69 </state>
70
71 <state>
72 <name>prepare-reset-yoke</name>
73
74 <enter>
75 <command>property-assign</command>
76 <property>/controls/flight/aileron-cmd</property>
77 <property>/controls/flight/aileron</property>
78 </enter>
79 <enter>
80 <command>property-assign</command>
81 <property>/controls/flight/elevator-cmd</property>
82 <property>/controls/flight/elevator</property>
83 </enter>
84 <enter>
85 <command>property-assign</command>
86 <property>/controls/flight/freeze-yoke</property>
87 <value type="bool">true</value>
88 </enter>
89 </state>
90
91 <state>
92 <name>reset-yoke</name>
93
94 <enter>
95 <command>property-assign</command>
96 <property>/controls/flight/aileron-cmd</property>
97 <value type="double">0.0</value>
98 </enter>
99 <enter>
100 <command>property-assign</command>
101 <property>/controls/flight/elevator-cmd</property>
102 <value type="double">0.0</value>
103 </enter>
104 </state>
105
106 <state>
107 <name>locked</name>
108
109 <enter>
110 <command>property-assign</command>
111 <property>/sim/model/c172p/cockpit/control-lock-visible</property>
112 <value type="bool">true</value>
113 </enter>
114 </state>
115
116 <!-- Transitions -->
117 <transition>
118 <name>init</name>
119 <source>unlocked</source>
120 <target>prepare-reset-yoke</target>
121 <condition>
122 <property>sim/model/c172p/cockpit/control-lock-placed</property>
123 </condition>
124 </transition>
125
126 <transition>
127 <name>prepare-center</name>
128 <source>prepare-reset-yoke</source>
129 <target>reset-yoke</target>
130 <condition>
131 <true/>
132 </condition>
133 </transition>
134
135 <transition>
136 <name>move-yoke-to-center</name>
137 <source>reset-yoke</source>
138 <target>locked</target>
139 <condition>
140 <and>
141 <equals>
142 <property>sim/model/c172p/cockpit/yoke-aileron</property>
143 <value>0.0</value>
144 </equals>
145 <equals>
146 <property>sim/model/c172p/cockpit/yoke-elevator</property>
147 <value>0.0</value>
148 </equals>
149 </and>
150 </condition>
151 </transition>
152
153 <transition>
154 <name>unlock-controls</name>
155 <source>locked</source>
156 <source>prepare-reset-yoke</source>
157 <source>reset-yoke</source>
158 <target>unlocked</target>
159 <condition>
160 <not>
161 <property>sim/model/c172p/cockpit/control-lock-placed</property>
162 </not>
163 </condition>
164 </transition>
165 </state-machine>
166
167 </PropertyList>