dir = DirectoryItem("Directory", TEMPDIR) fname = FileOpenItem("Single file (open)", ("csv", "eta"), FILE_CSV.name) fnames = FilesOpenItem("Multiple files", "csv", FILE_CSV.name) fname_s = FileSaveItem("Single file (save)", "eta", FILE_ETA.name) class SubDataSetWidget(DataSetWidget): klass = SubDataSet class SubDataSetItem(ObjectItem): klass = SubDataSet DataSetEditLayout.register(SubDataSetItem, SubDataSetWidget) DataSetShowLayout.register(SubDataSetItem, SubDataSetWidget) class TestParameters(DataSet): """ DataSet test The following text is the DataSet 'comment': <br>Plain text or <b>rich text<sup>2</sup></b> are both supported, as well as special characters (α, β, γ, δ, ...) """ files = SubDataSetItem("files") string = StringItem("String") text = TextItem("Text") _bg = BeginGroup("A sub group") float_slider = FloatItem("Float (with slider)", default=0.5,
self.raw2] = self.dataread.update(readcmd, ch1, ch2, self.redraw_timer.GetInterval(), Ach1, Ach2, raw_filename) self.draw_plot() if self.redraw_timer.GetInterval() != int(float(self.e.period) * 1000): self.redraw_timer.Stop() self.redraw_timer.Start(int(float(self.e.period) * 1000)) def on_exit(self, event): self.Destroy() def flash_status_message(self, msg, flash_len_ms=1500): self.statusbar.SetStatusText(msg) self.timeroff = wx.Timer(self) self.Bind(wx.EVT_TIMER, self.on_flash_status_off, self.timeroff) self.timeroff.Start(flash_len_ms, oneShot=True) def on_flash_status_off(self, event): self.statusbar.SetStatusText('') if __name__ == '__main__': _app = guidata.qapplication() DataSetEditLayout.register(EvalStringItem, LineEditWidget) DataSetShowLayout.register(EvalStringItem, LineEditWidget) app = wx.PySimpleApp() app.frame = GraphFrame() app.frame.Show() app.MainLoop()
if key in ('scale', 'physical length'): raise TypeError, _("Not mutable item.") setattr(self, key, value) # Register the new class as a DataSetItem class AxisParamWidget(DataSetWidget): klass = AxisParam class AxisParamItem(ObjectItem): klass = AxisParam DataSetEditLayout.register(AxisParamItem, AxisParamWidget) DataSetShowLayout.register(AxisParamItem, AxisParamWidget) class ScanningParam(DataSet): """Store the parameters describing a scanning probe measurement.""" filename = FileOpenItem(_('File name'), ('*'), default='', help=_('Raw file name')) type = ChoiceItem( _('Type of data'), [('topo', _('Topography')), ('ivcurve', _('IV curve')), ('ivmap', _('IV map')), ('didvcurve', _('dIdV curve')), ('didvmap', _('dIdV map')), ('topofft', _('FFT of topography')),
atexit.register(FILE_CSV.close) class SubDataSet(DataSet): dir = DirectoryItem("Directory", TEMPDIR) fname = FileOpenItem("Single file (open)", ("csv", "eta"), FILE_CSV.name) fnames = FilesOpenItem("Multiple files", "csv", FILE_CSV.name) fname_s = FileSaveItem("Single file (save)", "eta", FILE_ETA.name) class SubDataSetWidget(DataSetWidget): klass = SubDataSet class SubDataSetItem(ObjectItem): klass = SubDataSet DataSetEditLayout.register(SubDataSetItem, SubDataSetWidget) DataSetShowLayout.register(SubDataSetItem, SubDataSetWidget) class TestParameters(DataSet): """ DataSet test The following text is the DataSet 'comment': <br>Plain text or <b>rich text<sup>2</sup></b> are both supported, as well as special characters (α, β, γ, δ, ...) """ files = SubDataSetItem("files") string = StringItem("String") text = TextItem("Text") _bg = BeginGroup("A sub group") float_slider = FloatItem("Float (with slider)", default=0.5, min=0, max=1, step=0.01, slider=True)
[self.data, self.data2, self.time, self.raw1, self.raw2] = self.dataread.update( readcmd, ch1, ch2, self.redraw_timer.GetInterval(), Ach1, Ach2, raw_filename ) self.draw_plot() if self.redraw_timer.GetInterval() != int(float(self.e.period) * 1000): self.redraw_timer.Stop() self.redraw_timer.Start(int(float(self.e.period) * 1000)) def on_exit(self, event): self.Destroy() def flash_status_message(self, msg, flash_len_ms=1500): self.statusbar.SetStatusText(msg) self.timeroff = wx.Timer(self) self.Bind(wx.EVT_TIMER, self.on_flash_status_off, self.timeroff) self.timeroff.Start(flash_len_ms, oneShot=True) def on_flash_status_off(self, event): self.statusbar.SetStatusText("") if __name__ == "__main__": _app = guidata.qapplication() DataSetEditLayout.register(EvalStringItem, LineEditWidget) DataSetShowLayout.register(EvalStringItem, LineEditWidget) app = wx.PySimpleApp() app.frame = GraphFrame() app.frame.Show() app.MainLoop()