AM Not Detecting the Position Until an Update

Discuss suspected bugs with other users and Sim Innovations Staff

Moderators: russ, Ralph

Message
Author
JackZ
Posts: 2262
Joined: Mon Feb 22, 2016 1:02 pm

Re: AM Not Detecting the Position Until an Update

#21 Post by JackZ »

Problem is, AFAIK there is not a message port() equivalent for the RAspi Pico in Air Manager.

So how do you interface non supported hardware such as this screen in AM?

Jacques

PS: @jph Once again we are on a verge of polluting the thread of the OP about screens sinterfacing which is unrelated to the subject. Why don't we make a completely new thread in that case?
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

User avatar
BradyBrother100
Posts: 54
Joined: Tue Oct 13, 2020 4:21 pm
Location: United States MDT

Re: AM Not Detecting the Position Until an Update

#22 Post by BradyBrother100 »

Thanks for Ideas! I think I am going to have Air Player on a Raspberry Pi and connect a screen to it, which is what I was thinking originally.

Here is video of what JackZ's code does on my end. I wonder if the versions of the Zibo makes a difference. I have 3.45.

https://youtu.be/cw5qc0V8XWo

JackZ
Posts: 2262
Joined: Mon Feb 22, 2016 1:02 pm

Re: AM Not Detecting the Position Until an Update

#23 Post by JackZ »

I don't know about you, but my version works flawlessly on the latest Zibo version, with Am 3.7.10


Here's the gauge attached, that includes the new font.

Jacques
JZZibo B737 Batt Panelv102.siff
(189.69 KiB) Downloaded 195 times
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

User avatar
BradyBrother100
Posts: 54
Joined: Tue Oct 13, 2020 4:21 pm
Location: United States MDT

Re: AM Not Detecting the Position Until an Update

#24 Post by BradyBrother100 »

Sorry for the confusion, it turns out I was using your older version of the code. Yes, your updated code works with Zibo 737 3.45+. Thanks for your work! Back to the beginning of the thread, does anyone know why the request_callback(battery) wasn't doing anything until it was put into a function? Was it firing too early? I feel like the whole script could be simplified if we figure out why the code line wasn't doing anything.


Thanks!
Brady

JackZ
Posts: 2262
Joined: Mon Feb 22, 2016 1:02 pm

Re: AM Not Detecting the Position Until an Update

#25 Post by JackZ »

Yeah I figured you probably used an older version.

Your request callback as the first line in your code was waaaay too early in your code to be of any use, since you called it even BEFORE the text items to be displayed were declared via txt_add()!
Lua scripts are executed sequentially from top to bottom.
Examine my code carefully and you'll understand how it goes. I already simplified your code by regrouping all the separate xpl_datarefs_subscribe for electrical values into one.
It makes sense since these values are susceptible to change simultaneously, and it's best to update them whenever it's needed.

Jacques
Last edited by JackZ on Mon May 24, 2021 8:02 pm, edited 2 times in total.
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

JackZ
Posts: 2262
Joined: Mon Feb 22, 2016 1:02 pm

Re: AM Not Detecting the Position Until an Update

#26 Post by JackZ »

I modified slightly the code again so I moved the callback into the battery() function which makes more sense.
And I also removed the unneeded lines
JZZibo B737 Batt Panelv103.siff
(189.47 KiB) Downloaded 186 times
This will be my last version :D
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

User avatar
BradyBrother100
Posts: 54
Joined: Tue Oct 13, 2020 4:21 pm
Location: United States MDT

Re: AM Not Detecting the Position Until an Update

#27 Post by BradyBrother100 »

I moved the request_callback further down past the txt_adds but to no avail.

JackZ
Posts: 2262
Joined: Mon Feb 22, 2016 1:02 pm

Re: AM Not Detecting the Position Until an Update

#28 Post by JackZ »

BradyBrother100 wrote: Mon May 24, 2021 8:24 pm I moved the request_callback further down past the txt_adds but to no avail.
Hmmm. it is obviously more complicated than moving a simple line.
Sounds like you're trying to get your own code working no matter what.

Sorry to sound harsh, but I will not debug your original code, as it has some flaws, hence the reason I ended up with this modified version.
But maybe others will want to take the bait, I think I have done much more than I intended initially..
I suggest you study my code instead and try to figure out how it works and the differences with your original code.

If you end up with a better solution, please let us know.

Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

User avatar
BradyBrother100
Posts: 54
Joined: Tue Oct 13, 2020 4:21 pm
Location: United States MDT

Re: AM Not Detecting the Position Until an Update

#29 Post by BradyBrother100 »

Understandable, I never expected you to re-write my code in the first place. I really appreciate your work!

JackZ
Posts: 2262
Joined: Mon Feb 22, 2016 1:02 pm

Re: AM Not Detecting the Position Until an Update

#30 Post by JackZ »

Glad to know that.
You will notice that I used the same technique as Tony suggested, ie the use of a variable that contains the battery state.
hence the visibility of each text is not set to true, but to the status of this variable instead, like this if the plane is not powered by the battery, the display goes blank.

Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

Post Reply