Changes in src/sas/perspectives/fitting/basepage.py [6e653582:4380c03] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/perspectives/fitting/basepage.py
r6e653582 r4380c03 1861 1861 [max_state, max_value], unit]) 1862 1862 1863 # The following funcion seems to be superseded with fillsizer and1864 # init combo box. certainly it seems not to know about categories and uses1865 # only shapes and shape independent -- tested after commenting out and does1866 # not seem to cause problem. Leave commented out for now but delete in1867 # a code cleanup once clear it really is no longer used.1868 # PDB 8 April 20141869 1870 # def _set_model_sizer_selection(self, model):1871 # """1872 # Display the sizer according to the type of the current model1873 # """1874 # if model == None:1875 # return1876 # if hasattr(model, "s_model"):1877 #1878 # class_name = model.s_model.__class__1879 # name = model.s_model.name1880 # flag = (name != "NoStructure")1881 # if flag and \1882 # (class_name in self.model_list_box["Structure Factors"]):1883 # self.structurebox.Show()1884 # self.text2.Show()1885 # self.structurebox.Enable()1886 # self.text2.Enable()1887 # items = self.structurebox.GetItems()1888 # self.sizer1.Layout()1889 #1890 # for i in range(len(items)):1891 # if items[i] == str(name):1892 # self.structurebox.SetSelection(i)1893 # break1894 #1895 # if hasattr(model, "p_model"):1896 # class_name = model.p_model.__class__1897 # name = model.p_model.name1898 # self.formfactorbox.Clear()1899 #1900 # for k, list in self.model_list_box.iteritems():1901 # if k in["P(Q)*S(Q)", "Shapes"] and \1902 # class_name in self.model_list_box["Shapes"]:1903 # self.shape_rbutton.SetValue(True)1904 # ## fill the form factor list with new model1905 # self._populate_box(self.formfactorbox,1906 # self.model_list_box["Shapes"])1907 # items = self.formfactorbox.GetItems()1908 # ## set comboxbox to the selected item1909 # for i in range(len(items)):1910 # if items[i] == str(name):1911 # self.formfactorbox.SetSelection(i)1912 # break1913 # return1914 # elif k == "Shape-Independent":1915 # self.shape_indep_rbutton.SetValue(True)1916 # elif k == "Structure Factors":1917 # self.struct_rbutton.SetValue(True)1918 # elif k == "Multi-Functions":1919 # continue1920 # else:1921 # self.plugin_rbutton.SetValue(True)1922 #1923 # if class_name in list:1924 # ## fill the form factor list with new model1925 # self._populate_box(self.formfactorbox, list)1926 # items = self.formfactorbox.GetItems()1927 # ## set comboxbox to the selected item1928 # for i in range(len(items)):1929 # if items[i] == str(name):1930 # self.formfactorbox.SetSelection(i)1931 # break1932 # break1933 # else:1934 ## Select the model from the menu1935 # class_name = model.__class__1936 # name = model.name1937 # self.formfactorbox.Clear()1938 # items = self.formfactorbox.GetItems()1939 #1940 # for k, list in self.model_list_box.iteritems():1941 # if k in["P(Q)*S(Q)", "Shapes"] and \1942 # class_name in self.model_list_box["Shapes"]:1943 # if class_name in self.model_list_box["P(Q)*S(Q)"]:1944 # self.structurebox.Show()1945 # self.text2.Show()1946 # self.structurebox.Enable()1947 # self.structurebox.SetSelection(0)1948 # self.text2.Enable()1949 # else:1950 # self.structurebox.Hide()1951 # self.text2.Hide()1952 # self.structurebox.Disable()1953 # self.structurebox.SetSelection(0)1954 # self.text2.Disable()1955 #1956 # self.shape_rbutton.SetValue(True)1957 ## fill the form factor list with new model1958 # self._populate_box(self.formfactorbox,1959 # self.model_list_box["Shapes"])1960 # items = self.formfactorbox.GetItems()1961 # ## set comboxbox to the selected item1962 # for i in range(len(items)):1963 # if items[i] == str(name):1964 # self.formfactorbox.SetSelection(i)1965 # break1966 # return1967 # elif k == "Shape-Independent":1968 # self.shape_indep_rbutton.SetValue(True)1969 # elif k == "Structure Factors":1970 # self.struct_rbutton.SetValue(True)1971 # elif k == "Multi-Functions":1972 # continue1973 # else:1974 # self.plugin_rbutton.SetValue(True)1975 # if class_name in list:1976 # self.structurebox.SetSelection(0)1977 # self.structurebox.Disable()1978 # self.text2.Disable()1979 ## fill the form factor list with new model1980 # self._populate_box(self.formfactorbox, list)1981 # items = self.formfactorbox.GetItems()1982 ## set comboxbox to the selected item1983 # for i in range(len(items)):1984 # if items[i] == str(name):1985 # self.formfactorbox.SetSelection(i)1986 # break1987 # break1988 1863 1989 1864 def _draw_model(self, update_chisqr=True, source='model'): … … 3043 2918 def on_model_help_clicked(self, event): 3044 2919 """ 3045 on 'More details' button 2920 Function called when 'Details' button is pressed next to model 2921 of interest. As of Feb 2015 this function follows two paths: 2922 For regular models that ship with the release, it calls the Sphinx 2923 generated html documentation. For plugin models it still uses the 2924 old pop up window reading the description provided in the model. 2925 2926 This will presumably be deprecated when the sas mdels team decides 2927 on how to discover new models and grab their documentation from the 2928 file. 2929 2930 PDB 18 Feb 2015 2931 2932 :param evt: on Details Button pressed event 3046 2933 """ 3047 2934 from sas.perspectives.fitting.help_panel import HelpWindow … … 3052 2939 model_path = os.path.join(path, "model_functions.html") 3053 2940 if self.model == None: 3054 name = ' FuncHelp'2941 name = 'index.html' 3055 2942 else: 3056 2943 name = self.formfactorbox.GetValue() 3057 2944 frame = HelpWindow(None, -1, pageToOpen=model_path) 3058 # 2945 #If model name exists and model is not a custom model 3059 2946 #mod_cat = self.categorybox.GetStringSelection() 3060 2947 if frame.rhelp.HasAnchor(name): … … 3076 2963 def _on_mag_help(self, event): 3077 2964 """ 3078 Magnetic angles help panel 3079 """ 3080 from sas.perspectives.fitting.help_panel import HelpWindow 3081 # Get models help model_function path 3082 #import sas.perspectives.fitting as fitmedia 3083 from sas.models import get_data_path 3084 3085 media = get_data_path(media='media') 3086 path = os.path.join(media, "mag_pic.html") 3087 name = "Polar/Magnetic Angles" 3088 frame = HelpWindow(None, -1, 3089 title=' Help: Polarization/Magnetization Angles', 3090 pageToOpen=path, size=(865, 450)) 3091 try: 3092 frame.splitter.DetachWindow(frame.lpanel) 3093 # Display only the right side one 3094 frame.lpanel.Hide() 3095 frame.Show(True) 3096 except: 3097 frame.Destroy() 3098 msg = 'Display Error\n' 3099 info = "Info" 3100 wx.MessageBox(msg, info) 3101 2965 Bring up Magnetic Angle definition bmp image whenever the ? button 2966 is clicked. Calls DocumentationWindow with the path of the location 2967 within the documentation tree (after /doc/ ....". When using old 2968 versions of Wx When (i.e. before 2.9 and therefore not part of release 2969 versions distributed via installer) it brings up an image viewer 2970 box which allows the user to click through the rest of the images in 2971 the directory. Not ideal but probably better than alternative which 2972 would bring up the entire discussion of how magnetic models work? 2973 Specially since it is not likely to be accessed. The normal release 2974 versions bring up the normal image box. 2975 2976 :param evt: Triggers on clicking ? in Magnetic Angles? box 2977 """ 2978 2979 from sas.guiframe.documentation_window import DocumentationWindow 2980 2981 _TreeLocation = "_images/M_angles_pic.bmp" 2982 _doc_viewer = DocumentationWindow(self, -1, \ 2983 _TreeLocation,"Magnetic Angle Defintions") 2984 3102 2985 def _on_mag_on(self, event): 3103 2986 """ … … 3131 3014 def on_pd_help_clicked(self, event): 3132 3015 """ 3133 Button event for PD help 3134 """ 3135 from help_panel import HelpWindow 3136 import sas.models as models 3137 3138 # Get models help model_function path 3139 path = models.get_data_path(media='media') 3140 pd_path = os.path.join(path, "pd_help.html") 3141 3142 frame = HelpWindow(None, -1, pageToOpen=pd_path) 3143 frame.Show(True) 3016 Bring up Polydispersity Documentation whenever the ? button is clicked. 3017 Calls DocumentationWindow with the path of the location within the 3018 documentation tree (after /doc/ ....". Note that when using old 3019 versions of Wx (before 2.9) and thus not the release version of 3020 istallers, the help comes up at the top level of the file as 3021 webbrowser does not pass anything past the # to the browser when it is 3022 running "file:///...." 3023 3024 :param evt: Triggers on clicking ? in polydispersity box 3025 """ 3026 3027 from sas.guiframe.documentation_window import DocumentationWindow 3028 3029 _TreeLocation = "user/perspectives/fitting/fitting_help.html" 3030 _TreeLocation += "#polydispersity-distributions" 3031 _doc_viewer = DocumentationWindow(self, -1, \ 3032 _TreeLocation,"Polydispersity Help") 3144 3033 3145 3034 def on_left_down(self, event):
Note: See TracChangeset
for help on using the changeset viewer.