def __init__(self, parent, data): wx.Dialog.__init__(self, parent, title=L('CLUSTER_FILTER'), size=(400, 390)) self.SetBackgroundColour(wx.Colour(255, 255, 255)) pub().subscribe(self.update_language, T.LANGUAGE_CHANGED) self.parent = parent self.data = data sboxs_fc = self.set_filter_config() line = self.get_line() sbuttons = self.set_buttons() vsizer = wx.BoxSizer(wx.VERTICAL) vsizer.Add(sboxs_fc, 0, wx.EXPAND | wx.ALL, 7) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(vsizer, 0, wx.EXPAND) _style = wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.RIGHT | wx.TOP sizer.Add(line, 0, _style, 5) sizer.Add(sbuttons, flag=wx.ALIGN_RIGHT | wx.TOP | wx.BOTTOM, border=10) self.SetSizer(sizer) self.ShowModal()
def __init__(self, parent, page): _style = wx.LC_REPORT | wx.LC_SINGLE_SEL | ULC.ULC_BORDER_SELECT _style = _style | ULC.ULC_NO_HEADER ULC.UltimateListCtrl.__init__(self, parent, wx.ID_ANY, agwStyle=_style) pub().subscribe(self.update_language, T.LANGUAGE_CHANGED) self.currentItem = 0 self.page = page self.Bind(wx.EVT_RIGHT_UP, self.OnRightClick) self.Bind(ULC.EVT_LIST_ITEM_SELECTED, self.OnItemSelected) self.InsertColumn(0, L('NAME'), width=78, format=ULC.ULC_FORMAT_CENTER) self.InsertColumn(1, 'nro.', width=42, format=ULC.ULC_FORMAT_CENTER) self.InsertColumn(2, '%', width=42, format=ULC.ULC_FORMAT_CENTER) self.InsertColumn(3, 'c', width=15, format=ULC.ULC_FORMAT_LEFT) self.InsertColumn(4, 'r', width=15, format=ULC.ULC_FORMAT_LEFT) self.SetColumnToolTip(0, L('NAME_TOLL_TIP')) self.SetColumnToolTip(1, L('INDI_BY_CLUSTER')) self.SetColumnToolTip(2, L('PORCEN_BY_CLUSTER')) self.SetColumnToolTip(3, L('COLOR_CLUSTER')) self.SetColumnToolTip(4, L('COLOR_SUMMARY'))
def __init__(self, parent, kblocks): wx.Panel.__init__(self, parent, -1) pub().subscribe(self.update_language, T.LANGUAGE_CHANGED) self.SetBackgroundColour('#FFFFFF') self.kblocks = kblocks self.row_index = [] self.list_control = CheckListCtrl(self) sizer = wx.BoxSizer(wx.VERTICAL) self._checked_all = wx.CheckBox(self, -1, L('SELECT_ALL')) self._checked_all.Bind(wx.EVT_CHECKBOX, self.on_checked_all) space_text = wx.StaticText(self, -1, ' ') self._color_date_label = wx.StaticText(self, -1, L('SELECT_COLOR_DATA')) self.color_date = csel.ColourSelect(self, -1, colour=wx.Colour(243, 228, 168)) sizer_hor = wx.BoxSizer(wx.HORIZONTAL) sizer_hor.Add(self._checked_all, flag=wx.ALIGN_CENTER_VERTICAL) sizer_hor.Add(space_text, flag=wx.ALIGN_CENTER_VERTICAL) sizer_hor.Add(self.color_date, flag=wx.ALIGN_CENTER_VERTICAL) sizer_hor.Add(self._color_date_label, flag=wx.ALIGN_CENTER_VERTICAL) sizer.Add(sizer_hor, flag=wx.ALIGN_CENTER_VERTICAL) sizer.Add(self.list_control, 1, wx.EXPAND) self.SetSizer(sizer) self.init()
def __init__(self, parent): aui.AuiToolBar.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize, agwStyle=aui.AUI_TB_DEFAULT_STYLE | aui.AUI_TB_OVERFLOW) self.parent = parent self.SetToolBitmapSize(wx.Size(48, 48)) self.SetIdReferences() # --- item de proyecto self.AddSimpleTool(self.ID_NEW_PRO, '', inew.GetBitmap()) self.AddSimpleTool(self.ID_OPEN_PRO, '', iopen.GetBitmap()) self.AddSimpleTool(self.ID_CLOSE_PRO, '', iclose.GetBitmap()) self.AddSimpleTool(self.ID_DEL_PRO, '', idelete.GetBitmap()) self.AddSeparator() self.AddSimpleTool(self.ID_HIDE_PRO, '', iunhide.GetBitmap()) self.AddSimpleTool(self.ID_UNHIDE_PRO, '', ihide.GetBitmap()) self.Bind(wx.EVT_TOOL, self.on_new_project, id=self.ID_NEW_PRO) self.Bind(wx.EVT_TOOL, self.on_close_project, id=self.ID_CLOSE_PRO) self.Bind(wx.EVT_TOOL, self.on_open_project, id=self.ID_OPEN_PRO) self.Bind(wx.EVT_TOOL, self.on_hide_project, id=self.ID_HIDE_PRO) self.Bind(wx.EVT_TOOL, self.on_unhide_project, id=self.ID_UNHIDE_PRO) self.Bind(wx.EVT_TOOL, self.on_delete_project, id=self.ID_DEL_PRO) # Establecemos los labels self.SetLabelsLanguages() self.init_disable() # ---- actualización de los botones pub().subscribe(self.update_toolbar, T.TYPE_CHANGED_SELECTED_PROJECT) pub().subscribe(self.update_toolbar1, T.TYPE_CHANGED_UNSELECTED_PROJECT)
def __init__(self, parent, dialog_ref, a_conf): ''' Método de inicialización de la clase. :param parent: referencia al contenedor padre. :param dialog_ref: referencia a la clase Dialog principal ''' wx.Panel.__init__(self, parent, style=0) pub().subscribe(self.update_language, T.LANGUAGE_CHANGED) self.dialog_ref = dialog_ref self.SetBackgroundColour(wx.Colour(255, 255, 255)) sboxs_spf = self.get_spines_figure(a_conf) sboxs_lglc = self.get_legend_location(a_conf) sboxs_grid = self.get_grid(a_conf) sboxs_axes_labels = self.get_xy_label(a_conf) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(sboxs_spf, 0, wx.EXPAND | wx.ALL, 3) sizer.Add(sboxs_lglc, 0, wx.EXPAND | wx.ALL, 3) sizer.Add(sboxs_grid, 0, wx.EXPAND | wx.ALL, 3) sizer.Add(sboxs_axes_labels, 0, wx.EXPAND | wx.ALL, 3) self.SetSizer(sizer)
def __init__(self, parent, dialog_ref, conf): ''' Método de inicialización del Panel. :param parent: referencia al contenedor padre. ''' wx.Panel.__init__(self, parent, style=0) pub().subscribe(self.update_language, T.LANGUAGE_CHANGED) self.dialog_ref = dialog_ref self.SetBackgroundColour(wx.Colour(255, 255, 255)) sboxs_sf = self.get_size_figure(conf) sboxs_spf = self.get_spacing_figure(conf) msizer = wx.BoxSizer(wx.VERTICAL) msizer.Add(sboxs_sf, 0, wx.EXPAND | wx.ALL, 10) msizer.Add(sboxs_spf, 0, wx.EXPAND | wx.ALL, 10) sizer = wx.BoxSizer(wx.HORIZONTAL) sizer.Add(msizer, 0, wx.EXPAND) self.SetSizer(sizer)
def new_results(self, message): self.p_project = message.data self.p_path_files = [] self.p_formate = 10 self.p_create = False self.p_sep = ',' NewProject(self, self.properties, True) if self.p_create: style = wx.PD_APP_MODAL style |= wx.PD_CAN_ABORT dlg = PP.PyProgress(self, -1, L('MSG_PRO_HEADER_TITLE'), " :)", agwStyle=style) res, errs = self.ppr.add_res(self.p_project, self.p_path_files, self.p_formate, self.p_sep, dlg) dlg.Close() dlg.Destroy() # ---- informe de archivos con errores if errs != []: ResultErrors(self, errs) pub().sendMessage(T.ADD_RESULTS_IN_TREE, res) wx.SafeYield() wx.GetApp().GetTopWindow().Raise()
def __init__(self, parent): _title = L('CLUSTER_CONFIG') wx.Dialog.__init__(self, parent, title=_title, size=(400, 560)) self.SetBackgroundColour(wx.Colour(255, 255, 255)) pub().subscribe(self.update_language, T.LANGUAGE_CHANGED) sboxs_vm = self.set_visualization_mode() sbuttons = self.set_buttons() line = self.get_line() msizer = wx.BoxSizer(wx.VERTICAL) msizer.Add(sboxs_vm, 0, wx.EXPAND | wx.ALL, 7) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(msizer, 0, wx.EXPAND) _style = wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.RIGHT | wx.TOP sizer.Add(line, 0, _style, 5) sizer.Add(sbuttons, flag=wx.ALIGN_RIGHT | wx.TOP | wx.BOTTOM, border=10) self.SetSizer(sizer) self.Show()
def stop_busy(self): pub().sendMessage(T.STOP_BUSY) self.b_play.Enable() self.toolbar.Enable() self.b_setting.Enable() self.ch_graph.Enable() self.b_highligh.Enable() self.b_sorted.Enable()
def start_busy(self): pub().sendMessage(T.START_BUSY) self.b_play.Disable() self.toolbar.Disable() self.b_setting.Disable() self.ch_graph.Disable() self.b_highligh.Disable() self.b_sorted.Disable()
def do_selected(self, data, item): if isinstance(data, Project): self.last_sate_project = data.state self.less_project = True pub().sendMessage(T.TYPE_CHANGED_SELECTED_PROJECT, data.state) elif self.less_project: self.less_project = False pub().sendMessage(T.TYPE_CHANGED_UNSELECTED_PROJECT)
def start_busy(self): pub().sendMessage(T.START_BUSY) self.tbtna.SetLabelColor(wx.Colour(191, 191, 191)) self.tbtna.Disable() self.tbtnb.SetLabelColor(wx.Colour(191, 191, 191)) self.tbtnb.Disable() self.sc_count_clusters.Disable() self.cb_shape.Disable() self.cb_kmeans.Disable() self.clusters_seccion.s_enable(False)
def on_unhide(self, event): ret = [] for i in range(self.dvlc.GetItemCount()): if self.dvlc.IsChecked(i): ret.append(self.current[self.dvlc.GetItemText(i)]) self.Hide() if len(ret): pub().sendMessage(T.UNHIDE_PROJECT, tuple(ret)) self.Close()
def new_view(self, message): project = message.data self.view_name = '' self.vews_results = [] ViewsTava(self, project) if self.vews_results: view = self.ppr.add_views(self.view_name, self.vews_results, project) pub().sendMessage(T.ADD_VIEW_IN_TREE, view)
def __init__(self, parent): wx.Panel.__init__(self, parent) self.v_setting() pub().subscribe(self.show_view, T.SHOW_SELECTED_VIEW) pub().subscribe(self.pre_delete_page, T.PRE_DELETE_VIEW) self.sizer = wx.BoxSizer(wx.VERTICAL) self.SetSizer(self.sizer) self.v_content()
def delete_result(self, message): if self.ppr.contain_view(message.data.id): # ---- no se puede eliminar resultado, utilizado en vista dlg = wx.MessageDialog(self, L('RESULT_NOT_DELETE'), L('RESULT_NOT_DELETE_HEADER'), wx.OK | wx.ICON_ERROR) dlg.ShowModal() dlg.Destroy() else: # --- elimina de la bd y envía mensaje de eliminación self.ppr.delete_result(message.data) pub().sendMessage(T.DELETE_RESULT_TREE)
def change_language(self, language): if not self.i18n.isEnUsLanguage() and language == 'en': self.i18n.OnEnUs() self.update_language() pub().sendMessage(T.LANGUAGE_CHANGED) self.properties.set_language('en') if not self.i18n.isEsPyLanguage() and language == 'es': self.i18n.OnEsPy() self.update_language() pub().sendMessage(T.LANGUAGE_CHANGED) self.properties.set_language('es')
def __init__(self, parent, dialog_ref): wx.Panel.__init__(self, parent) pub().subscribe(self.update_language, T.LANGUAGE_CHANGED) sizer = wx.BoxSizer(wx.VERTICAL) sboxs_ax = self.get_axes(dialog_ref) sboxs_lg = self.get_legends(dialog_ref) sizer.Add(sboxs_ax, 0, wx.EXPAND | wx.ALL, 7) sizer.Add(sboxs_lg, 0, wx.EXPAND | wx.ALL, 7) self.SetSizer(sizer)
def on_dclick(self, event): if self.c_data is None: return None data = self.c_data[0] if isinstance(data, Project): pass elif isinstance(data, PackageFile): pass elif isinstance(data, PackageView): pass elif isinstance(data, Result): pass elif isinstance(data, View): pub().sendMessage(T.SHOW_SELECTED_VIEW, data)
def __init__(self, parent): wx.Dialog.__init__(self, parent, size=(600, 585), title=L('GRAPHIC_CONFIG')) pub().subscribe(self.update_language, T.LANGUAGE_CHANGED) # ---- variable de configuración de Figura conf = parent.fig_config a_conf = parent.ax_conf rd_config = parent.radar_chard_con ag_st = LB.INB_FIT_LABELTEXT | LB.INB_LEFT | LB.INB_DRAW_SHADOW ag_st = ag_st | LB.INB_GRADIENT_BACKGROUND | LB.INB_SHOW_ONLY_TEXT ag_st = ag_st | LB.INB_BOLD_TAB_SELECTION notebook = LB.LabelBook(self, -1, agwStyle=ag_st) notebook.SetFontBold(False) notebook.SetColour(LB.INB_TAB_AREA_BACKGROUND_COLOUR, wx.Colour(132, 164, 213)) imagelist = wx.ImageList(32, 32) imagelist.Add(my_bitmap.GetBitmap()) notebook.AssignImageList(imagelist) # ---- Panel de Figuras notebook.AddPage(FigureConfigPanel(notebook, self, conf), L('FIGURE'), 1, 0) # ---- Panel de Ejes self.ax_panel = AxesConfigPanel(notebook, self, a_conf) notebook.AddPage(self.ax_panel, L('AXES'), 0, 0) # ---- Panel de Radar Chart self.rc_panel = RadarChartConfigPanel(notebook, self, rd_config) notebook.AddPage(self.rc_panel, 'RadarChard', 1, 0) self.nb = notebook sbuttons = self.set_buttons() sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(self.nb, 1, wx.EXPAND | wx.ALL, 2) sizer.Add(sbuttons, flag=wx.ALIGN_RIGHT | wx.TOP | wx.BOTTOM, border=10) self.SetSizer(sizer) self.Bind(wx.EVT_CLOSE, self.on_close) self.CenterOnScreen() self.ShowModal()
def __init__(self, parent, dialog_ref, conf): ''' ''' wx.Panel.__init__(self, parent, style=0) pub().subscribe(self.update_language, T.LANGUAGE_CHANGED) self.dialog_ref = dialog_ref self.SetBackgroundColour(wx.Colour(255, 255, 255)) msizer = self.get_config_sample(conf) sizer = wx.BoxSizer(wx.HORIZONTAL) sizer.Add(msizer, 1, wx.EXPAND | wx.ALL, 3) self.SetSizer(sizer)
def stop_busy(self): pub().sendMessage(T.STOP_BUSY) self.tbtna.Enable() self.tbtna.SetLabelColor(wx.Colour(0, 0, 255)) self.tbtnb.Enable() self.tbtnb.SetLabelColor(wx.Colour(0, 0, 255)) self.sc_count_clusters.Enable() self.clusters_seccion.update_list(self.cb_shape.GetValue(), self.cb_kmeans.GetValue()) self.cb_shape.Enable() self.cb_kmeans.Enable() self.clusters_seccion.s_enable(True) if self.cluster_filter is not None: _c = self.clusters_seccion.g_elements() self.cluster_filter.update_by_generateClusters(_c) if self.cb_shape.GetValue() and not self.cb_kmeans.GetValue(): _v = self.clusters_seccion.shape.clusters_count self.sc_count_clusters.SetValue(_v)
def __init__(self, parent): wx.Panel.__init__(self, parent, -1) pub().subscribe(self.update_language, T.LANGUAGE_CHANGED) self.SetBackgroundColour('#FFFFFF') chec_sizer = wx.BoxSizer(wx.HORIZONTAL) # ---- componetes de vistas self._checked_all = wx.CheckBox(self, -1, L('SELECT_ALL')) self._checked_all.Bind(wx.EVT_CHECKBOX, self.on_checked_all) chec_sizer.Add(self._checked_all) # ---- ver cabeceras self._checked_header = wx.CheckBox(self, -1, L('CHECK_HEADER_CLUSTER')) self._checked_header.Bind(wx.EVT_CHECKBOX, self.on_checked_header) chec_sizer.Add(self._checked_header) _agws = aui.AUI_NB_TOP | aui.AUI_NB_TAB_SPLIT | aui.AUI_NB_TAB_MOVE _agws = _agws | aui.AUI_NB_SCROLL_BUTTONS | aui.AUI_NB_DRAW_DND_TAB self.nb_clus = AuiNotebook(self, agwStyle=_agws) self.shape_list = CheckListCtrlCluster(self.nb_clus, 0) self.nb_clus.AddPage(self.shape_list, "Shape") self.kmeans_list = CheckListCtrlCluster(self.nb_clus, 1) self.nb_clus.AddPage(self.kmeans_list, "Kmeans") self.nb_clus.EnableTab(1, False) self.shape = None self.tkmeans = None self.shape_row_index = [] self.kmeans_row_index = [] self.pages = [True, False] sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(chec_sizer, flag=wx.ALIGN_CENTER_VERTICAL) sizer.Add(self.nb_clus, 1, wx.EXPAND | wx.ALL, 1) self.SetSizer(sizer)
def __init__(self, iview): ''' Constructor ''' # ---- projectos pub().subscribe(self.add_project_in_tree, T.ADD_PROJECT_IN_TREE) pub().subscribe(self.pre_close, T.CLOSE_PROJECT) pub().subscribe(self.pre_open, T.OPEN_PROJECT) pub().subscribe(self.pre_hide, T.HIDE_PROJECT) pub().subscribe(self.pre_unhide, T.UNHIDE_PROJECT) pub.subscribe(self.pre_delete, T.DELETE_PROJECT) pub().subscribe(self.update_language, T.LANGUAGE_CHANGED) # ---- vistas pub().subscribe(self.add_view_in_tree, T.ADD_VIEW_IN_TREE) pub().subscribe(self.delete_view, T.DELETE_VIEW_TREE) # --- results pub().subscribe(self.add_results_in_tree, T.ADD_RESULTS_IN_TREE) pub().subscribe(self.delete_result, T.DELETE_RESULT_TREE) self.iview = iview self.init_tree() # ---- variables de estado self.last_sate_project = None self.less_project = False
def pre_delete_page(self, message): view_id = message.data.id if view_id in self.instancias_view: self.nb_main.RemovePage(self.instancias_view.index(view_id)) pub().sendMessage(T.DELETE_VIEW, message.data)
def delete_view(self, message): self.ppr.delete_view(message.data) pub().sendMessage(T.DELETE_VIEW_TREE)
def __init__(self, parent=None): wx.Frame.__init__(self, parent) self.v_setting() # --- vistas pub().subscribe(self.new_view, T.CREATE_VIEW) pub().subscribe(self.delete_view, T.DELETE_VIEW) # ---- results pub().subscribe(self.new_results, T.NEW_RESULTS) pub().subscribe(self.delete_result, T.DELETE_RESULT) pub().subscribe(self.change_name_objectives, T.CHANGE_RESULT) # ---- project pub().subscribe(self.unhide_project, T.PREUNHIDE_PROJECT) # ---- statusbar pub().subscribe(self.start_busy, T.START_BUSY) pub().subscribe(self.stop_busy, T.STOP_BUSY) # ---- properties helper self.properties = PropertiesHelper() self.sizer = wx.BoxSizer() self.SetSizer(self.sizer) self.v_content() self.ppr = MainFrameP(self) self.Bind(wx.EVT_CLOSE, self.on_close_tava)
def on_hide_project(self, event): pub().sendMessage(T.HIDE_PROJECT)
def on_unhide_project(self, event): pub().sendMessage(T.PREUNHIDE_PROJECT)
def postTime(self, amt): """ Send time to GUI """ amtOfTime = (amt + 1) * 10 pub().sendMessage("update", amtOfTime)
def pos_unhide(self): self.init_vars() pub().sendMessage(T.TYPE_CHANGED_UNSELECTED_PROJECT)
def pos_hide(self): self.less_project = False pub().sendMessage(T.TYPE_CHANGED_UNSELECTED_PROJECT)
def __init__(self, parent, kfigure, ksub_blocks, mainpanel): scrolled.ScrolledPanel.__init__(self, parent, size=(222, -1)) pub().subscribe(self.update_language, T.LANGUAGE_CHANGED) self.parent = parent self.mainpanel = mainpanel self.kfigure = kfigure self.SetBackgroundColour("#627aa3") self.init_arrays() self.data_selected = None self.normalization = 0 self.cluster_or_date = 0 self.duplicate_true = K_DATE_DUPLICATE_TRUE self.k_plot = K_PLOT_BLOCK self.k_color = K_COLOR_SUB_BLOCK self.cluster_config = None self.cluster_filter = None self.visualization_mode = V_M_CLUSTER self.legends_cluster = [False, False, True, False] self.legends_summary = [True, False, False, False] self.clus_one_axe = True self.summ_one_axe = True self.summ_dif_color = True self.data_summ_dif_color = True self.clus_summ_axs = [True, False, False, False] # ---- Lista de Datos self.data_seccion = DataSeccion(self, ksub_blocks) # ---- datos - normalización de datos panel_control = wx.Panel(self) panel_control.SetBackgroundColour('#3B598D') panel_radio = wx.Panel(panel_control) grid_radio = wx.BoxSizer(wx.HORIZONTAL) radio1 = wx.RadioButton(panel_radio, -1, 'Cluster', style=wx.RB_GROUP) radio1.SetForegroundColour("white") self.radio2 = wx.RadioButton(panel_radio, -1, L('DATA')) grid_radio.Add(radio1, 0, wx.ALL, 5) grid_radio.Add(self.radio2, 0, wx.ALL, 5) radio1.Bind(wx.EVT_RADIOBUTTON, self.on_check_cluster) self.radio2.Bind(wx.EVT_RADIOBUTTON, self.on_check_data) self.radio2.SetForegroundColour("white") panel_radio.SetSizer(grid_radio) panel_radio.SetBackgroundColour('#3B598D') panel_sizer = wx.BoxSizer(wx.VERTICAL) panel_sizer.Add(panel_radio, 1, wx.ALIGN_CENTER_HORIZONTAL) panel_control.SetSizer(panel_sizer) grid = wx.FlexGridSizer(cols=2) self.tbtn0 = platebtn.PlateButton(self, -1, self.NORMA_METO[self.normalization], None, style=platebtn.PB_STYLE_SQUARE | platebtn.PB_STYLE_NOBG) menu = wx.Menu() m_n1 = wx.MenuItem(menu, 0, self.NORMA_METO[0]) self.m_n2 = wx.MenuItem(menu, 1, self.NORMA_METO[1]) self.m_n3 = wx.MenuItem(menu, 2, self.NORMA_METO[2]) m_n4 = wx.MenuItem(menu, 3, self.NORMA_METO[3]) menu.AppendItem(m_n1) menu.AppendItem(self.m_n2) menu.AppendItem(self.m_n3) menu.AppendItem(m_n4) self.tbtn0.SetMenu(menu) self.tbtn0.SetLabelColor(wx.Colour(0, 0, 255)) self.tbtn0.Bind(wx.EVT_MENU, self.on_nor_menu) grid.Add(self.tbtn0, 0, wx.ALIGN_LEFT | wx.ALL, 5) # ---- Configuración de Clusters clus_sizer = wx.BoxSizer(wx.HORIZONTAL) self.cb_shape = wx.CheckBox(self, -1, "Shape") self.cb_shape.SetForegroundColour("white") self.cb_shape.SetValue(True) self.cb_kmeans = wx.CheckBox(self, -1, "Kmeans") self.cb_kmeans.SetForegroundColour("white") clus_sizer.Add(self.cb_shape) clus_sizer.Add(self.cb_kmeans) self.cb_shape.Bind(wx.EVT_CHECKBOX, self.on_cluster_shape_or_kmeans) self.cb_kmeans.Bind(wx.EVT_CHECKBOX, self.on_cluster_shape_or_kmeans) c_sizer = wx.BoxSizer() self.sc_count_clusters = wx.SpinCtrl(self, -1, "", size=(80, 30)) self.sc_count_clusters.SetRange(0, 1000) self.sc_count_clusters.SetValue(0) tbtna = platebtn.PlateButton(self, -1, self.ANALISIS_LABEL[0], None, style=platebtn.PB_STYLE_DEFAULT | platebtn.PB_STYLE_NOBG) tbtna.SetPressColor(wx.Colour(255, 165, 0)) tbtna.SetLabelColor(wx.Colour(0, 0, 255)) tbtna.Bind(wx.EVT_BUTTON, self.on_generate) self.tbtna = tbtna c_sizer.Add(self.sc_count_clusters, 0, wx.TOP | wx.RIGHT | wx.LEFT | wx.ALIGN_CENTER_HORIZONTAL, 5) c_sizer.Add(tbtna, 0, wx.TOP | wx.RIGHT | wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 5) # ---- seleccionar - analizar a_sizer = wx.BoxSizer() tbtnb = platebtn.PlateButton(self, -1, self.ANALISIS_LABEL[1], None, style=platebtn.PB_STYLE_DEFAULT | platebtn.PB_STYLE_NOBG) tbtnb.SetPressColor(wx.Colour(165, 42, 42)) tbtnb.SetLabelColor(wx.Colour(0, 0, 255)) tbtnb.Bind(wx.EVT_BUTTON, self.on_filter) self.tbtnb = tbtnb tbtnc = platebtn.PlateButton(self, -1, self.ANALISIS_LABEL[2], None, style=platebtn.PB_STYLE_DEFAULT | platebtn.PB_STYLE_NOBG) tbtnc.SetPressColor(wx.Colour(165, 42, 42)) tbtnc.SetLabelColor(wx.Colour(0, 0, 255)) tbtnc.Bind(wx.EVT_BUTTON, self.on_config) self.tbtnc = tbtnc a_sizer.Add(tbtnb, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 5) a_sizer.Add(tbtnc, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 5) # ---- Lista de Clusters self.clusters_seccion = ClusterSeccion(self) # ---- marco visualización self.sizer = wx.BoxSizer(wx.VERTICAL) self.sizer.Add(self.data_seccion, 2, wx.EXPAND | wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 2) self.sizer.Add(grid, 0, wx.TOP | wx.RIGHT | wx.LEFT | wx.ALIGN_CENTER_HORIZONTAL, 2) self.sizer.Add(panel_control, 0, wx.EXPAND | wx.TOP | wx.RIGHT | wx.LEFT | wx.ALIGN_RIGHT, 2) self.sizer.Add(clus_sizer, 0, wx.TOP | wx.RIGHT | wx.LEFT | wx.ALIGN_CENTER_HORIZONTAL, 2) self.sizer.Add(c_sizer, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 1) self.sizer.Add(self.clusters_seccion, 4, wx.EXPAND | wx.ALL, 1) self.sizer.Add(a_sizer, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 2) self.SetSizer(self.sizer) self.SetAutoLayout(1) self.SetupScrolling()
def __init__(self, parent): wx.Panel.__init__(self, parent) self.SetBackgroundColour('#DCE5EE') pub().subscribe(self.update_language, T.LANGUAGE_CHANGED) self.control_panel = None self.dframes = [] self.order_names = [] self.key_figure = 1 self.mode_run = False self.current_dataframes = None self.current_datacolors = None self.run_explorer = False self.figure_config_dialog_ref = None # ---- inicialización de figura self.fig = Figure() self.canvas = FigureCanvas(self, -1, self.fig) # ---- configuración de figura self.fig_config = FigureConfig() self.set_figure_config() # ---- configuración de axe self.ax_conf = AxesConfig() # ---- radar chard config self.radar_chard_con = RadarChadConfig() # ---- toolbar self.sizer_tool = wx.BoxSizer(wx.HORIZONTAL) _bitmap = play_fig.GetBitmap() self.b_play = wx.BitmapButton(self, -1, _bitmap, style=wx.NO_BORDER) self.sizer_tool.Add(self.b_play, flag=wx.ALIGN_CENTER_VERTICAL) self.b_play.Bind(wx.EVT_BUTTON, self.on_play) self.b_play.SetToolTipString(L('VISUALIZE_DATE_CLUSTER')) _bitmap = settings_fig.GetBitmap() self.b_setting = wx.BitmapButton(self, -1, _bitmap, style=wx.NO_BORDER) self.sizer_tool.Add(self.b_setting, flag=wx.ALIGN_CENTER_VERTICAL) self.b_setting.Bind(wx.EVT_BUTTON, self.on_config) self.b_setting.SetToolTipString(L('FIGURE_CONF')) _bitmap = sort_and_filter.GetBitmap() self.b_sorted = wx.BitmapButton(self, -1, _bitmap, style=wx.NO_BORDER) self.b_sorted.Bind(wx.EVT_BUTTON, self.on_sort_and_filter) self.b_sorted.SetToolTipString(L('BUTTON_ORDER_AND_FILTER')) self.b_sorted.Disable() self.sizer_tool.Add(self.b_sorted, 0, wx.ALIGN_CENTER_VERTICAL) _bp = line_highligh.GetBitmap() self.b_highligh = wx.BitmapButton(self, -1, _bp, style=wx.NO_BORDER) self.b_highligh.Bind(wx.EVT_BUTTON, self.on_highligh) self.b_highligh.SetToolTipString(L('BUTTON_HIGHLIGHT')) self.b_highligh.Disable() self.sizer_tool.Add(self.b_highligh, 0, wx.ALIGN_CENTER_VERTICAL) self.toolbar = Toolbar(self.canvas) self.toolbar.Realize() self.toolbar.SetBackgroundColour('#DCE5EE') self.sizer_tool.Add(self.toolbar, 0, wx.ALIGN_CENTER_VERTICAL) choice_grafic = self.get_choice_grafic() self.sizer_tool.Add(choice_grafic, wx.ALIGN_LEFT) self.sizer = wx.BoxSizer(wx.VERTICAL) self.sizer.Add(self.sizer_tool, 0, wx.EXPAND) self.sizer.Add(self.canvas, 1, wx.EXPAND) self.SetSizer(self.sizer) self.Fit() self._welcome()
def on_close_project(self, event): pub().sendMessage(T.CLOSE_PROJECT)
def on_open_project(self, event): pub().sendMessage(T.OPEN_PROJECT)