# Parameters Definition
Vers 1
Board_version 5203
# Format:
# Scope:         'g' = global, 'b' = board, 'c' = channel
# Type:          'd' = int decimal, 'h' = int hex, 'f' = float, 's' = string, 'c' = combo, 'x' = spinbox, 'b' = booleand, 'u' = int or float with units
# Special Types: 'm' = monitor (showed in GUI but not saved to cfg file), '-' no parameter (graphic separators)

# Name							Default_Value		Scope	Type	Description
#---------------------------------------------------------------------------------------	
[Connect]
#---------------------------------------------------------------------------------------
Open 							"eth:192.168.50.3"	b		s	

#---------------------------------------------------------------------------------------
[RunCtrl]
#---------------------------------------------------------------------------------------
StartRunMode					ASYNC				g		c		# Start of Run mode 
	- ASYNC
	- TDL

StopRunMode						MANUAL				g		c		# Run Stop Mode
	- MANUAL
	- PRESET_TIME
	- PRESET_COUNTS

EventBuildingMode				DISABLED			g		c		# DISABLED: no event building, TRGTIME_SORTING: event sorting by Trigger Time stamp, TRGID_SORTING: event sorting by Trigger ID
	- DISABLED
	- TRGTIME_SORTING
	- TRGID_SORTING

TrgTimeWindow					100					g		fu		# Coincidence Window for Event Building based on time stamp
PresetTime						0					g		fu		# Preset Time
PresetCounts					0					g		f		# Preset Counts (number of acquired events)
JobFirstRun						0					g		d		# First Run of the Job
JobLastRun						0					g		d		# Last Run of the Job
RunSleep						0					g		du		# Wait Time between runs of a job
EnableJobs						0					g		b		# Enable Jobs
RunNumber_AutoIncr				0					g		b		# Run Number auto increment

_BLANK							-					-		-
OutputFiles  					-					-		-
#______________________________________________________________

DataFilePath					DataFiles			g		s		# Destination folder to save the output files 
OF_OutFileUnit					LSB					g		c		# ToA and ToT unit
	- LSB
	- ns
OF_EnMaxSize					0					g		b		# Enable List file maximum size (Raw, binary, ASCII)
OF_MaxSize						"1 GB"				g		fu		# Max size of List files (in Bytes), minimum size allowed 1 MB
OF_RawData						0					g		b		# Enable Event List Raw data file
OF_ListBin						0					g		b		# Enable Event List binary file
OF_ListAscii 					0					g		b		# Enable Event List ASCII file 
OF_ListCSV						0					g		b		# Enable Event List CSV file
OF_Sync 						0					g		b		# Enable List with BrdID-Tstamp-TrgID file saving (for sync check) 
OF_ServiceInfo 					0					g		b		# Service event info (temperatures)
OF_RunInfo						0					g		b		# Enable Run Info file saving
OF_LeadHisto					0					g		b		# Enabling Leading edge timing spectrum file saving
OF_ToTHisto						0					g		b		# Enable ToT spectrum file saving

#---------------------------------------------------------------------------------------
[AcqMode]
#---------------------------------------------------------------------------------------
ChEnableMask0                      0xFFFFFFFF       b		h    	# Channel enable mask TDC0 (ch 0..31)
ChEnableMask1                      0xFFFFFFFF       b		h    	# Channel enable mask TDC0 (ch 32..63)
ChEnableMask2                      0xFFFFFFFF       b		h   	# Channel enable mask TDC1 (ch 64..95)
ChEnableMask3                      0xFFFFFFFF       b		h	    # Channel enable mask TDC1 (ch 96..127)
_BLANK							-					-		-

AcquisitionMode					COMMON_START		g		c		# Acquisition mode
	- COMMON_START
	- COMMON_STOP
	- TRG_MATCHING
	- STREAMING
	- TEST_MODE_1
	- TEST_MODE_2

MeasMode						LEAD_ONLY			g		c		# Time measurement mode
	- LEAD_ONLY
	- LEAD_TRAIL
	- LEAD_TOT8
	- LEAD_TOT11

En_Head_Trail					ONE_WORD			g		c		# Enable Header and Trailer
	- KEEP_ALL
	- ONE_WORD

En_Empty_Ev_Suppr				0					g		b		# Enable empty event suppression

#En_service_event				ENABLED				g		c		# Enable service event (2 words of board info)
#	- ENABLED
#	- DISABLED
#Dis_tdl                            ENABLED				#ENABLE: tdl disabled, DISABLE: tdl enabled - Not yet implemented?

_BLANK							-					-		-
TriggerSource					PTRG				g		c		# Trigger source 
	- SW_ONLY
	- T1-IN
	- T0-IN
	- PTRG
	- EDGE_CONN
	- MASK

TrefSource						PTRG				g		c		# Time reference source
	- CH0
	- T0-IN
	- T1-IN
	- PTRG
		
VetoSource						DISABLED			g		c		# The veto signal inhibits the trigger source (active high)
	- DISABLED
	- T0-IN
	- T1-IN
	- MASK

GateWidth	    				2 us				g		fu 		# Gate Width (will be rounded to steps of 12.8 ns)
TrgWindowWidth					2 us				g		fu 		# Trigger Window Width (will be rounded to steps of 12.8 ns)
TrgWindowOffset					-1 us				g		fu		# Trigger Window Offset = start of the trg window respect to trigger position (can be negative, will be rounded to steps of 12.8 ns)	
PtrgPeriod						10 us				g		fu		# Period of the internal periodic trigger

DigitalProbe0					TRG_ACCEPTED		g		c		# Digital probe source (T0-OUT)
	- CLK_1024			
	- TRG_ACCEPTED		
	- TRG_REJECTED		
	- TX_DATA_VALID	
	- TX_PCK_COMMIT	
	- TX_PCK_ACCEPTED	
	- TX_PCK_REJECTED	
	- TDC_DATA_VALID	
	- TDC_DATA_COMMIT	

DigitalProbe1					TX_DATA_VALID		g		c		# Digital probe source (T1-OUT)
	- CLK_1024			
	- TRG_ACCEPTED		
	- TRG_REJECTED		
	- TX_DATA_VALID	
	- TX_PCK_COMMIT	
	- TX_PCK_ACCEPTED	
	- TX_PCK_REJECTED	
	- TDC_DATA_VALID	
	- TDC_DATA_COMMIT	
	
T0_Out							PTRG				g		c		# T0_Out assignment
	- T0-IN
	- TRIGGER
	- RUN
	- PTRG
	- BUSY
	- DPROBE
	- SQ_WAVE
	- TDL_SYNC
	- RUN_SYNC
	- ZERO
	- MASK
	
T1_Out							ZERO			g		c		# T1_Out assignment
	- T1-IN
	- TRIGGER
	- RUN
	- PTRG
	- BUSY
	- DPROBE
	- SQ_WAVE
	- TDL_SYNC
	- RUN_SYNC
	- ZERO
	- MASK
	

#_BLANK							-					-		-
	



#---------------------------------------------------------------------------------------
[TDC]
#---------------------------------------------------------------------------------------
GlitchFilterMode				DISABLED           	g		c		# Glitch Filter (enforce minimum pulse width and/or distance)
	- DISABLED
	- TRAILING
	- LEADING
	- BOTH
GlitchFilterDelay				3            	    b		d		# Glicth Filter Delay (~800 ps to ~10 ns with 16 steps)
ToT_reject_low_thr				0					g		d		# ToT Reject lower threshold (0=disabled)
ToT_reject_high_thr				0					g		d		# ToT Reject higher threshold (0=disabled)
TDC_ChannelBufferSize			128           		g		c		# TDC Channel Buffer Size (limits max num of hits per channel)
	- 4
	- 8
	- 16
	- 32
	- 64
	- 128
	- 256
	- 512

TriggerBufferSize				16					g		d		# FPGA Trigger Buffer Size (limits num of pending triggers waiting for readout)	

TDCpulser_Width					"1 ns"				g		fu		# picoTDC Pulser Output (width in ns)
TDCpulser_Period				"10 ns"				g		fu		# picoTDC Pulser Output (period in ns)

HighResClock					DISABLED           	g		c		# High Res Clock Distribution (MCX connectors)
	- DISABLED
	- DAISY_CHAIN
	- FAN_OUT


#---------------------------------------------------------------------------------------
[DataAnalysis]
#---------------------------------------------------------------------------------------
DataAnalysis					ALL					g		c		# Data Analysis mode (statistics, measures, plots)
	- NONE
	- CNT_ONLY
	- CNT+MEAS
	- CNT+HISTO
	- ALL

_BLANK							-					-		-
LeadTrail_LSB					0					g		x		# Leading/Trailing LSB : LSB = 3.125ps * 2^N, Max N=10 (Max LSB = ~3.125 ns)
	- 0
	- 10

#_BLANK							-					-		-

LeadTrailHistoNbin				4K					g		c		# Number of channels (bins) in the Lead/Trail histogram
	- 256
	- 512
	- 1K
	- 2K
	- 4K
	- 8K
	- 16K
LeadTrailRebin					1					g		c		# Rebin factor (Histo_Bin = Orig_Value_LSB / BinSize); The BinSize will be calculated (not read from Config File). Must be a power of 2 
	- 1
	- 2
	- 4
	- 8
	- 16
	- 32
	- 64
LeadHistoMin					"0 ns"				g		fu		# Min value in for Lead Histogram (if no unit specified, the value is meant in ps)

_BLANK							-					-		-
ToT_LSB							0					g		x		# ToT LSB: LSB = 3.125ps * 2^N, Max N=18 (Max LSB = ~800 ns)
	- 0
	- 18
ToTHistoNbin					1K					g		c		# Number of channels (bins) in the ToT histogram
	- 256
	- 512
	- 1K
	- 2K
	- 4K
	- 8K
	- 16K
ToTRebin						1					g		c		# Rebin factor (Histo_Bin = Orig_Value_LSB / BinSize); The BinSize will be calculated (not read from Config File). Must be a power of 2 
	- 1
	- 2
	- 4
	- 8
	- 16
	- 32
	- 64
ToTHistoMin						"0 ns"				g		fu		# Min value in for ToA Histogram (if no unit specified, the value is meant in ps)

_BLANK							-					-		-

EnableWalkCorrection			0					g		b		# Enable Walk correction by ToT
WalkFitCoeff    				"1.23E-12  33.33 1e-2"	g	s 		# Walk vs ToT calibration curve (up to 5th order polynomial fit)


#---------------------------------------------------------------------------------------
[Adapters]
#---------------------------------------------------------------------------------------
AdapterType				NONE						g		c		# Adapter Type
	- NONE
	- A5256
DiscrThreshold			10           				c		f		# Discriminator Threshold (mV)
#DiscrThreshold2		100           				c		f		# 2nd Discriminator Threshold (mV)
DisableThresholdCalib   0							g		b		# Enable/Disable Thresholds Calibration		
A5256_Ch0Polarity		POSITIVE					g		c		# Polarity of Ch0 in A5256
	- POSITIVE
	- NEGATIVE


#---------------------------------------------------------------------------------------
[Regs]
#---------------------------------------------------------------------------------------
# Empty section (Tab used by GUI)

#---------------------------------------------------------------------------------------
[Statistics]
#---------------------------------------------------------------------------------------
# Empty section (Tab used by GUI)

#---------------------------------------------------------------------------------------
[Log]
#---------------------------------------------------------------------------------------
# Empty section (Tab used by GUI)
