def __init__(self, widget_id=None, sm=None, *args, **kwargs):
        # standard common initialisations
        BaseWidget.__init__(
            self,
            widget_id=widget_id,
            sm=sm,
        )

        # # widget-specific initialisations
        # self.block_keys = [['wait'], ['run'], ['done', 'cancel', 'fail']]
        # self.blocks = {}
        # for keys_now in self.block_keys:
        #     self.blocks[keys_now[0]] = []

        # self.time_of_night = {}

        # self.inst_health = []

        # self.tel_ids = self.sm.inst_data.get_inst_ids(
        #     inst_types=['LST', 'MST', 'SST']
        # )

        # # FIXME - need to add lock?
        # if len(self.inst_health) == 0:
        #     for id_now in self.tel_ids:
        #         self.inst_health.append({'id': id_now, 'val': 0})

        return
Example #2
0
    def __init__(self, widget_id=None, sm=None, *args, **kwargs):
        # standard common initialisations
        BaseWidget.__init__(
            self,
            widget_id=widget_id,
            sm=sm,
        )

        self.time_information = {
            'history_step_sec': -1,
            'history_duration_sec': -1,
            'history_start_sec': -1,
            'is_night_now': -1,
            'night_end_sec': -1,
            'night_start_sec': -1,
            'time_now_sec': -1,
        }

        # widget-specific initialisations
        self.block_keys = [['wait'], ['run'], ['done', 'cancel', 'fail']]
        self.blocks = {}
        for keys_now in self.block_keys:
            self.blocks[keys_now[0]] = []

        self.time_of_night = {}
        self.inst_health = []

        self.tel_ids = self.sm.inst_data.get_inst_ids(
            inst_types=['LST', 'MST', 'SST'])

        if len(self.inst_health) == 0:
            for id_now in self.tel_ids:
                self.inst_health.append({'id': id_now, 'val': 0})

        return
    def __init__(self, widget_id='', sm=None, *args, **kwargs):
        # standard common initialisations
        BaseWidget.__init__(
            self,
            widget_id=widget_id,
            sm=sm,
        )

        # optionally turn off updates for debugging
        # self.do_data_updates = False

        return
    def __init__(self, widget_id='', sm=None, *args, **kwargs):
        # standard common initialisations
        BaseWidget.__init__(
            self,
            widget_id=widget_id,
            sm=sm,
        )

        # widget-specific initialisations
        pass

        return
Example #5
0
    def __init__(self, widget_id=None, sm=None, *args, **kwargs):
        # standard common initialisations
        BaseWidget.__init__(
            self,
            widget_id=widget_id,
            sm=sm,
        )

        # widget-specific initialisations
        self.restore_delay_sec = 2

        return
Example #6
0
    def __init__(self, widget_id=None, sm=None, *args, **kwargs):
        # standard common initialisations
        BaseWidget.__init__(
            self,
            widget_id=widget_id,
            sm=sm,
        )

        self.no_sub_arr_name = self.base_config.no_sub_arr_name

        # widget-specific initialisations
        self.pos0 = [0, 90]

        self.tel_ids = self.sm.inst_data.get_inst_ids(
            inst_types=['LST', 'MST', 'SST'])

        return
Example #7
0
    def __init__(self, widget_id='', sm=None, *args, **kwargs):
        # standard common initialisations
        BaseWidget.__init__(
            self,
            widget_id=widget_id,
            sm=sm,
        )

        self.history_duration_sec = 6 * 60 * 60
        self.history_step_sec = 10 * 60

        self.tel_ids = self.sm.inst_data.get_inst_ids(inst_types=['LST', 'MST', 'SST'])
        self.time_information = {
            'history_step_sec': -1,
            'history_duration_sec': -1,
            'history_start_sec': -1,
            'is_night_now': -1,
            'night_end_sec': -1,
            'night_start_sec': -1,
            'time_now_sec': -1,
        }

        return
Example #8
0
    def __init__(self, widget_id=None, sm=None, *args, **kwargs):
        # standard common initialisations
        BaseWidget.__init__(
            self,
            widget_id=widget_id,
            sm=sm,
        )

        self.time_information = {
            'history_step_sec': -1,
            'history_duration_sec': -1,
            'history_start_sec': -1,
            'is_night_now': -1,
            'night_end_sec': -1,
            'night_start_sec': -1,
            'time_now_sec': -1,
        }

        # widget-specific initialisations
        self.tel_category = 'Telescope'
        self.tel_type = ['LST', 'MST', 'SST', 'AUX']
        self.tel_key = ['mirror', 'camera', 'mount', 'daq', 'aux']
        self.tel_ids = self.sm.inst_data.get_inst_ids(inst_types=self.tel_type)

        self.weather_category = 'Weather'
        self.weather_type = ['WS1', 'WS2', 'WS3', 'WS4']
        self.weather_key = ['Temp', 'Wind', 'Rain', 'Cloud']

        # self.hierarchy = [[self.tel_category, self.weather_category], self.tel_type, self.tel_key, self.tel_ids]
        # self.depthHierarchy = 0

        # self.hierarchy = {'id': 'root', 'keys': [self.tel_category], 'children': [
        #     {'id': 'tel_type', 'keys': self.tel_type, 'children': [
        #         {'id': 'tel_key', 'keys': self.tel_key, 'children': [
        #             {'id': 'tel_ids', 'keys': self.tel_ids, 'children': []}
        #         ]},
        #         # {'id': 'tel_idsFirst', 'keys': self.tel_ids, 'children': [
        #         #     {'id': 'tel_keySecond', 'keys': self.tel_key, 'children': []}
        #         # ]}
        #     ]},
        #     # {'id': 'weather_type', 'keys': self.weather_type, 'children': [
        #     #     {'id': 'weather_key', 'keys': self.weather_key, 'children': []}
        #     # ]}
        # ]}

        self.relationship = {
            # 'root': {'name': 'Root', 'children': ['global']},
            'global': {
                'name': 'All Data',
                'children': [self.tel_category, self.weather_category]
            },
            'tel_type': {
                'name': 'Size',
                'children': self.tel_type
            },
            'tel_key': {
                'name': 'Property',
                'children': self.tel_key
            },
            'tel_ids': {
                'name': 'Name',
                'children': self.tel_ids
            },
            'weather_type': {
                'name': 'Weath. Stat.',
                'children': self.weather_type
            },
            'weather_key': {
                'name': 'Measure',
                'children': self.weather_key
            }
        }
        self.relationship[self.tel_category] = {
            'name': 'Telescopes',
            'children': ['tel_type', 'tel_key', 'tel_ids']
        }
        self.relationship[self.weather_category] = {
            'name': 'Weather',
            'children': ['weather_type', 'weather_key']
        }
        for value in self.tel_type:
            self.relationship[value] = {'name': value, 'children': ['tel_key', 'tel_ids']}
        for value in self.tel_key:
            self.relationship[value] = {
                'name': value,
                'children': ['tel_type', 'tel_ids']
            }
        for value in self.tel_ids:
            self.relationship[value] = {'name': value, 'children': ['tel_key']}
        for value in self.weather_type:
            self.relationship[value] = {'name': value, 'children': ['weather_key']}
        for value in self.weather_key:
            self.relationship[value] = {'name': value, 'children': ['weather_type']}

        self.categories = {
            # 'root': 'group',
            'global': 'group',
            'tel_type': 'group',
            'tel_key': 'group',
            'tel_ids': 'group',
            'weather_type': 'group',
            'weather_key': 'group'
        }
        self.categories[self.tel_category] = 'group'
        self.categories[self.weather_category] = 'group'
        for value in self.tel_type:
            self.categories[value] = 'item'
        for value in self.tel_key:
            self.categories[value] = 'item'
        for value in self.tel_ids:
            self.categories[value] = 'item'
        for value in self.weather_type:
            self.categories[value] = 'item'
        for value in self.weather_key:
            self.categories[value] = 'item'

        # self.relationship = {
        #     'root': [self.tel_category,self.weather_category],
        #     'tel_type': self.tel_type,
        #     'tel_key': self.tel_key,
        #     'tel_ids': self.tel_ids,
        #     'weather_type': self.weather_type,
        #     'weather_key': self.weather_key,
        # }

        # self.relationship = {'root': {'parent': [], 'children': [self.tel_category, self.weather_category]}}
        # self.relationship[self.tel_category] = {'parent': ['root'], 'children': self.tel_type}
        # for value in self.tel_type:
        #     self.relationship[value] = {'parent': [self.tel_category, self.weather_category], 'children': self.tel_key}
        # for value in self.tel_key:
        #     self.relationship[value] = {'parent': self.tel_type, 'children': self.tel_ids}
        # for value in self.tel_ids:
        #     self.relationship[value] = {'parent': self.tel_key, 'children': []}
        # self.relationship[self.weather_category] = {'parent': ['root'], 'children': self.weather_type}
        # for value in self.weather_type:
        #     self.relationship[value] = {'parent': [self.tel_category, self.weather_category], 'children': self.weather_key}
        # for value in self.weather_key:
        #     self.relationship[value] = {'parent': self.weather_type, 'children': []}

        self.selected_keys = ['global']

        self.agregate = self.tel_ids