|
13 | 13 | RefuseAnyProjectLocation, |
14 | 14 | ValidateProjectLocation, |
15 | 15 | ) |
| 16 | +from OTAnalytics.application.state import CurrentExportConfigState |
16 | 17 | from OTAnalytics.application.upload_otconfig import NoOtconfigUpload, UploadOtconfig |
17 | 18 | from OTAnalytics.application.use_cases.ask_for_load_window import AskForLoadWindow |
18 | 19 | from OTAnalytics.application.use_cases.provide_input_files import ( |
@@ -261,57 +262,172 @@ def visualization_offset_slider_form(self) -> VisualizationOffSetSliderForm: |
261 | 262 | def project_form(self) -> ProjectForm: |
262 | 263 | return ProjectForm(self.view_model, self.resource_manager) |
263 | 264 |
|
| 265 | + @cached_property |
| 266 | + def get_do_events_of_current_analysis_config( |
| 267 | + self, |
| 268 | + ) -> GetDoEventsOfCurrentAnalysisConfig: |
| 269 | + return GetDoEventsOfCurrentAnalysisConfig( |
| 270 | + self.current_static_analysis_config_state |
| 271 | + ) |
| 272 | + |
| 273 | + @cached_property |
| 274 | + def get_do_counting_of_current_analysis_config( |
| 275 | + self, |
| 276 | + ) -> GetDoCountingOfCurrentAnalysisConfig: |
| 277 | + return GetDoCountingOfCurrentAnalysisConfig( |
| 278 | + self.current_static_analysis_config_state |
| 279 | + ) |
| 280 | + |
| 281 | + @cached_property |
| 282 | + def get_save_name_of_current_analysis_config( |
| 283 | + self, |
| 284 | + ) -> GetSaveNameOfCurrentAnalysisConfig: |
| 285 | + return GetSaveNameOfCurrentAnalysisConfig(self.current_export_config_state) |
| 286 | + |
| 287 | + @cached_property |
| 288 | + def get_save_suffix_of_current_analysis_config( |
| 289 | + self, |
| 290 | + ) -> GetSaveSuffixOfCurrentAnalysisConfig: |
| 291 | + return GetSaveSuffixOfCurrentAnalysisConfig(self.current_export_config_state) |
| 292 | + |
| 293 | + @cached_property |
| 294 | + def get_event_formats_of_current_analysis_config( |
| 295 | + self, |
| 296 | + ) -> GetEventFormatsOfCurrentAnalysisConfig: |
| 297 | + return GetEventFormatsOfCurrentAnalysisConfig(self.current_export_config_state) |
| 298 | + |
| 299 | + @cached_property |
| 300 | + def get_count_intervals_of_current_analysis_config( |
| 301 | + self, |
| 302 | + ) -> GetCountIntervalsOfCurrentAnalysisConfig: |
| 303 | + return GetCountIntervalsOfCurrentAnalysisConfig( |
| 304 | + self.current_export_config_state |
| 305 | + ) |
| 306 | + |
| 307 | + @cached_property |
| 308 | + def get_counting_event_of_current_analysis_config( |
| 309 | + self, |
| 310 | + ) -> GetCountingEventOfCurrentAnalysisConfig: |
| 311 | + return GetCountingEventOfCurrentAnalysisConfig(self.current_export_config_state) |
| 312 | + |
| 313 | + @cached_property |
| 314 | + def get_num_processes_of_current_analysis_config( |
| 315 | + self, |
| 316 | + ) -> GetNumProcessesOfCurrentAnalysisConfig: |
| 317 | + return GetNumProcessesOfCurrentAnalysisConfig( |
| 318 | + self.current_static_analysis_config_state |
| 319 | + ) |
| 320 | + |
| 321 | + @cached_property |
| 322 | + def get_logfile_of_current_analysis_config( |
| 323 | + self, |
| 324 | + ) -> GetLogfileOfCurrentAnalysisConfig: |
| 325 | + return GetLogfileOfCurrentAnalysisConfig( |
| 326 | + self.current_static_analysis_config_state |
| 327 | + ) |
| 328 | + |
| 329 | + @cached_property |
| 330 | + def set_do_events_in_current_analysis_config( |
| 331 | + self, |
| 332 | + ) -> SetDoEventsInCurrentAnalysisConfig: |
| 333 | + return SetDoEventsInCurrentAnalysisConfig( |
| 334 | + self.current_static_analysis_config_state, |
| 335 | + self.static_analysis_config_changed, |
| 336 | + ) |
| 337 | + |
| 338 | + @cached_property |
| 339 | + def set_do_counting_in_current_analysis_config( |
| 340 | + self, |
| 341 | + ) -> SetDoCountingInCurrentAnalysisConfig: |
| 342 | + return SetDoCountingInCurrentAnalysisConfig( |
| 343 | + self.current_static_analysis_config_state, |
| 344 | + self.static_analysis_config_changed, |
| 345 | + ) |
| 346 | + |
| 347 | + @cached_property |
| 348 | + def set_save_name_in_current_analysis_config( |
| 349 | + self, |
| 350 | + ) -> SetSaveNameInCurrentAnalysisConfig: |
| 351 | + return SetSaveNameInCurrentAnalysisConfig( |
| 352 | + self.current_export_config_state, self.static_analysis_config_changed |
| 353 | + ) |
| 354 | + |
| 355 | + @cached_property |
| 356 | + def set_save_suffix_in_current_analysis_config( |
| 357 | + self, |
| 358 | + ) -> SetSaveSuffixInCurrentAnalysisConfig: |
| 359 | + return SetSaveSuffixInCurrentAnalysisConfig( |
| 360 | + self.current_export_config_state, self.static_analysis_config_changed |
| 361 | + ) |
| 362 | + |
| 363 | + @cached_property |
| 364 | + def set_event_formats_in_current_analysis_config( |
| 365 | + self, |
| 366 | + ) -> SetEventFormatsInCurrentAnalysisConfig: |
| 367 | + return SetEventFormatsInCurrentAnalysisConfig( |
| 368 | + self.current_export_config_state, self.static_analysis_config_changed |
| 369 | + ) |
| 370 | + |
| 371 | + @cached_property |
| 372 | + def set_count_intervals_in_current_analysis_config( |
| 373 | + self, |
| 374 | + ) -> SetCountIntervalsInCurrentAnalysisConfig: |
| 375 | + return SetCountIntervalsInCurrentAnalysisConfig( |
| 376 | + self.current_export_config_state, self.static_analysis_config_changed |
| 377 | + ) |
| 378 | + |
| 379 | + @cached_property |
| 380 | + def set_counting_event_in_current_analysis_config( |
| 381 | + self, |
| 382 | + ) -> SetCountingEventInCurrentAnalysisConfig: |
| 383 | + return SetCountingEventInCurrentAnalysisConfig( |
| 384 | + self.current_export_config_state, self.static_analysis_config_changed |
| 385 | + ) |
| 386 | + |
| 387 | + @cached_property |
| 388 | + def set_num_processes_in_current_analysis_config( |
| 389 | + self, |
| 390 | + ) -> SetNumProcessesInCurrentAnalysisConfig: |
| 391 | + return SetNumProcessesInCurrentAnalysisConfig( |
| 392 | + self.current_static_analysis_config_state, |
| 393 | + self.static_analysis_config_changed, |
| 394 | + ) |
| 395 | + |
| 396 | + @cached_property |
| 397 | + def set_logfile_in_current_analysis_config( |
| 398 | + self, |
| 399 | + ) -> SetLogfileInCurrentAnalysisConfig: |
| 400 | + return SetLogfileInCurrentAnalysisConfig( |
| 401 | + self.current_static_analysis_config_state, |
| 402 | + self.static_analysis_config_changed, |
| 403 | + ) |
| 404 | + |
| 405 | + @cached_property |
| 406 | + def current_export_config_state(self) -> CurrentExportConfigState: |
| 407 | + return self.current_static_analysis_config_state.export_config |
| 408 | + |
264 | 409 | @cached_property |
265 | 410 | def static_analysis_config_form(self) -> StaticAnalysisConfigForm: |
266 | | - analysis_config_state = self.current_static_analysis_config_state |
267 | | - export_config_state = analysis_config_state.export_config |
268 | | - config_changed = self.static_analysis_config_changed |
269 | 411 | return StaticAnalysisConfigForm( |
270 | 412 | resource_manager=self.resource_manager, |
271 | | - get_do_events=GetDoEventsOfCurrentAnalysisConfig(analysis_config_state), |
272 | | - set_do_events=SetDoEventsInCurrentAnalysisConfig( |
273 | | - analysis_config_state, config_changed |
274 | | - ), |
275 | | - get_do_counting=GetDoCountingOfCurrentAnalysisConfig(analysis_config_state), |
276 | | - set_do_counting=SetDoCountingInCurrentAnalysisConfig( |
277 | | - analysis_config_state, config_changed |
278 | | - ), |
279 | | - get_save_name=GetSaveNameOfCurrentAnalysisConfig(export_config_state), |
280 | | - set_save_name=SetSaveNameInCurrentAnalysisConfig( |
281 | | - export_config_state, config_changed |
282 | | - ), |
283 | | - get_save_suffix=GetSaveSuffixOfCurrentAnalysisConfig(export_config_state), |
284 | | - set_save_suffix=SetSaveSuffixInCurrentAnalysisConfig( |
285 | | - export_config_state, config_changed |
286 | | - ), |
287 | | - get_event_formats=GetEventFormatsOfCurrentAnalysisConfig( |
288 | | - export_config_state |
289 | | - ), |
290 | | - set_event_formats=SetEventFormatsInCurrentAnalysisConfig( |
291 | | - export_config_state, config_changed |
292 | | - ), |
293 | | - get_count_intervals=GetCountIntervalsOfCurrentAnalysisConfig( |
294 | | - export_config_state |
295 | | - ), |
296 | | - set_count_intervals=SetCountIntervalsInCurrentAnalysisConfig( |
297 | | - export_config_state, config_changed |
298 | | - ), |
299 | | - get_counting_event=GetCountingEventOfCurrentAnalysisConfig( |
300 | | - export_config_state |
301 | | - ), |
302 | | - set_counting_event=SetCountingEventInCurrentAnalysisConfig( |
303 | | - export_config_state, config_changed |
304 | | - ), |
305 | | - get_num_processes=GetNumProcessesOfCurrentAnalysisConfig( |
306 | | - analysis_config_state |
307 | | - ), |
308 | | - set_num_processes=SetNumProcessesInCurrentAnalysisConfig( |
309 | | - analysis_config_state, config_changed |
310 | | - ), |
311 | | - get_logfile=GetLogfileOfCurrentAnalysisConfig(analysis_config_state), |
312 | | - set_logfile=SetLogfileInCurrentAnalysisConfig( |
313 | | - analysis_config_state, config_changed |
314 | | - ), |
| 413 | + get_do_events=self.get_do_events_of_current_analysis_config, |
| 414 | + set_do_events=self.set_do_events_in_current_analysis_config, |
| 415 | + get_do_counting=self.get_do_counting_of_current_analysis_config, |
| 416 | + set_do_counting=self.set_do_counting_in_current_analysis_config, |
| 417 | + get_save_name=self.get_save_name_of_current_analysis_config, |
| 418 | + set_save_name=self.set_save_name_in_current_analysis_config, |
| 419 | + get_save_suffix=self.get_save_suffix_of_current_analysis_config, |
| 420 | + set_save_suffix=self.set_save_suffix_in_current_analysis_config, |
| 421 | + get_event_formats=self.get_event_formats_of_current_analysis_config, |
| 422 | + set_event_formats=self.set_event_formats_in_current_analysis_config, |
| 423 | + get_count_intervals=self.get_count_intervals_of_current_analysis_config, |
| 424 | + set_count_intervals=self.set_count_intervals_in_current_analysis_config, |
| 425 | + get_counting_event=self.get_counting_event_of_current_analysis_config, |
| 426 | + set_counting_event=self.set_counting_event_in_current_analysis_config, |
| 427 | + get_num_processes=self.get_num_processes_of_current_analysis_config, |
| 428 | + set_num_processes=self.set_num_processes_in_current_analysis_config, |
| 429 | + get_logfile=self.get_logfile_of_current_analysis_config, |
| 430 | + set_logfile=self.set_logfile_in_current_analysis_config, |
315 | 431 | ) |
316 | 432 |
|
317 | 433 | @cached_property |
@@ -351,7 +467,12 @@ def track_statistic_form(self) -> TrackStatisticForm: |
351 | 467 | @cached_property |
352 | 468 | def ui_factory(self) -> UiFactory: |
353 | 469 | return NiceGuiUiFactory( |
354 | | - self.resource_manager, self.run_config.file_picker_directory |
| 470 | + self.resource_manager, |
| 471 | + get_count_intervals=self.get_count_intervals_of_current_analysis_config, |
| 472 | + get_counting_event=self.get_counting_event_of_current_analysis_config, |
| 473 | + get_save_name=self.get_save_name_of_current_analysis_config, |
| 474 | + get_save_suffix=self.get_save_suffix_of_current_analysis_config, |
| 475 | + base_directory=self.run_config.file_picker_directory, |
355 | 476 | ) |
356 | 477 |
|
357 | 478 | @cached_property |
|
0 commit comments