- self.prof_seg_nb.AddPage(self.tab_prof_seg, 'classe %i' % (i + 1))
-
- if clnb > 2 :
- self.TabAFC = aui.AuiNotebook(panel.TabChdSim, -1, wx.DefaultPosition)
- log.info('read AFC')
- list_graph=read_list_file(DictPathOut['liste_graph_afc'], self.encoding)
- self.tabAFCGraph = GraphPanelAfc(self.TabAFC, DictPathOut, list_graph, self.clnb, coding=self.encoding)
- self.TabAFC.AddPage(self.tabAFCGraph, 'AFC')
-
- if os.path.exists(self.DictPathOut['afc_facteur']) :
- dictrow, first = ReadList(self.DictPathOut['afc_facteur'], self.encoding)
- self.TabAFC_facteur = ListForSpec(self.parent, parametres, dictrow, first)
- #dictrow, first = ReadList(self.DictPathOut['afc_row'], self.encoding)
- #self.TabAFC_ligne = ListForSpec(self.parent, self.parametres, dictrow, first)
- #dictrow, first = ReadList(self.DictPathOut['afc_col'], self.encoding)
- #self.TabAFC_colonne = ListForSpec(parent, self.parametres, dictrow, first)
- self.TabAFC.AddPage(self.TabAFC_facteur, 'Facteurs')
- #self.TabAFC.AddPage(self.TabAFC_colonne, u'Colonnes')
- #self.TabAFC.AddPage(self.TabAFC_ligne, u'Lignes')
-
- sizer_3 = wx.BoxSizer(wx.VERTICAL)
- self.parent.nb_panel_2 = wx.Panel(panel.TabChdSim, -1)
- self.parent.button_simi = wx.Button(self.parent.nb_panel_2, -1, "Voyager")
- self.parent.simi3dpanel = simi3d(self.parent.nb_panel_2, -1)
- sizer_3.Add(self.parent.simi3dpanel, 1, wx.EXPAND, 0)
- sizer_3.Add(self.parent.button_simi, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
- self.parent.nb_panel_2.SetSizer(sizer_3)
- self.TabAFC.AddPage(self.parent.nb_panel_2, "graph 3D")
- self.parent.Bind(wx.EVT_BUTTON, self.onsimi, self.parent.button_simi)
-
- panel.TabChdSim.AddPage(panel.ProfNB, 'Profils')
- #panel.TabChdSim.AddPage(panel.AntiProfNB, 'Antiprofils')
- dlg.Update(4 + self.clnb, 'Affichage...')
- if clnb > 2 :
- panel.TabChdSim.AddPage(self.TabAFC, 'AFC')
- if os.path.exists(DictPathOut['prof_seg']) :
- panel.TabChdSim.AddPage(self.prof_seg_nb, u'Profils des segments répétés')
-
-# panel.Bind(wx.EVT_BUTTON, self.ongetrapport, id = self.ID_rapport)
- self.parent.nb.AddPage(panel, 'Classification - %s' % corpname)
- self.parent.ShowTab(True)
- self.parent.nb.SetSelection(self.parent.nb.GetPageCount() - 1)
- #for pane in self.parent._mgr.GetAllPanes() :
- # if isinstance(pane.window, aui.AuiNotebook):
- # nb = pane.window
- # nb.SetAGWWindowStyleFlag(notebook_flags)
- # nb.SetArtProvider(aui.ChromeTabArt())
- dlg.Destroy()
- self.parent._mgr.Update()
-
+ self.prof_seg_nb.AddPage(self.tab_prof_seg, _("Cluster") + ' %i' % (i + 1))
+ panel.ProfNB.SetSelection(0)
+ if clnb > 2 :
+ self.TabAFC = aui.AuiNotebook(panel.TabChdSim, -1, wx.DefaultPosition)
+ log.info('read AFC')
+ list_graph=read_list_file(DictPathOut['liste_graph_afc'])
+ self.tabAFCGraph = GraphPanelAfc(self.TabAFC, DictPathOut, list_graph, self.clnb)
+ self.TabAFC.AddPage(self.tabAFCGraph, _("CA"))
+ if os.path.exists(self.DictPathOut['afc_facteur']) :
+ dictrow, first = ReadList(self.DictPathOut['afc_facteur'])
+ self.TabAFC_facteur = ListForSpec(self.parent, parametres, dictrow, first[1:])
+ # dictrow, first = ReadList(self.DictPathOut['afc_row'], self.encoding)
+ # self.TabAFC_ligne = ListForSpec(self.parent, self.parametres, dictrow, first)
+ # dictrow, first = ReadList(self.DictPathOut['afc_col'], self.encoding)
+ # self.TabAFC_colonne = ListForSpec(parent, self.parametres, dictrow, first)
+ self.TabAFC.AddPage(self.TabAFC_facteur, _("Factor"))
+ # self.TabAFC.AddPage(self.TabAFC_colonne, 'Colonnes')
+ # self.TabAFC.AddPage(self.TabAFC_ligne, 'Lignes')
+ sizer_3 = wx.BoxSizer(wx.VERTICAL)
+ self.parent.nb_panel_2 = wx.Panel(panel.TabChdSim, -1)
+ self.parent.button_simi = wx.Button(self.parent.nb_panel_2, -1, "Voyager")
+ self.parent.simi3dpanel = simi3d(self.parent.nb_panel_2, -1)
+ sizer_3.Add(self.parent.simi3dpanel, 1, wx.EXPAND, 0)
+ sizer_3.Add(self.parent.button_simi, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
+ self.parent.nb_panel_2.SetSizer(sizer_3)
+ self.TabAFC.AddPage(self.parent.nb_panel_2, _("3D graph"))
+ self.parent.Bind(wx.EVT_BUTTON, self.onsimi, self.parent.button_simi)
+ panel.TabChdSim.AddPage(panel.ProfNB, _("Profiles"))
+ # panel.TabChdSim.AddPage(panel.AntiProfNB, 'Antiprofils')
+ dlg.Update(4 + self.clnb, 'Affichage...')
+ if clnb > 2 :
+ panel.TabChdSim.AddPage(self.TabAFC, _("CA"))
+ if os.path.exists(DictPathOut['prof_seg']) :
+ panel.TabChdSim.AddPage(self.prof_seg_nb, _("Repeated segments profiles"))
+ # panel.Bind(wx.EVT_BUTTON, self.ongetrapport, id = self.ID_rapport)
+ if os.path.exists(os.path.join(self.parametres['pathout'], 'tgenchi2.csv')) :
+ self.parametres['tgenspec'] = os.path.join(self.parametres['pathout'], 'tgenchi2.csv')
+ TgenLayout(panel)
+ if os.path.exists(self.dictpathout['translations.txt']) :
+ with open(self.dictpathout['translations.txt'], 'r', encoding='utf8') as f:
+ translist = f.read()
+ translist = [line.split('\t') for line in translist.splitlines()]
+ for line in translist :
+ self.opentrans(line)
+ panel.TabChdSim.SetSelection(0)
+ self.parent.nb.AddPage(panel, _("Clustering") + ' - %s' % corpname)
+ self.parent.ShowTab(True)
+ self.parent.nb.SetSelection(self.parent.nb.GetPageCount() - 1)
+ # for pane in self.parent._mgr.GetAllPanes() :
+ # if isinstance(pane.window, aui.AuiNotebook):
+ # nb = pane.window
+ # nb.SetAGWWindowStyleFlag(notebook_flags)
+ # nb.SetArtProvider(aui.ChromeTabArt())
+ dlg.Destroy()
+ self.parent._mgr.Update()
+
+ def opentrans(self, trans) :
+ prof = ReadProfileAsDico(self.dictpathout[trans[0]], False)
+ with open(self.dictpathout[trans[1]], 'r', encoding='utf8') as f :
+ lems = f.read()
+ lems = [line.split('\t') for line in lems.splitlines()]
+ lems = dict(lems)
+ open_antiprofil(self.panel, prof, 'utf8', title = trans[0], translation=True, lems=lems)
+ self.panel.lems = lems
+ self.panel.TabChdSim.SetSelection(self.panel.TabChdSim.GetPageCount() - 1)
+