
' ------------------------------------- Slots
Button 1 Label Title1
Button Title1 Label "Slots"
Button Title1 Color Green2
Button 2 Label "FirstInSlot random"
'
' ------------------------------------- Params
Button 4 Label Title2
Button Title2 Label "Params"
Button Title2 Color Green2
Button 5 Label "NumChannels random"
Button 6 Label "FilterSeconds random"
Button 7 Label "LogSeconds random"

' ------------------------------------- Visualization
Button 17 Label Title3
Button Title3 Label "Visualization"
Button Title3 Color Green2
Button 18 Label "CPS"
Button 19 Label "CPM"
Button 20 Label "CPH"

' ------------------------------------- Start-Stop
Button 22 Label Title4
Button Title4 Label "Start-Stop"
Button Title4 Color Green2
Button 23 Label "START"
Button 24 Label "STOP"

' =============================================================
'  START AND STOP PROGRAM
' =============================================================
Variable Numeric Slot_Commands = 31
'Variable Numeric Slot_Responses = 32

Window MinSize
Stop

Label EventStop
	For v1 = 0 To 128
		Button v1 Text ""
	Next
	Window Sizable
End


' =============================================================
'  SEND COMMAND (default timeout = 0.5 Sec)
' =============================================================
Label SendCommand
	Variable String SC1           '<-- Parameter Command-String
	SlotText Slot_Commands = SC1
	Variable Numeric SC2
	For SC2 = 0.1 To 0.5 Step 0.1 ' <-- 0.5 seconds timeout
		If SlotText(Slot_Commands) = ""
			Exit
		EndIf
		Wait Seconds 0.1
	Next
Return


' =============================================================
'  COMMANDS
' =============================================================

' ------------------------------------- Slots
Label FirstInSlot Random
	SendCommand("FirstInSlot " + Int(Rnd * 900))
Return

' ------------------------------------- Params
Label NumChannels Random
	SendCommand("NumChannels " + Int(Rnd * 99))
Return

Label FilterSeconds Random
	SendCommand("FilterSeconds " + Int(Rnd * 900))
Return

Label LogSeconds Random
	SendCommand("LogSeconds " + Int(Rnd * 900))
Return

Label CPS
	SendCommand("CPS")
Return

Label CPM
	SendCommand("CPM")
Return

Label CPH
	SendCommand("CPH")
Return

Label Start
	SendCommand("Start")
Return

Label Stop
	SendCommand("Stop")
Return


'BOOKMARKS 

'EDITEDLINES 19 1 20 2 26 7 27 7 28 7 24 7 25 7 23 8 4 9 -1 10 

'WATCH SewTo_Speed
'EXEC Button 5 Text Button5
