Beispiel #1
0
 def __init__(self, model):
     '''
     Constructor
     '''
     self.model = model
     self.ui = UserInterface(self, self.model)
     self.view = Report(self, self.model)
Beispiel #2
0
class Controller():
    '''
    classdocs
    '''

    def __init__(self, model):
        '''
        Constructor
        '''
        self.model = model
        self.ui = UserInterface(self, self.model)
        self.view = Report(self, self.model)

    def set_file_name(self, filename):
        '''
        Initiating satellite scan
        '''
        self.model.add_file_for_parsing(filename)

    @errorlog
    def execute_converter(self, openfile):
        '''
        Execute converting from RSM to xls
        '''
        self.set_file_name(openfile)
        self.model.process_data()
        self.model.clear()

    def request_savefile(self):
        return self.ui.set_save_filename()

    def transfer_consts(self, consts):
        self.model.parameters.update(consts)

    def open_limit_file(self, filename):
        limit = parse_cut_file(filename)
        self.model.limit = limit

    def emergency_shutdown(self, message):
        logger.info("emergency shutdown initiated")
        self.view.reset()
        self.model.clear()
        information_message(message)