1
0
Fork 0

Moved Davtron M877 chronometer into Instruments-3d/clock since it is a common instrument...

This commit is contained in:
sydadams 2007-09-22 20:42:39 +00:00
parent 52547b817a
commit 07fd1b5ee6
5 changed files with 1402 additions and 0 deletions

View file

@ -0,0 +1,55 @@
var davtron=props.globals.getNode("/instrumentation/clock/m877",1);
var set_hour=davtron.getNode("set-hour",1);
var set_min=davtron.getNode("set-min",1);
var mode=davtron.getNode("mode",1);
var modestring =davtron.getNode("mode-string",1);
var modetext =["GMT","LT","FT","ET"];
var HR=davtron.getNode("indicated-hour",1);
var MN=davtron.getNode("indicated-min",1);
var MODE = 0;
setlistener("/sim/signals/fdm-initialized", func {
set_hour.setBoolValue(0);
set_min.setBoolValue(0);
mode.setIntValue(MODE);
modestring.setValue(modetext[MODE]);
HR.setIntValue(0);
MN.setIntValue(0);
print("Chronometer ... Check");
settimer(update_clock,2);
});
setlistener("/instrumentation/clock/m877/mode", func {
MODE = cmdarg().getValue();
modestring.setValue(modetext[MODE]);
});
update_clock = func{
var FThr =getprop("/instrumentation/clock/flight-meter-hour");
var FM =0;
if (MODE == 0) {
setprop("/instrumentation/clock/m877/indicated-hour",getprop("/instrumentation/clock/indicated-hour"));
setprop("/instrumentation/clock/m877/indicated-min",getprop("/instrumentation/clock/indicated-min"));
}
if (MODE == 1) {
setprop("/instrumentation/clock/m877/indicated-hour",getprop("/instrumentation/clock/local-hour"));
setprop("/instrumentation/clock/m877/indicated-min",getprop("/instrumentation/clock/indicated-min"));
}
if (MODE == 2) {
setprop("/instrumentation/clock/m877/indicated-hour",FThr);
FH = getprop("/instrumentation/clock/m877/indicated-hour");
FM = FThr - FH;
FM = FM * 60;
setprop("/instrumentation/clock/m877/indicated-min",FM);
}
if (MODE == 3) {
setprop("/instrumentation/clock/m877/indicated-hour",getprop("/instrumentation/clock/ET-hr"));
setprop("/instrumentation/clock/m877/indicated-min",getprop("/instrumentation/clock/ET-min"));
}
settimer(update_clock,0);
}

Binary file not shown.

View file

@ -0,0 +1,69 @@
<?xml version="1.0"?>
<!--Davtron M877 Chronometer-->
<PropertyList>
<name>M877 hotspots</name>
<w-base>60</w-base>
<h-base>60</h-base>
<w>60</w>
<h>60</h>
<layers>
</layers>
<actions>
<!--
<action>
<name>outline</name>
<button>0</button>
<x>-30</x>
<y>-30</y>
<w>60</w>
<h>60</h>
</action>
-->
<action>
<name>mode increment</name>
<button>0</button>
<x>-18</x>
<y>-20</y>
<w>12</w>
<h>8</h>
<binding>
<command>property-adjust</command>
<property>instrumentation/clock/m877/mode</property>
<step>1</step>
<min>0</min>
<max>4</max>
<wrap>true</wrap>
</binding>
</action>
<action>
<name>set time</name>
<button>0</button>
<x>-5</x>
<y>-20</y>
<w>9</w>
<h>8</h>
<binding>
</binding>
</action>
<action>
<name>increment time</name>
<button>0</button>
<x>5</x>
<y>-20</y>
<w>12</w>
<h>8</h>
<binding>
</binding>
</action>
</actions>
</PropertyList>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,102 @@
<?xml version="1.0"?>
<PropertyList>
<path>m877.ac</path>
<animation>
<type>select</type>
<object-name>gmt</object-name>
<condition>
<equals>
<property>instrumentation/clock/m877/mode</property>
<value>0</value>
</equals>
</condition>
</animation>
<animation>
<type>select</type>
<object-name>lt</object-name>
<condition>
<equals>
<property>instrumentation/clock/m877/mode</property>
<value>1</value>
</equals>
</condition>
</animation>
<animation>
<type>select</type>
<object-name>ft</object-name>
<condition>
<equals>
<property>instrumentation/clock/m877/mode</property>
<value>2</value>
</equals>
</condition>
</animation>
<animation>
<type>select</type>
<object-name>et</object-name>
<condition>
<equals>
<property>instrumentation/clock/m877/mode</property>
<value>3</value>
</equals>
</condition>
</animation>
<animation>
<type>textranslate</type>
<object-name>HR.001</object-name>
<property>instrumentation/clock/m877/indicated-hour</property>
<factor>0.01</factor>
<step>10</step>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
<animation>
<type>textranslate</type>
<object-name>HR.002</object-name>
<property>instrumentation/clock/m877/indicated-hour</property>
<factor>0.1</factor>
<step>1</step>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
<animation>
<type>textranslate</type>
<object-name>MN.001</object-name>
<property>instrumentation/clock/m877/indicated-min</property>
<factor>0.01</factor>
<step>10</step>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
<animation>
<type>textranslate</type>
<object-name>MN.002</object-name>
<property>instrumentation/clock/m877/indicated-min</property>
<factor>0.1</factor>
<step>1</step>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
</PropertyList>