mirror of
https://github.com/nasa/trick.git
synced 2025-02-22 09:51:06 +00:00
Add checkpoint functionality to variable_server.py
This commit is contained in:
parent
6205864d92
commit
c35ca93830
@ -829,6 +829,30 @@ class VariableServer(object):
|
|||||||
self.send('trick.exec_{0}()'
|
self.send('trick.exec_{0}()'
|
||||||
.format('freeze' if bool(freeze) else 'run'))
|
.format('freeze' if bool(freeze) else 'run'))
|
||||||
|
|
||||||
|
def checkpoint(self, filename):
|
||||||
|
"""
|
||||||
|
Dump a checkpoint.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
filename : str
|
||||||
|
The checkpoint file name. The checkpoint will be saved in the
|
||||||
|
directory containing the sim's input file.
|
||||||
|
"""
|
||||||
|
self.send('trick.checkpoint("' + filename + '")')
|
||||||
|
|
||||||
|
def load_checkpoint(self, filename):
|
||||||
|
"""
|
||||||
|
Load a checkpoint. The path is relative to the directory containing
|
||||||
|
the sim's S_main executable.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
filename : str
|
||||||
|
The checkpoint file name.
|
||||||
|
"""
|
||||||
|
self.send('trick.load_checkpoint("' + filename + '")')
|
||||||
|
|
||||||
def enable_real_time(self, enable=True):
|
def enable_real_time(self, enable=True):
|
||||||
"""
|
"""
|
||||||
Toggle real-time execution.
|
Toggle real-time execution.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user