|
Problem about skin "IDLE" event
I make a skin called "climate_popup.skin" which was displayed when the car climiate control was touched. The skin will exit if no touch in 3 seconds. So I use the skin IDLE event
-- ExecTBL.ini
"IDLE","EXIT",CLIMATE_POPUP.SKIN
-- climate_popup.skin
IDL,003
-- PLUGIN
Case "CLIMATE_POPUP"
If LCase(SDK.GetInfo("RRSCREEN")) = "climate_popup.skin" Then
ProcessCommand = 2
Else
CMD = "LOAD;climate_popup.skin"
ProcessCommand = 3
End If
This works but not perfect since the skin was closed and re-open during continous climate operation. So I changed the code:
-- ExecTBL.ini
"IDLE","CLIMATE_EXIT",CLIMATE_POPUP.SKIN
-- PLUGIN
Case "CLIMATE_EXIT"
Dim curTime As Date = Date.Now()
Dim diff As Long = DateDiff(DateInterval.Second, StatusHolder.climateBean.lastChangedTime, curTime)
If diff >= 3 And LCase(SDK.GetInfo("RRSCREEN")) = "climate_popup.skin" Then
CMD = "EXIT"
ProcessCommand = 3
Else
ProcessCommand = 2
End If
After code change, it was a much longer time than 3 seconds that the skin was close when no climate operation . I trace the debug.txt, the IDLE event was fired after 30s.
|