diff options
Diffstat (limited to 'prediction_controller.py')
| -rw-r--r-- | prediction_controller.py | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/prediction_controller.py b/prediction_controller.py index 168ad62..e822f2e 100644 --- a/prediction_controller.py +++ b/prediction_controller.py @@ -241,4 +241,26 @@ class PredictionController: if launch_dt > datetime(2100, 1, 1): errors.append("Launch date too far in the future") - return errors
\ No newline at end of file + return errors + + def save_complete_state(self, filename: str) -> bool: + """Save the complete prediction state including all calculated data""" + from prediction_state_service import PredictionStateService + return PredictionStateService.save_prediction_state( + self.calendar_manager, self, filename + ) + + def load_complete_state(self, filename: str) -> bool: + """Load complete prediction state and restore controller""" + from prediction_state_service import PredictionStateService + + state = PredictionStateService.load_prediction_state(filename) + if state: + success = PredictionStateService.restore_from_state( + state, self.calendar_manager, self + ) + if success and state.prediction_date: + # Restore prediction date directly if available + self.prediction = state.prediction_date + return success + return False
\ No newline at end of file |
