diff options
author | Hugues Hiegel <hugues@hiegel.fr> | 2013-02-12 05:20:35 +0100 |
---|---|---|
committer | Hugues Hiegel <hugues@hiegel.fr> | 2013-02-12 05:20:35 +0100 |
commit | 2a02bb7ee34d426afe2e974067c4a9ea470c3753 (patch) | |
tree | d96535465f3f13e5180048ac515b8d9cb41d7920 /scripts/global.lua | |
parent | 61238eecd2496ad711cc60a56fda00cae2dd6fd1 (diff) |
Test de Marqueetests2
Diffstat (limited to 'scripts/global.lua')
-rwxr-xr-x | scripts/global.lua | 39 |
1 files changed, 37 insertions, 2 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"
|