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