Package theia :: Package helpers :: Module settings
[hide private]
[frames] | no frames]

Source Code for Module theia.helpers.settings

 1  '''Module to initiate all global variables for theia.''' 
 2   
 3  # Provides: 
 4  #   init 
 5   
6 -def init(dic):
7 '''Initiate globals with dictionary. 8 9 dic: dictionary holding values for globals. [dictionary] 10 11 ''' 12 # these are *all* the theia globals 13 global info 14 global warning 15 global text 16 global cad 17 global fname 18 global fclib 19 global antiClip 20 global short 21 global clipFactor # portion of beam inside optic to determine whether 22 # clipping has occured. 23 global FCFactor # factor to compensate for FreeCAD units 24 25 #geometry 26 global zero #geometrical 0 distance (for seperation) 27 global inf # geometrical infinite 28 global flatK # curvature of a flat surface 29 30 #dictionary of orders in which input is given in .tia 31 global inOrder 32 global types 33 global typeStrings 34 35 #geometry 36 zero = 1.e-10 37 inf = 1.e15 38 flatK = 1.e-5 39 clipFactor = 2. 40 FCFactor = 0.001 41 42 #order of data in .tia 43 inOrder = { 44 45 'bm': ['Wx','Wy','WDistx','WDisty','Wl','P', 46 'X','Y','Z','Theta','Phi','Alpha','Ref'], 47 48 'mr': ['X','Y','Z','Theta','Phi','Wedge','Alpha', 49 'HRK','ARK','Diameter','Thickness','N','HRr','HRt','ARr','ARt', 50 'KeepI', 'Ref'], 51 52 'sp': ['RonHR', 'TonHR', 'RonAR', 'TonAR', 53 'X','Y','Z','Theta','Phi','Wedge','Alpha', 54 'HRK','ARK','Diameter','Thickness','N','HRr','HRt','ARr','ARt', 55 'KeepI', 'Ref'], 56 57 'bs': ['X','Y','Z','Theta','Phi','Wedge','Alpha', 58 'HRK','ARK','Diameter','Thickness','N','HRr','HRt','ARr','ARt', 59 'KeepI', 'Ref'], 60 61 'th': ['X','Y','Z','Theta','Phi','Focal','Diameter', 62 'R','T','KeepI','Ref'], 63 64 'tk': ['X','Y','Z','Theta','Phi','K1','K2','Diameter', 65 'Thickness','N','R','T','KeepI','Ref'], 66 67 'bd': ['X','Y','Z','Theta','Phi','Diameter','Thickness', 'Ref'], 68 'gh': ['X','Y','Z','Theta','Phi','Diameter', 'Ref'], 69 'bo': ['X', 'Y', 'Z']} 70 71 # expected types of inputs 72 types = {'X': float, 'Y': float, 'Z': float, 73 'Theta': float, 'Phi': float, 'Diameter': float, 74 'Thickness': float, 'Ref': str, 'K1': float, 'K2': float, 75 'KeepI': bool, 'T': float, 'R': float, 'N': float, 'Focal': float, 76 'HRK': float, 'ARK': float, 77 'HRr': float, 'HRt': float,'ARr': float,'ARt': float, 78 'Wedge': float, 'Alpha': float, 79 'RonHR': int, 'TonHR': int, 'RonAR': int, 'TonAR': int, 80 'Wx': float, 'Wy': float, 'WDistx': float, 'WDisty': float, 81 'Wl': float, 'P': float} 82 83 #strings to print types 84 typeStrings = {float: 'float', int: 'int', str: 'string', bool: 'boolean'} 85 86 #parsed from command line 87 info = dic['info'] 88 warning = dic['warning'] 89 text = dic['text'] 90 cad = dic['cad'] 91 fname = dic['fname'] 92 fclib = dic['fclib'] 93 antiClip = dic['antiClip'] 94 short = dic['short']
95