[c77d859] | 1 | |
---|
| 2 | |
---|
| 3 | import wx |
---|
[6f023e8] | 4 | import copy |
---|
[c77d859] | 5 | |
---|
| 6 | class PageInfo(object): |
---|
| 7 | """ |
---|
| 8 | Contains info to reconstruct a page |
---|
| 9 | """ |
---|
| 10 | def __init__(self, parent,model=None, data=None): |
---|
| 11 | |
---|
| 12 | """ |
---|
| 13 | Initialization of the Panel |
---|
| 14 | """ |
---|
| 15 | #TODO: remove this once the inheritence is cleaned up |
---|
| 16 | ## Data member to store the dispersion object created |
---|
| 17 | self._disp_obj_dict = {} |
---|
| 18 | |
---|
| 19 | #Data used for fitting |
---|
| 20 | self.data = data |
---|
| 21 | # flag to allow data2D plot |
---|
| 22 | self.enable2D=False |
---|
| 23 | # model on which the fit would be performed |
---|
| 24 | self.model = model |
---|
| 25 | #fit page manager |
---|
| 26 | self.manager = None |
---|
| 27 | #Store the parent of this panel parent |
---|
| 28 | # For this application fitpanel is the parent |
---|
| 29 | self.parent = parent |
---|
| 30 | # Event_owner is the owner of model event |
---|
| 31 | self.event_owner = None |
---|
[c9a4377] | 32 | ##page name |
---|
| 33 | self.page_name="" |
---|
[c77d859] | 34 | # Contains link between model ,all its parameters, and panel organization |
---|
| 35 | self.parameters=[] |
---|
| 36 | # Contains list of parameters that cannot be fitted and reference to |
---|
| 37 | #panel objects |
---|
| 38 | self.fixed_param=[] |
---|
| 39 | # Contains list of parameters with dispersity and reference to |
---|
| 40 | #panel objects |
---|
| 41 | self.fittable_param=[] |
---|
| 42 | #list of dispersion paramaters |
---|
| 43 | self.disp_list=[] |
---|
| 44 | #contains link between a model and selected parameters to fit |
---|
| 45 | self.param_toFit=[] |
---|
| 46 | #dictionary of model type and model class |
---|
| 47 | self.model_list_box =None |
---|
| 48 | ## list of check box |
---|
| 49 | self.list_of_radiobox={} |
---|
| 50 | ## save current value of combobox |
---|
| 51 | self.formfactorcombobox = "" |
---|
| 52 | self.structurecombobox = "" |
---|
| 53 | ## Qrange |
---|
| 54 | self.qmin=None |
---|
| 55 | self.qmax=None |
---|
| 56 | self.npts=None |
---|
[c9a4377] | 57 | |
---|
[c77d859] | 58 | |
---|
| 59 | |
---|
| 60 | def save_radiobox_state(self, object ): |
---|
| 61 | """ |
---|
| 62 | save radiobox state |
---|
| 63 | @param object: radiobox |
---|
| 64 | self.list_of_check= ["label", id, state] |
---|
| 65 | |
---|
| 66 | """ |
---|
| 67 | label = object.GetLabel() |
---|
| 68 | id = object.GetId() |
---|
| 69 | state = object.GetValue() |
---|
| 70 | self.list_of_radiobox[label]=[label, id, state] |
---|
| 71 | |
---|
[59a7f2d] | 72 | |
---|
[6f023e8] | 73 | def clone(self): |
---|
| 74 | model=None |
---|
| 75 | if self.model !=None: |
---|
| 76 | model = self.model.clone() |
---|
| 77 | |
---|
| 78 | obj = PageInfo( self.parent,model= model ) |
---|
| 79 | obj.data = copy.deepcopy(self.data) |
---|
| 80 | |
---|
| 81 | return obj |
---|
[c77d859] | 82 | |
---|
| 83 | |
---|