Changeset 9053779 in sasview for calculatorview
- Timestamp:
- Jun 16, 2012 10:53:51 AM (13 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 79c8066
- Parents:
- 4a47244
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
calculatorview/src/sans/perspectives/calculator/data_operator.py
rdd2ab70 r9053779 453 453 val = None 454 454 self.data2_cbox.SetClientData(pos3, val) 455 dnames = [dstate.data.name for dstate in self._data.values()] 456 ind = numpy.argsort(dnames) 457 for datastate in numpy.array(self._data.values())[ind]: 458 data = datastate.data 459 if data != None: 460 name = data.name 461 pos1 = self.data1_cbox.Append(str(name)) 462 self.data1_cbox.SetClientData(pos1, data) 463 pos2 = self.data2_cbox.Append(str(name)) 464 self.data2_cbox.SetClientData(pos2, data) 465 if str(current1) == str(name): 466 pos_pre1 = pos1 467 if str(current2) == str(name): 468 pos_pre2 = pos2 469 try: 470 theory_list = datastate.get_theory() 471 for theory, _ in theory_list.values(): 472 th_name = theory.name 473 posth1 = self.data1_cbox.Append(str(th_name)) 474 self.data1_cbox.SetClientData(posth1, theory) 475 posth2 = self.data2_cbox.Append(str(th_name)) 476 self.data2_cbox.SetClientData(posth2, theory) 477 if str(current1) == str(th_name): 478 pos_pre1 = posth1 479 if str(current2) == str(th_name): 480 pos_pre2 = posth2 481 except: 482 continue 455 dnames = [] 456 for dstate in self._data.values(): 457 if dstate != None: 458 if dstate.data != None: 459 dnames.append(dstate.data.name) 460 if len(dnames) > 0: 461 ind = numpy.argsort(dnames) 462 for datastate in numpy.array(self._data.values())[ind]: 463 data = datastate.data 464 if data != None: 465 name = data.name 466 pos1 = self.data1_cbox.Append(str(name)) 467 self.data1_cbox.SetClientData(pos1, data) 468 pos2 = self.data2_cbox.Append(str(name)) 469 self.data2_cbox.SetClientData(pos2, data) 470 if str(current1) == str(name): 471 pos_pre1 = pos1 472 if str(current2) == str(name): 473 pos_pre2 = pos2 474 try: 475 theory_list = datastate.get_theory() 476 for theory, _ in theory_list.values(): 477 th_name = theory.name 478 posth1 = self.data1_cbox.Append(str(th_name)) 479 self.data1_cbox.SetClientData(posth1, theory) 480 posth2 = self.data2_cbox.Append(str(th_name)) 481 self.data2_cbox.SetClientData(posth2, theory) 482 if str(current1) == str(th_name): 483 pos_pre1 = posth1 484 if str(current2) == str(th_name): 485 pos_pre2 = posth2 486 except: 487 continue 483 488 self.data1_cbox.SetSelection(pos_pre1) 484 489 self.data2_cbox.SetSelection(pos_pre2)
Note: See TracChangeset
for help on using the changeset viewer.