c172p-team / c172p

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

FG1000 refactor lighting and position of kap140, amphib gear ctrl, elt and hobbs #1430

Closed wlbragg closed 1 year ago

wlbragg commented 1 year ago

@dany93

This is finished. It rearranges the fg1000 panel features of the fg1000-KAP140 and to a lesser extent the FG1000-GFC. Also finishes some interior lighting effects that were missing, including...

KAP140 Amphibian Gear Control Amphibian Gear Control Breakers

Both dome lighting lightmaps and rheostat material panel lighting.

Ready to merge.

dany93 commented 1 year ago

The amphibian gear controls do not retract the gears, neither by the lever nor by the G key.

I perhaps don't look at the right things, but I see no effects of the dome lighting (knobs at the ceiling, right?).

(tested with the new ADF code in fgdta/..../FG1000, but I guess there is no connection)

wlbragg commented 1 year ago

Make sure Bat switch to on and the gear control breakers are pushed in (right below the gear control).

The dome lights need Bat switch to on, Cabin Pwr12v switch on panel to on, both knob on the ceiling (by the light) turned up.

wlbragg commented 1 year ago

I am not sure that the amphibian gear is starting up with the gear extended? I know I had it start up several times with the gear retracted. So I need to fix that here I guess before we merge. Beware, it does seem to take a few seconds to notice the gears are moving after throwing the gear lever. I think gear not being extended at startup maybe has to do with the fact that to use the amphibian variant in the fg1000 variant, you have to change to it in the GUI vs starting up in it. I'm not sure how I will solve that. It might be easiest to make another variant fg1000-amphibian-set? What do you think?

dany93 commented 1 year ago

Make sure Bat switch to on and the gear control breakers are pushed in (right below the gear control). The dome lights need Bat switch to on, Cabin Pwr12v switch on panel to on, both knob on the ceiling (by the light) turned up.

With these switches "ON", everything is right. But I had never noticed this. I guess all of them are usually "ON" with Autostart (they should).

wlbragg commented 1 year ago

Two more things.

All variants... I think we need to change the amount of time it takes to drain the battery with certain conditions. I was sitting here with the sim running and the amphibian on the runway, not running but with the dome light set to full on. I got distracted for a few minutes and when I came back the battery was dead. I think you should get way more than a few minutes out of a battery using only the dome lights. I want to research and revisit the battery drain logic.

FG1000 specific... Speaking of battery, I know the emergency bat system is supposed to click on if there is a disruption to the main bat system. So would that include draining the main battery? If so I need to actually add some logic to trip the stby bat when power is not coming from the main bat. I didn't really write any system for the stby bat other than it is powered and recharged. It's still on the todo list. I needed more research on how that system works.

dany93 commented 1 year ago

I think gear not being extended at startup maybe has to do with the fact that to use the amphibian variant in the fg1000 variant

I did this test by starting --aircraft=c172p-fg1000-gfc, then switching to the amphibious from inside the sim (the GUI). (Most of the time, I do like this)

It might be easiest to make another variant fg1000-amphibian-set? What do you think?

Above my skills. You are the better to choose. Compromise between the user's comfort and, for you the code to implement

dany93 commented 1 year ago

Battery drain: you are obviously right. But which is the culprit? General battery drain or dome lights consumption?

dany93 commented 1 year ago

Speaking of battery, I know the emergency bat system is supposed to click on if there is a disruption to the main bat system.

I don't know. But in the G1000 manual (p.14) I read:

Reversionary Display Operation In the event of a display failure, the G1000 System automatically switches to reversionary (backup) mode. In reversionary mode, all important flight information is presented on the remaining display in the same format as in normal operating mode.

However, I think you are going too far, to a system excessively complicated taking into account its importance in our context.

wlbragg commented 1 year ago

I think you are going too far, to a system excessively complicated taking into account its importance in our context.

I was thinking about it in the context of the failure system.

wlbragg commented 1 year ago

I did some digging and I am using a amp draw of 3.6 per dome light, which may be a little high, but maybe not. According to my understanding calculates to around 4 hours on a 30Ah battery which is what I am using in the fg1000. So i am going o dig into the electrical again and see where the extra drain is.

wlbragg commented 1 year ago

@dany93

I'm done with this. I found some issues that must have happened with the "Effects and Material animations must come after knob animation" PR. That PR broke the radio lighting dimmer knob for the kap140, dme and kr87 in the default c172p. I happened to notice it when I was doing the fg1000 instrument lighting. It's all fixed now as far as I can tell. What wasn't working, was the dimmer knob wasn't dimming the digits or the button lighting. We set it up a long time ago so that when you turned down the intensity of the lighting on the radio stack instruments, once you got to all the way to the lowest setting the buttons on all the instruments would not be illuminated but the digits would be. The effect for the digits was you could dim and brighten them, but you could never turn them down so far that you could no longer see them. For example, if you start at full brightness and you start turning the brightness down, when it got to 0 the digits would turn back on to a bright setting instead of going off. That functionality was broke on those instruments, now its working again.

Also, I screwed up a while back and reverted a merge you did ("Effects and Material animations must come after knob animation"). I thought I reverted the revert, but I noticed in the logs I was getting all those error messages about the material and effects animation duplicating the knob rotations. So I checked master and sure enough, that PR was no longer a part of master. So I reverted the revert and all is well. I just wanted you to know in case you get any strang conflicts when pulling from master. If you do, you may have to start over and just pull a completely new and fresh master. But the commit history is preserved and everything is correct.

So, as I said in the beginning, I am done with this and your free to merge.

Oh, one more thing, I started to change the color of the kr87 digits to match the kap140 in the fg1000. But then I noticed it was the kap140 that didn't match any of the instruments in the default aircraft so I changed the kap140 to match everything else. Not a big deal, I just thought it looked funny to have different colored instrument digits.

dany93 commented 1 year ago

So I reverted the revert and all is well. I just wanted you to know in case you get any strang conflicts when pulling from master...

I git pulled an update into my master from origin/master ( 8bb5f554eb ) and everything is clean. I no longer get the "material and effects animation duplicating the knob rotations" in the terminal.

dany93 commented 1 year ago

Only tested on the default aircraft:

I can more or less get what I wish but I often have to fiddle a bit.

I have these messages:

   44.11 [ALRT]:nasal      ERROR: Cannot add listener to tied property /controls[0]/lighting[0]/strobe[0]
   44.66 [ALRT]:nasal      ERROR: Cannot add listener to tied property /controls[0]/lighting[0]/instruments-norm[0]
   45.09 [ALRT]:nasal      ERROR: Cannot add listener to tied property /controls[0]/lighting[0]/instruments-norm[0]
  110.16 [ALRT]:nasal      ERROR: Cannot add listener to tied property /controls[0]/lighting[0]/instruments-norm[0]
  110.62 [ALRT]:nasal      ERROR: Cannot add listener to tied property /controls[0]/lighting[0]/instruments-norm[0]
  153.03 [ALRT]:nasal      ERROR: Cannot add listener to tied property /controls[0]/lighting[0]/taxi-light[0]
  195.41 [ALRT]:nasal      ERROR: Cannot add listener to tied property /controls[0]/lighting[0]/instruments-norm[0]
wkitty42 commented 1 year ago

On 8/1/23 10:12 AM, dany93 wrote:

I can more or less get what I wish but I often have to fiddle a bit.

with ALS or no?

ISTR some difference with lighting depending on if ALS was used or not... like the gauge lights would be black or very dark without ALS unless one of the rendering sliders was set to a certain point... i think... thus my question "ALS or not"...

i guess i should also add "what are your rendering sliders set to?" because they may play into this...

dany93 commented 1 year ago

On 8/1/23 10:12 AM, dany93 wrote: I can more or less get what I wish but I often have to fiddle a bit.

wkitty42 wrote

with ALS or no?

With ALS "ON".

dany93 commented 1 year ago

On FG1000 gfc variant: Same issue with STBY IND knob. For the ADF lighting. If I displace or scroll for down, the ADF illumination decreases (as expected), then increases again. Despite the value (%) remaining at 0. There is an issue when the value (kind of) goes through 0 then below.

No issue for the "steam" (round) instrument lighting.

Same knob / lighting issue for the AP (KAP140) in the FG1000 kap variant.

wlbragg commented 1 year ago

But it is a bit weird for the NAV /COM instruments (COM, ADF, DME, AP). If I displace downward or scroll for down, the illumination decreases (as expected), then increases again. Despite the value (%) remaining at 0. There is an issue when the value (kind of) goes through 0 then below.

That is the correct behavior. That's what I tried to explained in my post. I don't remember who originally discovered that it needed to be that way and set it up. I just know it was either reported or researched that it needed that odd behavior. I'm sure the discussion is in the closed issues somewhere.

So what your seeing is the expected behavior as far as it was programmed. It might be nice to verify the behavior is accurate to the real life behavior. I assumed it was a real life behavior back when it was first introduced.

wlbragg commented 1 year ago

I found the issue #754 that at least touched on it, I didn't read the entire thread.

Some highlights

I found the pages concerning these lights in the 172P POH (I have the one from 1982):

The engine instrument cluster (if post lights are installed), radio equipment, and magnetic compass have integral lightning and operate independently of post or flood lightning. The intensity of this lightning is controlled by the inner knob on the light dimming rheostat labelled RADIO LT; rotate the knob clockwise to obtain the desired light intensity. However, for daylight operation, the compass and engine instrument lights may be turned off while still maintaining maximum light intensity for the digital readouts in the radio equipment. This is accomplished by rotating the RADIO LT knob full counterclockwise. Check that the flood lights/post lights are turned off for daylight operation by rotating the PANEL LT knob full counterclockwise.

From Section 7, page 29.

AND

Yes, I re-read it and it seems to imply that. So I suppose this would be the way to go:

PANEL LT should control only the gauges backlight, nothing else from let's say 1% to 100%, RADIO LT should affect the digital displays and also activate only the backlight of all buttons in the radio stack At 0% instead of turning the radio lights completely off we have the "special" daylight configuration, so that the digital displays of all radios are at maximal intensity, but no backlight is activated on the buttons as mentioned before, using different cursors for the inner and outer knob of the light rheostats as right now it's really tough to guess where you are clicking, particularly at night! lowering a bit the illumination of the autopilot in the radio stack as it's clearly over illuminated when compared to the other elements What do you think?

wlbragg commented 1 year ago

Oh wow, I just caught a mistake we made back then or there is another breakage.

The engine instrument cluster (if post lights are installed), radio equipment, and magnetic compass have integral lightning and operate independently of post or flood lightning.

The magnetic compass, we missed it or it is n longer working.

What you should see overall is as follows.

When you displace the instrument lighting knob the following should be affected... engine instrument cluster (that was defined later on to be the oil temp/pressure and the rpm gauge) radio equipment (radio stack) magnetic compass This "special" set of equipment lighting is referred to as INTEGRAL LIGHTING. I don't think the magnetic compass is hooked up to the integral lighting any longer (I'll fix that)

At 0% instead of turning the radio lights completely off we have the "special" daylight configuration, so that the digital displays of all radios are at maximal intensity, but no backlight is activated on the buttons and the integral lighting equipment.

POST LIGHTING is the glowing of all the gauges on the panel, not any of the radio stack. Right or wrong we have post lighting also illuminate the engine instrument cluster with integral lighting.

dany93 commented 1 year ago

@wlbragg wrote

That is the correct behavior. That's what I tried to explained in my post

Now, I understand. Sorry and thank you.

wlbragg commented 1 year ago

I am going to add the magnetic compass integral lighting and then you can merge. c172p-lighting

dany93 commented 1 year ago

OK, whenever you like. Thank you for your explanatory pictures.

Do you know the meaning of "Post" in "Post Lighting"? Like the lampposts on the edges of a garden?

wlbragg commented 1 year ago

No, not really, other than I am pretty sure they are bulbs in the casings of the gauge itself. I finished fixing the magnetic compass lighting. I'll push it here shortly.

wlbragg commented 1 year ago

It's done, ready to merge.

wkitty42 commented 1 year ago

On 8/1/23 1:32 PM, dany93 wrote:

OK, whenever you like. Thank you for your explanatory pictures.

Do you know the meaning of "Post" in "Post Lighting"? Like the lampposts on the edges of a garden?

behind the glass, in the bottom middle edge of each of the gauges is a clear glass or acrylic post standing up toward the center... it carries light to the gauge face when the lights are on... they are easier on the eyes than raw bulbs lighting the same area...

wlbragg commented 1 year ago

@wkitty42 cool, thank you for that. Should we model the post, ha, just kidding!

dany93 commented 1 year ago

@wlbragg Merged.

It is not the subject of this issue, but please don't forget for the amphibious, no gear power supply (one have to manually push the buttons).

callahanp commented 1 year ago

I've bought a KI225 ADF indicator on ebay, which I took apart to see how the bezel was constructed. This revealed how the lighting works on the instrument.

There are two lamps, not one, in the upper corners, about .927 inches from a vertical center line, and 1.375 from a horizontal center line. An acrylic prism behind the front glass lens reflects light from the lamps onto the dial and illuminates the airplane graphic on the front side of the outer prism. I can post 3d models and drawings of the bezel and the outer lens and prisms on the flightgear wiki if anyone wants to see them.

-Pat

On Wed, Aug 2, 2023 at 5:03 AM dany93 @.***> wrote:

@wlbragg https://github.com/wlbragg Merged.

It is not the subject of this issue, but don't forget for the amphibious, no gear power supply (one have to manually push the buttons).

— Reply to this email directly, view it on GitHub https://github.com/c172p-team/c172p/issues/1430#issuecomment-1661821002, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABOZDUHY7XZ6K3J4FFTDC2TXTIJU7ANCNFSM6AAAAAA25SRWFM . You are receiving this because you are subscribed to this thread.Message ID: @.***>