September 5, 200916 yr Commercial Member I hope the final answer to this is not going to be too embarrassing...In Slew mode, Lat/Lon is showing as N47 25 91 / W122 18 48If I use PLANE_LATITUDE and PLANE_LONGITUDE and run them through the conversions in fsgauges_sp2.h I get N 47 43 17 / W-122 30 79.The conversions in my modified gauges.h file are #define FS_LATITUDE_DEG(val) ((val)/FS_LAT_FACTOR) //where FS_LAT_FACTOR = 111130.555557#define FS_LONGITUDE_DEG(val) ((val)>140737488355332)?(val)/FS_LON_FACTOR-360.0:(val)/FS_LON_FACTOR //where FS_LON_FACTOR = 781874935307.40 My display code for two strings is: lookup_var(&currlat);sprintf(pelement->string, "%12s%4.6f"," Latitude = ",FS_LATITUDE_DEG(currlat.var_value.n));lookup_var(&currlon);sprintf(pelement->string, "%13s%4.6f"," Longitude = ",FS_LONGITUDE_DEG(currlon.var_value.n)); I haven't been putting out misleading information all these years, have I?-Dai
September 5, 200916 yr Dai, Just a shot in the dark.. Believe the result you're getting is Decimal Degrees, where the output from FS is Degrees/Decimal Minutes with a ceiling on the remainder minutes. DD.DDDD yoursDD mm.mm Fs slew display47 43 17(47) 47.4317 - 47 = .4317.4317 * 60 = 25.902 (25)25.902 - 25 = .902 .902 * 100 = 90.2 ceil = (91)47 25.91122 30 79(122)122.3079 - 122 = .3079 .3079 * 60 = 18.474 (18)18.474 -18 = .474 .474 * 100 = 47.4 ceil = (48)122 18.48Just how the output is formatted, dats all :-) Better off doing calculations with your "raw" output. Here are some conversions, courtesy of Arne.. Sorry XML. <String>%((A:PLANE LATITUDE, 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!"</String><String>%((A:PLANE LONGITUDE, 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><String>%((A:PLANE LATITUDE, degrees) d 0 >= )%{if}%N%{else}%S%{end}%( abs d flr )%!02d!°%( 1 % 60 * d flr )%!02d!'%( 1 % 60 * )%!02.0f"</String><String>%((A:PLANE LONGITUDE, degrees) d 0 >= )%{if}%E%{else}%W%{end}%( abs d flr )%!03d!°%( 1 % 60 * d flr )%!02d!'%( 1 % 60 * )%!02.0f"</String> Roman FS RTWR SHRS F-111 JoinFS Little Navmap
September 6, 200916 yr Author Commercial Member Many thanks Roman. As I've admitted before, maths is not a strong point and I'm not proud of the fact.-Dai
September 6, 200916 yr Author Commercial Member Just FYI: this was my final conversion code. //Convert the incoming FS data to decimalDecToMin(FS_xxxxITUDE_DEG(<data>.var_value.n));// Convert latlon degrees decimal to degrees and minutesint geodeg=0,geomin=0,geosec=0;void DecToMin(double degData){ double dblMin=0; geodeg=(int)degData; dblMin=degData-geodeg; dblMin=fabs(dblMin*60); geomin=(int)dblMin; geosec=(int)ceil((dblMin-geomin)*100); return;} -Dai
Create an account or sign in to comment