' =============================================
'   PK-POS v1 - 28/11/2024
' =============================================

NumeroCassette = 14

' ------------------------------------- BUTTONS
For v1 = 1 To 14
	Button v1 Label "Post" + v1
	Button v1 Color Honeydew
Next
Button 15 Label Data
Button 15 Color Yellow9
Button 16 Label OpenCloseLog
Button 16 Label "Start Log"
Button 16 Color Blue

' ------------------------------------- INIT
Option Speed 9
Load Theremino_Hal.exe
Gosub MainLoop
Stop

' ------------------------------------- CLOSE APPLICATION
Label EventStop
	Load CloseApps Theremino_Hal.exe
End

' ------------------------------------- MAIN LOOP
Label MainLoop
	' --------------------------------- Test SLOTS
	Numeric NumeroCassette
	Numeric Cassetta
	For Cassetta = 1 To NumeroCassette
		If Slot(Cassetta) <> Array1(Cassetta)
			Array1(Cassetta) = Slot(Cassetta)
			If Slot(Cassetta) = 0
				AddCassetta
			EndIf
		EndIf
	Next
	' ---------------------------------- Print TIME
	Button  Data Text  "  " + (Now)
Goto MainLoop

Label AddCassetta
	Array2(Cassetta) = Array2(Cassetta) + 1
	Button Cassetta Text "Post 1  = " + Array2(Cassetta)
Return

' -------------------------------------- LOG
Label OpenCloseLog
	Variable Numeric SL1
	If SL1 = 0
		SL1 = 1
		Gosub StartLog
		Button OpenCloseLog Label "Stop Log"
		Button 16 Color Red
	Else
		SL1 = 0
		Gosub StopLog
		Button OpenCloseLog Label "Start Log"
		Button 16 Color LightGreen
	EndIf
Return

Label StartLog
	'resetslot
	'Load Theremino_Logger.exe
Return

Label StopLog
	'Load CloseApps Theremino_Logger.exe
	'resetslot
Return


'BOOKMARKS 

'EDITEDLINES -1 9 -1 1 -1 2 -1 3 -1 4 -1 5 -1 6 -1 7 -1 8 -1 9 -1 10 

'WATCH 
'WATCH 
'WATCH 
'WATCH Array1
