fix error in INITB, make INITB accessable with --> key

This commit is contained in:
Joshua Davidson 2017-05-18 14:52:02 -04:00
parent 533e09e0e6
commit d91b465b74
6 changed files with 90 additions and 4 deletions
Models/Instruments
Nasal

View file

@ -76,7 +76,7 @@
<offsets> <offsets>
<x-m>-0.001</x-m> <x-m>-0.001</x-m>
<y-m>-0.042</y-m> <y-m>-0.042</y-m>
<z-m>0.0755</z-m> <z-m>0.0715</z-m>
</offsets> </offsets>
<alignment>left-center</alignment> <alignment>left-center</alignment>
<axis-alignment>yz-plane</axis-alignment> <axis-alignment>yz-plane</axis-alignment>

View file

@ -70,6 +70,28 @@
</condition> </condition>
</model> </model>
<model>
<name>INITB</name>
<path>INITB/INITB.xml</path>
<offsets>
<heading-deg>180</heading-deg>
<roll-deg>180</roll-deg>
<pitch-deg>90</pitch-deg>
</offsets>
<condition>
<and>
<greater-than-equals>
<property>/systems/electrical/bus/ac1</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>/MCDU[0]/page</property>
<value>INITB</value>
</equals>
</and>
</condition>
</model>
<model> <model>
<name>DATA</name> <name>DATA</name>
<path>DATA/DATA.xml</path> <path>DATA/DATA.xml</path>

View file

@ -76,7 +76,7 @@
<offsets> <offsets>
<x-m>-0.001</x-m> <x-m>-0.001</x-m>
<y-m>-0.042</y-m> <y-m>-0.042</y-m>
<z-m>0.0755</z-m> <z-m>0.0715</z-m>
</offsets> </offsets>
<alignment>left-center</alignment> <alignment>left-center</alignment>
<axis-alignment>yz-plane</axis-alignment> <axis-alignment>yz-plane</axis-alignment>

View file

@ -70,6 +70,28 @@
</condition> </condition>
</model> </model>
<model>
<name>INITB</name>
<path>INITB/INITB.xml</path>
<offsets>
<heading-deg>180</heading-deg>
<roll-deg>180</roll-deg>
<pitch-deg>90</pitch-deg>
</offsets>
<condition>
<and>
<greater-than-equals>
<property>/systems/electrical/bus/ac1</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>/MCDU[1]/page</property>
<value>INITB</value>
</equals>
</and>
</condition>
</model>
<model> <model>
<name>DATA</name> <name>DATA</name>
<path>DATA/DATA.xml</path> <path>DATA/DATA.xml</path>

View file

@ -42,8 +42,6 @@ var initInputA = func(key) {
} else { } else {
var crz = int(scratchpad); var crz = int(scratchpad);
var crzs = size(scratchpad); var crzs = size(scratchpad);
print(crz);
print(crzs);
if (crzs >= 1 and crzs <= 3) { if (crzs >= 1 and crzs <= 3) {
screenFlash(0.2); screenFlash(0.2);
setprop("/FMGC/internal/cruise-ft", crz * 100); setprop("/FMGC/internal/cruise-ft", crz * 100);
@ -75,6 +73,17 @@ var arrowbutton = func(btn) {
setprop("/MCDU[0]/page", "DATA"); setprop("/MCDU[0]/page", "DATA");
}, 0.2); }, 0.2);
} }
if (getprop("/MCDU[0]/page") == "INITA") {
setprop("/MCDU[0]/page", "NONE");
settimer(func {
setprop("/MCDU[0]/page", "INITB");
}, 0.2);
} else if (getprop("/MCDU[0]/page") == "INITB") {
setprop("/MCDU[0]/page", "NONE");
settimer(func {
setprop("/MCDU[0]/page", "INITA");
}, 0.2);
}
} else if (btn == "right") { } else if (btn == "right") {
if (getprop("/MCDU[0]/page") == "DATA") { if (getprop("/MCDU[0]/page") == "DATA") {
setprop("/MCDU[0]/page", "NONE"); setprop("/MCDU[0]/page", "NONE");
@ -87,6 +96,17 @@ var arrowbutton = func(btn) {
setprop("/MCDU[0]/page", "DATA"); setprop("/MCDU[0]/page", "DATA");
}, 0.2); }, 0.2);
} }
if (getprop("/MCDU[0]/page") == "INITA") {
setprop("/MCDU[0]/page", "NONE");
settimer(func {
setprop("/MCDU[0]/page", "INITB");
}, 0.2);
} else if (getprop("/MCDU[0]/page") == "INITB") {
setprop("/MCDU[0]/page", "NONE");
settimer(func {
setprop("/MCDU[0]/page", "INITA");
}, 0.2);
}
} else if (btn == "up") { } else if (btn == "up") {
# Nothing for now # Nothing for now
} else if (btn == "down") { } else if (btn == "down") {

View file

@ -73,6 +73,17 @@ var arrowbutton = func(btn) {
setprop("/MCDU[1]/page", "DATA"); setprop("/MCDU[1]/page", "DATA");
}, 0.2); }, 0.2);
} }
if (getprop("/MCDU[1]/page") == "INITA") {
setprop("/MCDU[1]/page", "NONE");
settimer(func {
setprop("/MCDU[1]/page", "INITB");
}, 0.2);
} else if (getprop("/MCDU[1]/page") == "INITB") {
setprop("/MCDU[1]/page", "NONE");
settimer(func {
setprop("/MCDU[1]/page", "INITA");
}, 0.2);
}
} else if (btn == "right") { } else if (btn == "right") {
if (getprop("/MCDU[1]/page") == "DATA") { if (getprop("/MCDU[1]/page") == "DATA") {
setprop("/MCDU[1]/page", "NONE"); setprop("/MCDU[1]/page", "NONE");
@ -85,6 +96,17 @@ var arrowbutton = func(btn) {
setprop("/MCDU[1]/page", "DATA"); setprop("/MCDU[1]/page", "DATA");
}, 0.2); }, 0.2);
} }
if (getprop("/MCDU[1]/page") == "INITA") {
setprop("/MCDU[1]/page", "NONE");
settimer(func {
setprop("/MCDU[1]/page", "INITB");
}, 0.2);
} else if (getprop("/MCDU[1]/page") == "INITB") {
setprop("/MCDU[1]/page", "NONE");
settimer(func {
setprop("/MCDU[1]/page", "INITA");
}, 0.2);
}
} else if (btn == "up") { } else if (btn == "up") {
# Nothing for now # Nothing for now
} else if (btn == "down") { } else if (btn == "down") {