#!/bin/bash
#
# Helper to switch between the various camera heads.

# Make sure the camera server is not running.
sudo systemctl stop camera_server

# Get rid of the camera server register settings.
rm -f $HOME/.config/Fastec/settings/camera_server*

# Get rid of the FasMotion registry settings.
rm -f $HOME/.config/Fastec/FasMotion.conf

# Clear scratch
rm -rf $HOME/.config/Fastec/scratch
mkdir $HOME/.config/Fastec/scratch

# Make sure there's not a factory black frame in calibration.
rm -f $HOME/.config/Fastec/calibration/factory_blkref
rm -f $HOME/.config/Fastec/calibration/factory_gain
rm -f $HOME/.config/Fastec/calibration/bad_pixel*

# Restart the camera server.
sudo systemctl start camera_server


