1
0
Fork 0

Added initialization and user dialog for improved weather system.

This commit is contained in:
david 2003-06-08 14:44:53 +00:00
parent dd18220d95
commit a48332cfdf
3 changed files with 900 additions and 79 deletions

840
gui/dialogs/weather.xml Normal file
View file

@ -0,0 +1,840 @@
<?xml version="1.0"?>
<PropertyList>
<!-- Control the weather -->
<name>weather</name>
<width>800</width>
<height>570</height>
<modal>false</modal>
<text>
<x>10</x>
<y>540</y>
<label>Weather Conditions</label>
</text>
<text>
<x>10</x>
<y>480</y>
<label>Aloft</label>
</text>
<!-- Header Row -->
<group>
<x>0</x>
<y>450</y>
<text>
<x>10</x>
<y>0</y>
<label>Layer</label>
</text>
<text>
<x>75</x>
<y>0</y>
<label>Elev (ft)</label>
</text>
<text>
<x>160</x>
<y>0</y>
<label>Wind Dir</label>
</text>
<text>
<x>240</x>
<y>0</y>
<label>Wind Spd</label>
</text>
<text>
<x>330</x>
<y>0</y>
<label>Turb</label>
</text>
<text>
<x>400</x>
<y>0</y>
<label>Vis (m)</label>
</text>
<text>
<x>490</x>
<y>0</y>
<label>Temp (C)</label>
</text>
<text>
<x>580</x>
<y>0</y>
<label>Dewpt (C)</label>
</text>
<text>
<x>670</x>
<y>0</y>
<label>Alt (inHg)</label>
</text>
</group>
<!-- Data Rows -->
<group>
<x>0</x>
<y>420</y>
<text>
<x>10</x>
<y>0</y>
<label>5</label>
</text>
<input>
<x>75</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[4]/elevation-ft</property>
</input>
<input>
<x>160</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[4]/wind-from-heading-deg</property>
</input>
<input>
<x>245</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[4]/wind-speed-kt</property>
</input>
<slider>
<x>330</x>
<y>0</y>
<width>75</width>
<height>25</height>
<property>/environment/config/aloft/entry[4]/turbulence-norm</property>
</slider>
<input>
<x>410</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[4]/visibility-m</property>
</input>
<input>
<x>495</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[4]/temperature-degc</property>
</input>
<input>
<x>580</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[4]/dewpoint-degC</property>
</input>
<input>
<x>665</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[4]/pressure-sea-level-inhg</property>
</input>
</group>
<group>
<x>0</x>
<y>390</y>
<text>
<x>10</x>
<y>0</y>
<label>4</label>
</text>
<input>
<x>75</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[3]/elevation-ft</property>
</input>
<input>
<x>160</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[3]/wind-from-heading-deg</property>
</input>
<input>
<x>245</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[3]/wind-speed-kt</property>
</input>
<slider>
<x>330</x>
<y>0</y>
<width>75</width>
<height>25</height>
<property>/environment/config/aloft/entry[3]/turbulence-norm</property>
</slider>
<input>
<x>410</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[3]/visibility-m</property>
</input>
<input>
<x>495</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[3]/temperature-degc</property>
</input>
<input>
<x>580</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[3]/dewpoint-degC</property>
</input>
<input>
<x>665</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[3]/pressure-sea-level-inhg</property>
</input>
</group>
<group>
<x>0</x>
<y>360</y>
<text>
<x>10</x>
<y>0</y>
<label>3</label>
</text>
<input>
<x>75</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[2]/elevation-ft</property>
</input>
<input>
<x>160</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[2]/wind-from-heading-deg</property>
</input>
<input>
<x>245</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[2]/wind-speed-kt</property>
</input>
<slider>
<x>330</x>
<y>0</y>
<width>75</width>
<height>25</height>
<property>/environment/config/aloft/entry[2]/turbulence-norm</property>
</slider>
<input>
<x>410</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[2]/visibility-m</property>
</input>
<input>
<x>495</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[2]/temperature-degc</property>
</input>
<input>
<x>580</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[2]/dewpoint-degC</property>
</input>
<input>
<x>665</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[2]/pressure-sea-level-inhg</property>
</input>
</group>
<group>
<x>0</x>
<y>330</y>
<text>
<x>10</x>
<y>0</y>
<label>2</label>
</text>
<input>
<x>75</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[1]/elevation-ft</property>
</input>
<input>
<x>160</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[1]/wind-from-heading-deg</property>
</input>
<input>
<x>245</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[1]/wind-speed-kt</property>
</input>
<slider>
<x>330</x>
<y>0</y>
<width>75</width>
<height>25</height>
<property>/environment/config/aloft/entry[1]/turbulence-norm</property>
</slider>
<input>
<x>410</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[1]/visibility-m</property>
</input>
<input>
<x>495</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[1]/temperature-degc</property>
</input>
<input>
<x>580</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[1]/dewpoint-degC</property>
</input>
<input>
<x>665</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[1]/pressure-sea-level-inhg</property>
</input>
</group>
<group>
<x>0</x>
<y>300</y>
<text>
<x>10</x>
<y>0</y>
<label>1</label>
</text>
<input>
<x>75</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[0]/elevation-ft</property>
</input>
<input>
<x>160</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[0]/wind-from-heading-deg</property>
</input>
<input>
<x>245</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[0]/wind-speed-kt</property>
</input>
<slider>
<x>330</x>
<y>0</y>
<width>75</width>
<height>25</height>
<property>/environment/config/aloft/entry[0]/turbulence-norm</property>
</slider>
<input>
<x>410</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[0]/visibility-m</property>
</input>
<input>
<x>495</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[0]/temperature-degc</property>
</input>
<input>
<x>580</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[0]/dewpoint-degC</property>
</input>
<input>
<x>665</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/aloft/entry[0]/pressure-sea-level-inhg</property>
</input>
</group>
<text>
<x>10</x>
<y>240</y>
<label>Boundary Layer</label>
</text>
<!-- Header Row -->
<group>
<x>0</x>
<y>210</y>
<text>
<x>10</x>
<y>0</y>
<label>Layer</label>
</text>
<text>
<x>75</x>
<y>0</y>
<label>Elev (ft)</label>
</text>
<text>
<x>160</x>
<y>0</y>
<label>Wind Dir</label>
</text>
<text>
<x>240</x>
<y>0</y>
<label>Wind Spd</label>
</text>
<text>
<x>330</x>
<y>0</y>
<label>Turb</label>
</text>
<text>
<x>400</x>
<y>0</y>
<label>Vis (m)</label>
</text>
<text>
<x>490</x>
<y>0</y>
<label>Temp (C)</label>
</text>
<text>
<x>580</x>
<y>0</y>
<label>Dewpt (C)</label>
</text>
<text>
<x>670</x>
<y>0</y>
<label>Alt (inHg)</label>
</text>
</group>
<group>
<x>0</x>
<y>180</y>
<text>
<x>10</x>
<y>0</y>
<label>3</label>
</text>
<input>
<x>75</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/boundary/entry[2]/elevation-ft</property>
</input>
<input>
<x>160</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/boundary/entry[2]/wind-from-heading-deg</property>
</input>
<input>
<x>245</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/boundary/entry[2]/wind-speed-kt</property>
</input>
<slider>
<x>330</x>
<y>0</y>
<width>75</width>
<height>25</height>
<property>/environment/config/boundary/entry[2]/turbulence-norm</property>
</slider>
<input>
<x>410</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/boundary/entry[2]/visibility-m</property>
</input>
<input>
<x>495</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/boundary/entry[2]/temperature-degc</property>
</input>
<input>
<x>580</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/boundary/entry[2]/dewpoint-degC</property>
</input>
<input>
<x>665</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/boundary/entry[2]/pressure-sea-level-inhg</property>
</input>
</group>
<group>
<x>0</x>
<y>150</y>
<text>
<x>10</x>
<y>0</y>
<label>2</label>
</text>
<input>
<x>75</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/boundary/entry[1]/elevation-ft</property>
</input>
<input>
<x>160</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/boundary/entry[1]/wind-from-heading-deg</property>
</input>
<input>
<x>245</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/boundary/entry[1]/wind-speed-kt</property>
</input>
<slider>
<x>330</x>
<y>0</y>
<width>75</width>
<height>25</height>
<property>/environment/config/boundary/entry[1]/turbulence-norm</property>
</slider>
<input>
<x>410</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/boundary/entry[1]/visibility-m</property>
</input>
<input>
<x>495</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/boundary/entry[1]/temperature-degc</property>
</input>
<input>
<x>580</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/boundary/entry[1]/dewpoint-degC</property>
</input>
<input>
<x>665</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/boundary/entry[1]/pressure-sea-level-inhg</property>
</input>
</group>
<group>
<x>0</x>
<y>120</y>
<text>
<x>10</x>
<y>0</y>
<label>1</label>
</text>
<input>
<x>75</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/boundary/entry[0]/elevation-ft</property>
</input>
<input>
<x>160</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/boundary/entry[0]/wind-from-heading-deg</property>
</input>
<input>
<x>245</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/boundary/entry[0]/wind-speed-kt</property>
</input>
<slider>
<x>330</x>
<y>0</y>
<width>75</width>
<height>25</height>
<property>/environment/config/boundary/entry[0]/turbulence-norm</property>
</slider>
<input>
<x>410</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/boundary/entry[0]/visibility-m</property>
</input>
<input>
<x>495</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/boundary/entry[0]/temperature-degc</property>
</input>
<input>
<x>580</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/boundary/entry[0]/dewpoint-degC</property>
</input>
<input>
<x>665</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/boundary/entry[0]/pressure-sea-level-inhg</property>
</input>
</group>
<group>
<x>0</x>
<y>60</y>
<text>
<x>10</x>
<y>0</y>
<label>Boundary transition depth</label>
</text>
<input>
<x>250</x>
<y>0</y>
<width>80</width>
<height>25</height>
<property>/environment/config/boundary-transition-ft</property>
</input>
</group>
<!-- Button Box -->
<group>
<x>105</x>
<y>10</y>
<button>
<x>0</x>
<y>0</y>
<legend>OK</legend>
<binding>
<command>dialog-apply</command>
</binding>
<binding>
<command>reinit</command>
<subsystem>environment</subsystem>
</binding>
<binding>
<command>dialog-close</command>
</binding>
<default>true</default>
</button>
<button>
<x>100</x>
<y>0</y>
<legend>Apply</legend>
<binding>
<command>dialog-apply</command>
</binding>
<binding>
<command>reinit</command>
<subsystem>environment</subsystem>
</binding>
</button>
<button>
<x>200</x>
<y>0</y>
<legend>Reset</legend>
<binding>
<command>dialog-update</command>
</binding>
</button>
<button>
<x>300</x>
<y>0</y>
<legend>Cancel</legend>
<binding>
<command>dialog-close</command>
</binding>
</button>
</group>
</PropertyList>

View file

@ -199,10 +199,10 @@
<label>Weather</label>
<item>
<label>Air</label>
<label>Weather Conditions</label>
<binding>
<command>dialog-show</command>
<dialog-name>air</dialog-name>
<dialog-name>weather</dialog-name>
</binding>
</item>
@ -214,75 +214,6 @@
</binding>
</item>
<item>
<label>Winds</label>
<binding>
<command>dialog-show</command>
<dialog-name>winds</dialog-name>
</binding>
</item>
<item>
<label>Random Weather</label>
<!-- visibility from 20m to 20km -->
<binding>
<command>property-randomize</command>
<property>/environment/visibility-m</property>
<min>20</min>
<max>20000</max>
</binding>
<!-- sea-level temperature from -40degC to +40degC -->
<binding>
<command>property-randomize</command>
<property>/environment/temperature-sea-level-degc</property>
<min>-40</min>
<max>40</max>
</binding>
<!-- dew point from -40degC to +40degC (will adjust to temperature) -->
<binding>
<command>property-randomize</command>
<property>/environment/dewpoint-sea-level-degc</property>
<min>-40</min>
<max>40</max>
</binding>
<!-- altimeter from 27.92inHG to 31.92inHG -->
<binding>
<command>property-randomize</command>
<property>/environment/pressure-sea-level-inhg</property>
<min>27.92</min>
<max>31.92</max>
</binding>
<!-- any wind direction -->
<binding>
<command>property-randomize</command>
<property>/environment/wind-from-heading-deg</property>
<min>0</min>
<max>360</max>
</binding>
<!-- wind speed from 0 to 40kt -->
<binding>
<command>property-randomize</command>
<property>/environment/params/base-wind-speed-kt</property>
<min>0</min>
<max>40</max>
</binding>
<!-- leave out gusts for now -->
<!-- not more than moderate turbulence -->
<binding>
<command>property-randomize</command>
<property>/environment/turbulence-norm</property>
<min>0.0</min>
<max>0.5</max>
</binding>
<!-- bottom cloud layer 0 to 15000 ft -->
<binding>
<command>property-randomize</command>
<property>/environment/clouds/layer[0]/elevation-ft</property>
<min>0</min>
<max>15000</max>
</binding>
</item>
</menu>
<menu>

View file

@ -247,12 +247,62 @@ Started September 2000 by David Megginson, david@megginson.com
<!-- Environment -->
<environment>
<visibility-m type="double">16000</visibility-m>
<temperature-sea-level-degc type="double">15</temperature-sea-level-degc>
<dewpoint-sea-level-degc type="double">5</dewpoint-sea-level-degc>
<pressure-sea-level-inhg type="double">29.92</pressure-sea-level-inhg>
<wind-from-heading-deg type="double">270</wind-from-heading-deg>
<turbulence-norm type="double">0.0</turbulence-norm>
<config>
<boundary-transition-ft>500</boundary-transition-ft>
<boundary>
<entry>
<elevation-ft>0</elevation-ft>
<wind-from-heading-deg>270</wind-from-heading-deg>
<wind-speed-kt>3</wind-speed-kt>
<turbulence-norm>0.0</turbulence-norm>
<visibility-m>16000</visibility-m>
<pressure-sea-level-inhg>29.92</pressure-sea-level-inhg>
<temperature-sea-level-degc>15.0</temperature-sea-level-degc>
<dewpoint-sea-level-degc>5.0</dewpoint-sea-level-degc>
</entry>
<entry>
<elevation-ft>500</elevation-ft>
<wind-from-heading-deg>280</wind-from-heading-deg>
<wind-speed-kt>6</wind-speed-kt>
<turbulence-norm>0.1</turbulence-norm>
</entry>
</boundary>
<aloft>
<entry>
<elevation-ft>3000</elevation-ft>
<wind-from-heading-deg>300</wind-from-heading-deg>
<wind-speed-kt>10</wind-speed-kt>
<turbulence-norm>0.05</turbulence-norm>
<visibility-m>16000</visibility-m>
<pressure-sea-level-inhg>29.92</pressure-sea-level-inhg>
<temperature-sea-level-degc>15.0</temperature-sea-level-degc>
<dewpoint-sea-level-degc>5.0</dewpoint-sea-level-degc>
</entry>
<entry>
<elevation-ft>6000</elevation-ft>
<wind-from-heading-deg>310</wind-from-heading-deg>
<wind-speed-kt>20</wind-speed-kt>
<turbulence-norm>0.00</turbulence-norm>
</entry>
<entry>
<elevation-ft>9000</elevation-ft>
<wind-from-heading-deg>320</wind-from-heading-deg>
<wind-speed-kt>30</wind-speed-kt>
</entry>
</aloft>
</config>
<clouds>
<status>true</status>
<layer n="0">
@ -282,11 +332,11 @@ Started September 2000 by David Megginson, david@megginson.com
<span-m>40000</span-m>
</layer>
</clouds>
<params>
<control-fdm-atmosphere type="bool">false</control-fdm-atmosphere>
<base-wind-speed-kt type="double">0</base-wind-speed-kt>
<gust-wind-speed-kt type="double">0</gust-wind-speed-kt>
</params>
</environment>
<controls>