1
0
Fork 0

Add a variant of the high res c172 rpm gauge that includes a working

LCD hobbs meter (instead of the previous "static" hobbs meter that was pretty
but didn't ever change.)  This requires some aircraft specific nasal support
since the hobbs meter isn't implemented in the same way on every aircraft:

# initialize the hobbs meter and configure to save every 5 minutes
var hobbs = aircraft.timer.new("/instrumentation/clock/hobbs-meter-sec");
aircraft.data.save(5);
hobbs.stop();

setlistener( "/engines/engine[0]/running",
    func {
	var running = getprop("/engines/engine[0]/running");
	if ( running ) {
	    hobbs.start();
	} else {
	    hobbs.stop();
	}
    }
);
setlistener( "/instrumentation/clock/hobbs-meter-sec",
    func {
	var secs = getprop("/instrumentation/clock/hobbs-meter-sec");
	setprop("/instrumentation/clock/hobbs-meter-hours", secs / 3600);
    },
    1
);
This commit is contained in:
curt 2009-04-22 18:11:23 +00:00
parent b6ccd90066
commit 6ab2bca4ef

View file

@ -0,0 +1,145 @@
<?xml version="1.0"?>
<!--
rpm.xml
RPM indicator from C172-S
Martin Dressler dr@musicabona.cz
Jan 30 2003
-->
<PropertyList>
<name>C172-S RPM Gauge</name>
<w-base>512</w-base>
<h-base>512</h-base>
<params>
<rpm-select>/engines/engine[0]/rpm</rpm-select>
</params>
<layers>
<layer>
<name>Backplate</name>
<w>512</w>
<h>512</h>
<texture>
<path>Aircraft/Instruments/Textures/rpm1.rgb</path>
<x1>0.0</x1>
<x2>1.0</x2>
<y1>0.0</y1>
<y2>1.0</y2>
</texture>
</layer>
<layer>
<name>Hobbs LCD background</name>
<texture>
<path>Aircraft/Instruments/Textures/faces-3.rgb</path>
<x1>0.6</x1>
<y1>0.2</y1>
<x2>0.9</x2>
<y2>0.3</y2>
</texture>
<w>190</w>
<h>43</h>
<transformations>
<transformation>
<type>x-shift</type>
<offset>0</offset>
</transformation>
<transformation>
<type>y-shift</type>
<offset>-76</offset>
</transformation>
</transformations>
</layer>
<layer>
<name>Digital Hobbs</name>
<type>text</type>
<font>led</font>
<point-size>14</point-size>
<color>
<red>0.0</red>
<green>0.0</green>
<blue>0.0</blue>
</color>
<chunks>
<chunk>
<type>number-value</type>
<property>/instrumentation/clock/hobbs-meter-hours</property>
<format>%07.1f</format>
</chunk>
</chunks>
<transformations>
<transformation>
<type>x-shift</type>
<offset>-55</offset>
</transformation>
<transformation>
<type>y-shift</type>
<offset>-90</offset>
</transformation>
</transformations>
</layer>
<layer>
<name>Needle</name>
<w>264</w>
<h>56</h>
<texture>
<path>Aircraft/Instruments/Textures/misc2.rgb</path>
<x1>0.0</x1>
<x2>0.515625</x2>
<y1>0.4375</y1>
<y2>0.546875</y2>
</texture>
<transformations>
<transformation>
<type>rotation</type>
<property alias="../../../../../params/rpm-select"/>
<offset>90</offset>
<min>0.0</min>
<max>3500.0</max>
<scale>1.0</scale>
<interpolation>
<entry><ind> 0.0</ind><dep>-128.6 </dep></entry>
<entry><ind> 0.1</ind><dep>-123.85</dep></entry>
<entry><ind> 500.0</ind><dep> -92.85</dep></entry>
<entry><ind> 1000.0</ind><dep> -57.1 </dep></entry>
<entry><ind> 1500.0</ind><dep> -21.1 </dep></entry>
<entry><ind> 2000.0</ind><dep> 15.4 </dep></entry>
<entry><ind> 2500.0</ind><dep> 51.4 </dep></entry>
<entry><ind> 3000.0</ind><dep> 87.4 </dep></entry>
<entry><ind> 3500.0</ind><dep> 123.4 </dep></entry>
</interpolation>
</transformation>
<transformation>
<type>x-shift</type>
<offset>-49</offset>
</transformation>
</transformations>
</layer>
<layer>
<name>Needle center</name>
<w>24</w>
<h>24</h>
<texture>
<path>Aircraft/Instruments/Textures/misc2.rgb</path>
<x1>0.515625</x1>
<x2>0.5625</x2>
<y1>0.4375</y1>
<y2>0.484375</y2>
</texture>
</layer>
</layers>
</PropertyList>