-
-class ChiSquare():
- def __init__(self,parent):
- chioption = { 'valobs' : True,
- 'valtheo' : True,
- 'resi' : False,
- 'contrib' : True,
- 'pourcent' : False,
- 'pourcentl' : True,
- 'pourcentc' : True,
- 'graph' : True,
- 'bw' : False,
- }
- dlg = ChiDialog(parent, -1, u"Chi2", chioption, size=(400, 350),
- style = wx.DEFAULT_DIALOG_STYLE
- )
- dlg.CenterOnParent()
- val = dlg.ShowModal()
- if val==wx.ID_OK :
- self.dlg=wx.ProgressDialog("Traitements",
- "Veuillez patienter...",
- maximum = 4,
- parent=parent,
- style = wx.PD_APP_MODAL|wx.PD_AUTO_HIDE|wx.PD_ELAPSED_TIME
- )
- self.dlg.Center()
- self.count = 1
- keepGoing = self.dlg.Update(self.count)
-
- ColSel1 = dlg.list_box_1.GetSelections()
- ColSel2 = dlg.list_box_2.GetSelections()
- if dlg.chiopt :
- chioption['valobs'] = dlg.dial.check1.GetValue()
- chioption['valtheo'] = dlg.dial.check2.GetValue()
- chioption['resi'] = dlg.dial.check3.GetValue()
- chioption['contrib'] = dlg.dial.check4.GetValue()
- chioption['pourcent'] = dlg.dial.check5.GetValue()
- chioption['pourcentl'] = dlg.dial.check6.GetValue()
- chioption['pourcentc'] = dlg.dial.check7.GetValue()
- chioption['graph'] = dlg.dial.check8.GetValue()
- chioption['bw'] = dlg.dial.checkbw.GetValue()
- dlg.dial.Destroy()
-
- self.count += 1
- keepGoing = self.dlg.Update(self.count,u"Analyse dans R...")
- analyse=MakeChi2(parent,ColSel1,ColSel2, chioption)
-
- self.count += 1
- keepGoing = self.dlg.Update(self.count,u"Ecriture des résultats")
-
- listfileout = analyse.dolayout(chioption)
- #listfileout=dlg.ShowChi2(ColSel1,ColSel2)
- parent.FreqNum += 1
- parent.DictTab[u"Chi2_%s*"%parent.FreqNum]=listfileout
- parent.newtab = wx.html.HtmlWindow(parent.nb, -1)
- if "gtk2" in wx.PlatformInfo:
- parent.newtab.SetStandardFonts()
- parent.newtab.LoadPage(listfileout[len(listfileout)-1])
- parent.nb.AddPage(parent.newtab,u"Chi2_%s*"%parent.FreqNum)
- parent.nb.SetSelection(parent.nb.GetPageCount()-1)
- parent.ShowTab(wx.EVT_BUTTON)
- parent.DisEnSaveTabAs(True)
- self.count += 1
- keepGoing = self.dlg.Update(self.count,u"Fini")
- else :
- if dlg.chiopt :
- dlg.dial.Destroy()
- dlg.Destroy()