Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("sensmain")
'clv1.AddTextItem( "Set Idle Sensor (when GPS only)", "a")
clv1.Add( CreateListItem( $"ENABLE IDLE SENSOR (when GPS only)"$, clv1.AsView.Width, 90dip, 2), 90dip, $"usesensor"$)
clv1.Add( CreateListItem( $"Idle Time Before Recording (seconds)"$, clv1.AsView.Width, 90dip, 1), 90dip, $"idlerecord"$)
clv1.Add( CreateListItem( $"Idle Sensitivity"$, clv1.AsView.Width, 90dip,1), 90dip, $"MagnitudeThreshold"$)
clv1.Add( CreateListItem( $"Idle Time Out (seconds)"$, clv1.AsView.Width, 90dip,1), 90dip, $"stopIdle"$)
clv1.Add( CreateListItem( $"Drive Screen Dismiss Before Idle Count"$, clv1.AsView.Width, 90dip,3), 90dip, $"drvdismiss"$)
clv1.Add( CreateListItem( $"ENABLE OBSTACLE WARNING"$, clv1.AsView.Width, 90dip, 2), 90dip, $"warnenable"$)
clv1.Add( CreateListItem( $"Show Caution (Yellow) Warning When Within (x) meters"$, clv1.AsView.Width, 90dip,1), 90dip, $"startwarn"$)
clv1.Add( CreateListItem( $"Show Extreme (Red) Warning When Within (x) meters"$, clv1.AsView.Width, 90dip,1), 90dip, $"startextreme"$)
clv1.Add( CreateListItem( $"Enable Text To Speech Warning System"$, clv1.AsView.Width, 90dip,3), 90dip, $"ttsenable"$)
clv1.Add( CreateListItem( $"Text To Speech Update Rate (seconds)"$, clv1.AsView.Width, 90dip,1), 90dip, $"ttsrate"$)
clv1.Add( CreateListItem( $"Shorten Update Rate By Half When Extreme Warning"$, clv1.AsView.Width, 90dip,3), 90dip, $"extremeenabled"$)
' If StateManager.RestoreState(Activity, "setsensors", 360) = False Then
'set the default values
' EditText1.Text = "Default text"
' EditText2.Text = "Default text"
' End If
btnSave.Background = BDmod.CreateStateListDrawable
btnClose.Background = BDmod.CreateStateListDrawable
btnhelpclose.Background = BDmod.CreateStateListDrawable
pnlHelp.Visible = False
Loadsettings
End Sub
Sub clv1_ItemClick (Index As Int, Value As Object)
Log(" item clicked: "&Index)
Dim pnl As Panel = clv1.GetPanel(Index)
Dim chk As Label = pnl.GetView(0)
Dim str As String = chk.Text
lblheader.Text = str
lblhelp.Text = GetHelp(Value) ' CRLF&Value &" index: "&Index '.Title = Value&" edt value: "&edt.Text
lblhelp.TextSize = BDmod.SetTextSize(lblhelp,lblhelp.Text,1)
pnlHelp.Visible = True
pnlHelp.BringToFront
End Sub
Sub GetHelp(val As Object) As String
Dim seek As String = val
Dim ret As String = "Sorry Folks, No Help Found For This Specific Topic. It May Be Obvious From The Title What Setting Is Required."
Select seek
' idle detect section
Case "usesensor"
ret = "This setting will enable (turn on) or disable (turn off) the device / engine idle detection system. This uses the tablet or phone internal sensors to detect vibration. If using an ECM Data Adaptor, this system is disabled (not required). The following parameters will 'fine tune' this system."
Case "idlerecord"
ret = "This setting specifies the minimum number of seconds of continuous idle detection required before recording it as an idle event."
Case "MagnitudeThreshold"
ret = "This setting specifies the sensitivity of the vibration sensor (0.5 default). The higher the number, the less sensitive idle detection becomes. Depending on the device (tablet or phone) and mounting location, more sensitivity may be required to detect vehicle vibration (when engine is running)."
Case "stopIdle"
ret = "This setting will RESET (to zero) accumulated idle time when vibration (engine running) is NOT detected after (x) seconds. This helps avoid recording fake / false idling time that was not produced by constant vibration - as when engine is actually running as opposed to tapping on the device to make entries (engine is off). "
Case "drvdismiss"
ret = "This setting (when enabled) will prevent detecting and recording idle time when the Driving Screen is being displayed."&CRLF&"When the vehicle comes to a stop, the Driving screen will stay in focus until 5 minutes have elapsed. After this time, or if touched, it will be dismissed to the MAIN form - where idle detection will begin again. "
' warning section
Case "warnenable"
ret = "This setting will enable (turn on) or disable (turn off) obstacle detection warning. This system warns operators of 'OBSTACLES' (culverts, signs, curbs, etc.) that they are approaching. This function uses the internal GPS device hardware and GPS markers (you recorded) that indicate where obstacles exist. Note: When Mode = 'Travel', Obstacle Warning is turned off (not required). The following parameters will 'fine tune' this system."
Case "startwarn"
ret = "This setting will determine, when approaching an ostacle, when to display (distance in meters) the Caution Warning message (Yellow)."&CRLF&"Example: "&CRLF&" Slow Moving (Tractors/Mowers) - 50 meters"&CRLF&" Medium Speed (50 kmh, Motor Graders) - 150 meters"&CRLF&" Fast Moving (80 - 90 kmh, Snow Plows - 400 meters"
Case "startextreme"
ret = "This setting will determine, when approaching an ostacle, when to display (distance in meters) the Extreme Warning message (Red)."&CRLF&"Example: "&CRLF&" Slow Moving (Tractors/Mowers) - 20 meters"&CRLF&" Medium Speed (50 kmh, Motor Graders) - 100 meters"&CRLF&" Fast Moving (80 - 90 kmh, Snow Plows - 150 meters"
Case "ttsenable"
ret = "This setting will allow the use of Text to Speech warnings. Along with the screen warning, The device will 'Speak' a warning as well. Pair your device to a bluetooth system (headset, car stereo or a bluetooth speaker) and get a louder audible warning when approaching obstacles."
Case "ttsrate"
ret = "This setting will define how often the Text to Speech message will be broadcast (in seconds) when approaching an obstacle. Set this based on how fast the vehicle generally travels."
Case "extremeenabled"
ret = "This setting, when enabled, will cut in half, the time required to broadcast the warning message when in the Extreme (Red) zone. "
End Select
Return ret
End Sub