[f53cd30] | 1 | """ |
---|
[efe730d] | 2 | Application settings |
---|
[f53cd30] | 3 | """ |
---|
[a1b8fee] | 4 | from __future__ import print_function |
---|
| 5 | |
---|
[f53cd30] | 6 | import time |
---|
| 7 | import os |
---|
[efe730d] | 8 | import logging |
---|
| 9 | |
---|
[d85c194] | 10 | from sas.sasgui.guiframe.gui_style import GUIFRAME |
---|
[f53cd30] | 11 | import sas.sasview |
---|
| 12 | |
---|
[463e7ffc] | 13 | logger = logging.getLogger(__name__) |
---|
[c155a16] | 14 | |
---|
[f53cd30] | 15 | # Version of the application |
---|
| 16 | __appname__ = "SasView" |
---|
| 17 | __version__ = sas.sasview.__version__ |
---|
[839f70f7] | 18 | __DOI__ = sas.sasview.__DOI__ |
---|
| 19 | __release_date__ = sas.sasview.__release_date__ |
---|
[f53cd30] | 20 | __build__ = sas.sasview.__build__ |
---|
[c8d22ec] | 21 | __download_page__ = 'https://github.com/SasView/sasview/releases' |
---|
[9989a6a] | 22 | __update_URL__ = 'http://www.sasview.org/latestversion.json' |
---|
[f53cd30] | 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? |
---|
[c8d22ec] | 31 | __EVT_DEBUG_2_FILE__ = False |
---|
[f53cd30] | 32 | __EVT_DEBUG_FILENAME__ = "debug.log" |
---|
| 33 | |
---|
| 34 | # About box info |
---|
| 35 | _do_aboutbox = True |
---|
| 36 | _do_acknowledge = True |
---|
[5e88e27c] | 37 | _do_release = True |
---|
[f53cd30] | 38 | _do_tutorial = True |
---|
| 39 | _acknowledgement_preamble =\ |
---|
[e572d4b] | 40 | '''To ensure the long term support and development of this software please |
---|
| 41 | remember to:''' |
---|
[0ea31ca] | 42 | _acknowledgement_preamble_bullet1 =\ |
---|
[d8161f2] | 43 | '''Acknowledge its use in your publications as :''' |
---|
[0ea31ca] | 44 | _acknowledgement_preamble_bullet2 =\ |
---|
[d8161f2] | 45 | '''Reference SasView as:''' |
---|
[0ea31ca] | 46 | _acknowledgement_preamble_bullet3 =\ |
---|
[c8d22ec] | 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''' |
---|
[f53cd30] | 50 | _acknowledgement_publications = \ |
---|
[e572d4b] | 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.") |
---|
[d8161f2] | 55 | _acknowledgement_citation = \ |
---|
[e572d4b] | 56 | '''M. Doucet et al. SasView Version %s, %s''' % (__version__, __DOI__) |
---|
[f53cd30] | 57 | _acknowledgement = \ |
---|
[e572d4b] | 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") |
---|
[f53cd30] | 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")) |
---|
[c155a16] | 74 | logger.info("icon path: %s" % icon_path) |
---|
[f53cd30] | 75 | media_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "media")) |
---|
[c8d22ec] | 76 | test_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "test")) |
---|
[f53cd30] | 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") |
---|
[e0f28e6] | 81 | _ornl_logo = os.path.join(icon_path, "ornl_logo.png") |
---|
[f53cd30] | 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") |
---|
[e0f28e6] | 85 | _ansto_logo = os.path.join(icon_path, "ansto_logo.png") |
---|
[49e000b] | 86 | _tudelft_logo = os.path.join(icon_path, "tudelft_logo.png") |
---|
[1779e72] | 87 | _dls_logo = os.path.join(icon_path, "dls_logo.png") |
---|
[1b4cb41] | 88 | _bam_logo = os.path.join(icon_path, "bam_logo.png") |
---|
[f53cd30] | 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/" |
---|
[e0f28e6] | 95 | _ornl_url = "http://neutrons.ornl.gov/" |
---|
[f53cd30] | 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/" |
---|
[e0f28e6] | 100 | _ansto_url = "http://www.ansto.gov.au/" |
---|
[49e000b] | 101 | _tudelft_url = "http://www.tnw.tudelft.nl/en/cooperation/facilities/reactor-instituut-delft/" |
---|
[1779e72] | 102 | _dls_url = "http://www.diamond.ac.uk/" |
---|
[f53cd30] | 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") |
---|
[839f70f7] | 107 | _copyright = ("(c) 2009 - %s, UTK, UMD, NIST, ORNL, ISIS, ESS, ILL, ANSTO," |
---|
| 108 | "TU Delft, DLS and BAM") % __release_date__ |
---|
[adb0851] | 109 | marketplace_url = "http://marketplace.sasview.org/" |
---|
[f53cd30] | 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 |
---|
[ae9b8bf] | 116 | PLUGIN_STATE_EXTENSIONS = ['.fitv', '.inv', '.prv', '.crf'] |
---|
[f53cd30] | 117 | PLUGINS_WLIST = ['Fitting files (*.fitv)|*.fitv', |
---|
[c8d22ec] | 118 | 'Invariant files (*.inv)|*.inv', |
---|
[96d293da] | 119 | 'P(r) files (*.prv)|*.prv', |
---|
[ae9b8bf] | 120 | 'Corfunc files (*.crf)|*.crf'] |
---|
[f53cd30] | 121 | PLOPANEL_WIDTH = 415 |
---|
| 122 | PLOPANEL_HEIGTH = 370 |
---|
| 123 | DATAPANEL_WIDTH = 235 |
---|
| 124 | DATAPANEL_HEIGHT = 700 |
---|
[c8d22ec] | 125 | SPLASH_SCREEN_PATH = os.path.join(icon_path, "SVwelcome_mini.png") |
---|
| 126 | TUTORIAL_PATH = os.path.join(media_path, "Tutorial.pdf") |
---|
[f53cd30] | 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 |
---|
[c8d22ec] | 132 | WELCOME_PANEL_ON = True |
---|
[f53cd30] | 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 | |
---|
[957af0d] | 156 | # Time out for updating sasview |
---|
| 157 | UPDATE_TIMEOUT = 2 |
---|
| 158 | |
---|
[c6bdb3b] | 159 | # Time out for updating sasview |
---|
| 160 | UPDATE_TIMEOUT = 2 |
---|
| 161 | |
---|
[f53cd30] | 162 | def printEVT(message): |
---|
| 163 | if __EVT_DEBUG__: |
---|
[c8d22ec] | 164 | """ |
---|
| 165 | :TODO - Need method doc string |
---|
| 166 | """ |
---|
[9c3d784] | 167 | print("%g: %s" % (time.clock(), message)) |
---|
[c8d22ec] | 168 | |
---|
[f53cd30] | 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() |
---|