- Timestamp:
- Mar 22, 2011 4:59:13 PM (14 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:
- 6e8b436
- Parents:
- a3c96f7a
- Location:
- guiframe
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/data_manager.py
ra3c96f7a rec611aad 120 120 return name 121 121 122 def add_theory_data(self, data_list): 123 """ 124 """ 125 for id, data in data_list.iteritems(): 126 if id in self.stored_data: 127 msg = "Data manager already stores %s" % str(data.name) 128 msg += "" 129 logging.info(msg) 130 data_state = self.stored_data[id] 131 data_state.theory_data = data 132 else: 133 data_state = DataState(theory_data=data) 134 data_state.id = data.id 135 self.stored_data[id] = data_state 136 122 137 123 def add_data(self, data_list): 138 124 """ … … 151 137 self.stored_data[id] = data_state 152 138 153 154 139 def update_data(self, prev_data, new_data): 155 140 """ … … 164 149 return prev_data.id, {new_data.id: self.stored_data[new_data.id]} 165 150 166 def update_theory(self, data_id, theory, state=None): 167 """ 168 """ 169 if data_id in self.stored_data.keys(): 170 data_state = self.stored_data[data_id] 171 data_state.set_theory(theory_data=theory, theory_state=state) 172 return {data_id: self.stored_data[data_id]} 173 return {} 151 def update_theory(self, theory, data_id=None, state=None): 152 """ 153 """ 154 uid = data_id 155 if data_id is None and theory is not None: 156 uid = theory.id 157 if uid in self.stored_data.keys(): 158 data_state = self.stored_data[uid] 159 else: 160 data_state = DataState() 161 data_state.uid = uid 162 data_state.set_theory(theory_data=theory, theory_state=state) 163 self.stored_data[uid] = data_state 164 return {uid: self.stored_data[uid]} 165 174 166 175 167 def get_message(self): -
guiframe/data_state.py
ra3c96f7a rec611aad 17 17 Store information about data 18 18 """ 19 def __init__(self, data , theory_data=None, model=None, parent=None):19 def __init__(self, data=None, parent=None): 20 20 """ 21 21 22 22 """ 23 self.model = model24 self.theory_data = theory_data25 23 self.parent = parent 26 24 self.data = data … … 79 77 80 78 def set_data(self, data): 81 self.data = data82 83 def set_theory_data(self, theory_data):84 79 """ 85 80 """ 86 self.theory_data = theory_data 87 88 def get_theory_data(self): 81 self.data = data 82 83 84 def get_data(self): 89 85 """ 90 86 """ 91 return self.theory_data92 93 def set_model(self, model):94 """95 """96 self.model = model97 98 def get_model(self):99 """100 """101 return self.model102 103 def get_data(self):104 87 return self.data 105 88
Note: See TracChangeset
for help on using the changeset viewer.