Jump to content
Sign in to follow this  
Guest ridgell

trig and geocalc question

Recommended Posts

Did the same again , appeared in the codebox window with element,select ,value etcbut not in thread after I hit OK button ?Karol
The command is {code} not {codebox} (replace curly braces with square brackets)...Alternatively, simply highlight all your script and click the last icon on the toolbar of this editor...

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Geocalc test instrument .Karol

<Gauge Name="GeoTEST" Version="1.0"><Image Name="zDATA_SCRN.bmp"/><Update Hidden="No"/> <Macro Name="c">C:fs9gps</Macro><Macro Name="g">C:fs9gps</Macro>   <Element> <Element>	<Select>	  <Value>	30.00(>@c:GeoCalcLatitude1, degrees)	  -50.00(>@c:GeoCalcLongitude1, degrees)		   0(>@c:GeoCalcAzimuth1, degrees)		  20(>@c:GeoCalcLength, NMiles)			(@c:GeoCalcExtrapolationLatitude, degrees)(>L:Lat1,degrees)			(@c:GeoCalcExtrapolationLongitude, degrees)(>L:Lon1,degrees)	  </Value> 	 </Select>	</Element>  <Element>	  <Position X="9" Y="8" />   <FormattedText X="80" Y="130" Font="Tahoma" FontSize="13" LineSpacing="16" Adjust="Left" Color="#349F34" Bright="Yes">	  <String>	   %Lat1%((L:Lat1,degrees))%!3.4f!\n	%Lon1%((L:Lon1,degrees))%!3.4f!	  </String>	  </FormattedText>	</Element> </Element></Gauge>

Share this post


Link to post
Share on other sites

The above instrument is returning only zeros.Any ideas or comments .Karol

Share this post


Link to post
Share on other sites

I conducted a test by removing the Geocalc code contained in the select /element section.The returns were again or still zeros .It would appear that the Geocalc is not being initialized , but why ?Karol

Share this post


Link to post
Share on other sites

No responses ?Has anyone tried to get Geocalc to work in a simple instrument ora test instrument ?Karol

Share this post


Link to post
Share on other sites

Hi,It certainly does!But your code seems to be a bit wrong.There must be a space between the number and command.Also you can put the code in the string when you use FormattedText, less code!So, try:

<String>%( 30.00  (>@c:GeoCalcLatitude1, degrees) -50.00  (>@c:GeoCalcLongitude1, degrees) 0  (>@c:GeoCalcAzimuth1, degrees) 20  (>@c:GeoCalcLength, NMiles) (@c:GeoCalcExtrapolationLatitude, degrees)  (>L:Lat1,degrees) (@c:GeoCalcExtrapolationLongitude, degrees)  (>L:Lon1,degrees)  ) %Lat1:  %((L:Lat1,degrees))%!3.4f!\n%Lon1:  %((L:Lon1,degrees))%!3.4f!</String>

Added 2 spaces, but one is enough.Hope it helps,Jan

Share this post


Link to post
Share on other sites

Thank you Jan , will try in 'String' .I got the following to work

<Gauge Name="GeoTest" Version="1.0"><Image Name="zDATA_SCRN.bmp"/> <Update Frequency="18" /> <Macro Name="c">C:fs9gps</Macro><Macro Name="g">C:fs9gps</Macro>   <Element> <Element>-	<Select>	  <Value>(A:PLANE LATITUDE, degrees) (>@c:GeoCalcLatitude1,degrees) (A:PLANE LONGITUDE, degrees) (>@c:GeoCalcLongitude1,degrees) 0 (>@c:GeoCalcAzimuth1,degrees) 20 (>@c:GeoCalcLength,nmiles) (@c:GeoCalcExtrapolationLatitude,degrees) (>L:Lat1,degrees) (@c:GeoCalcExtrapolationLongitude,degrees) (>L:Lon1,degrees)    </Value> 	 </Select>	</Element>  <Element>	  <Position X="9" Y="8" />   <FormattedText X="140" Y="130" Font="Tahoma" FontSize="13" LineSpacing="16" Adjust="Left" Color="#349F34" Bright="Yes">	  <String>	   %Lat1%((L:Lat1,degrees) d 0 >= s0 r abs d 3600 * 60 % r d 60 * 60 % flr r flr 'N' 'S' l0 ? )%!s!%!02.0f!% %!02.0f!%' %!02.0f!"%\n	%Lon1%((L:Lon1,degrees) d 0 >= s0 r abs d 3600 * 60 % r d 60 * 60 % flr r flr 'E' 'W' l0 ? )%!s!%!03.0f!% %!02.0f!%' %!02.0f!%"%	  </String>	  </FormattedText>	</Element> </Element> </Gauge>

basically it returns Lat/Long 20 NM ahead .CheersKarol

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...