# $Header: https://oberon.oapd.inaf.it/shins/trunk/shins/src/scripts/templates/tpl/SHARKNIR_gen_abort.py 3952 2022-05-19 08:30:53Z depa $

from shinsapp import SHINSApp
from util.shinsLogger import logger
from util import functions as ufun
from util import exception

class SHARKNIR_gen_abort(SHINSApp):
    
    @exception.handler_for_run
    def run(self, ins_s=None, det_s=None, tel_s=None, rtc_s=None, **kwargs):
        logger.info(__name__)

        obsController = self.obsController

        ##################################
        # Aborting all motors and scicam #
        ##################################
        
        logger.info('SHARKNIR_gen_abort: Aborting motion')
        self.status = obsController.emergencyAbortAll(ins_s)
