' ----------------------------------------------
'  Commands to Theremino_GPS
' ----------------------------------------------

Button 1 Label Average30
Button 2 Label Average120

Button 4 Label Minimize
Button 5 Label Maximize
Button 6 Label Normal

Button 8 Label Main
Button 9 Label Raw
Button 10 Label Sat
Button 11 Label Pos
Button 12 Label Map

Button 17 Label MapToLocal
Button 18 Label MapTo

Button 20 Label Image
Button 21 Label ImageTime
Button 22 Label ImageName

Variable Numeric Slot_CommandsToGPS = 1

Stop

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

' =============================================================
'  COMMANDS TO GPS
' =============================================================
Label Average30
	SendCommand(Slot_CommandsToGPS)("Average 30")
Return

Label Average120
	s1 = "Average 120"
	SendCommand(Slot_CommandsToGPS)("s1")
Return

Label Minimize
	SendCommand(Slot_CommandsToGPS)("Minimize")
Return
Label Maximize
	SendCommand(Slot_CommandsToGPS)("Maximize")
Return
Label Normal
	SendCommand(Slot_CommandsToGPS)("Normal")
Return

Label Main
	SendCommand(Slot_CommandsToGPS)("Main")
Return
Label Raw
	SendCommand(Slot_CommandsToGPS)("Raw")
Return
Label Sat
	SendCommand(Slot_CommandsToGPS)("Sat")
Return
Label Pos
	SendCommand(Slot_CommandsToGPS)("Pos")
Return
Label Map
	SendCommand(Slot_CommandsToGPS)("Map")
Return

Label MapToLocal
	SendCommand(Slot_CommandsToGPS)("MapToLocal")
Return
Label MapTo
	SendCommand(Slot_CommandsToGPS)("MapTo 45.470690 7.945215 30")
Return

Label Image
	SendCommand(Slot_CommandsToGPS)("Image")
Return
Label ImageTime
	SendCommand(Slot_CommandsToGPS)("ImageTime")
Return
Label ImageName
	SendCommand(Slot_CommandsToGPS)("ImageName" + " TestImage_" + Format(Now, "yyyy_MM_dd_HH_mm_ss"))
Return


'WATCH SewTo_Speed
'EXEC Button 5 Text Button5
