Changeset 6dc9ad8 in sasview
- Timestamp:
- Jul 31, 2009 7:23:33 PM (15 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:
- 9ff861b
- Parents:
- a6a7e8a
- Location:
- sansview/perspectives/fitting
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/basepage.py
re72bd95 r6dc9ad8 993 993 flag= name != "NoStructure" 994 994 if flag and (class_name in self.model_list_box["Structure Factors"]): 995 self.structurebox.Show() 996 self.text2.Show() 995 997 self.structurebox.Enable() 996 998 self.text2.Enable() … … 1048 1050 if k in["P(Q)*S(Q)","Shapes" ] and class_name in self.model_list_box["Shapes"]: 1049 1051 if class_name in self.model_list_box["P(Q)*S(Q)"]: 1052 self.structurebox.Show() 1053 self.text2.Show() 1050 1054 self.structurebox.Enable() 1051 1055 self.structurebox.SetSelection(0) 1052 1056 self.text2.Enable() 1053 1057 else: 1058 self.structurebox.Hide() 1059 self.text2.Hide() 1054 1060 self.structurebox.Disable() 1055 1061 self.structurebox.SetSelection(0) … … 1165 1171 self.structurebox.Insert("None", 0,None) 1166 1172 self.structurebox.SetSelection(0) 1173 self.structurebox.Hide() 1174 self.text2.Hide() 1167 1175 self.structurebox.Disable() 1168 1176 self.text2.Disable() 1169 1177 1170 1178 if self.model.__class__ in self.model_list_box["P(Q)*S(Q)"]: 1179 self.structurebox.Show() 1180 self.text2.Show() 1171 1181 self.structurebox.Enable() 1172 1182 self.text2.Enable() … … 1273 1283 form_factor = self.formfactorbox.GetClientData( f_id ) 1274 1284 if not form_factor in self.model_list_box["multiplication"]: 1285 self.structurebox.Hide() 1286 self.text2.Hide() 1275 1287 self.structurebox.Disable() 1276 1288 self.structurebox.SetSelection(0) 1277 1289 self.text2.Disable() 1278 1290 else: 1291 self.structurebox.Show() 1292 self.text2.Show() 1279 1293 self.structurebox.Enable() 1280 1294 self.text2.Enable() … … 1576 1590 self.disp_cb_dict[p] = wx.CheckBox(self, -1, p, (10, 10)) 1577 1591 self.state.disp_cb_dict[p]= self.disp_cb_dict[p].GetValue() 1578 if not self.enable2D: 1592 print "self.enable2D",self.enable2D 1593 if not (self.enable2D or self.data.__class__.__name__ =="Data2D"): 1594 self.disp_cb_dict[p].Hide() 1579 1595 self.disp_cb_dict[p].Disable() 1580 1596 else: 1597 self.disp_cb_dict[p].Show(True) 1581 1598 self.disp_cb_dict[p].Enable() 1582 1599 -
sansview/perspectives/fitting/fitpage.py
r5af5183 r6dc9ad8 285 285 nsigmas = wx.StaticText(self, -1, 'Nsigmas') 286 286 self.sizer4_4.Add(nsigmas,( iy, ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 287 287 288 288 for item in self.model.dispersion.keys(): 289 289 if not item in self.model.orientation_params: … … 364 364 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 365 365 if self.data.__class__.__name__ =="Data2D": 366 cb.Show(True) 366 367 cb.Enable() 367 368 else: 369 cb.Hide() 368 370 cb.Disable() 369 371 ix = 1 … … 373 375 ctl1.SetValue(str (format_number(value))) 374 376 if self.data.__class__.__name__ =="Data2D": 377 ctl1.Show(True) 375 378 ctl1.Enable() 376 379 else: 380 ctl1.Hide() 377 381 ctl1.Disable() 378 382 self.sizer4_4.Add(ctl1, (iy,ix),(1,1),wx.EXPAND) … … 389 393 ctl2.Hide() 390 394 if self.data.__class__.__name__ =="Data2D": 395 #ctl2.Show(True) 391 396 ctl2.Enable() 392 397 else: 398 #ctl2.Hide() 393 399 ctl2.Disable() 394 400 self.fittable_param.append([cb,name1,ctl1,text2, … … 404 410 Tctl.SetValue(str (format_number(value))) 405 411 if self.data.__class__.__name__ =="Data2D": 412 Tctl.Show(True) 406 413 Tctl.Enable() 407 414 else: 415 Tctl.Hide() 408 416 Tctl.Disable() 409 417 self.sizer4_4.Add(Tctl, (iy,ix),(1,1), … … 420 428 Tctl.SetValue(str (format_number(value))) 421 429 if self.data.__class__.__name__ =="Data2D": 430 Tctl.Show(True) 422 431 Tctl.Enable() 423 432 else: 433 Tctl.Hide() 424 434 Tctl.Disable() 425 435 self.sizer4_4.Add(Tctl, (iy,ix),(1,1), … … 1013 1023 keys.sort() 1014 1024 1015 iy = 11025 iy = 0 1016 1026 ix = 0 1017 1027 self.cb1 = wx.CheckBox(self, -1,"Select all", (10, 10)) … … 1127 1137 else: 1128 1138 type = "Gaussian" 1139 1140 iy += 1 1141 ix = 0 1142 #Add tile for orientational angle 1143 for item in keys: 1144 if item in self.model.orientation_params: 1145 orient_angle = wx.StaticText(self, -1, '[For 2D only]:') 1146 sizer.Add(orient_angle,(iy, ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 1147 if not self.data.__class__.__name__ =="Data2D": 1148 orient_angle.Hide() 1149 else: 1150 orient_angle.Show(True) 1151 break 1129 1152 1130 1153 #For Gaussian only … … 1139 1162 wx.EVT_CHECKBOX(self, cb.GetId(), self.select_param) 1140 1163 if self.data.__class__.__name__ =="Data2D": 1164 cb.Show(True) 1141 1165 cb.Enable() 1142 1166 else: 1167 cb.Hide() 1143 1168 cb.Disable() 1144 1169 sizer.Add( cb,( iy, ix),(1,1), … … 1153 1178 ctl1.SetValue(format_number(value)) 1154 1179 if self.data.__class__.__name__ =="Data2D": 1180 #ctl1.Show(True) 1155 1181 ctl1.Enable() 1156 1182 else: 1183 #ctl1.Hide() 1157 1184 ctl1.Disable() 1158 1185 sizer.Add(ctl1, (iy,ix),(1,1), wx.EXPAND) … … 1169 1196 ctl2.Hide() 1170 1197 if self.data.__class__.__name__ =="Data2D": 1198 ctl1.Show(True) 1171 1199 ctl1.Enable() 1172 1200 else: 1201 ctl1.Hide() 1173 1202 ctl1.Disable() 1174 1203 param_min, param_max= self.model.details[item][1:] … … 1184 1213 ctl3.Hide() 1185 1214 if self.data.__class__.__name__ =="Data2D": 1215 #ctl3.Show(True) 1186 1216 ctl3.Enable() 1187 1217 else: 1218 #ctl3.Hide() 1188 1219 ctl3.Disable() 1189 1220 ix += 1 … … 1198 1229 ctl4.Hide() 1199 1230 if self.data.__class__.__name__ =="Data2D": 1231 #ctl4.Show(True) 1200 1232 ctl4.Enable() 1201 1233 else: 1234 #ctl4.Hide() 1202 1235 ctl4.Disable() 1203 1236 if self.engine_type=="park": … … 1211 1244 units = wx.StaticText(self, -1, "", style=wx.ALIGN_LEFT) 1212 1245 if self.data.__class__.__name__ =="Data2D": 1246 units.Show(True) 1213 1247 units.Enable() 1214 1248 else: 1249 units.Hide() 1215 1250 units.Disable() 1216 1251 sizer.Add(units, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) -
sansview/perspectives/fitting/modelpage.py
rf20767b r6dc9ad8 213 213 self.sizer4_4.Add( name,( iy, ix),(1,1), 214 214 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 215 if not self.enable2D: 216 name.Hide() 217 else: 218 name.Show(True) 215 219 ix = 1 216 220 value= self.model.getParam(name1) … … 219 223 ctl1.SetValue(str (format_number(value))) 220 224 if not self.enable2D: 225 ctl1.Hide() 221 226 ctl1.Disable() 222 227 else: 228 ctl1.Show(True) 223 229 ctl1.Enable() 224 230 self.sizer4_4.Add(ctl1, (iy,ix),(1,1), wx.EXPAND) … … 234 240 Tctl1.SetValue(str (format_number(value))) 235 241 if not self.enable2D: 242 Tctl1.Hide() 236 243 Tctl1.Disable() 237 244 else: 245 Tctl1.Show(True) 238 246 Tctl1.Enable() 239 247 self.sizer4_4.Add(Tctl1, (iy,ix),(1,1), … … 250 258 Tctl2.SetValue(str (format_number(value))) 251 259 if not self.enable2D: 260 Tctl2.Hide() 252 261 Tctl2.Disable() 253 262 else: 263 Tctl2.Show(True) 254 264 Tctl2.Enable() 255 265 self.sizer4_4.Add(Tctl2, (iy,ix),(1,1), … … 287 297 self._draw_model() 288 298 self.model_view.Disable() 289 299 300 self.set_model_param_sizer(self.model) 301 self._set_sizer_gaussian() 302 290 303 if len(self.orientation_params)>0: 291 304 for item in self.orientation_params: 292 if item[2]!=None: 305 if item[2]!=None: 293 306 item[2].Enable() 294 307 if self.disp_name == "ArrayDispersion": … … 304 317 event = PageInfoEvent(page = self) 305 318 wx.PostEvent(self.parent, event) 306 307 319 308 320 309 321 def reset_page(self, state): … … 464 476 keys.sort() 465 477 466 iy = 1478 iy = 0 467 479 ix = 0 468 480 self.text1_2 = wx.StaticText(self, -1, 'Names') … … 507 519 iy+=1 508 520 sizer.Add((10,10),(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 521 iy += 1 522 ix = 0 523 524 #Add tile for orientational angle parameters 525 for item in keys: 526 if item in self.model.orientation_params: 527 orient_angle = wx.StaticText(self, -1, '[For 2D only]:') 528 sizer.Add(orient_angle,(iy, ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 529 if not self.enable2D: 530 orient_angle.Hide() 531 else: 532 orient_angle.Show(True) 533 break 534 509 535 for item in self.model.orientation_params: 510 536 if not item in self.disp_list and item in keys: … … 514 540 sizer.Add( name,( iy, ix),(1,1), 515 541 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 542 if not self.enable2D: 543 name.Hide() 544 else: 545 name.Show(True) 516 546 517 547 ix += 1 … … 522 552 ctl1.SetValue(str (format_number(value))) 523 553 if not self.enable2D: 554 ctl1.Hide() 524 555 ctl1.Disable() 525 556 else: 557 ctl1.Show(True) 526 558 ctl1.Enable() 527 559 … … 533 565 except: 534 566 units = wx.StaticText(self, -1, "", style=wx.ALIGN_LEFT) 567 if not self.enable2D: 568 units.Hide() 569 units.Disable() 570 else: 571 units.Show(True) 572 units.Enable() 573 535 574 sizer.Add(units, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 536 575
Note: See TracChangeset
for help on using the changeset viewer.