Sign in to follow this  
Guest bartels

Problems with VOR2_TF_FLAG

Recommended Posts

I am unable to obtain any value for the two token variables, VOR1_TF_FLAG and VOR2_TF_FLAG...I do get good values from HSI_TF_FLAG, so at least I know I'm not totally batty... :)I'm also a bit confused by this entry in the FS2002gauges.h file:// vor1_tf_flag and vor2_tf_flag#define VOR_TF_FLAG_OFF 0#define VOR_TF_FLAG_TO 1#define VOR_TF_FLAG_FROM 2and later on:VOR1_TF_FLAG,VOR2_TF_FLAG,I assume that I should use either of the two VORx_TF_FLAG tokens just as I would the HSI_TF_FLAG token, but it doesn't seem to work... FLOAT64 FSAPI callback10( PELEMENT_STRING pelement){float rwert=pelement->source_var[0].var_value.n;rwert = HSI_TF_FLAGvar.var_value.n ; sprintf(pelement->string,"%.0f",rwert);return 0;}FLOAT64 FSAPI callback9( PELEMENT_STRING pelement){float rwert=pelement->source_var[0].var_value.n;rwert = VOR1_TF_FLAGvar.var_value.n ; sprintf(pelement->string,"%.0f",rwert);return 0;}FLOAT64 FSAPI callback8( PELEMENT_STRING pelement){float rwert=pelement->source_var[0].var_value.n;rwert = VOR2_TF_FLAGvar.var_value.n ; sprintf(pelement->string,"%.0f",rwert);return 0;}The first statement using HSI_TF_FLAG returns the expected -1, 0 or 1...The other two statements return only a big, fat 0Can anyone shed some light on this for me???BillAVSIM OmbudsmanFounder and Director,Creative Recycling of Aircraft Partshttp://catholic-hymns.com/frbill/FS2002/images/fartslogo.jpg

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Try the .d member of ...var_valuethe TF_FLAGS (like most vor extra data) are some of the cases where you need .d instead of .nFLOAT64 FSAPI callback9( PELEMENT_STRING pelement){ float rwert=pelement->source_var[0].var_value.n; sprintf(pelement->string,"%d",VOR1_TF_FLAGvar.var_value.d); return rwert;}Arne Bartels

Share this post


Link to post
Share on other sites

>Try the .d member of ...var_value>the TF_FLAGS (like most vor extra data) are some of the cases>where you need .d instead of .n>>FLOAT64 FSAPI callback9( PELEMENT_STRING pelement)>{> float rwert=pelement->source_var[0].var_value.n;> sprintf(pelement->string,"%d",VOR1_TF_FLAGvar.var_value.d);> return rwert;>}Thanks, Arne! That works perfectly! Now if I could just figure out how to specify .d instead of .n in EasyGauge, I'd have it made.Fortunately, it's a trivial matter to modify the .c file and recompile, but it would be a lot more convenient if it were done right to begin with... :)FLOAT64 FSAPI callback7( PELEMENT_SLIDER pelement){FLOAT64 rwertX=pelement->source_var_x.var_value.n;FLOAT64 rwertY=pelement->source_var_y.var_value.n;if ( VOR2_TF_FLAGvar.var_value.d == 2 ) { SHOW_IMAGE(pelement) ; } else { HIDE_IMAGE(pelement) ; } return rwertX;}FLOAT64 FSAPI callbackS7( PELEMENT_SLIDER pelement){FLOAT64 rwertY=pelement->source_var_y.var_value.n;FLOAT64 rwertX=pelement->source_var_x.var_value.n;if ( VOR2_TF_FLAGvar.var_value.d == 2 ) { SHOW_IMAGE(pelement) ; } else { HIDE_IMAGE(pelement) ; } return rwertY;}BillAVSIM OmbudsmanFounder and Director,Creative Recycling of Aircraft Partshttp://catholic-hymns.com/frbill/FS2002/images/fartslogo.jpg

Share this post


Link to post
Share on other sites

Hi Bill,actually to fully comply with the gauge.h and the panel SDK, it is an enum so best to use .e MVOR1NEEDLE = MMVOR1_NEEDLE.var_value.n; MVOR1GSNEEDLE = MMVOR1_GS_NEEDLE.var_value.n; MVOR1BCFLAGS = MMVOR1_BACK_COURSE_FLAGS.var_value.f; MVOR1TFFLAG = MMVOR1_TF_FLAG.var_value.e; MVOR1GSFLAG = MMVOR1_GS_FLAG.var_value.n; MVOR1CODE = MMVOR1_CODE.var_value.f; MVOR1ID = MMVOR1_IDENTITY.var_value.p;There are the ones I use and it works fine.To better know if this is a p, a e, a n... just look at the tokenvar.doc in the SDK, it tells you the variable type in the second column.Best,

Share this post


Link to post
Share on other sites

Unfortunately tokenvar.doc isn't too reliable in that respect. It is correct for most NAV/COM/ADF variables, but later it describes more the type of information and not the type of variable.E.g. MASTER_BATTERY is referenced as:MASTER_BATTERY B TRUE=on.but the information isn't in the ..var_value.b member, it is var_value.n that takes the boolean values 1.0 or 0.0.This inconsistency is prominent in all SDKs so far. So your are more or less out to try it out. As a general guideline you find almost only .n type variables for "newer" (in the history of FS) variables, except where it is impossible to use .n vars e.g. strings (...var_value.p). The border between "new" and "old" is somewhere near CURRENT_DME (this is FS98 to CFSI/FS2002).Or try first the member after tokenvar.doc, but if it doesn't work try to use ...var_value.n next.Arne Bartels

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