Load Theremino_Hal.exe

Button 1 Label Post1
Button 2 Label Post2
Button 3 Label Post3
Button 4 Label Post4
Button 5 Label Post5
Button 6 Label Post6
Button 7 Label Post7
Button 8 Label Post8
Button 9 Label Post9
Button 10 Label Post10
Button 11 Label Post11
Button 12 Label Post12
Button 13 Label Post13
Button 14 Label Post14
Button 15 Label Data
Button 16 Label OpenCloseLog
Button OpenCloseLog Text "Start Log"


Button 1 Color Honeydew
Button 2 Color Honeydew
Button 3 Color Honeydew
Button 4 Color Honeydew
Button 5 Color Honeydew
Button 6 Color Honeydew
Button 7 Color Honeydew
Button 8 Color Honeydew
Button 9 Color Honeydew
Button 10 Color Honeydew
Button 11 Color Honeydew
Button 12 Color Honeydew
Button 13 Color Honeydew
Button 14 Color Honeydew
Button 15 Color Yellow
Button 16 Color Blue

Option Speed 9

Gosub MainLoop

Stop

Variable Numeric Slot1old
Variable Numeric Slot2old
Variable Numeric Slot3old
Variable Numeric Slot4old
Variable Numeric Slot5old
Variable Numeric Slot6old
Variable Numeric Slot7old
Variable Numeric Slot8old
Variable Numeric Slot9old
Variable Numeric Slot10old
Variable Numeric Slot11old
Variable Numeric Slot12old
Variable Numeric Slot13old
Variable Numeric Slot14old

'Variable Numeric ResSlot
'ResSlot = 1



Label MainLoop
	'If ResSlot = 1
	'	resetslot
	'	ResSlot = 0
	'EndIf
	If Slot(1) <> Slot1old
		Slot1old = Slot(1)
		If Slot(1) = 0
			AddCassetta1
		EndIf
	EndIf
	
	If Slot(2) <> Slot2old
		Slot2old = Slot(2)
		If Slot(2) = 0
			AddCassetta2
		EndIf
	EndIf
	
	If Slot(3) <> Slot3old
		Slot3old = Slot(3)
		If Slot(3) = 0
			AddCassetta3
		EndIf
	EndIf
	
	If Slot(4) <> Slot4old
		Slot4old = Slot(4)
		If Slot(4) = 0
			AddCassetta4
		EndIf
	EndIf
	
	If Slot(5) <> Slot5old
		Slot5old = Slot(5)
		If Slot(5) = 0
			AddCassetta5
		EndIf
	EndIf
	
	If Slot(6) <> Slot6old
		Slot6old = Slot(6)
		If Slot(6) = 0
			AddCassetta6
		EndIf
	EndIf
	
	If Slot(7) <> Slot7old
		Slot7old = Slot(7)
		If Slot(7) = 0
			AddCassetta7
		EndIf
	EndIf
	
	If Slot(8) <> Slot8old
		Slot8old = Slot(8)
		If Slot(8) = 0
			AddCassetta8
		EndIf
	EndIf
	
	If Slot(9) <> Slot9old
		Slot9old = Slot(9)
		If Slot(9) = 0
			AddCassetta9
		EndIf
	EndIf
	
	If Slot(10) <> Slot10old
		Slot10old = Slot(10)
		If Slot(10) = 0
			AddCassetta10
		EndIf
	EndIf
	
	If Slot(11) <> Slot11old
		Slot11old = Slot(11)
		If Slot(11) = 0
			AddCassetta11
		EndIf
	EndIf
	
	If Slot(12) <> Slot12old
		Slot12old = Slot(12)
		If Slot(12) = 0
			AddCassetta12
		EndIf
	EndIf
	
	If Slot(13) <> Slot13old
		Slot13old = Slot(13)
		If Slot(13) = 0
			AddCassetta13
		EndIf
	EndIf
	
	If Slot(14) <> Slot14old
		Slot14old = Slot(14)
		If Slot(14) = 0
			AddCassetta14
		EndIf
	EndIf
	
	Button  Data Text  "  " + (Now)
	
Goto MainLoop

Label AddCassetta1
	Variable Numeric TOBIN1
	Variable Numeric wset
	wset = 0
	TOBIN1 = TOBIN1 +1
	Button Post1 Text "Post 1  = " + TOBIN1
	Slot(16) = TOBIN1
	'If Slot(16) > 0
	'	Slot(16) = wset
	'EndIf
Return

Label AddCassetta2
	Variable Numeric TOBIN2
	TOBIN2 =  TOBIN2 + 1
	Button Post2 Text "Post 2  = " + TOBIN2
	Slot(17) = TOBIN2
Return

Label AddCassetta3
	Variable Numeric TOBIN3
	TOBIN3 =  TOBIN3 + 1
	Button Post3 Text "Post 3  = " + TOBIN3
	Slot(18) = TOBIN3
Return

Label AddCassetta4
	Variable Numeric TOBIN4
	TOBIN4 = TOBIN4 + 1
	Button Post4 Text "Post 4  = " + TOBIN4
	Slot(19) = TOBIN4
Return

Label AddCassetta5
	Variable Numeric TOBIN5
	TOBIN5 =  TOBIN5 + 1
	Button Post5 Text "Post 5  = " + TOBIN5
	Slot(20) = TOBIN5
Return

Label AddCassetta6
	Variable Numeric TOBIN6
	TOBIN6 =  TOBIN6 + 1
	Button Post6 Text "Post 6  = " + TOBIN6
	Slot(21) = TOBIN6
Return

Label AddCassetta7
	Variable Numeric TOBIN7
	TOBIN7 =  TOBIN7 + 1
	Button Post7 Text "Post 7  = " + TOBIN7
	Slot(22) = TOBIN7
Return

Label AddCassetta8
	Variable Numeric TOBIN8
	TOBIN8 =  TOBIN8 + 1
	Button Post8 Text "Post 8  = " + TOBIN8
	Slot(23) = TOBIN8
Return

Label AddCassetta9
	Variable Numeric TOBIN9
	TOBIN9 =  TOBIN9 + 1
	Button Post9 Text "Post 9  = " + TOBIN9
	Slot(24) = TOBIN9
Return

Label AddCassetta10
	Variable Numeric TOBIN10
	TOBIN10 =  TOBIN10 + 1
	Button Post10 Text "Post 10  = " + TOBIN10
	Slot(25) = TOBIN10
Return

Label AddCassetta11
	Variable Numeric TOBIN11
	TOBIN11 =  TOBIN11 + 1
	Button Post11 Text "Post 11  = " + TOBIN11
	Slot(26) = TOBIN11
Return

Label AddCassetta12
	Variable Numeric TOBIN12
	TOBIN12 =  TOBIN12 + 1
	Button Post12 Text "Post 12  = " + TOBIN12
	Slot(27) = TOBIN12
Return

Label AddCassetta13
	Variable Numeric TOBIN13
	TOBIN13 =  TOBIN13 + 1
	Button Post13 Text "Post 13  = " + TOBIN13
	Slot(28) = TOBIN13
Return

Label AddCassetta14
	Variable Numeric TOBIN14
	TOBIN14 =  TOBIN14 + 1
	Button Post14 Text "Post 14  = " + TOBIN14
	Slot(29) = TOBIN14
Return


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 resetslot
	'Imposta a zero gli slot di comunicazione con il logger
	
	
	Slot(1) = 1000
	Slot(2) = 1000
	Slot(3) = 1000
	Slot(4) = 1000
	Slot(5) = 1000
	Slot(6) = 1000
	Slot(7) = 1000
	Slot(8) = 1000
	Slot(9) = 1000
	Slot(10) = 1000
	Slot(11) = 1000
	Slot(12) = 1000
	Slot(13) = 1000
	Slot(14) = 1000
	
	
	Slot(16) = 0
	Slot(17) = 0
	Slot(18) = 0
	Slot(19) = 0
	Slot(20) = 0
	Slot(21) = 0
	Slot(22) = 0
	Slot(23) = 0
	Slot(24) = 0
	Slot(25) = 0
	Slot(26) = 0
	Slot(27) = 0
	Slot(28) = 0
	Slot(29) = 0
	
	
	
	
'_____________________________________________
	
Return

Label StartLog
	resetslot
	Load Theremino_Logger.exe
Return

Label StopLog
	Load CloseApps Theremino_Logger.exe
	resetslot
Return


'BOOKMARKS 232 33 

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

'WATCH TOBIN1
'WATCH TOBIN2
'WATCH TOBIN3
'WATCH Slot1old
'WATCH Slot(16)
