#!/bin/sh
################################################################################
# testCapture Development test script
# T.Barnabt, BEAM Ltd, 2007-04-28
################################################################################
#
export PATH=../tmsControl:$PATH
host=tms3
#echo "Set BEAM Type"
#tmsControl --cycleType Beam1 ${host}
#tmsControl --cycleType Beam3 ${host}
echo "Set PupeTest mode"
tmsControl --setPupeConfig 1,1,1 ${host}
echo "Load test signal"
#tmsControl --setTestData 1,../datasrc/beam1-437000-8.psd ${host}
tmsControl --setTestData 1,../datasrc/beam3-437000-8.psd ${host}
sleep 1
echo "Capture diagnostics data"
# Channel,Source,Clock,startTime,postTriggerDelay,trigAnd,trigStore,trigData,trigMask
#
# PLL CycleStart Test
#tmsControl --captureDiagnostics 1,0,3,0,2,0,1,0,2 -outFile diag_start_0.txt ${host}
tmsControl --captureDiagnostics 1,0,0,0,2,0,1,0,2 -outFile diag_start_0.txt ${host}
tmsControl --captureDiagnostics 1,1,3,0,2,0,0,0,2 -outFile diag_start_1.txt ${host}
# PLL Injection Test
tmsControl --captureDiagnostics 1,0,0,0,2,0,1,0,32 -outFile diag_injection_0.txt ${host}
tmsControl --captureDiagnostics 1,1,0,0,2,0,0,0,32 -outFile diag_injection_1.txt ${host}
tmsControl --captureDiagnostics 1,2,0,0,2,0,0,0,32 -outFile diag_injection_2.txt ${host}
tmsControl --captureDiagnostics 1,3,0,0,2,0,0,0,32 -outFile diag_injection_3.txt ${host}
echo "Capture Data"
tmsControl --readData 1,0,0,0,0,1024,0 -outFile data1.txt ${host}
################################################################################
# PlotExamples
################################################################################
#
#kst -F diag_start_0.txt diagSource0.kst
#kst -F diag_start_1.txt diagSource1.kst
#kst -F diag_injection_0.txt diagSource0.kst
#kst -F diag_injection_1.txt diagSource1.kst
#kst -F data1.txt data.kst
#kst -m 1 -y 1 -y 2 -y 3 -y 4 -y 5 -y 6 -y 7 data.txt
################################################################################
# Examples
################################################################################
#
# PLL Test Source 1
#tmsControl --captureDiagnostics 1,1,0,0,2,0,0,0,2 -kst -outFile data.txt ${host}
#tmsControl --captureDiagnostics 1,1,0,0,10000,0,0,0,2 -kst -outFile data.txt ${host}
#tmsControl --captureDiagnostics 1,1,3,0,2,0,0,0,2 -kst -outFile data.txt ${host}
#tmsControl --captureDiagnostics 1,1,3,0,10000,0,0,0,2 -kst -outFile data.txt ${host}
#tmsControl --captureDiagnostics 1,1,3,0,0,0,0,0,32 -kst -outFile data.txt ${host}
#tmsControl --captureDiagnostics 1,1,0,0,0,0,0,0,32 -kst -outFile data.txt ${host}
#tmsControl --captureDiagnostics 1,1,0,0,10000,0,0,0,32 -kst -outFile data.txt ${host}
#tmsControl --captureDiagnostics 1,1,0,0,20000,0,0,0,32 -kst -outFile data.txt ${host}
#tmsControl --captureDiagnostics 1,1,3,0,2,0,0,0,2 -kst -outFile data1.txt ${host}
#tmsControl --captureDiagnostics 1,1,3,0,10000,0,0,0,2 -kst -outFile data2.txt ${host}
#tmsControl --captureDiagnostics 1,1,3,0,0,0,0,0,32 -kst -outFile data3.txt ${host}
#tmsControl --captureDiagnostics 1,1,3,0,20000,0,0,0,32 -kst -outFile data4.txt ${host}
# Current tests 0
#tmsControl --captureDiagnostics 1,0,0,0,2,0,1,0,32 -kst -outFile data.txt ${host}
#tmsControl --captureDiagnostics 1,2,0,0,2,0,1,0,32 -kst -outFile data.txt ${host}
# Current tests 1
#tmsControl --captureDiagnostics 1,0,0,0,0,0,1,0,2 -kst -outFile data.txt ${host}
#tmsControl --captureDiagnostics 1,0,0,0,0,0,1,0,32 -kst -outFile data.txt ${host}
#tmsControl --captureDiagnostics 1,1,0,0,2,0,0,0,32 -kst -outFile data.txt ${host}
#tmsControl --captureDiagnostics 1,1,0,0,10000,0,0,0,32 -kst -outFile data.txt ${host}
#tmsControl --captureDiagnostics 1,2,0,0,0,0,0,0,32 -kst -outFile data2.txt ${host}
# PLL Test After Injection
#tmsControl --captureDiagnostics 1,0,2,0,2,0,1,0,32 -outFile data.txt ${host}
#tmsControl --captureDiagnostics 1,0,3,0,2,0,1,0,32 -outFile data.txt ${host}
#tmsControl --captureDiagnostics 1,0,4,0,2,0,1,0,2 -outFile data.txt ${host}
#tmsControl --captureDiagnostics 1,0,5,0,2,0,1,0,2 -outFile data.txt ${host}
if false; then
tmsControl --captureDiagnostics 1,0,0,0,2,0,1,0,2 -outFile data1.txt ${host}
tmsControl --captureDiagnostics 1,0,0,0,1024,0,1,0,2 -outFile data2.txt ${host}
tmsControl --captureDiagnostics 1,0,0,0,2048,0,1,0,2 -outFile data3.txt ${host}
tmsControl --captureDiagnostics 1,0,0,0,3072,0,1,0,2 -outFile data4.txt ${host}
cat data1.txt data2.txt data3.txt data4.txt > data.txt
fi