From 874e8c31f5c1f8cf47de2ae50378874d0b8d26eb Mon Sep 17 00:00:00 2001
From: Joshua Davidson <joshuadavidson2000@gmail.com>
Date: Fri, 29 Sep 2017 18:21:09 -0400
Subject: [PATCH] A32X: Fix N1 mode issues

---
 .../Instruments/Upper-ECAM/res/iae-eis1.svg   | 10 ++--
 Systems/fadec-iae.xml                         | 52 ++++++++++++++++++-
 revision.txt                                  |  2 +-
 3 files changed, 56 insertions(+), 8 deletions(-)

diff --git a/Models/Instruments/Upper-ECAM/res/iae-eis1.svg b/Models/Instruments/Upper-ECAM/res/iae-eis1.svg
index 65536c1f..b40eaad3 100644
--- a/Models/Instruments/Upper-ECAM/res/iae-eis1.svg
+++ b/Models/Instruments/Upper-ECAM/res/iae-eis1.svg
@@ -41,9 +41,9 @@
      inkscape:window-height="1030"
      id="namedview371"
      showgrid="true"
-     inkscape:zoom="2"
-     inkscape:cx="476.79314"
-     inkscape:cy="1163.0004"
+     inkscape:zoom="0.70710678"
+     inkscape:cx="593.5508"
+     inkscape:cy="758.63245"
      inkscape:window-x="1592"
      inkscape:window-y="-8"
      inkscape:window-maximized="1"
@@ -1048,7 +1048,7 @@
      id="N11-thr"
      d="m 37.491777,495.14503 c 0,2.9783 -2.41437,5.39267 -5.39267,5.39267 -2.9783,0 -5.39268,-2.41437 -5.39268,-5.39267 0,-2.9783 2.41438,-5.39268 5.39268,-5.39268 2.9783,0 5.39267,2.41438 5.39267,5.39268 z"
      inkscape:transform-center-x="106.68099"
-     style="fill:#000000;stroke:#00a0d2;stroke-width:2.88800001;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+     style="fill:#000000;stroke:#ffffff;stroke-width:2.88800001;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
   <rect
      inkscape:transform-center-y="0.0034370262"
      inkscape:transform-center-x="53.222749"
@@ -1435,7 +1435,7 @@
      inkscape:label="#rect4292"
      inkscape:transform-center-x="98.43003" />
   <path
-     style="fill:#000000;stroke:#00a0d2;stroke-width:2.88800001;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+     style="fill:#000000;stroke:#ffffff;stroke-width:2.88800001;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
      inkscape:transform-center-x="106.68099"
      d="m 384.46678,495.14503 c 0,2.9783 -2.41437,5.39267 -5.39267,5.39267 -2.9783,0 -5.39268,-2.41437 -5.39268,-5.39267 0,-2.9783 2.41438,-5.39268 5.39268,-5.39268 2.9783,0 5.39267,2.41438 5.39267,5.39268 z"
      id="N12-thr"
diff --git a/Systems/fadec-iae.xml b/Systems/fadec-iae.xml
index 657d7891..55dd6887 100644
--- a/Systems/fadec-iae.xml
+++ b/Systems/fadec-iae.xml
@@ -433,9 +433,33 @@
         <gain>1</gain>
         <update-interval-secs type="double">0.05</update-interval-secs>
         <input>
+			<condition>
+				<and>
+					<equals>
+						<property>/controls/engines/thrust-limit</property>
+						<value>FLX</value>
+					</equals>
+					<equals>
+						<property>/systems/thrust/state1</property>
+						<value>MCT</value>
+					</equals>
+				</and>
+			</condition>
             <expression>
                 <table>
-                    <property>/controls/engines/engine[0]/throttle-man</property>
+					<product>
+						<value>0.97</value>
+						<property>/engines/flx-throttle</property>
+					</product>
+                    <entry><ind>0.00</ind><dep> 22.4</dep></entry>
+                    <entry><ind>1.00</ind><dep>103.8</dep></entry>
+                </table>
+            </expression>
+        </input>
+        <input>
+            <expression>
+                <table>
+                    <property>/controls/engines/engine[0]/throttle-cmd-man</property>
                     <entry><ind>0.00</ind><dep> 22.4</dep></entry>
                     <entry><ind>1.00</ind><dep>103.8</dep></entry>
                 </table>
@@ -450,9 +474,33 @@
         <gain>1</gain>
         <update-interval-secs type="double">0.05</update-interval-secs>
         <input>
+			<condition>
+				<and>
+					<equals>
+						<property>/controls/engines/thrust-limit</property>
+						<value>FLX</value>
+					</equals>
+					<equals>
+						<property>/systems/thrust/state2</property>
+						<value>MCT</value>
+					</equals>
+				</and>
+			</condition>
             <expression>
                 <table>
-                    <property>/controls/engines/engine[1]/throttle-man</property>
+					<product>
+						<value>0.97</value>
+						<property>/engines/flx-throttle</property>
+					</product>
+                    <entry><ind>0.00</ind><dep> 22.4</dep></entry>
+                    <entry><ind>1.00</ind><dep>103.8</dep></entry>
+                </table>
+            </expression>
+        </input>
+        <input>
+            <expression>
+                <table>
+                    <property>/controls/engines/engine[1]/throttle-cmd-man</property>
                     <entry><ind>0.00</ind><dep> 22.4</dep></entry>
                     <entry><ind>1.00</ind><dep>103.8</dep></entry>
                 </table>
diff --git a/revision.txt b/revision.txt
index 153038f1..1e144984 100644
--- a/revision.txt
+++ b/revision.txt
@@ -1 +1 @@
-2003
\ No newline at end of file
+2004
\ No newline at end of file