40
40
import os
41
41
import time
42
42
import platform
43
+ import reprlib
43
44
44
45
# Third Party Imports
45
46
82
83
verify_configuration ,
83
84
get_navigate_path ,
84
85
)
85
- from navigate .tools .file_functions import create_save_path , save_yaml_file
86
+ from navigate .tools .file_functions import create_save_path , save_yaml_file , get_ram_info
86
87
from navigate .tools .common_dict_tools import update_stage_dict
87
88
from navigate .tools .multipos_table_tools import update_table
88
89
from navigate .tools .common_functions import combine_funcs
96
97
97
98
class Controller :
98
99
"""Navigate Controller"""
99
-
100
100
def __init__ (
101
101
self ,
102
102
root ,
@@ -139,7 +139,6 @@ def __init__(
139
139
Command line input arguments for non-default
140
140
file paths or using synthetic hardware modes.
141
141
"""
142
-
143
142
#: Tk top-level widget: Tk.tk GUI instance.
144
143
self .root = root
145
144
@@ -148,24 +147,31 @@ def __init__(
148
147
149
148
#: string: Path to the configuration yaml file.
150
149
self .configuration_path = configuration_path
150
+ logger .info (f"Configuration Path: { self .configuration_path } " )
151
151
152
152
#: string: Path to the experiment yaml file.
153
153
self .experiment_path = experiment_path
154
+ logger .info (f"Experiment Path: { self .experiment_path } " )
154
155
155
156
#: string: Path to the waveform constants yaml file.
156
157
self .waveform_constants_path = waveform_constants_path
158
+ logger .info (f"Waveform Constants Path: { self .waveform_constants_path } " )
157
159
158
160
#: string: Path to the REST API yaml file.
159
161
self .rest_api_path = rest_api_path
162
+ logger .info (f"REST API Path: { self .rest_api_path } " )
160
163
161
164
#: string: Path to the waveform templates yaml file.
162
165
self .waveform_templates_path = waveform_templates_path
166
+ logger .info (f"Waveform Templates Path: { self .waveform_templates_path } " )
163
167
164
168
#: string: Path to the GUI configuration yaml file.
165
169
self .gui_configuration_path = gui_configuration_path
170
+ logger .info (f"GUI Configuration Path: { self .gui_configuration_path } " )
166
171
167
172
#: iterable: Non-default command line input arguments for
168
173
self .args = args
174
+ logger .info (f"Variable Input Arguments: { self .args } " )
169
175
170
176
#: Object: Thread pool for the controller.
171
177
self .threads_pool = SynchronizedThreadPool ()
@@ -191,6 +197,10 @@ def __init__(
191
197
verify_experiment_config (self .manager , self .configuration )
192
198
verify_waveform_constants (self .manager , self .configuration )
193
199
200
+ 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." )
203
+
194
204
#: ObjectInSubprocess: Model object in MVC architecture.
195
205
self .model = ObjectInSubprocess (
196
206
Model , args , self .configuration , event_queue = self .event_queue
@@ -269,9 +279,6 @@ def __init__(
269
279
t = threading .Thread (target = self .update_event )
270
280
t .start ()
271
281
272
- # self.microscope = self.configuration['configuration']
273
- # ['microscopes'].keys()[0] # Default to the first microscope
274
-
275
282
#: MenuController: Menu Sub-Controller.
276
283
self .menu_controller = MenuController (view = self .view , parent_controller = self )
277
284
self .menu_controller .initialize_menus ()
@@ -321,17 +328,6 @@ def __init__(
321
328
if platform .system () == "Windows" :
322
329
self .view .root .bind ("<Configure>" , self .resize )
323
330
324
- logger .info (self .__repr__ ())
325
-
326
- def __repr__ (self ):
327
- return (
328
- f'Controller("{ self .root } ", "{ self .splash_screen } ", '
329
- f'"{ self .configuration_path } ", "{ self .experiment_path } ", '
330
- f'"{ self .waveform_constants_path } ", "{ self .rest_api_path } ", '
331
- f'"{ self .waveform_templates_path } ", "{ self .gui_configuration_path } ", '
332
- f'"{ self .args } ")'
333
- )
334
-
335
331
def update_buffer (self ):
336
332
"""Update the buffer size according to the camera
337
333
dimensions listed in the experimental parameters.
0 commit comments