-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathparameters.py
50 lines (29 loc) · 1.26 KB
/
parameters.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from dataclasses import dataclass
from PIL import Image
SoftInstance = None
Instance = None
@dataclass
class Parameters:
# Generally all of these default values aren't used for the simulation. They are only used to verify the types of
# values that are inserted into it by the GUI
tick_distance: float = 0.5 #This is also in pixels, in simulation it doesn't look like it because z is skewed (already a TODO elesewhere to fix it)
wavelength: float = 0.001 #Also in pixels haha, every length unit is in pixles
brightnessFactor: float = 1000 #Turn up to make brighter pixels, will probably need to be a few hundred or more to see anything
width: int = 32
occluder: Image = None
visualizerAmount: int = 7
detectorDistance: float = 2000
detectorDistance: float = 10
lowResolution: int = 16 # For all planes in time simulation
def printToConsole(self):
print()
for attr in dir(self):
if not attr.startswith("__") and not attr == "printToConsole":
print(f"{attr}: {getattr(self, attr)}")
print()
def initParams():
global SoftInstance, Instance
if SoftInstance is None:
SoftInstance = Parameters()
if Instance is None:
Instance = Parameters()