Changeset 685e0e3 in sasview
- Timestamp:
- Aug 10, 2018 8:41:49 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- c7f259d
- Parents:
- a2cc8b97
- Location:
- src/sas/qtgui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/MainWindow/DataExplorer.py
rebfe223 r685e0e3 405 405 self.model.beginResetModel() 406 406 theories_copied += 1 407 new_item = self.recursivelyCloneItem(outer_item) 408 # Append a "unique" descriptor to the name 409 time_bit = str(time.time())[7:-1].replace('.', '') 410 new_name = new_item.text() + '_@' + time_bit 411 new_item.setText(new_name) 407 new_item = self.cloneTheory(outer_item) 412 408 self.model.appendRow(new_item) 413 409 self.model.endResetModel() 414 #self.model.reset()415 410 416 411 freeze_msg = "" … … 427 422 # Actively switch tabs 428 423 self.setCurrentIndex(1) 424 425 def cloneTheory(self, item_from): 426 """ 427 Manually clone theory items into a new HashableItem 428 """ 429 new_item = GuiUtils.HashableStandardItem() 430 new_item.setCheckable(True) 431 new_item.setCheckState(QtCore.Qt.Checked) 432 info_item = QtGui.QStandardItem("Info") 433 data_item = QtGui.QStandardItem() 434 data_item.setData(item_from.child(0).data()) 435 new_item.setText(item_from.text()) 436 new_item.setChild(0, data_item) 437 new_item.setChild(1, info_item) 438 # Append a "unique" descriptor to the name 439 time_bit = str(time.time())[7:-1].replace('.', '') 440 new_name = new_item.text() + '_@' + time_bit 441 new_item.setText(new_name) 442 # Change the underlying data so it is no longer a theory 443 try: 444 new_item.child(0).data().is_data = True 445 except AttributeError: 446 #no data here, pass 447 pass 448 return new_item 429 449 430 450 def recursivelyCloneItem(self, item): -
src/sas/qtgui/Plotting/Plotter.py
r42787fb r685e0e3 75 75 is_fit = (self.data.id=="fit") 76 76 77 # make sure we have some function to operate on 78 if self.data.xtransform is None: 79 self.data.xtransform = 'log10(x)' 80 if self.data.ytransform is None: 81 self.data.ytransform = 'log10(y)' 82 83 # Transform data if required. 84 if self.data.xtransform is not None or self.data.ytransform is not None: 85 _, _, xscale, yscale = GuiUtils.xyTransform(self.data, self.data.xtransform, self.data.ytransform) 86 if xscale != 'log': 87 self.xscale = xscale 88 if yscale != 'log': 89 self.yscale = yscale 90 91 # Redefine the Scale properties dialog 92 self.properties = ScaleProperties(self, 93 init_scale_x=self.data.xtransform, 94 init_scale_y=self.data.ytransform) 77 if not is_fit: 78 # make sure we have some function to operate on 79 if self.data.xtransform is None: 80 self.data.xtransform = 'log10(x)' 81 if self.data.ytransform is None: 82 self.data.ytransform = 'log10(y)' 83 84 # Transform data if required. 85 if self.data.xtransform is not None or self.data.ytransform is not None: 86 _, _, xscale, yscale = GuiUtils.xyTransform(self.data, self.data.xtransform, self.data.ytransform) 87 if xscale != 'log': 88 self.xscale = xscale 89 if yscale != 'log': 90 self.yscale = yscale 91 92 # Redefine the Scale properties dialog 93 self.properties = ScaleProperties(self, 94 init_scale_x=self.data.xtransform, 95 init_scale_y=self.data.ytransform) 95 96 96 97 # Shortcuts -
src/sas/qtgui/Utilities/GuiUtils.py
r3d18691 r685e0e3 427 427 for index in range(model_item.rowCount()): 428 428 item = model_item.item(index) 429 if str(item.text()) == filename:429 if filename in str(item.text()): 430 430 # TODO: assure item type is correct (either data1/2D or Plotter) 431 431 plot_data[item] = item.child(0).data()
Note: See TracChangeset
for help on using the changeset viewer.