Re: [Flightgear-devel] electrical system patch

2007-05-24 Thread Curtis Olson
On 5/24/07, Javky wrote: I solved this problem with this condition: if ( volts > node->get_volts() || node->get_volts()==0 ) I know, it's not the best, but it works (I think much more better than 24 volts everywhere and useless switches). The correct solution is to fill the internal structur

Re: [Flightgear-devel] electrical system patch

2007-05-24 Thread Javky
Quoting Harald JOHNSEN <[EMAIL PROTECTED]>: > Martin Spott wrote: > > >Hi Harald, > > > > > > > >I still don't understand why it should be required to initialize these > >values to -0.01 instead of 0.0. If power switches are off, then 0.0 is > >the correct value "by definition" (TM). If some condi

Re: [Flightgear-devel] electrical system patch

2007-05-24 Thread Harald JOHNSEN
Martin Spott wrote: >Hi Harald, > > > >I still don't understand why it should be required to initialize these >values to -0.01 instead of 0.0. If power switches are off, then 0.0 is >the correct value "by definition" (TM). If some conditional statement >doesn't handle this, then probably the con

Re: [Flightgear-devel] electrical system patch

2007-05-23 Thread Martin Spott
Hi Harald, Harald JOHNSEN wrote: > This lines only initialize the internal values of the electrical system. > The properties are set in the propagate function : > // publish values to specified properties > for ( i = 0; i < node->get_num_props(); ++i ) { > fgSetFloat(

Re: [Flightgear-devel] electrical system patch

2007-05-21 Thread Harald JOHNSEN
Martin Spott wrote: >Why is setting to 0.0 not sufficient to reach the desired goal ? > > Martin. > > This lines only initialize the internal values of the electrical system. The properties are set in the propagate function : // publish values to specified properties for (

Re: [Flightgear-devel] electrical system patch

2007-05-20 Thread Martin Spott
Harald JOHNSEN wrote: > this patch will propagate zero volt to the output properties > when...there is no current at all. [...] > RCS file: /var/cvs/FlightGear-0.9/source/src/Systems/electrical.cxx,v > retrieving revision 1.35.2.1 > diff -u -r1.35.2.1 electrical.cxx > --- electrical.cxx 11 M

[Flightgear-devel] electrical system patch

2007-05-19 Thread Harald JOHNSEN
Hi, this patch will propagate zero volt to the output properties when...there is no current at all. Atm if you switch all inputs off (alt & bat switches) you still have 24v at the outputs. Harald. Index: electrical.cxx === RCS