Blinking text

Help and techniques for creating Air Manager Instrument Graphics

Moderators: russ, Ralph

Message
Author
User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Blinking text

#11 Post by Keith Baxter »

Shimokuta wrote: Mon Apr 18, 2022 7:21 am Hey Keith

I have coded the CAS messages more or less like you have; i think i asked you in another thread about this ;)
I am not sure how your code added functions.

Code: Select all

 -- Start a timer that will fire the callback on requested interval
    timer_start(0, delta_ms, function()
        if data ~= nil then
            user_callback(table.unpack(data))
            data = nil
        end
    end)
What i understand this should make messages blink?
It resets data to nil , but how is this triggered?

grtz

Roel
Hi,

That timer is for the dataref subscribe throttle. What that does is instead of having the datarefs fire when a value changes you can force a fire every interval.
Corjan did that for me some time ago.

https://www.forums.siminnovations.com/v ... 769#p31769

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

Shimokuta
Posts: 113
Joined: Wed Feb 03, 2021 12:52 pm

Re: Blinking text

#12 Post by Shimokuta »

Ah ok.
Clever!

I am going to try that

thx

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Blinking text

#13 Post by Keith Baxter »

Shimokuta wrote: Mon Apr 18, 2022 7:55 am Ah ok.
Clever!

I am going to try that

thx
Hi,

Yes it is a very useful bit of code.
Some instruments like the GI275 and the MVP50 series have a user setup that allows for probe pulsing. Normally to smooth out readings or reduce data in the logging features. Typically they use 333ms, 666ms and 1000ms.
So if you want you could add a user property that would dictate the interval of the dataref fires.

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

Shimokuta
Posts: 113
Joined: Wed Feb 03, 2021 12:52 pm

Re: Blinking text

#14 Post by Shimokuta »

hmmm, i am having difficuilties here to understand this all. :S

Code: Select all

-----------------------------------------------------------------------------------------------------
---CAS Alerts
-----------------------------------------------------------------------------------------------------
function xpl_dataref_subscribe_trottle(...)
    -- Local variables
    local args = {...}
    local user_callback = args[#args - 1]
    local delta_ms = table.remove(args, #args)
    local data = nil
    
    -- Replace the user callback with our own
    args[#args] = function (...)
        data = {...}
    end
    
    -- Do the actual subscribe
    xpl_dataref_subscribe(table.unpack(args))
what do you enter where the ... are ??

User avatar
Ralph
Posts: 7876
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Blinking text

#15 Post by Ralph »

I thought you just wanted to have a blinking text? Why do you need data throttling for that? Aren't you making things more complex than required?

Shimokuta
Posts: 113
Joined: Wed Feb 03, 2021 12:52 pm

Re: Blinking text

#16 Post by Shimokuta »

yes, all i want is blinking text, but indeed, for cas messages on a canvas.

User avatar
Ralph
Posts: 7876
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Blinking text

#17 Post by Ralph »

Then I'm not sure why you are bothering with data throttling?

Shimokuta
Posts: 113
Joined: Wed Feb 03, 2021 12:52 pm

Re: Blinking text

#18 Post by Shimokuta »

@Ralph
What would you suggest??

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Blinking text

#19 Post by Keith Baxter »

Hi,

What instrument and for what airframe are you trying to create. Depending on this information a call can be made and we can understand better what you are trying to do.

I will help you achieve what you want.

Keith


EDIT: I just checked back on some of your posts. Am I correct you want to reproduce the Honeywell Primus 1000 for the Learjet 45?
ice_screenshot_20220419-091453.png
If so then dataref throttle is the way to go.

I can walk you through easier on the discord. Just make an appointment any time that suites you. I am available most time.
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

Shimokuta
Posts: 113
Joined: Wed Feb 03, 2021 12:52 pm

Re: Blinking text

#20 Post by Shimokuta »

Hi keith


thanks

Yes that is correct
It is the Learjet 45 EICAS MFD
I have it working, except for the blinking CAS messages. :S

Yes i think we are connected on discord
i will contact you!

Post Reply