David Culp:
The radar instrument uses the above three items, and applies a scale factor to the x-shift and y-shift in order to match the instrument's scale. Changing the display scale can be done entirely in the XML code for the instrument. Right now it's set up only to display a 40 mile scale. The radar is an AWACS view, which is not very realistic, but it is useful and demonstrates the technology. With just a little more work I can get a HUD marker. All I need to do there is make a bank angle adjustment to the current values. This works great with one target. For two or more targets the radar instrument will have to know the numbering of the aircraft model properties. This isn't implemented yet. David Culp: I couldn't stop. Here's a better radar instrument. It has: 1) range select knob 20 and 40 nm (not clickable.. yet) 2) target altitude readout at lower right 3) target disappears when range exceeds 43 nm 4) range ring values now are read from instrumentation/radar/range 5) instrumentation/radar/range is preset in the *-set.xml file to 40 nm The next step would be a clickable range selection. The problem here is that the instrument currently displays the "blip" only if the target's range is less then 43 nm. If the range scale is decreased to 20 nm, then the "blip" will show past the edges of the instrument. I might need to make another instrument for the 20 nm scale to make that work.
This commit is contained in:
parent
6f8a6bd045
commit
e4faabff78
4 changed files with 225 additions and 0 deletions
BIN
Aircraft/Instruments/Textures/radar_background.rgb
Normal file
BIN
Aircraft/Instruments/Textures/radar_background.rgb
Normal file
Binary file not shown.
BIN
Aircraft/Instruments/Textures/radar_frame.rgb
Normal file
BIN
Aircraft/Instruments/Textures/radar_frame.rgb
Normal file
Binary file not shown.
BIN
Aircraft/Instruments/Textures/radar_misc.rgb
Normal file
BIN
Aircraft/Instruments/Textures/radar_misc.rgb
Normal file
Binary file not shown.
225
Aircraft/Instruments/radar.xml
Normal file
225
Aircraft/Instruments/radar.xml
Normal file
|
@ -0,0 +1,225 @@
|
|||
<PropertyList>
|
||||
<name>Radar</name>
|
||||
<w-base>256</w-base>
|
||||
<h-base>256</h-base>
|
||||
<layers>
|
||||
|
||||
<layer>
|
||||
<name>background</name>
|
||||
<w>256</w>
|
||||
<h>256</h>
|
||||
<texture>
|
||||
<path>Aircraft/Instruments/Textures/radar_background.rgb</path>
|
||||
<x1>0</x1>
|
||||
<y1>0</y1>
|
||||
<x2>1</x2>
|
||||
<y2>1</y2>
|
||||
</texture>
|
||||
</layer>
|
||||
|
||||
<layer>
|
||||
<name>target1</name>
|
||||
<w>8</w>
|
||||
<h>17</h>
|
||||
<condition>
|
||||
<less-than>
|
||||
<property>ai/models/aircraft[1]/radar/range-nm</property>
|
||||
<value>43</value>
|
||||
</less-than>
|
||||
</condition>
|
||||
<texture>
|
||||
<path>Aircraft/Instruments/Textures/radar_misc.rgb</path>
|
||||
<x1>0.0429687</x1>
|
||||
<y1>0.8320312</y1>
|
||||
<x2>0.0703125</x2>
|
||||
<y2>0.8945312</y2>
|
||||
</texture>
|
||||
<transformations>
|
||||
<transformation>
|
||||
<type>x-shift</type>
|
||||
<property>ai/models/aircraft[1]/radar/x-shift</property>
|
||||
<scale>2.55</scale>
|
||||
</transformation>
|
||||
<transformation>
|
||||
<type>y-shift</type>
|
||||
<property>ai/models/aircraft[1]/radar/y-shift</property>
|
||||
<scale>2.55</scale>
|
||||
</transformation>
|
||||
<transformation>
|
||||
<type>rotation</type>
|
||||
<property>ai/models/aircraft[1]/radar/rotation</property>
|
||||
</transformation>
|
||||
</transformations>
|
||||
</layer>
|
||||
|
||||
<layer>
|
||||
<name>frame</name>
|
||||
<w>256</w>
|
||||
<h>256</h>
|
||||
<texture>
|
||||
<path>Aircraft/Instruments/Textures/radar_frame.rgb</path>
|
||||
<x1>0</x1>
|
||||
<y1>0</y1>
|
||||
<x2>1</x2>
|
||||
<y2>1</y2>
|
||||
</texture>
|
||||
</layer>
|
||||
|
||||
<layer>
|
||||
<name>range knob</name>
|
||||
<condition>
|
||||
<equals>
|
||||
<property>instrumentation/radar/range</property>
|
||||
<value>20</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<w>22</w>
|
||||
<h>22</h>
|
||||
<texture>
|
||||
<path>Aircraft/Instruments/Textures/radar_misc.rgb</path>
|
||||
<x1>0.0273437</x1>
|
||||
<y1>0.9101562</y1>
|
||||
<x2>0.0898437</x2>
|
||||
<y2>0.9765662</y2>
|
||||
</texture>
|
||||
<transformations>
|
||||
<transformation>
|
||||
<type>x-shift</type>
|
||||
<offset>-108</offset>
|
||||
</transformation>
|
||||
<transformation>
|
||||
<type>y-shift</type>
|
||||
<offset>-112</offset>
|
||||
</transformation>
|
||||
<transformation>
|
||||
<type>rotation</type>
|
||||
<offset>-45</offset>
|
||||
</transformation>
|
||||
</transformations>
|
||||
</layer>
|
||||
|
||||
<layer>
|
||||
<name>range knob</name>
|
||||
<condition>
|
||||
<equals>
|
||||
<property>instrumentation/radar/range</property>
|
||||
<value>40</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<w>22</w>
|
||||
<h>22</h>
|
||||
<texture>
|
||||
<path>Aircraft/Instruments/Textures/radar_misc.rgb</path>
|
||||
<x1>0.0273437</x1>
|
||||
<y1>0.9101562</y1>
|
||||
<x2>0.0898437</x2>
|
||||
<y2>0.9765662</y2>
|
||||
</texture>
|
||||
<transformations>
|
||||
<transformation>
|
||||
<type>x-shift</type>
|
||||
<offset>-108</offset>
|
||||
</transformation>
|
||||
<transformation>
|
||||
<type>y-shift</type>
|
||||
<offset>-112</offset>
|
||||
</transformation>
|
||||
<transformation>
|
||||
<type>rotation</type>
|
||||
<offset>40</offset>
|
||||
</transformation>
|
||||
</transformations>
|
||||
</layer>
|
||||
|
||||
<layer>
|
||||
<name>altitude</name>
|
||||
<type>text</type>
|
||||
<font>led</font>
|
||||
<point-size>6</point-size>
|
||||
<color>
|
||||
<red>0.96</red>
|
||||
<green>1.0</green>
|
||||
<blue>0.96</blue>
|
||||
</color>
|
||||
<chunks>
|
||||
<chunk>
|
||||
<type>number-value</type>
|
||||
<property>ai/models/aircraft[1]/position/altitude-ft</property>
|
||||
<scale>0.001</scale>
|
||||
<format>%2.1f</format>
|
||||
</chunk>
|
||||
</chunks>
|
||||
<transformations>
|
||||
<transformation>
|
||||
<type>x-shift</type>
|
||||
<offset>85</offset>
|
||||
</transformation>
|
||||
<transformation>
|
||||
<type>y-shift</type>
|
||||
<offset>-121</offset>
|
||||
</transformation>
|
||||
</transformations>
|
||||
</layer>
|
||||
|
||||
<layer>
|
||||
<name>outer range ring</name>
|
||||
<type>text</type>
|
||||
<font>led</font>
|
||||
<point-size>6</point-size>
|
||||
<color>
|
||||
<red>0.96</red>
|
||||
<green>1.0</green>
|
||||
<blue>0.96</blue>
|
||||
</color>
|
||||
<chunks>
|
||||
<chunk>
|
||||
<type>number-value</type>
|
||||
<property>instrumentation/radar/range</property>
|
||||
<format>%2.0f</format>
|
||||
</chunk>
|
||||
</chunks>
|
||||
<transformations>
|
||||
<transformation>
|
||||
<type>x-shift</type>
|
||||
<offset>-90</offset>
|
||||
</transformation>
|
||||
<transformation>
|
||||
<type>y-shift</type>
|
||||
<offset>66</offset>
|
||||
</transformation>
|
||||
</transformations>
|
||||
</layer>
|
||||
|
||||
<layer>
|
||||
<name>inner range ring</name>
|
||||
<type>text</type>
|
||||
<font>led</font>
|
||||
<point-size>6</point-size>
|
||||
<color>
|
||||
<red>0.96</red>
|
||||
<green>1.0</green>
|
||||
<blue>0.96</blue>
|
||||
</color>
|
||||
<chunks>
|
||||
<chunk>
|
||||
<type>number-value</type>
|
||||
<property>instrumentation/radar/range</property>
|
||||
<scale>0.5</scale>
|
||||
<format>%2.0f</format>
|
||||
</chunk>
|
||||
</chunks>
|
||||
<transformations>
|
||||
<transformation>
|
||||
<type>x-shift</type>
|
||||
<offset>-50</offset>
|
||||
</transformation>
|
||||
<transformation>
|
||||
<type>y-shift</type>
|
||||
<offset>32</offset>
|
||||
</transformation>
|
||||
</transformations>
|
||||
</layer>
|
||||
|
||||
|
||||
</layers>
|
||||
</PropertyList>
|
Loading…
Add table
Reference in a new issue