c172p-team / c172p

A high detailed version of the Cessna 172P aircraft for FlightGear
GNU General Public License v2.0
80 stars 43 forks source link

2 engines in the System Failures dialogue #408

Open gilbertohasnofb opened 9 years ago

gilbertohasnofb commented 9 years ago

Currently the 160 HP engine is associated with property engine[0] and the 180 HP with engine[1]. This has the downside of creating two separated entries for engine failure in the System Failures dialogue. If the 160 HP is selected, only "Engine 1" in that dialogue will fail it, but if the 180 HP is selected, only "Engine 2" will fail it. Ideally we should find a way of having a single engine in that dialogue which fails both engine[0] and engine[1].

gilbertohasnofb commented 9 years ago

Brainstorming here: if the failures interface allows, maybe we could have a single toggle which fails both engine[0] and engine[1].

gilbertohasnofb commented 8 years ago

Or have another property being controlled by the Failure Manager, and then using some <logic> we can make that if this property has failed, then both engine[0] and engine[1] also must be failed. Makes sense, @onox?

onox commented 8 years ago

Is it ok if I look at this at the end of the week? I really need to focus on a university project now.

gilbertohasnofb commented 8 years ago

@onox of course, there is no rush! Good luck with your project.

gilbertohasnofb commented 8 years ago

@onox can you think of any way to make the Failure Manager display only the active-engine as opposed to engine[0] or engine[1]? I can't find any mention of the failure manager in our code, so is it safe to assume this is all done automatically by the sim itself? If that's the case, I suppose there would be not much we can do to fix this, right?

onox commented 8 years ago

I think you would have to override and fix the "System Failures" dialog. Currently it simply iterates over the /engines/engine[i] properties.

gilbertohasnofb commented 8 years ago

What do you mean by overriding it?

onox commented 8 years ago

That you copy and modify the code, and make the button in the menu activate your dialog instead of FG's System Dialog.

gilbertohasnofb commented 8 years ago

That you copy and modify the code

Ok, that's clear and easy

and make the button in the menu activate your dialog instead of FG's System Dialog.

I don't get how this would be done. How can I hijack FG's interface so it open my Failure Manager instead of its own?

gilbertohasnofb commented 8 years ago

@onox I am off for today, but if you can explain to me how I would get a custom dialog to be activated via FG's gui I can try to tackle this before our deadline.

gilbertohasnofb commented 8 years ago

@onox would you know the answer for this? If it's something not too complicated I might be able to get it done before our deadline tomorrow.