1 | """ |
---|
2 | Application settings |
---|
3 | """ |
---|
4 | from __future__ import print_function |
---|
5 | |
---|
6 | import time |
---|
7 | import os |
---|
8 | import logging |
---|
9 | |
---|
10 | from sas.sasgui.guiframe.gui_style import GUIFRAME |
---|
11 | import sas.sasview |
---|
12 | |
---|
13 | logger = logging.getLogger(__name__) |
---|
14 | |
---|
15 | # Version of the application |
---|
16 | __appname__ = "SasView" |
---|
17 | __version__ = sas.sasview.__version__ |
---|
18 | __DOI__ = sas.sasview.__DOI__ |
---|
19 | __release_date__ = sas.sasview.__release_date__ |
---|
20 | __build__ = sas.sasview.__build__ |
---|
21 | __download_page__ = 'https://github.com/SasView/sasview/releases' |
---|
22 | __update_URL__ = 'http://www.sasview.org/latestversion.json' |
---|
23 | |
---|
24 | # Debug message flag |
---|
25 | __EVT_DEBUG__ = False |
---|
26 | |
---|
27 | # Flag for automated testing |
---|
28 | __TEST__ = False |
---|
29 | |
---|
30 | # Debug message should be written to a file? |
---|
31 | __EVT_DEBUG_2_FILE__ = False |
---|
32 | __EVT_DEBUG_FILENAME__ = "debug.log" |
---|
33 | |
---|
34 | # About box info |
---|
35 | _do_aboutbox = True |
---|
36 | _do_acknowledge = True |
---|
37 | _do_release = True |
---|
38 | _do_tutorial = True |
---|
39 | _acknowledgement_preamble =\ |
---|
40 | '''To ensure the long term support and development of this software please |
---|
41 | remember to:''' |
---|
42 | _acknowledgement_preamble_bullet1 =\ |
---|
43 | '''Acknowledge its use in your publications as :''' |
---|
44 | _acknowledgement_preamble_bullet2 =\ |
---|
45 | '''Reference SasView as:''' |
---|
46 | _acknowledgement_preamble_bullet3 =\ |
---|
47 | '''Reference the model you used if appropriate (see documentation for refs)''' |
---|
48 | _acknowledgement_preamble_bullet4 =\ |
---|
49 | '''Send us your reference for our records: developers@sasview.org''' |
---|
50 | _acknowledgement_publications = \ |
---|
51 | ("This work benefited from the use of the SasView application, originally" |
---|
52 | "developed under NSF Award DMR-0520547. SasView also contains code developed" |
---|
53 | "with funding from the EU Horizon 2020 programme under the SINE2020 project" |
---|
54 | "Grant No 654000.") |
---|
55 | _acknowledgement_citation = \ |
---|
56 | '''M. Doucet et al. SasView Version %s, %s''' % (__version__, __DOI__) |
---|
57 | _acknowledgement = \ |
---|
58 | ("This work was originally developed as part of the DANSE project funded by" |
---|
59 | "the US NSF under Award DMR-0520547,\n but is currently maintained by a" |
---|
60 | "collaboration between UTK, UMD, NIST, ORNL, ISIS, ESS, ILL, ANSTO, TU Delft," |
---|
61 | "DLS, BAM and the scattering community.\n\n SasView also contains code" |
---|
62 | "developed with funding from the EU Horizon 2020 programme under the SINE2020" |
---|
63 | "project (Grant No 654000).\nA list of individual contributors can be found" |
---|
64 | "at: http://www.sasview.org/contact.html") |
---|
65 | |
---|
66 | _homepage = "http://www.sasview.org" |
---|
67 | _download = __download_page__ |
---|
68 | _authors = [] |
---|
69 | _paper = "http://sourceforge.net/p/sasview/tickets/" |
---|
70 | _license = "mailto:help@sasview.org" |
---|
71 | |
---|
72 | |
---|
73 | icon_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "images")) |
---|
74 | logger.info("icon path: %s" % icon_path) |
---|
75 | media_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "media")) |
---|
76 | test_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "test")) |
---|
77 | |
---|
78 | _nist_logo = os.path.join(icon_path, "nist_logo.png") |
---|
79 | _umd_logo = os.path.join(icon_path, "umd_logo.png") |
---|
80 | _sns_logo = os.path.join(icon_path, "sns_logo.png") |
---|
81 | _ornl_logo = os.path.join(icon_path, "ornl_logo.png") |
---|
82 | _isis_logo = os.path.join(icon_path, "isis_logo.png") |
---|
83 | _ess_logo = os.path.join(icon_path, "ess_logo.png") |
---|
84 | _ill_logo = os.path.join(icon_path, "ill_logo.png") |
---|
85 | _ansto_logo = os.path.join(icon_path, "ansto_logo.png") |
---|
86 | _tudelft_logo = os.path.join(icon_path, "tudelft_logo.png") |
---|
87 | _dls_logo = os.path.join(icon_path, "dls_logo.png") |
---|
88 | _bam_logo = os.path.join(icon_path, "bam_logo.png") |
---|
89 | _nsf_logo = os.path.join(icon_path, "nsf_logo.png") |
---|
90 | _danse_logo = os.path.join(icon_path, "danse_logo.png") |
---|
91 | _inst_logo = os.path.join(icon_path, "utlogo.gif") |
---|
92 | _nist_url = "http://www.nist.gov/" |
---|
93 | _umd_url = "http://www.umd.edu/" |
---|
94 | _sns_url = "http://neutrons.ornl.gov/" |
---|
95 | _ornl_url = "http://neutrons.ornl.gov/" |
---|
96 | _nsf_url = "http://www.nsf.gov" |
---|
97 | _isis_url = "http://www.isis.stfc.ac.uk/" |
---|
98 | _ess_url = "http://ess-scandinavia.eu/" |
---|
99 | _ill_url = "http://www.ill.eu/" |
---|
100 | _ansto_url = "http://www.ansto.gov.au/" |
---|
101 | _tudelft_url = "http://www.tnw.tudelft.nl/en/cooperation/facilities/reactor-instituut-delft/" |
---|
102 | _dls_url = "http://www.diamond.ac.uk/" |
---|
103 | _danse_url = "http://www.cacr.caltech.edu/projects/danse/release/index.html" |
---|
104 | _inst_url = "http://www.utk.edu" |
---|
105 | _corner_image = os.path.join(icon_path, "angles_flat.png") |
---|
106 | _welcome_image = os.path.join(icon_path, "SVwelcome.png") |
---|
107 | _copyright = ("(c) 2009 - %s, UTK, UMD, NIST, ORNL, ISIS, ESS, ILL, ANSTO," |
---|
108 | "TU Delft, DLS and BAM") % __release_date__ |
---|
109 | marketplace_url = "http://marketplace.sasview.org/" |
---|
110 | |
---|
111 | #edit the list of file state your plugin can read |
---|
112 | APPLICATION_WLIST = 'SasView files (*.svs)|*.svs' |
---|
113 | APPLICATION_STATE_EXTENSION = '.svs' |
---|
114 | GUIFRAME_WIDTH = 1150 |
---|
115 | GUIFRAME_HEIGHT = 840 |
---|
116 | PLUGIN_STATE_EXTENSIONS = ['.fitv', '.inv', '.prv', '.crf'] |
---|
117 | PLUGINS_WLIST = ['Fitting files (*.fitv)|*.fitv', |
---|
118 | 'Invariant files (*.inv)|*.inv', |
---|
119 | 'P(r) files (*.prv)|*.prv', |
---|
120 | 'Corfunc files (*.crf)|*.crf'] |
---|
121 | PLOPANEL_WIDTH = 415 |
---|
122 | PLOPANEL_HEIGTH = 370 |
---|
123 | DATAPANEL_WIDTH = 235 |
---|
124 | DATAPANEL_HEIGHT = 700 |
---|
125 | SPLASH_SCREEN_PATH = os.path.join(icon_path, "SVwelcome_mini.png") |
---|
126 | TUTORIAL_PATH = os.path.join(media_path, "Tutorial.pdf") |
---|
127 | DEFAULT_STYLE = GUIFRAME.MULTIPLE_APPLICATIONS|GUIFRAME.MANAGER_ON\ |
---|
128 | |GUIFRAME.CALCULATOR_ON|GUIFRAME.TOOLBAR_ON |
---|
129 | SPLASH_SCREEN_WIDTH = 512 |
---|
130 | SPLASH_SCREEN_HEIGHT = 366 |
---|
131 | SS_MAX_DISPLAY_TIME = 2000 |
---|
132 | WELCOME_PANEL_ON = True |
---|
133 | WELCOME_PANEL_SHOW = False |
---|
134 | CLEANUP_PLOT = False |
---|
135 | # OPEN and SAVE project menu |
---|
136 | OPEN_SAVE_PROJECT_MENU = True |
---|
137 | #VIEW MENU |
---|
138 | VIEW_MENU = True |
---|
139 | #EDIT MENU |
---|
140 | EDIT_MENU = True |
---|
141 | |
---|
142 | SetupIconFile_win = os.path.join(icon_path, "ball.ico") |
---|
143 | SetupIconFile_mac = os.path.join(icon_path, "ball.icns") |
---|
144 | DefaultGroupName = "." |
---|
145 | OutputBaseFilename = "setupSasView" |
---|
146 | |
---|
147 | FIXED_PANEL = True |
---|
148 | DATALOADER_SHOW = True |
---|
149 | CLEANUP_PLOT = False |
---|
150 | WELCOME_PANEL_SHOW = False |
---|
151 | #Show or hide toolbar at the start up |
---|
152 | TOOLBAR_SHOW = True |
---|
153 | # set a default perspective |
---|
154 | DEFAULT_PERSPECTIVE = 'None' |
---|
155 | |
---|
156 | # Time out for updating sasview |
---|
157 | UPDATE_TIMEOUT = 2 |
---|
158 | |
---|
159 | # Time out for updating sasview |
---|
160 | UPDATE_TIMEOUT = 2 |
---|
161 | |
---|
162 | def printEVT(message): |
---|
163 | if __EVT_DEBUG__: |
---|
164 | """ |
---|
165 | :TODO - Need method doc string |
---|
166 | """ |
---|
167 | print("%g: %s" % (time.clock(), message)) |
---|
168 | |
---|
169 | if __EVT_DEBUG_2_FILE__: |
---|
170 | out = open(__EVT_DEBUG_FILENAME__, 'a') |
---|
171 | out.write("%10g: %s\n" % (time.clock(), message)) |
---|
172 | out.close() |
---|