And, as always, posting the code you are having trouble with is much
more useful than simply announcing that different versions start
infinite loops. :)

Andy

i wrote different functions here is few examples. by the way i am writing these to the larcsim c172aero also added time.h under msvc7.1.

i am tryng to add a delay in seconds before activation/ deactivation of cockpit functions. my aim is to declare specific drag according to time within component cycle time. i am trying to add an example decleration for that purpose....but function goes toooooooooo..........infinite!!! or totaly frezes sim .

my first try
// travel time speedbrake drag coeff=1 after travel comp drag=1 // itt logic checker to break loop

if( Speedbrk) { if (itt==0)
        start_time = clock();
while((clock() - start_time) < 3 * CLOCKS_PER_SEC) { speedd=1 ; itt=1; } }
              speeddd=1.7; }


another try


double delwait ( double  seconds )
{
 double checker1,result1 ;
 checker1= clock () +seconds * CLK_TCK ;
 result1= checker1-clock();
 return (result1);
}
if( Speedbrk) {       if ( itt==0 )     {    ni=delwait(2);
                                    while (ni>0)  {  speedd=1;   itt=1; }    }
else { speedd=1.7 ;} }


another try but frezes whole sim

wait ( int seconds )
{
 clock_t endwait;
 endwait = clock () + seconds * CLK_TCK ;
 return(endwait-clock())
}

if( Speedbrk) { if ( itt==0 ) { while ( wait (2)>=0) { speedd=1; itt=1 }}
                                                 speedd= 1.7 ;}

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/


_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to