mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-02 09:01:36 +08:00
replay: add 'tryapplyparams' command
This only applies parameters from the log file and user-supplied overrides. It is intended to be called as one of the first startup commands (after param load), so that during startup, all applications find the parameters from the replayed system. Note that this is an optional command and 'replay start' will again load and apply the parameters in any case.
This commit is contained in:
@@ -63,8 +63,10 @@ public:
|
||||
|
||||
/// Start task.
|
||||
/// @param quiet silently fail if no log file found
|
||||
/// @param apply_params_only if true, only apply parameters from definitions section of the file
|
||||
/// and user-overridden parameters, then exit w/o replaying.
|
||||
/// @return OK on success.
|
||||
static int start(bool quiet);
|
||||
static int start(bool quiet, bool apply_params_only);
|
||||
|
||||
static void task_main_trampoline(int argc, char *argv[]);
|
||||
|
||||
@@ -116,6 +118,13 @@ private:
|
||||
bool readFormat(std::ifstream &file, uint16_t msg_size);
|
||||
bool readAndAddSubscription(std::ifstream &file, uint16_t msg_size);
|
||||
|
||||
/**
|
||||
* Read the file header and definitions sections. Apply the parameters from this section
|
||||
* and apply user-defined overridden parameters.
|
||||
* @return true on success
|
||||
*/
|
||||
bool readDefinitionsAndApplyParams(std::ifstream &file);
|
||||
|
||||
/**
|
||||
* Read and handle additional messages starting at current file position, while position < end_position.
|
||||
* This handles dropout and parameter update messages.
|
||||
|
||||
Reference in New Issue
Block a user