AMS-BP 0.4.40__py3-none-any.whl → 0.4.41__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
AMS_BP/__init__.py CHANGED
@@ -10,4 +10,4 @@ Last updated: 2024-12-16
10
10
 
11
11
  """
12
12
 
13
- __version__ = "0.4.40"
13
+ __version__ = "0.4.41"
@@ -1,10 +1,12 @@
1
1
  from pathlib import Path
2
2
 
3
- from PyQt6.QtCore import pyqtSignal
3
+ from PyQt6.QtCore import Qt, QTimer, pyqtSignal
4
4
  from PyQt6.QtWidgets import (
5
5
  QComboBox,
6
6
  QDoubleSpinBox,
7
7
  QFormLayout,
8
+ QGraphicsOpacityEffect,
9
+ QLabel,
8
10
  QLineEdit,
9
11
  QMessageBox,
10
12
  QPushButton,
@@ -23,6 +25,7 @@ class LaserConfigWidget(QWidget):
23
25
 
24
26
  def __init__(self):
25
27
  super().__init__()
28
+ self._confocal_mode = False
26
29
  self.laser_name_widgets = []
27
30
  layout = QVBoxLayout()
28
31
  layout.setContentsMargins(10, 10, 10, 10)
@@ -30,6 +33,25 @@ class LaserConfigWidget(QWidget):
30
33
  self.setLayout(layout)
31
34
  self.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding)
32
35
 
36
+ self.scanning_label = QLabel(
37
+ "Scanning Confocal Selected \n Only Gaussian Laser Allowed"
38
+ )
39
+ self.scanning_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
40
+ self.scanning_label.setStyleSheet(
41
+ "color: green; font-weight: bold; font-size: 14px;"
42
+ )
43
+ self.scanning_label.setVisible(
44
+ True
45
+ ) # Always visible — will control opacity instead
46
+ # blinking effect
47
+ self.opacity_effect = QGraphicsOpacityEffect(self.scanning_label)
48
+ self.scanning_label.setGraphicsEffect(self.opacity_effect)
49
+ self.opacity_effect.setOpacity(0.0)
50
+ self.blink_timer = QTimer(self)
51
+ self.blink_timer.setInterval(500)
52
+ self.blink_timer.timeout.connect(self._toggle_scanning_label_opacity)
53
+ layout.addWidget(self.scanning_label)
54
+
33
55
  form = QFormLayout()
34
56
 
35
57
  self.num_lasers = QSpinBox()
@@ -52,35 +74,49 @@ class LaserConfigWidget(QWidget):
52
74
  self.validate_button.clicked.connect(self.validate)
53
75
  layout.addWidget(self.validate_button)
54
76
 
77
+ def _toggle_scanning_label_opacity(self):
78
+ if self._confocal_mode:
79
+ current_opacity = self.opacity_effect.opacity()
80
+ new_opacity = 0.0 if current_opacity > 0.5 else 1.0
81
+ self.opacity_effect.setOpacity(new_opacity)
82
+ else:
83
+ self.opacity_effect.setOpacity(0.0)
84
+
55
85
  def set_confocal_mode(self, enabled: bool):
86
+ self._confocal_mode = enabled
87
+
56
88
  for i in range(self.laser_tabs.count()):
57
89
  tab = self.laser_tabs.widget(i)
58
90
 
59
91
  laser_type: QComboBox = tab.findChild(QComboBox)
60
92
  beam_width: QDoubleSpinBox = tab.findChildren(QDoubleSpinBox)[
61
93
  1
62
- ] # Assumes 2nd spinbox is beam_width
94
+ ] # second spinbox is beam_width
63
95
 
64
96
  if enabled:
65
- # Force laser type to "gaussian" and disable editing
66
97
  laser_type.setCurrentText("gaussian")
67
98
  laser_type.setEnabled(False)
68
99
 
69
- # Hide beam width
70
100
  beam_width.hide()
71
101
  label = tab.layout().labelForField(beam_width)
72
102
  if label:
73
103
  label.hide()
74
104
  else:
75
- # Enable laser type editing
76
105
  laser_type.setEnabled(True)
77
106
 
78
- # Show beam width
79
107
  beam_width.show()
80
108
  label = tab.layout().labelForField(beam_width)
81
109
  if label:
82
110
  label.show()
83
111
 
112
+ # Handle blinking label
113
+ if enabled:
114
+ self.scanning_label.setVisible(True)
115
+ self.blink_timer.start()
116
+ else:
117
+ self.scanning_label.setVisible(False)
118
+ self.blink_timer.stop()
119
+
84
120
  def validate(self) -> bool:
85
121
  try:
86
122
  data = self.get_data()
@@ -148,13 +184,22 @@ class LaserConfigWidget(QWidget):
148
184
  layout.addRow(f"Laser {index + 1} Beam Width (µm):", beam_width)
149
185
  layout.addRow(f"Laser {index + 1} Numerical Aperture:", numerical_aperture)
150
186
  layout.addRow(f"Laser {index + 1} Refractive Index:", refractive_index)
151
- layout.addRow(f"Laser {index + 1} Inclination Angle (°):", inclination_angle)
187
+ inclination_label = QLabel(f"Laser {index + 1} Inclination Angle (°):")
188
+ layout.addRow(inclination_label, inclination_angle)
152
189
 
153
190
  # Logic for hilo
154
- laser_type.currentTextChanged.connect(
155
- lambda val: inclination_angle.setEnabled(val == "hilo")
156
- )
157
- inclination_angle.setEnabled(laser_type.currentText() == "hilo")
191
+ def handle_inclination_visibility(selected_type):
192
+ if selected_type == "hilo":
193
+ inclination_angle.show()
194
+ inclination_label.show()
195
+ else:
196
+ inclination_angle.hide()
197
+ inclination_label.hide()
198
+
199
+ laser_type.currentTextChanged.connect(handle_inclination_visibility)
200
+
201
+ # Initial state
202
+ handle_inclination_visibility(laser_type.currentText())
158
203
 
159
204
  tab.setLayout(layout)
160
205
  self.laser_tabs.addTab(tab, f"Laser {index + 1}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: AMS_BP
3
- Version: 0.4.40
3
+ Version: 0.4.41
4
4
  Summary: Advanced Microscopy Simulations developed for the Weber Lab by Baljyot Singh Parmar
5
5
  Project-URL: Documentation, https://joemans3.github.io/AMS_BP/
6
6
  Project-URL: Source code, https://github.com/joemans3/AMS_BP
@@ -125,6 +125,7 @@ To start the GUI, run:
125
125
 
126
126
  run_AMS_BP gui
127
127
  ```
128
+ Please note, the first time the package is used it will take a minute to start.
128
129
  For detailed walkthrough see the [GUI Documentation](./src/AMS_BP/gui/README.md).
129
130
  ## Configuration File
130
131
 
@@ -1,4 +1,4 @@
1
- AMS_BP/__init__.py,sha256=rCKDYOiRo5EP_NAuyZFc4JQqqS6gw0ETq8EBpZd5sqI,327
1
+ AMS_BP/__init__.py,sha256=H0K3YhBrQ5e1jJ-LrEb_2gXpTU1K78stoJSHBtYVKFc,327
2
2
  AMS_BP/main_cli.py,sha256=Z2vRNCSY2GZq0yG5unCZI2BAdtKtVnh1DuNuB2rIo2g,5797
3
3
  AMS_BP/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  AMS_BP/core/run_sim_util.py,sha256=UQr0l9rbtTmzuuWXjkIaTQV-ETO5AqyXRwflF6U2WYs,2415
@@ -73,7 +73,7 @@ AMS_BP/gui/widgets/experiment_config_widget.py,sha256=uyxLXwHQRpaOC_GvqYkKUpqK2x
73
73
  AMS_BP/gui/widgets/flurophore_config_widget.py,sha256=g1dag-S_BsbhwdJm9g42K02ZibZCqQPtAR56iV7Cuko,19889
74
74
  AMS_BP/gui/widgets/general_config_widget.py,sha256=YbnE11TnWZBgb-xqKWM00p8RdSp-9eTbwTZ9mikPvZc,1321
75
75
  AMS_BP/gui/widgets/global_config_widget.py,sha256=XS9y031BRQZZdNE7EAretYuaIoi4VebCG-u5mb2sEak,5091
76
- AMS_BP/gui/widgets/laser_config_widget.py,sha256=8zpcTqCac4sZnDdmgz2-LY3xVDaKmlnN7wIGkSjqJqk,8957
76
+ AMS_BP/gui/widgets/laser_config_widget.py,sha256=X4ifkTpAdKjNORm2SmRg4vYpvDPemUNQlfCChx2uWn4,10605
77
77
  AMS_BP/gui/widgets/molecule_config_widget.py,sha256=vnrrBUM0fU2rBt-9jzjorZftcEbdAMmuff6uyFtg5Ko,27871
78
78
  AMS_BP/gui/widgets/output_config_widget.py,sha256=pExiAHIHs0-J-dY2lZtfB0ei9oNjZIJKDQtWDSjFZOY,2105
79
79
  AMS_BP/gui/widgets/psf_config_widget.py,sha256=75ggeolYI_Sbn5LD_hUGY3S4Z9uRkJGtzZhb79NgsY4,4534
@@ -103,8 +103,8 @@ AMS_BP/utils/decorators.py,sha256=4qFdvzPJne0dhkhD1znPxRln1Rfr5NX8rdcCDcbATRU,62
103
103
  AMS_BP/utils/errors.py,sha256=7BOd-L4_YeKmWn3Q4EOdTnNF3Bj_exDa3eg5X0yCZrc,759
104
104
  AMS_BP/utils/maskMaker.py,sha256=2ca3n2nc8rFtUh1LurKXOJJsUmhrOpWbRnVX7fjRVvs,335
105
105
  AMS_BP/utils/util_functions.py,sha256=9Qlr4kjY04fObktR8TrzB0IgoG1yXtcmxPRX9AN34mM,9671
106
- ams_bp-0.4.40.dist-info/METADATA,sha256=HJwALAWKvFTs6giEwD2HA1GvBfWmOR74FFMLJWx_DqU,9829
107
- ams_bp-0.4.40.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
108
- ams_bp-0.4.40.dist-info/entry_points.txt,sha256=06NS85P4dz6vosMOKXHfx8l7gK9WXBZxuwjl55XfT2c,65
109
- ams_bp-0.4.40.dist-info/licenses/LICENSE,sha256=k_-JV1DQKvO0FR8WjvOisqdTl0kp6VJ7RFM3YZhao0c,1071
110
- ams_bp-0.4.40.dist-info/RECORD,,
106
+ ams_bp-0.4.41.dist-info/METADATA,sha256=ZHg98aTBe7F0Nl1VgTwApNA2bE_t2CLPsJz-bp7hikg,9909
107
+ ams_bp-0.4.41.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
108
+ ams_bp-0.4.41.dist-info/entry_points.txt,sha256=06NS85P4dz6vosMOKXHfx8l7gK9WXBZxuwjl55XfT2c,65
109
+ ams_bp-0.4.41.dist-info/licenses/LICENSE,sha256=k_-JV1DQKvO0FR8WjvOisqdTl0kp6VJ7RFM3YZhao0c,1071
110
+ ams_bp-0.4.41.dist-info/RECORD,,