CVS: data/Aircraft/DO-26/Nasal do26-keyboard.xml, NONE, 1.1 doors.nas, NONE, 1.1 immat.nas, NONE, 1.1 light.nas, NONE, 1.1 liveries.nas, NONE, 1.1 views.xml, NONE, 1.1

Emmanuel Baranger <[email protected]> Mon, 5 Apr 2010 13:22:57 -0500
Newsgroups gmane.games.flightgear.cvc
Message-ID <[email protected]>
Update of /var/cvs/FlightGear-0.9/data/Aircraft/DO-26/Nasal
In directory baron.flightgear.org:/tmp/cvs-serv8645/Nasal

Added Files:
	do26-keyboard.xml doors.nas immat.nas light.nas liveries.nas 
	views.xml 
Log Message:
- new plane 

--- NEW FILE "do26-keyboard.xml" ---
<?xml version="1.0"?>

<PropertyList>

   <key n="100">
    <name>d</name>
    <desc>Canopy</desc>
    <binding>
     <command>nasal</command>
     <script>doors.doorsystem.crewexport();</script>
    </binding>
   </key>

</PropertyList>

--- NEW FILE "doors.nas" ---
# =====
# Doors
# =====

Doors = {};

Doors.new = func {
   obj = { parents : [Doors],
           crew : aircraft.door.new("instrumentation/doors/crew", 8.0),
           passenger : aircraft.door.new("instrumentation/doors/passenger", 10.0)
         };
   return obj;
};

Doors.crewexport = func {
   me.crew.toggle();
}

Doors.passengerexport = func {
   me.passenger.toggle();
}


# ==============
# Initialization
# ==============

# objects must be here, otherwise local to init()
doorsystem = Doors.new();


--- NEW FILE "immat.nas" ---
# ===========================
# Immatriculation by Zakharov
# ===========================

var refresh_immat = func {
    var immat = props.globals.getNode("/sim/model/immat",1).getValue();
    var immat_size = size(immat);
    if (immat_size != 0) immat = string.uc(immat);
    for (var i = 0; i < 6; i += 1) {
	if (i >= immat_size)
	    glyph = -1;
	elsif (string.isupper(immat[i]))
		glyph = immat[i] - `A`;
	elsif (string.isdigit(immat[i]))
	    glyph = immat[i] - `0` + 26;
	else
	   glyph = 36;
	props.globals.getNode("/sim/multiplay/generic/int["~i~"]", 1).setValue(glyph+1);
    }
}

var immat_dialog = gui.Dialog.new("/sim/gui/dialogs/h1/status/dialog",
                                  "Aircraft/H1-Racer/Dialogs/immat.xml");

setlistener("/sim/signals/fdm-initialized", func {
  if (props.globals.getNode("/sim/model/immat") == nil) {
    var immat = props.globals.getNode("/sim/model/immat",1);
    var callsign = props.globals.getNode("/sim/multiplay/callsign").getValue();
    if (callsign != "callsign") immat.setValue(callsign);
  else immat.setValue("NR258Y");
  }
  refresh_immat();
  setlistener("sim/model/immat", refresh_immat, 0);
},0);


--- NEW FILE "light.nas" ---
var sbc1 = aircraft.light.new( "/sim/model/lights/sbc1", [0.5, 0.3] );
sbc1.interval = 0.1;
sbc1.switch( 1 );

var sbc2 = aircraft.light.new( "/sim/model/lights/sbc2", [0.2, 0.3], "/sim/model/lights/sbc1/state" );
sbc2.interval = 0;
sbc2.switch( 1 );

setlistener( "/sim/model/lights/sbc2/state", func(n) {
  var bsbc1 = sbc1.stateN.getValue();
  var bsbc2 = n.getBoolValue();
  var b = 0;
  if( bsbc1 and bsbc2 and getprop( "/controls/lighting/beacon") ) {
    b = 1;
  } else {
    b = 0;
  }
  setprop( "/sim/model/lights/beacon/enabled", b );

  if( bsbc1 and !bsbc2 and getprop( "/controls/lighting/strobe" ) ) {
    b = 1;
  } else {
    b = 0;
  }
  setprop( "/sim/model/lights/strobe/enabled", b );
});

var beacon = aircraft.light.new( "/sim/model/lights/beacon", [0.05, 0.05] );
beacon.interval = 0;

var strobe = aircraft.light.new( "/sim/model/lights/strobe", [0.05, 0.05, 0.05, 1] );
strobe.interval = 0;

setprop( "/instrumentation/nav[0]/ident", 0 );
setprop( "/instrumentation/nav[1]/ident", 0 );


--- NEW FILE "liveries.nas" ---
aircraft.livery.init("Aircraft/H1-Racer/Models/Liveries");



--- NEW FILE "views.xml" ---
<?xml version="1.0" encoding="UTF-8"?>

<PropertyList>

  <chase-distance-m type="double" archive="y">-30.0</chase-distance-m>

  <view n="100">
    <name>Tail Camera View</name>
    <type>lookfrom</type>
    <internal archive="y">true</internal>
    <config>
      <from-model type="bool">true</from-model>
      <from-model-idx type="int">0</from-model-idx>
      <ground-level-nearplane-m type="double">0.01f</ground-level-nearplane-m>
      <default-field-of-view-deg type="double">30</default-field-of-view-deg>
      <pitch-offset-deg>-5</pitch-offset-deg>
      <x-offset-m archive="y"> 0.000 </x-offset-m> <!--Right-->
      <y-offset-m archive="y"> 2.000 </y-offset-m> <!--Up-->
      <z-offset-m archive="y"> 9.227 </z-offset-m> <!--Back-->
    </config>
  </view>

  <view n="0">
    <internal archive="y">true</internal>
    <config>
     <x-offset-m archive="y"> -0.501 </x-offset-m>	<!-- Right -->
     <y-offset-m archive="y"> -1.203 </y-offset-m>	<!-- Up    -->
     <z-offset-m archive="y"> -7.714 </z-offset-m>	<!-- Back  -->
     <pitch-offset-deg> 0.000 </pitch-offset-deg>
     <default-field-of-view-deg>70</default-field-of-view-deg>
    </config>
  </view>

  <view n="1">
    <config>
      <target-z-offset-m archive="y" type="double">0</target-z-offset-m>
    </config>
  </view>

  <view n="2">
    <config>
      <target-z-offset-m archive="y" type="double">0</target-z-offset-m>
    </config>
  </view>

  <view n="3">
    <config>
      <target-z-offset-m archive="y" type="double">0</target-z-offset-m>
    </config>
  </view>

  <view n="4">
    <config>
      <target-z-offset-m archive="y" type="double">0</target-z-offset-m>
    </config>
  </view>

  <view n="5">
    <config>
      <target-z-offset-m archive="y" type="double">0</target-z-offset-m>
    </config>
  </view>

  <view n="6">
    <config>
      <target-z-offset-m archive="y" type="double">0</target-z-offset-m>
    </config>
  </view>

</PropertyList>


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev