From 61238eecd2496ad711cc60a56fda00cae2dd6fd1 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Mon, 11 Feb 2013 13:21:37 +0100 Subject: Updates. TBT --- scripts/global_custom_scripts.lua | 108 +++++++++++++++++++++++--------------- 1 file changed, 66 insertions(+), 42 deletions(-) (limited to 'scripts/global_custom_scripts.lua') diff --git a/scripts/global_custom_scripts.lua b/scripts/global_custom_scripts.lua index 55ae244..9c2d337 100755 --- a/scripts/global_custom_scripts.lua +++ b/scripts/global_custom_scripts.lua @@ -66,77 +66,101 @@ function global_custom_rightDigitsEvent(swPosition) end function global_custom_spdLmtMethodEvent(idx) - if idx > 2 then - -- reinit RPM leds only if method > 2 - initLedTable(mRPMLedTable, 0) - SetRPMLed("mRPMLedTable") - end + if idx > 2 then + -- reinit RPM leds only if method > 2 + initLedTable(mRPMLedTable, 0) + SetRPMLed("mRPMLedTable") + end - -- continue with standard behaviour + -- continue with standard behaviour return 2 end function global_custom_gearEvent(gear) -- type your custom gear event script here - -- check if gear == 'E' (see ascii table ) - if gear == 69 then + -- check if gear == 'E' (see ascii table ) + if gear == 69 then - -- toggle OFF in this example - toggleAllLed(0) + -- toggle OFF in this example + toggleAllLed(0) - -- control gear digit display - SetGearDigit(GetCurrentGear()) + -- control gear digit display + SetGearDigit(GetCurrentGear()) - -- control left panel (6 chars max) - -- nothing display in this example - local ldigits = " " - SetLeftDigits( ldigits ) - -- control right panel (6 chars max) - -- nothing display in this example - local rdigits = " " - SetRightDigits( rdigits ) + -- control left panel (6 chars max) + -- nothing display in this example + local ldigits = " " + SetLeftDigits( ldigits ) + -- control right panel (6 chars max) + -- nothing display in this example + local rdigits = " " + SetRightDigits( rdigits ) - -- refresh SLI board - SLISendReport(1) + -- refresh SLI board + SLISendReport(1) - -- return 1 to bypass std behavior - return 1 - end + -- return 1 to bypass std behavior + return 1 + end return 2 end function global_custom_enterSessionEvent(devType) - initLedTable(mRPMLedTable,0) + initLedTable(mRPMLedTable,0) SetRPMLed("mRPMLedTable") - for j = 1, 0 do - for i = 0, 12 do - led = led.format("RPM%d",i) - mRPMLedTable[led] = j - SetRPMLed("mRPMLedTable") - print( string.format("rpm%d : %d", i, j)) - win.Sleep(200) - end - end + for j = 1, 0 do + for i = 0, 6 do + led = led.format("RPM%d", i) + mRPMLedTable[led] = j + led = led.format("RPM%d",12-i) + mRPMLedTable[led] = j + SetRPMLed("mRPMLedTable") + SLISleep(200) + end + end + + for j = 1,0 do + for i = 0,2 do + SetWarnLed(1+i, j) + SetWarnLed(6-i, j) + SetExtLed(1+i, j) + SetExtLed(5-i, j) + SLISleep(200) + end + end - return 2 + return 1 end function global_custom_exitSessionEvent(devType) -- type your custom script on session ending, here - local ldigits = " exit " - SetLeftDigits( ldigits ) - local rdigits = " exit " - SetRightDigits( rdigits ) + local ldigits = " exit " + SetLeftDigits( ldigits ) + local rdigits = " exit " + SetRightDigits( rdigits ) - -- refresh SLI board - SLISendReport(1) + -- refresh SLI board + SLISendReport(1) return 1 end function global_custom_ledEvent(idx, ledFunction, state) + -- bypass for power led -- + if ledFunction == 10 + then + if mPowerLED > 0 + then + if mPowerLED > 6 + then + setExtLed(mPowerLED - 6, state) + else + setWarnLed(mPowerLED, state) + end + -- continue + end return 2 end -- cgit v1.2.3