DT-DL:
#Region Project Attributes
#ApplicationLabel: Detection Threshold - Detection Limit
#VersionCode: 2
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
[FONT=Akkurat Std][COLOR=rgb(28, 30, 41)][/COLOR][/FONT]
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private checkbox1, checkbox2, checkbox3, checkbox4 As CheckBox
Public ResultBgd, ResultRaw, K, Confidence, DT, DL, NET, Bgd, Raw As Int
Private lblCommentaire, lblConfidence, lblBgd, lblCS1, lblCS2, lblPercent1, lblPercent2, lblPercent3, lblPercent4, lblRaw, lblEditBgd, lblEditRaw As Label
Private btnOK As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub btnOK_Click
btnOK = Sender
TestResult
CalculDT_DL
if btnOK.Text = "O K" Then
Significant
End if
End Sub
Sub TestResult
lblEditBgd.Text = 0
lblEditRaw.Text = 0
Confidence = 0
lblCommentaire.Text = "Enter Measured Bgd"
lblCommentaire.Color = Colors.RGB(255,235,128) 'yellow
If lblEditBgd.Text > 0 Then
lblCommentaire.Text = "Enter Measured Raw"
Else
Wait For edtRaw_TextChanged (Old As Label, New As Label)
If Raw > 0 Then
lblCommentaire.Text = "Select a confidence interval"
End If
End If
End Sub
Sub CheckBox_CheckedChange(Checked As Boolean)
If checkbox1.Checked = True Then 'checked = True
K=1.645
Confidence=checkbox1.Tag
End If
If checkbox2.Checked = True Then
K=1.96
Confidence=checkbox2.Tag
End If
If checkbox3.Checked = True Then
K=2.1
Confidence=checkbox3.Tag
Else
If checkbox4.Checked = True Then
K=3
Confidence=checkbox4.Tag
End If
End If
End Sub
Private Sub CalculDT_DL
DT=K*Sqrt(2*(Bgd+1))
DL=(K*K)+(2*DT)
NET=Raw-Bgd
End Sub
Private Sub Significant
If NET>DT Then
lblCommentaire.Text = "Significant: Net>DT @" + Confidence
lblCommentaire.Color = Colors.RGB(255,0,0) 'red
Else
lblCommentaire.Text = "Not Significant: Net<DL @" + Confidence
lblCommentaire.Color = Colors.RGB(0,255,0) 'green
End If
End Sub