The code.ill.fr has been recreated and upgraded with the latest version this weekend, If you encounter any problem please inform the Helpdesk.

Commit 89274298 authored by eric pellegrini's avatar eric pellegrini
Browse files

the plotter show the last loaded data now

parent 65b8edfb
...@@ -230,13 +230,13 @@ class DataPanel(wx.Panel): ...@@ -230,13 +230,13 @@ class DataPanel(wx.Panel):
self.parent._data = self.dataDict[var]['data'] self.parent._data = self.dataDict[var]['data']
self.show_data() self.show_data()
def show_dataset(self): def show_dataset(self, index=0):
self.datasetlist.DeleteAllItems() self.datasetlist.DeleteAllItems()
for i, k in enumerate(self.dataDict.keys()): for i, k in enumerate(self.dataDict.keys()):
self.datasetlist.InsertStringItem(i, k) self.datasetlist.InsertStringItem(i, k)
self.datasetlist.SetStringItem(i, 1,self.dataDict[k]['basename']) self.datasetlist.SetStringItem(i, 1,self.dataDict[k]['basename'])
self.datasetlist.SetStringItem(i, 2,self.dataDict[k]['path']) self.datasetlist.SetStringItem(i, 2,self.dataDict[k]['path'])
self.datasetlist.Select(0, True) self.datasetlist.Select(index, True)
def show_data(self): def show_data(self):
self.datalist.DeleteAllItems() self.datalist.DeleteAllItems()
...@@ -417,6 +417,7 @@ class PlotterFrame(wx.Frame): ...@@ -417,6 +417,7 @@ class PlotterFrame(wx.Frame):
self.Destroy() self.Destroy()
def on_load_data(self, event=None): def on_load_data(self, event=None):
filters = 'NC file (*.nc)|*.nc|All files (*.*)|*.*' filters = 'NC file (*.nc)|*.nc|All files (*.*)|*.*'
dialog = wx.FileDialog ( self, message = 'Open file...', wildcard=filters, style=wx.MULTIPLE) dialog = wx.FileDialog ( self, message = 'Open file...', wildcard=filters, style=wx.MULTIPLE)
if dialog.ShowModal() == wx.ID_CANCEL: if dialog.ShowModal() == wx.ID_CANCEL:
...@@ -447,7 +448,7 @@ class PlotterFrame(wx.Frame): ...@@ -447,7 +448,7 @@ class PlotterFrame(wx.Frame):
unique_name = self.unique(basename, self.plugin._dataDict) unique_name = self.unique(basename, self.plugin._dataDict)
self.plugin._dataDict[unique_name]={'data':data,'path':filename,'basename':basename} self.plugin._dataDict[unique_name]={'data':data,'path':filename,'basename':basename}
self.plugin._dataPanel.show_dataset() self.plugin._dataPanel.show_dataset(-1)
def unique(self, key, dic): def unique(self, key, dic):
skey = key skey = key
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment