September 9, 201213 yr Is it possible to use a non-linearity table with the MAKE_MOVING macro like you can with the MAKE_NEEDLE macro. I have a non-linear airspeed strip that moves on the x-plane using a mask. Thanks, Chris
September 10, 201213 yr Commercial Member In short - no. You'll need to calculate distance moved based on airspeed e.g. 60-120 knots moves the tape by X pixels, 120-180knots moves the tape by Y pixels, over 180knots moves the tape by Z pixels. Effectively it's a non-linearity table in code! -Dai
September 11, 201213 yr Author Thanks Dai So using your example would I have to use two different make moving for each range of speeds that have different linearity maybe using a if else logic? Or would I have to code it some other way? Sorry I am very new at this. Mostly did xml, just trying c code now. Appreciate all your help Chris
September 13, 201213 yr Moderator ** DELETED BY AUTHOR AS UTTERLY USELESS CODE EXAMPLE ** Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
September 13, 201213 yr Commercial Member Sorry Chris - RL isn't leaving me much time to visit any forums ATM. The code block below is for a flap indicator which moves the tape different distances depending on flap angle selected. The theory is exactly the same as an ASI-driven tape. Note the one VERY large gotcha - as you move across 'boundaries' you have to first subtract the previous boundary, then calculate the current position, then finally add that to ALL previous boundaries. if(leftflap_pos<1986) { left_curr_pos=leftflap_pos*0.0135; } else if(leftflap_pos<4965) { // Subtract the previous boundary left_curr_flaps=leftflap_pos-1985; // Calculate the current position left_curr_flaps*=0.0095; // Add current to previous left_curr_pos=left_curr_flaps+(1985*0.0135); } else if(leftflap_pos<8937) { // Subract the previous boundary left_curr_flaps=leftflap_pos-4964; // Calculate the current one left_curr_flaps*=0.0065; // Add current to all previous left_curr_pos=left_curr_flaps+(1985*0.0135)+(2979*0.0095); } else if(leftflap_pos<10923) { // etc. left_curr_flaps=leftflap_pos-8936; left_curr_flaps*=0.006; left_curr_pos=left_curr_flaps+(1985*0.0135)+(2979*0.0095)+(3973*0.0065); } else if(leftflap_pos<16385) { left_curr_flaps=leftflap_pos-10922; left_curr_flaps*=0.0047; left_curr_pos=left_curr_flaps+(1985*0.0135)+(2979*0.0095)+(3973*0.0065)+(1986*0.006); }
September 14, 201213 yr Author Thanks again Dai, The big gotcha is what I have been trying to figure out. I will look at your code and try to figure it out and post an update. Thanks a lot for your help. Chris
September 14, 201213 yr Author Dai, That was it. Appreciate all you help. Those non-linearity tables are a lot easier in xml! But were is the challenge in that!!!
September 14, 201213 yr Commercial Member Good news :smile: I was actually trying to post an edit with a bit more explanation when the broadband went phut! just as I hit save.... :Cry: So here it is anyway - it may help someone else. if(leftflap_pos<1986) // 1986 = 4 degrees { left_curr_pos=leftflap_pos*0.0135; } else if(leftflap_pos<4965) // 4965 = 10 degrees { // Subtract the previous boundary area left_curr_flaps=leftflap_pos-1985; // Calculate the current position - trial and error to figure out the tape movement for six degrees (from 4 to 10) left_curr_flaps*=0.0095; // Add current to previous left_curr_pos=left_curr_flaps+(1985*0.0135); } else if(leftflap_pos<8937) // 18 degrees { // Subract the previous boundary left_curr_flaps=leftflap_pos-4964; // Calculate the current position - trial and error to figure out the tape movement for the eight degrees (from 10 to 18) left_curr_flaps*=0.0065; // Add current to all previous left_curr_pos=left_curr_flaps+(1985*0.0135)+(2979*0.0095); } else if(leftflap_pos<10923) { // etc. left_curr_flaps=leftflap_pos-8936; left_curr_flaps*=0.006; left_curr_pos=left_curr_flaps+(1985*0.0135)+(2979*0.0095)+(3973*0.0065); } else if(leftflap_pos<16385) { left_curr_flaps=leftflap_pos-10922; left_curr_flaps*=0.0047; left_curr_pos=left_curr_flaps+(1985*0.0135)+(2979*0.0095)+(3973*0.0065)+(1986*0.006); }
September 14, 201213 yr Author yea my tape range was 0-60 for one range and 61-450 for the other. I still ended up breaking the tape down to 0-60, 61-200, 201-300, 301-450 just to get better accuracy. When I left it at 61-450 I lost some accuracy at the end of the range. Chris
Create an account or sign in to comment