40
40
import os
41
41
import time
42
42
import platform
43
- import reprlib
44
43
45
44
# Third Party Imports
46
45
64
63
FeaturePopupController ,
65
64
MenuController ,
66
65
PluginsController ,
66
+ HistogramController ,
67
67
# MicroscopePopupController,
68
68
# AdaptiveOpticsPopupController,
69
69
)
97
97
98
98
class Controller :
99
99
"""Navigate Controller"""
100
+
100
101
def __init__ (
101
102
self ,
102
103
root ,
@@ -198,8 +199,10 @@ def __init__(
198
199
verify_waveform_constants (self .manager , self .configuration )
199
200
200
201
total_ram , available_ram = get_ram_info ()
201
- logger .info (f"Total RAM: { total_ram / 1024 ** 3 :.2f} GB. "
202
- f"Available RAM: { available_ram / 1024 ** 3 :.2f} GB." )
202
+ logger .info (
203
+ f"Total RAM: { total_ram / 1024 ** 3 :.2f} GB. "
204
+ f"Available RAM: { available_ram / 1024 ** 3 :.2f} GB."
205
+ )
203
206
204
207
#: ObjectInSubprocess: Model object in MVC architecture.
205
208
self .model = ObjectInSubprocess (
@@ -225,7 +228,7 @@ def __init__(
225
228
self .event_listeners = {}
226
229
227
230
#: AcquireBarController: Acquire Bar Sub-Controller.
228
- self .acquire_bar_controller = AcquireBarController (self .view .acqbar , self )
231
+ self .acquire_bar_controller = AcquireBarController (self .view .acquire_bar , self )
229
232
230
233
#: ChannelsTabController: Channels Tab Sub-Controller.
231
234
self .channels_tab_controller = ChannelsTabController (
@@ -242,6 +245,10 @@ def __init__(
242
245
self .view .camera_waveform .camera_tab , self
243
246
)
244
247
248
+ self .histogram_controller = HistogramController (
249
+ self .view .camera_waveform .camera_tab .histogram , self
250
+ )
251
+
245
252
#: MIPSettingController: MIP Settings Tab Sub-Controller.
246
253
self .mip_setting_controller = MIPViewController (
247
254
self .view .camera_waveform .mip_tab , self
@@ -365,7 +372,7 @@ def update_buffer(self):
365
372
366
373
def update_acquire_control (self ):
367
374
"""Update the acquire control based on the current experiment parameters."""
368
- self .view .acqbar .stop_stage .config (
375
+ self .view .acquire_bar .stop_stage .config (
369
376
command = self .stage_controller .stop_button_handler
370
377
)
371
378
@@ -551,12 +558,14 @@ def refresh(width, height):
551
558
height : int
552
559
Height of the GUI.
553
560
"""
554
- if width < 1200 or height < 600 :
561
+ if width < 1300 or height < 800 :
555
562
return
556
563
self .view .camera_waveform ["width" ] = (
557
- width - self .view .frame_left .winfo_width () - 81
558
- )
559
- self .view .camera_waveform ["height" ] = height - 110
564
+ width - self .view .left_frame .winfo_width () - 35
565
+ ) #
566
+ self .view .camera_waveform ["height" ] = height - 117
567
+
568
+ print ("camera_waveform height" , self .view .camera_waveform ["height" ])
560
569
561
570
if event .widget != self .view .scroll_frame :
562
571
return
@@ -1081,13 +1090,16 @@ def capture_image(self, command, mode, *args):
1081
1090
)
1082
1091
self .execute ("stop_acquire" )
1083
1092
1084
- # Display the Image in the View
1093
+ # Display the image and update the histogram
1085
1094
self .camera_view_controller .try_to_display_image (
1086
1095
image = self .data_buffer [image_id ]
1087
1096
)
1088
1097
self .mip_setting_controller .try_to_display_image (
1089
1098
image = self .data_buffer [image_id ]
1090
1099
)
1100
+ self .histogram_controller .populate_histogram (
1101
+ image = self .data_buffer [image_id ]
1102
+ )
1091
1103
images_received += 1
1092
1104
1093
1105
# Update progress bar.
@@ -1212,7 +1224,9 @@ def display_images(
1212
1224
)
1213
1225
camera_view_controller .microscope_name = microscope_name
1214
1226
popup_window .popup .bind ("<Configure>" , camera_view_controller .resize )
1215
- self .additional_microscopes [microscope_name ]["popup_window" ] = popup_window
1227
+ self .additional_microscopes [microscope_name ][
1228
+ "popup_window"
1229
+ ] = popup_window
1216
1230
self .additional_microscopes [microscope_name ][
1217
1231
"camera_view_controller"
1218
1232
] = camera_view_controller
@@ -1226,7 +1240,9 @@ def display_images(
1226
1240
),
1227
1241
)
1228
1242
1229
- self .additional_microscopes [microscope_name ]["show_img_pipe" ] = show_img_pipe
1243
+ self .additional_microscopes [microscope_name ][
1244
+ "show_img_pipe"
1245
+ ] = show_img_pipe
1230
1246
self .additional_microscopes [microscope_name ]["data_buffer" ] = data_buffer
1231
1247
1232
1248
# start thread
@@ -1263,7 +1279,9 @@ def destroy_virtual_microscope(self, microscope_name, destroy_window=True):
1263
1279
# destroy the popup window
1264
1280
if destroy_window :
1265
1281
self .additional_microscopes [microscope_name ]["popup_window" ].popup .dismiss ()
1266
- self .additional_microscopes [microscope_name ]["camera_view_controller" ] = None
1282
+ self .additional_microscopes [microscope_name ][
1283
+ "camera_view_controller"
1284
+ ] = None
1267
1285
del self .additional_microscopes [microscope_name ]
1268
1286
1269
1287
def move_stage (self , pos_dict ):
0 commit comments