#!/bin/sh
# This script is designed to reset the pgp Running error also can be used to reset camera.
# Setup Guide: DEVICE PGP_IOC PGP CH



zenity --list --window-icon=warning --title="Verify Information is Correct" --text="Double check the following values match after IOC reboot:" --column="Setting PV" --column="PV Value" --column="Description" \
    "Exposure time" "$(printf %e $(caget -t $1:AcquireTime_RBV))" "" \
    "Trigger Delay" "$(printf %e $(caget -t $1:CamTrigDelay_RBV))" "" \
    "Trigger mode" $(caget -t $1:TriggerMode_RBV) "May need to be set as Pulse again regardless of read back value" \
    "NC Event Code" $(caget -t $1:CamTrigDelay_RBV) "" \
    "SC Event Code" $(caget -t $1:CamEventCode_RBV) "" \
    "Timing:TriggerSource" $(caget -t $3:Ch$4:Timing:TriggerSource_RBV) "" \
    "Timing:RateType" $(caget -t $3:Ch$4:EvrV2:RateType_RBV) &

caput $1:Acquire 0
sleep 0.5s
caput $1:CAMERA_PWR 0
sleep 5s
caput $1:CAMERA_PWR 1
siocRestart $2 &

#End of script
