summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/global.lua39
-rwxr-xr-xscripts/global_custom_scripts.lua40
2 files changed, 45 insertions, 34 deletions
diff --git a/scripts/global.lua b/scripts/global.lua
index fef9ac6..9cfc573 100755
--- a/scripts/global.lua
+++ b/scripts/global.lua
@@ -262,8 +262,8 @@ function GetSLIMaxInfo()
if mOSPBlinkTime < 1 or mOSPBlinkTime > 48 then mOSPBlinkTime = 32 end
-- get current Power LED index
- mPowerLED = GetContextInfo("ledpowerindex")
- if mPowerLED == nil then mPowerLED = 11 end
+ --mPowerLED = GetContextInfo("ledpowerindex")
+ --if mPowerLED == nil then mPowerLED = 11 end
-- get current speed Limiter LED index
mSpeedLimiterLED = GetContextInfo("ledspeedlimiterindex")
@@ -441,6 +441,41 @@ function GetCurrentGear()
return result
end
+-- marquee
+function Marquee(mString, mDelay)
+ local length = string.len(mString)
+
+ for i = 1,length+12 do
+
+ local mRight = ""
+ local mIddle = " "
+ local mLeft = ""
+
+ -- right
+ for j = i-5,i do
+ if j <= 0 then mRight = mRight .. " " end
+ if j > 0 and j <= length then mRight = mRight .. string.sub(mString, j, j) end
+ if j > length then mRight = mRight .. " " end
+ end
+ -- middle
+ j = i - 6
+ if j > 0 and j <= length then mIddle = string.sub(mString, j , j) end
+ -- left
+ for j = i-12,i-7 do
+ if j <= 0 then mLeft = mLeft .. " " end
+ if j > 0 and j <= length then mLeft = mLeft .. string.sub(mString, j, j) end
+ if j > length then mLeft = mLeft .. " " end
+ end
+
+
+ SetRightDigits(mRight)
+ SetGearDigit(mIddle)
+ SetLeftDigits(mLeft)
+
+ SLISendReport(1)
+ SLISleep(mDelay)
+ end
+end
--==============================================
require "scripts/slidevice"
diff --git a/scripts/global_custom_scripts.lua b/scripts/global_custom_scripts.lua
index 9c2d337..ff2fef7 100755
--- a/scripts/global_custom_scripts.lua
+++ b/scripts/global_custom_scripts.lua
@@ -77,29 +77,21 @@ function global_custom_spdLmtMethodEvent(idx)
end
function global_custom_gearEvent(gear)
- -- type your custom gear event script here
- -- check if gear == 'E' (see ascii table )
+
if gear == 69 then
- -- toggle OFF in this example
- toggleAllLed(0)
+ --toggleAllLed(0)
- -- 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 )
-- refresh SLI board
SLISendReport(1)
- -- return 1 to bypass std behavior
return 1
end
@@ -107,8 +99,8 @@ function global_custom_gearEvent(gear)
end
function global_custom_enterSessionEvent(devType)
- initLedTable(mRPMLedTable,0)
- SetRPMLed("mRPMLedTable")
+
+ Marquee( GetContextInfo("carname") , 50 )
for j = 1, 0 do
for i = 0, 6 do
@@ -117,6 +109,7 @@ function global_custom_enterSessionEvent(devType)
led = led.format("RPM%d",12-i)
mRPMLedTable[led] = j
SetRPMLed("mRPMLedTable")
+ SLISendReport(1)
SLISleep(200)
end
end
@@ -127,40 +120,23 @@ function global_custom_enterSessionEvent(devType)
SetWarnLed(6-i, j)
SetExtLed(1+i, j)
SetExtLed(5-i, j)
+ SLISendReport(1)
SLISleep(200)
end
end
+ SetDigitsAllowed(true)
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 )
- -- refresh SLI board
- SLISendReport(1)
+ Marquee( "exit" , 50 )
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