i will take some with me from then Netherlands!!
Or even better...Bavaria!!
Code: Select all
function callback_w_cas(pitch_trim, flaps, spoilers, aileron_trim, rudder_trim, parkbrk, N11, N12, gear, oilp1, oilp2)
-- CAS Parking Break
if parkbrk == false then
CAS_prk_white = false
CAS_prk_red = false
else
CAS_prk_white = true
end
if (N11 >= 35 or N12 >=35) and parkbrk == true then
CAS_prk_red = true
CAS_prk_white = false
end
if (N11 <= 35 or N12 <=35) and parkbrk == true then
CAS_prk_white = true
CAS_prk_red = false
end
local casW_list ={}
if CAS_prk_red == true then table.insert(casW_list,bell_casW_alerts[1])end --EMER/ PARK BRake red
if CAS_prk_white == true then table.insert(casW_list,bell_casW_alerts[2])end ---EMER/ PARK BRake white
Hi,Shimokuta wrote: ↑Tue Dec 07, 2021 8:10 pm I just did al little test with parking brake CAS messages, great success!!
Didn't know about the table option in LUA but this is great!
Thanks for the help.
(small part of my test)
Code: Select all
function callback_w_cas(pitch_trim, flaps, spoilers, aileron_trim, rudder_trim, parkbrk, N11, N12, gear, oilp1, oilp2) -- CAS Parking Break if parkbrk == false then CAS_prk_white = false CAS_prk_red = false else CAS_prk_white = true end if (N11 >= 35 or N12 >=35) and parkbrk == true then CAS_prk_red = true CAS_prk_white = false end if (N11 <= 35 or N12 <=35) and parkbrk == true then CAS_prk_white = true CAS_prk_red = false end local casW_list ={} if CAS_prk_red == true then table.insert(casW_list,bell_casW_alerts[1])end --EMER/ PARK BRake red if CAS_prk_white == true then table.insert(casW_list,bell_casW_alerts[2])end ---EMER/ PARK BRake white
100% Ralph. I actually changed the tables to .json file. Might be the next level for some. It can also be done as you say.Ralph wrote: ↑Tue Dec 07, 2021 9:31 pm I'm a bit of a brute force scripter I suppose, not that elegant But I would think of an array in an array. The array inside the array would consist of 3 items:
- A tag to refer to (string)
- The warning displayed (string)
- Type of message, warning, caution, etc (integer maybe?)
Maybe as a 4th an importance level for that type, if that exists.
Then you can just add to that list without worrying about the order.