from functions import DoConf, exec_rcode
import os
from shutil import copyfile
-from PrintRScript import barplot
+from PrintRScript import barplot, ChronoChi2Script, ChronoPropScript
import tempfile
import sys
from KeyFrame import AlcOptFrame
pass
def OnCloseMe(self, event):
- self.Destroy()
+ self.Destroy()
def OnSaveImage(self, event) :
dlg = wx.FileDialog(
if not tree :
width = 100 + (10*len(rownames)) + (100 * len(colnames))
height = len(rownames) * 15
- if height < 400 :
+ if height < 400 :
height = 400
else :
width = 500
dial = BarGraphDialog(ira, width, height)
val = dial.ShowModal()
if val == wx.ID_OK :
- tmpgraph = tempfile.mktemp(dir=ira.TEMPDIR)
+ tmpgraph = tempfile.mktemp(dir=ira.TEMPDIR)
if dial.format.GetSelection() == 0 :
svg = 'FALSE'
wildcard = "png|*.png"
exec_rcode(ira.RPath, tmpscript, wait = True)
win = ImageViewer(ira, parametres, _(u"Graphic").decode('utf8'), size=(700, 500))
win.Show(True)
- dial.Destroy()
+ dial.Destroy()
+
+class ChronoFrame :
+ def __init__(self, ira, parametres, pathout, which = 'chi2'):
+ width = 800
+ height = 600
+ self.parametres = parametres
+ self.pathout = pathout
+ self.parent = ira
+ dial = BarGraphDialog(ira, width, height)
+ val = dial.ShowModal()
+ if val == wx.ID_OK :
+ tmpgraph = tempfile.mktemp(dir=ira.TEMPDIR)
+ if dial.format.GetSelection() == 0 :
+ svg = 'FALSE'
+ wildcard = "png|*.png"
+ else :
+ svg = 'TRUE'
+ wildcard = "svg|*.svg"
+ parametres = {'width' : dial.widthsp.GetValue(),
+ 'height': dial.heightsp.GetValue(),
+ 'tmpgraph' : tmpgraph,
+ 'svg' : svg,
+ 'wildcard' : wildcard}
+ self.parametres.update(parametres)
+ if which == 'chi2' :
+ script = ChronoChi2Script(self)
+ else :
+ script = ChronoPropScript(self)
+ script.make_script()
+ exec_rcode(ira.RPath, script.scriptout, wait = True)
+ win = ImageViewer(ira, self.parametres, _(u"Graphic").decode('utf8'), size=(700, 500))
+ win.Show(True)
+ dial.Destroy()
+
+
class MergeDialog ( wx.Dialog ):
event.Skip()
def RemoveGraphe(self, evt ):
- pass
\ No newline at end of file
+ pass