Add Clemenceau/Foch to new Ai carrier scheme
This commit is contained in:
parent
45bd8ec9b8
commit
3980515c47
2 changed files with 473 additions and 8 deletions
|
@ -17,9 +17,95 @@
|
|||
<nasal>
|
||||
<load>
|
||||
<![CDATA[
|
||||
# add AN/SPN-46 see http://chateau-logic.com/content/emesary-nasal-implementation-flightgear
|
||||
var self = cmdarg();
|
||||
|
||||
print("Model load Clemenceau ", self.getPath());
|
||||
var pathc = self.getPath();
|
||||
|
||||
# timescales
|
||||
|
||||
var elevator_transit_time = 30.0;
|
||||
var jbd_transit_time = 5.0;
|
||||
|
||||
# register the dialog
|
||||
|
||||
setprop(pathc~"/dlg-name", "Clemenceau");
|
||||
|
||||
# init course control, animation and detail properties
|
||||
|
||||
setprop("/controls/clemenceau/lights", 0);
|
||||
|
||||
setprop("/controls/clemenceau/turn-to-launch-hdg", 0);
|
||||
setprop("/controls/clemenceau/turn-to-recovery-hdg", 0);
|
||||
setprop("/controls/clemenceau/turn-to-base-course", 1);
|
||||
|
||||
|
||||
################
|
||||
# elevators
|
||||
|
||||
setprop("/controls/clemenceau/elevator[0]/state",1);
|
||||
setprop("/controls/clemenceau/elevator[1]/state",0);
|
||||
|
||||
var elevator1 = aircraft.door.new(pathc~"/surface-positions/elevator[0]", elevator_transit_time, 1);
|
||||
var elevator2 = aircraft.door.new(pathc~"/surface-positions/elevator[1]", elevator_transit_time, 0);
|
||||
|
||||
|
||||
var elevator_array = [elevator1, elevator2];
|
||||
|
||||
################
|
||||
# jet blast deflectors
|
||||
|
||||
setprop("/controls/clemenceau/jbd[0]/state", 0);
|
||||
setprop("/controls/clemenceau/jbd[1]/state", 0);
|
||||
|
||||
|
||||
var jbd1 = aircraft.door.new(pathc~"/surface-positions/jbd[0]", jbd_transit_time, 0);
|
||||
var jbd2 = aircraft.door.new(pathc~"/surface-positions/jbd[1]", jbd_transit_time, 0);
|
||||
|
||||
|
||||
var jbd_array = [jbd1, jbd2];
|
||||
|
||||
|
||||
# elevator control
|
||||
|
||||
var elevator_operate = func (i){
|
||||
|
||||
var tgt = getprop("/controls/clemenceau/elevator["~i~"]/state");
|
||||
if (tgt == 1)
|
||||
{
|
||||
print ("Elevator ", i+1, " up.");
|
||||
elevator_array[i].open();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
print ("Elevator ", i+1, " down.");
|
||||
elevator_array[i].close();
|
||||
}
|
||||
}
|
||||
|
||||
# JBD control
|
||||
|
||||
var jbd_operate = func (i) {
|
||||
|
||||
var tgt = getprop("/controls/clemenceau/jbd["~i~"]/state");
|
||||
if (tgt == 1)
|
||||
{
|
||||
print ("JBD ", i+1, " up.");
|
||||
jbd_array[i].open();
|
||||
}
|
||||
else
|
||||
{
|
||||
print ("JBD ", i+1, " down.");
|
||||
jbd_array[i].close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
# add AN/SPN-46 see http://chateau-logic.com/content/emesary-nasal-implementation-flightgear
|
||||
|
||||
|
||||
fn_an_spn_46 = getprop("/sim/fg-root") ~ "/Aircraft/Generic/an_spn_46.nas";
|
||||
io.load_nasal(fn_an_spn_46, "an_spn_46");
|
||||
var anspn = an_spn_46.ANSPN46_System.new("Clemenceau", self);
|
||||
|
@ -29,12 +115,30 @@
|
|||
an_spn_46_timer.restart(anspn.GetUpdateRate());
|
||||
});
|
||||
an_spn_46_timer.restart(6);
|
||||
|
||||
|
||||
# listeners
|
||||
|
||||
var l_elev1 = setlistener("/controls/clemenceau/elevator/state", func {elevator_operate(0);},0,0);
|
||||
var l_elev2 = setlistener("/controls/clemenceau/elevator[1]/state", func {elevator_operate(1);},0,0);
|
||||
|
||||
var l_jbd1 = setlistener("/controls/clemenceau/jbd[0]/state", func {jbd_operate(0);},0,0);
|
||||
var l_jbd2 = setlistener("/controls/clemenceau/jbd[1]/state", func {jbd_operate(1);},0,0);
|
||||
|
||||
]]>
|
||||
</load>
|
||||
|
||||
<unload>
|
||||
<![CDATA[
|
||||
an_spn_46_timer.stop();
|
||||
|
||||
# clean up listeners
|
||||
|
||||
removelistener(l_elev_1);
|
||||
removelistener(l_elev_2);
|
||||
|
||||
removelistener(l_jbd_1);
|
||||
removelistener(l_jbd_2);
|
||||
]]>
|
||||
</unload>
|
||||
</nasal>
|
||||
|
@ -198,7 +302,7 @@
|
|||
</condition>
|
||||
<type>rotate</type>
|
||||
<object-name>JBD-1</object-name>
|
||||
<property>/surface-positions/jbd1-pos-norm</property>
|
||||
<property>surface-positions/jbd[0]/position-norm</property>
|
||||
<factor>70</factor>
|
||||
<axis>
|
||||
<x1-m>-61.8038</x1-m>
|
||||
|
@ -218,7 +322,7 @@
|
|||
</condition>
|
||||
<type>rotate</type>
|
||||
<object-name>JBD-1</object-name>
|
||||
<property>surface-positions/jbd-pos-norm</property>
|
||||
<property>surface-positions/jbd[0]/position-norm</property>
|
||||
<factor>70</factor>
|
||||
<axis>
|
||||
<x1-m>-61.8038</x1-m>
|
||||
|
@ -244,7 +348,7 @@
|
|||
</condition>
|
||||
<type>rotate</type>
|
||||
<object-name>JBD-2</object-name>
|
||||
<property>/surface-positions/jbd2-pos-norm</property>
|
||||
<property>surface-positions/jbd[1]/position-norm</property>
|
||||
<factor>70</factor>
|
||||
<axis>
|
||||
<x1-m>37.4696</x1-m>
|
||||
|
@ -264,7 +368,7 @@
|
|||
</condition>
|
||||
<type>rotate</type>
|
||||
<object-name>JBD-2</object-name>
|
||||
<property>surface-positions/jbd-pos-norm</property>
|
||||
<property>surface-positions/jbd[1]/position-norm</property>
|
||||
<factor>70</factor>
|
||||
<axis>
|
||||
<x1-m>37.4696</x1-m>
|
||||
|
@ -279,19 +383,20 @@
|
|||
<type>translate</type>
|
||||
<object-name>Ascenseur1</object-name>
|
||||
<object-name>Ascenseur1-Marquage</object-name>
|
||||
<property>surface-positions/elevators-pos-norm</property>
|
||||
<property>surface-positions/elevator[0]/position-norm</property>
|
||||
<factor>9.20</factor>
|
||||
<offset-m>-9.20</offset-m>
|
||||
<axis>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<z>-1</z>
|
||||
<z>1</z>
|
||||
</axis>
|
||||
</animation>
|
||||
<animation>
|
||||
<type>translate</type>
|
||||
<object-name>Ascenseur2</object-name>
|
||||
<object-name>Ascenseur2-Marquage</object-name>
|
||||
<property>surface-positions/elevators-pos-norm</property>
|
||||
<property>surface-positions/elevator[1]/position-norm</property>
|
||||
<factor>9.20</factor>
|
||||
<axis>
|
||||
<x>0</x>
|
||||
|
@ -430,4 +535,112 @@
|
|||
<interaction-type>carrier-wire</interaction-type>
|
||||
</animation>
|
||||
|
||||
<!-- elevators -->
|
||||
|
||||
<animation>
|
||||
<type>pick</type>
|
||||
<object-name>Ascenseur1</object-name>
|
||||
<action>
|
||||
<button>0</button>
|
||||
<repeatable>false</repeatable>
|
||||
<binding>
|
||||
<command>property-toggle</command>
|
||||
<property>/controls/clemenceau/elevator/state</property>
|
||||
</binding>
|
||||
</action>
|
||||
<hovered>
|
||||
<binding>
|
||||
<command>set-tooltip</command>
|
||||
<tooltip-id>elev1</tooltip-id>
|
||||
<label>move elevator 1</label>
|
||||
</binding>
|
||||
</hovered>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>pick</type>
|
||||
<object-name>Ascenseur2</object-name>
|
||||
<action>
|
||||
<button>0</button>
|
||||
<repeatable>false</repeatable>
|
||||
<binding>
|
||||
<command>property-toggle</command>
|
||||
<property>/controls/clemenceau/elevator[1]/state</property>
|
||||
</binding>
|
||||
</action>
|
||||
<hovered>
|
||||
<binding>
|
||||
<command>set-tooltip</command>
|
||||
<tooltip-id>elev2</tooltip-id>
|
||||
<label>move elevator 2</label>
|
||||
</binding>
|
||||
</hovered>
|
||||
</animation>
|
||||
|
||||
|
||||
<!-- jet blast deflectors -->
|
||||
|
||||
<animation>
|
||||
<type>pick</type>
|
||||
<object-name>JBD-1</object-name>
|
||||
|
||||
<action>
|
||||
<button>0</button>
|
||||
<repeatable>false</repeatable>
|
||||
<binding>
|
||||
<command>property-toggle</command>
|
||||
<property>/controls/clemenceau/jbd[0]/state</property>
|
||||
</binding>
|
||||
</action>
|
||||
<hovered>
|
||||
<binding>
|
||||
<command>set-tooltip</command>
|
||||
<tooltip-id>jbd1</tooltip-id>
|
||||
<label>operate JBD1</label>
|
||||
</binding>
|
||||
</hovered>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>pick</type>
|
||||
<object-name>JBD-2</object-name>
|
||||
|
||||
<action>
|
||||
<button>0</button>
|
||||
<repeatable>false</repeatable>
|
||||
<binding>
|
||||
<command>property-toggle</command>
|
||||
<property>/controls/clemenceau/jbd[1]/state</property>
|
||||
</binding>
|
||||
</action>
|
||||
<hovered>
|
||||
<binding>
|
||||
<command>set-tooltip</command>
|
||||
<tooltip-id>jbd2</tooltip-id>
|
||||
<label>operate JBD2</label>
|
||||
</binding>
|
||||
</hovered>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>pick</type>
|
||||
<object-name>Island</object-name>
|
||||
<action>
|
||||
<button>0</button>
|
||||
<repeatable>false</repeatable>
|
||||
<binding>
|
||||
<command>dialog-show</command>
|
||||
<dialog-name>Clemenceau</dialog-name>
|
||||
<property></property>
|
||||
</binding>
|
||||
</action>
|
||||
<hovered>
|
||||
<binding>
|
||||
<command>set-tooltip</command>
|
||||
<tooltip-id>bridge</tooltip-id>
|
||||
<label>show Clemenceau control dialog</label>
|
||||
</binding>
|
||||
</hovered>
|
||||
</animation>
|
||||
|
||||
</PropertyList>
|
||||
|
|
252
gui/dialogs/clemenceau.xml
Normal file
252
gui/dialogs/clemenceau.xml
Normal file
|
@ -0,0 +1,252 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<PropertyList>
|
||||
<name>Clemenceau</name>
|
||||
<modal>false</modal>
|
||||
<layout>vbox</layout>
|
||||
|
||||
|
||||
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
|
||||
<empty>
|
||||
<stretch>1</stretch>
|
||||
</empty>
|
||||
|
||||
<text>
|
||||
<label>Clemenceau Controls</label>
|
||||
</text>
|
||||
|
||||
<empty>
|
||||
<stretch>1</stretch>
|
||||
</empty>
|
||||
|
||||
<button>
|
||||
<pref-width>16</pref-width>
|
||||
<pref-height>16</pref-height>
|
||||
<legend></legend>
|
||||
<keynum>27</keynum>
|
||||
<border>2</border>
|
||||
<binding>
|
||||
<command>dialog-close</command>
|
||||
</binding>
|
||||
</button>
|
||||
</group>
|
||||
|
||||
<hrule/>
|
||||
|
||||
<group>
|
||||
<layout>table</layout>
|
||||
|
||||
<text>
|
||||
<label>Course</label>
|
||||
<row>0</row>
|
||||
<col>0</col>
|
||||
</text>
|
||||
|
||||
<radio>
|
||||
<row>1</row>
|
||||
<col>0</col>
|
||||
<halign>left</halign>
|
||||
<label>Turn to launch course</label>
|
||||
<property>/controls/clemenceau/turn-to-launch-hdg</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
var v = getprop("/controls/clemenceau/turn-to-launch-hdg");
|
||||
foreach (var c; props.globals.getNode("/ai/models").getChildren("carrier")){
|
||||
|
||||
if (c.getNode("name").getValue() == "Clemenceau")
|
||||
{
|
||||
c.getNode("controls/turn-to-launch-hdg").setBoolValue(v);
|
||||
c.getNode("controls/turn-to-recovery-hdg").setBoolValue(0);
|
||||
c.getNode("controls/turn-to-base-course").setBoolValue(0);
|
||||
}
|
||||
}
|
||||
|
||||
setprop("/controls/clemenceau/turn-to-base-course", 0);
|
||||
setprop("/controls/clemenceau/turn-to-recovery-hdg", 0);
|
||||
</script>
|
||||
</binding>
|
||||
</radio>
|
||||
|
||||
<radio>
|
||||
<row>2</row>
|
||||
<col>0</col>
|
||||
<halign>left</halign>
|
||||
<label>Turn to recovery course</label>
|
||||
<property>/controls/clemenceau/turn-to-recovery-hdg</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
var v = getprop("/controls/clemenceau/turn-to-recovery-hdg");
|
||||
foreach (var c; props.globals.getNode("/ai/models").getChildren("carrier")){
|
||||
|
||||
if (c.getNode("name").getValue() == "Clemenceau")
|
||||
{
|
||||
c.getNode("controls/turn-to-recovery-hdg").setBoolValue(v);
|
||||
c.getNode("controls/turn-to-launch-hdg").setBoolValue(0);
|
||||
c.getNode("controls/turn-to-base-course").setBoolValue(0);
|
||||
}
|
||||
}
|
||||
|
||||
setprop("/controls/clemenceau/turn-to-base-course", 0);
|
||||
setprop("/controls/clemenceau/turn-to-launch-hdg", 0);
|
||||
</script>
|
||||
</binding>
|
||||
</radio>
|
||||
|
||||
<radio>
|
||||
<row>3</row>
|
||||
<col>0</col>
|
||||
<halign>left</halign>
|
||||
<label>Turn to base course</label>
|
||||
<property>/controls/clemenceau/turn-to-base-course</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
var v = getprop("/controls/clemenceau/turn-to-base-course");
|
||||
foreach (var c; props.globals.getNode("/ai/models").getChildren("carrier")){
|
||||
|
||||
if (c.getNode("name").getValue() == "Clemenceau")
|
||||
{
|
||||
c.getNode("controls/turn-to-base-course").setBoolValue(v);
|
||||
c.getNode("controls/turn-to-recovery-hdg").setBoolValue(0);
|
||||
c.getNode("controls/turn-to-launch-hdg").setBoolValue(0);
|
||||
}
|
||||
}
|
||||
|
||||
setprop("/controls/clemenceau/turn-to-launch-hdg", 0);
|
||||
setprop("/controls/clemenceau/turn-to-recovery-hdg", 0);
|
||||
</script>
|
||||
</binding>
|
||||
</radio>
|
||||
</group>
|
||||
|
||||
<hrule/>
|
||||
|
||||
<group>
|
||||
<layout>table</layout>
|
||||
|
||||
<text>
|
||||
<label>Equipment</label>
|
||||
<row>0</row>
|
||||
<col>0</col>
|
||||
</text>
|
||||
|
||||
<checkbox>
|
||||
<halign>left</halign>
|
||||
<row>1</row>
|
||||
<col>0</col>
|
||||
<label>Elevator 1</label>
|
||||
<property>/controls/clemenceau/elevator[0]/state</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</checkbox>
|
||||
|
||||
<checkbox>
|
||||
<halign>left</halign>
|
||||
<row>1</row>
|
||||
<col>1</col>
|
||||
<label>Elevator 2</label>
|
||||
<property>/controls/clemenceau/elevator[1]/state</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</checkbox>
|
||||
|
||||
<checkbox>
|
||||
<halign>left</halign>
|
||||
<row>3</row>
|
||||
<col>0</col>
|
||||
<label>JBD 1</label>
|
||||
<property>/controls/clemenceau/jbd[0]/state</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</checkbox>
|
||||
|
||||
<checkbox>
|
||||
<halign>left</halign>
|
||||
<row>3</row>
|
||||
<col>1</col>
|
||||
<label>JBD 2</label>
|
||||
<property>/controls/clemenceau/jbd[1]/state</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</checkbox>
|
||||
|
||||
|
||||
|
||||
</group>
|
||||
|
||||
|
||||
|
||||
|
||||
<hrule/>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
<default-padding>6</default-padding>
|
||||
<empty>
|
||||
<stretch>true</stretch>
|
||||
</empty>
|
||||
|
||||
<button>
|
||||
<legend>OK</legend>
|
||||
<default>true</default>
|
||||
<equal>true</equal>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
<binding>
|
||||
<command>dialog-close</command>
|
||||
</binding>
|
||||
</button>
|
||||
|
||||
<button>
|
||||
<legend>Apply</legend>
|
||||
<equal>true</equal>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</button>
|
||||
|
||||
<button>
|
||||
<legend>Reset</legend>
|
||||
<equal>true</equal>
|
||||
<binding>
|
||||
<command>dialog-update</command>
|
||||
</binding>
|
||||
</button>
|
||||
|
||||
<button>
|
||||
<legend>Cancel</legend>
|
||||
<equal>true</equal>
|
||||
<key>Esc</key>
|
||||
<binding>
|
||||
<command>dialog-close</command>
|
||||
</binding>
|
||||
</button>
|
||||
|
||||
<empty>
|
||||
<stretch>true</stretch>
|
||||
</empty>
|
||||
</group>
|
||||
</PropertyList>
|
Loading…
Add table
Reference in a new issue