Jump to content
Sign in to follow this  
Guest Pencil pusher

Master battery operation

Recommended Posts

Guest Pencil pusher

Is there a selection that needs to be made for it to operate other xml code?Situation: gmax/plugins/mkmdl.parts.xml has the listing for Electrical master battery - I have titled and animated accordingly an 'old fashioned' clunky master battery switch - usually labelled 'Ground/Flight switch'. This works OK but it does not isolate other functions as it seems to do on other peoples aircraft! Is it because it is not listed in the Panel.cfg file?I have a couple of gauges (fuel contents and OAT) that are selected by their own power switches, and also the electrical engine starter, but none of these are isolated by the operation of the master battery. I can get the fuel and OAT gauges switched by the ground flight switch if I exchange the power switch code for the (A:Electrical master battery, bool), but I do not seem to be able either to string the two switches together, or to get it to isolate the Starter button.I have separate code for the switch and for the gauge. Ideally I would like the gauge file to be inhibited by the master battery switch, so that the gauge power switch can be visually changed, but not to operate the gauge. (I can get the gauges to be inhibited, but the power switches automatically go to off - I think that I have tried all combinations in the code over the last 7 days or so, and I have very little hair left!)Power switch code so far - gauge code uses the L:OAT switch, bool link. Code for the fuel gauge switch is similar.(A:Electrical master battery, bool) == if{ (A:Electrical master battery, bool) (>L:OAT switch, bool) } els{ (A:Electrical master battery, bool) (L:OAT switch, bool) }OAT switch(L:OAT switch, bool) -- d 0 < if{ 1 } (>L:OAT switch, bool)(L:OAT switch, bool) ++ d 1 > if{ 0 } (>L:OAT switch, bool)Help required please!RegardsKeith

Share this post


Link to post
Share on other sites

Ok... there's no "magic" in FS that kills power to a gauge. It's up to the programmer to make that happen.If the programmer isn't looking at the battery switch to decide whether there's power or not... then the battery switch won't affect the gauge.There's absolutely nothing in FS that makes a gauge do it without being specifically coded to do so.


Ed Wilson

Mindstar Aviation
My Playland - I69

Share this post


Link to post
Share on other sites

Just a little tip unless there is some other function involved.. No worries..No headaches.For this - (L:OAT switch, bool) -- d 0 < if{1 } (>L:OAT switch, bool)Make it (L:OAT switch, bool) ! (>L:OAT switch, bool)RomanProud "TEAM AVSIM" RTW race member.


20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

Share this post


Link to post
Share on other sites

Ahh! now I see what yout gettin at --- See code below hope it helps :-)(L:OAT switch, bool)OAT switch(L:OAT switch, bool) ! (>L:OAT switch, bool)(L:OAT switch, bool) ! (>L:OAT switch, bool)(A:Electrical master battery, bool) 1 == (L:OAT switch, bool) 1 == & if { (A:AMBIENT TEMPERATURE, *** Celcius or Degrees ) } els{ 0 } !----< Use the above value for the OAT gauge whether it is a string digital display or a analog gauge with a needle---/> OAT DISPALYRomanProud "TEAM AVSIM" RTW race member.


20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

Share this post


Link to post
Share on other sites
Guest Pencil pusher

Roman,Thank you for your previous advice - the simpler code works exactly the same as my (copied) more complex code (which I found difficult to understand, not being C++ orientated).Tomorrow I will now try your latest suggestion, and let you know the result.Thanks againKeith

Share this post


Link to post
Share on other sites
Guest Pencil pusher

Ed, Thanks, I am aware that one has to tell a high speed idiot (software & computer) everything, and for this aged person a lot also!If you can locate the DH Rapide DH89a of Dave Garwood (Possibly from Classic british files) there does not seem to be any specific code to enable/disable electrical supply to the starter, lamps etc, although he does employ a separate electrical panel. This is what I have so far found difficult to cotton on to! I am though now trying to create a separate electrical panel to see if that gets over my problem.RegardsKeith

Share this post


Link to post
Share on other sites

>Ed, >Thanks, I am aware that one has to tell a high speed idiot>(software & computer) everything, and for this aged person a>lot also!>If you can locate the DH Rapide DH89a of Dave Garwood>(Possibly from Classic british files) there does not seem to>be any specific code to enable/disable electrical supply to>the starter, lamps etc, although he does employ a separate>electrical panel. This is what I have so far found difficult>to cotton on to! I am though now trying to create a separate>electrical panel to see if that gets over my problem.>Regards>KeithGetting all of that stuff to work correctly requires that the modeler and the gauge developer work closely together to ensure the model doesn't show something it shouldn't.


Ed Wilson

Mindstar Aviation
My Playland - I69

Share this post


Link to post
Share on other sites

Yep.. the integration between the modeler (sp?) and a gauge designer has never have been so close.. Each of their own have their own specialties, but without one another the final result could/can be flawed.for modifying/ updating your "own" aero-plane -----If one is working with a 2d panel only, and a VC has all gauges called by the panel.cfg it should'nt be a problem except for specially coded visual model. (Spot View)Once something comes to dealing with VC ( because of internal coding, IE True gauges via MDL ) changing something already there cannot/ or.. not worth the time, be done. ( The trick here, if a gauge is called by the panel.cfg you have a 50/50 chance of dealing with it) If the gauge / or any gauges are NOT callded by the panel.cfg--------- live with it. RomanProud "TEAM AVSIM" RTW race member.


20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

Share this post


Link to post
Share on other sites
Guest Pencil pusher

Roman,Thank you very, very much for your code - it works beautifully, and I have been able to use it for my fuel gauge. I have not had to add a dummy master battery switch - the gmax animated one is sufficient.The engine start though did not work with the simple addition, but I did find that with a small modification I could use the 747 engine start knob to get the desired effect!Next up is to try your code with the Landing, nav & cockpit lights!I am just beginning to understand the translation of your code into a form of english that makes some sense (my efforts to date have been mainly empirical (try it and fly it!), althoght analogue gauges seem a lot more simple to produce than switched logic. My translation of your code:(A:Electrical master battery, bool) 1 == (L:OAT switch, bool) 1 == & if{ (A:AMBIENT TEMPERATURE, Celsius) } els{0} goes something like this:Electrical master battery ON (1 ==), OAT switch ON (1==), AND (&)if so (if{ ) show Ambient Temperature (}), otherwise (els) show zero ({ 0 }) . Remembering that in Polish notation, one enters the first parameter, then the second parameter, followed by the operand!This is not too bad for a simple two parameter function, for more functions I might need more tuition. Although I have downloaded Arne Bartels XML tutorial, I am afraid that it does not make much sense to me especially when talking about 'stacks' etc., as I am not a C++ progammer.Thanks again,Keith :-)

Share this post


Link to post
Share on other sites
Guest Pencil pusher

Eurika!!!!!YES - there is a trick for Master battery operation, and after a long search it would appear to be tied up in which version of the aircraft.cfg one uses as a basis.....Other aircraft.cfg files that seem to have a listing for 'electric_always_available=1' do not seem to allow power to the starter and lights if one changes this to '0' (false). Even the Keyboard autostart function (Ctrl+E) does not work.I have changed my aircraft.cfg file to use one from an aircraft that does not have this listing, but does switch power from the master battery (Ted Cookes Sparrowjet). Where this .cfg comes from originally I don't know, but the template .cfg files in FS9 for the C172, C182 & Mooney, do not isolate power (possibly because they do not use .xml gauges?).Hope this helps other people who may have this problem.RegardsKeith :-)

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...