''

def on_activated_async(self, view):

    if stino.arduino_info[u'init_done']:
        panel_names = [u'stino_panel', u'stino_build_panel']
        for panel_name in panel_names:
            win = view.window()
            if win:
                panel = win.find_output_panel(panel_name)
                if panel:
                    vector = panel.layout_extent()
                    key = (u'%s_size' % panel_name)
                    stino.arduino_info[u'selected'].set(key, vector)
        view_name = view.name()
        if view_name.endswith(u'-    Serial    Monitor'):
            serial_port = view_name.split(u'-')[0].strip()
            view.run_command(u'stino_send_to_serial', {u'serial_port': serial_port})
        if (self.global_settings is None):
            app_dir_path = stino.arduino_info[u'arduino_app_path']
            settings_path = os.path.join(app_dir_path, u'global.stino-settings')
            self.global_settings = stino.file.SettingsFile(settings_path)
        has_settings_changed = False
        file_path = view.file_name()
        if (file_path and stino.c_file.is_cpp_file(file_path)):
            dir_path = os.path.dirname(file_path)
            conf_file_name = u'config.stino-settings'
            conf_file_path = os.path.join(dir_path, conf_file_name)
            if os.path.isfile(conf_file_path):
                has_settings_changed = True
                settings = stino.file.SettingsFile(conf_file_path)
                if (not self.is_sketch_settings):
                    self.is_sketch_settings = True
                    selected = stino.arduino_info[u'selected']
                    pkg = selected.get(u'package', u'')
                    ptfm = selected.get(u'platform', u'')
                    ver = selected.get(u'version', u'')
                    board = selected.get((u'board@%s' % ptfm), u'')
                    programmer = selected.get(u'programmer', u'')
                    self.global_settings.set(u'package', pkg)
                    self.global_settings.set(u'platform', ptfm)
                    self.global_settings.set(u'version', ver)
                    self.global_settings.set((u'board@%s' % ptfm), board)
                    self.global_settings.set(u'programmer', programmer)
                    board_info = stino.arduino_info[u'boards'].get(board, {})
                    options = board_info.get(u'options', [])
                    for option in options:
                        key = (u'option_%s@%s' % (option, board))
                        value = selected.get(key)
                        self.global_settings.set(key, value)
            elif self.is_sketch_settings:
                has_settings_changed = True
                self.is_sketch_settings = False
                settings = self.global_settings
            if has_settings_changed:
                pkg = settings.get(u'package', u'')
                ptfm = settings.get(u'platform', u'')
                ver = settings.get(u'version', u'')
                pkgs_info = stino.arduino_info.get(u'installed_packages', {})
                ptfm_info = stino.selected.get_platform_info(pkgs_info, pkg, ptfm, ver)
                if ptfm_info:
                    stino.do_action.put(stino.on_platform_select, pkg, ptfm)
                    stino.do_action.put(stino.on_version_select, ver)
                    keys = settings.get_keys()
                    for key in keys:
                        if key.startswith(u'option_'):
                            value = settings.get(key)
                            stino.on_board_option_select(key, value)
                    board = settings.get((u'board@%s' % ptfm), u'')
                    stino.do_action.put(stino.on_board_select, board)
                    programmer = settings.get(u'programmer', u'')
                    stino.on_programmer_select(programmer)
            selected = stino.arduino_info[u'selected']
            pkg = selected.get(u'package')
            ptfm = selected.get(u'platform')
            ver = selected.get(u'version')
            board = selected.get((u'board@%s' % ptfm))
            text = (u'[%s,    %s,    %s,    %s' % (pkg, ptfm, ver, board))
            board_info = stino.arduino_info[u'boards'].get(board, {})
            options = board_info.get(u'options', [])
            for option in options:
                key = (u'option_%s@%s' % (option, board))
                sel_value_name = selected.get(key)
                text += (u',    %s' % sel_value_name)
            serial_port = selected.get(u'serial_port')
            if serial_port:
                text += (u',    %s' % serial_port)
            text += u']'
            view.set_status(u'selected', text)
