2003-07-17 18:24:17 +00:00
|
|
|
// replay.hxx - a system to record and replay FlightGear flights
|
|
|
|
//
|
2011-10-01 22:58:40 +02:00
|
|
|
// Written by Curtis Olson, started July 2003.
|
2003-07-17 18:24:17 +00:00
|
|
|
//
|
2004-11-19 22:10:41 +00:00
|
|
|
// Copyright (C) 2003 Curtis L. Olson - http://www.flightgear.org/~curt
|
2003-07-17 18:24:17 +00:00
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License as
|
|
|
|
// published by the Free Software Foundation; either version 2 of the
|
|
|
|
// License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful, but
|
|
|
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
2006-02-21 01:16:04 +00:00
|
|
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2003-07-17 18:24:17 +00:00
|
|
|
//
|
|
|
|
// $Id$
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _FG_REPLAY_HXX
|
|
|
|
#define _FG_REPLAY_HXX 1
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
2021-02-18 23:12:31 -06:00
|
|
|
#include <mutex>
|
2003-07-17 18:24:17 +00:00
|
|
|
#include <simgear/compiler.h>
|
|
|
|
|
|
|
|
#include <simgear/math/sg_types.hxx>
|
|
|
|
#include <simgear/props/props.hxx>
|
2003-09-24 17:20:55 +00:00
|
|
|
#include <simgear/structure/subsystem_mgr.hxx>
|
2020-06-06 22:12:18 +01:00
|
|
|
#include <simgear/io/iostreams/gzcontainerfile.hxx>
|
Allow replay of Continuous recordings if --load-tape is given a URL.
E.g. for --load-tape=http[s]://foo.com/foo/bar/wibble.fgtape, we download in
the background to a file called foo.com_[MD5]_wibble.fgtape, where [MD5] is an
8-character hash of /foo/bar.
We assume any existing file contains valid data and only download any remaining
data (by specifying an http Range header).
Also, when loading/downloading and replaying continuous recordings at startup,
we set the aircraft and airport from the recording.
src/Aircraft/replay.cxx
src/Aircraft/replay.hxx
FGReplay::loadContinuousHeader()
Loads properties from Continuous recording's header, distinguishing
between failure due to incorrect header, or due to a truncated file.
FGReplay::indexContinuousRecording()
Contains Continuous recording indexing code, in a form that can be used
in background while we are downloading.
Added a mutex to protect m_continuous_in_time_to_frameinfo, which can now
be modified in background as Continuous recording is downloaded.
src/Main/fg_init.cxx
src/Main/options.cxx
fgOptLoadTape():
Modified to handle --load-tape=<url>. We start download, and read
the header before returning, so that we can force the FDM to use the
recording's aircraft instead of the user's default. Limit recording
download rate if /sim/replay/download-max-bytes-per-sec is set, by
calling new filerequest->setMaxBytesPerSec().
2021-02-15 15:51:23 +00:00
|
|
|
#include <simgear/io/HTTPFileRequest.hxx>
|
2003-07-17 18:24:17 +00:00
|
|
|
|
2020-05-28 09:50:06 +01:00
|
|
|
#include <MultiPlayer/multiplaymgr.hxx>
|
|
|
|
|
2012-11-10 21:25:31 +01:00
|
|
|
#include <deque>
|
|
|
|
#include <vector>
|
2003-07-17 18:24:17 +00:00
|
|
|
|
2011-10-01 22:58:40 +02:00
|
|
|
class FGFlightRecorder;
|
2003-07-17 18:24:17 +00:00
|
|
|
|
2020-05-18 21:05:40 +01:00
|
|
|
struct FGReplayData {
|
2020-05-16 23:15:34 +01:00
|
|
|
|
2003-07-17 18:24:17 +00:00
|
|
|
double sim_time;
|
2020-05-16 23:15:34 +01:00
|
|
|
// Our aircraft state.
|
|
|
|
std::vector<char> raw_data;
|
|
|
|
|
|
|
|
// Incoming multiplayer messages.
|
|
|
|
std::vector<std::shared_ptr<std::vector<char>>> multiplayer_messages;
|
Added record/replay of extra properties, with specific support for window size/position and view settings.
Recording of extra properties is only supported in Continuous recordings.
Modified Continuous recording format to allow future forwards
compatibility. See docs-mini/README-recordings.md for details. This breaks
compatibility with previously-generated Continuous recordings, but this only
affects next.
To reduce overhead we record all extra property values in the first frame and
then later frames contain only extra property changes. When replaying, if the
user jumps backwards we replay all extra property changes since the start of
the recording. Similarly if the user jumps forwards, we replay any intervening
extra property changes.
Recording extra properties:
This is enabled by:
/sim/replay/record-extra-properties
The extra properties that are recorded are identified by the property
paths in the values of /sim/replay/record-extra-properties-paths/path[]
properties. We record the entire tree for each specified path.
Recording of main window position size:
We have specific support for record and replay of main window position/size.
This is enabled by:
/sim/replay/record-main-window
Recording of main window view:
We have specific support for recording the view type and direction/zoom
settings.
This is enabled by:
/sim/replay/record-main-view
We record the /sim/current-view/ property tree, excluding some subtrees
that continuously vary but are not required for replaying of the view.
When replaying, we allow separate control of what extra property changes are
replayed, with:
/sim/replay/replay-extra-property-changes
/sim/replay/replay-extra-property-removal
/sim/replay/replay-main-window-position
/sim/replay/replay-main-window-size
/sim/replay/replay-main-view
We work around some problems caused by the use of tied properties when
replaying changes to view-number.
Window position issue:
When replaying window position and size changes, things get a little tricky
because osgViewer::GraphicsWindow::setWindowRectangle() takes a position
for the entire window, but osgGA::GUIEventAdapter::RESIZE events contain
the position of the interior of the window; for example the y values will
differ by the height of the window's titlebar. This can cause windows to
move progressively further down each time they are positioned or resized.
There doesn't seem to be a way of finding the size of a window's
furniture directly. So instead this commit adds a new method
osgGA::GUIEventAdapter::setWindowRectangleInteriorWithCorrection() which
wraps osgViewer::GraphicsWindow::setWindowRectangle(). We listen for the
following osgGA::GUIEventAdapter::RESIZE event and calculate corrections
for x and y position that are used for subsequent calls.
docs-mini/README-recordings.md:
Updated to document new Continuous format.
scripts/python/recordreplay.py:
New script to test various aspects of record/replay.
Other:
We now create convenience softlink to most recent continuous recording, using
SGPath::makeLink(). Note that SGPath::makeLink() currently does nothing on
Windows.
Changed format of Continuous recordings to contain a single property tree
in header. This is much simpler than having separate Config and Meta trees.
2020-12-24 14:21:38 +00:00
|
|
|
std::vector<char> extra_properties;
|
|
|
|
std::map<std::string, std::string> replay_extra_property_changes;
|
|
|
|
std::vector<std::string> replay_extra_property_removals;
|
2020-05-18 21:05:40 +01:00
|
|
|
|
|
|
|
// Updates static statistics defined below.
|
|
|
|
void UpdateStats();
|
|
|
|
|
|
|
|
// Resets out static property nodes; to be called by fgStartNewReset().
|
|
|
|
static void resetStatisticsProperties();
|
|
|
|
|
|
|
|
FGReplayData();
|
|
|
|
~FGReplayData();
|
|
|
|
|
|
|
|
size_t m_bytes_raw_data = 0;
|
|
|
|
size_t m_bytes_multiplayer_messages = 0;
|
|
|
|
size_t m_num_multiplayer_messages = 0;
|
|
|
|
|
|
|
|
// Statistics about replay data, also properties /sim/replay/datastats_*.
|
|
|
|
static size_t s_num;
|
|
|
|
static size_t s_bytes_raw_data;
|
|
|
|
static size_t s_bytes_multiplayer_messages;
|
|
|
|
static size_t s_num_multiplayer_messages;
|
|
|
|
static SGPropertyNode_ptr s_prop_num;
|
|
|
|
static SGPropertyNode_ptr s_prop_bytes_raw_data;
|
|
|
|
static SGPropertyNode_ptr s_prop_bytes_multiplayer_messages;
|
|
|
|
static SGPropertyNode_ptr s_prop_num_multiplayer_messages;
|
|
|
|
};
|
2003-07-17 18:24:17 +00:00
|
|
|
|
2012-11-10 21:25:31 +01:00
|
|
|
typedef struct {
|
|
|
|
double sim_time;
|
|
|
|
std::string message;
|
|
|
|
std::string speaker;
|
|
|
|
} FGReplayMessages;
|
2003-07-17 18:24:17 +00:00
|
|
|
|
Added record/replay of extra properties, with specific support for window size/position and view settings.
Recording of extra properties is only supported in Continuous recordings.
Modified Continuous recording format to allow future forwards
compatibility. See docs-mini/README-recordings.md for details. This breaks
compatibility with previously-generated Continuous recordings, but this only
affects next.
To reduce overhead we record all extra property values in the first frame and
then later frames contain only extra property changes. When replaying, if the
user jumps backwards we replay all extra property changes since the start of
the recording. Similarly if the user jumps forwards, we replay any intervening
extra property changes.
Recording extra properties:
This is enabled by:
/sim/replay/record-extra-properties
The extra properties that are recorded are identified by the property
paths in the values of /sim/replay/record-extra-properties-paths/path[]
properties. We record the entire tree for each specified path.
Recording of main window position size:
We have specific support for record and replay of main window position/size.
This is enabled by:
/sim/replay/record-main-window
Recording of main window view:
We have specific support for recording the view type and direction/zoom
settings.
This is enabled by:
/sim/replay/record-main-view
We record the /sim/current-view/ property tree, excluding some subtrees
that continuously vary but are not required for replaying of the view.
When replaying, we allow separate control of what extra property changes are
replayed, with:
/sim/replay/replay-extra-property-changes
/sim/replay/replay-extra-property-removal
/sim/replay/replay-main-window-position
/sim/replay/replay-main-window-size
/sim/replay/replay-main-view
We work around some problems caused by the use of tied properties when
replaying changes to view-number.
Window position issue:
When replaying window position and size changes, things get a little tricky
because osgViewer::GraphicsWindow::setWindowRectangle() takes a position
for the entire window, but osgGA::GUIEventAdapter::RESIZE events contain
the position of the interior of the window; for example the y values will
differ by the height of the window's titlebar. This can cause windows to
move progressively further down each time they are positioned or resized.
There doesn't seem to be a way of finding the size of a window's
furniture directly. So instead this commit adds a new method
osgGA::GUIEventAdapter::setWindowRectangleInteriorWithCorrection() which
wraps osgViewer::GraphicsWindow::setWindowRectangle(). We listen for the
following osgGA::GUIEventAdapter::RESIZE event and calculate corrections
for x and y position that are used for subsequent calls.
docs-mini/README-recordings.md:
Updated to document new Continuous format.
scripts/python/recordreplay.py:
New script to test various aspects of record/replay.
Other:
We now create convenience softlink to most recent continuous recording, using
SGPath::makeLink(). Note that SGPath::makeLink() currently does nothing on
Windows.
Changed format of Continuous recordings to contain a single property tree
in header. This is much simpler than having separate Config and Meta trees.
2020-12-24 14:21:38 +00:00
|
|
|
enum FGTapeType
|
|
|
|
{
|
|
|
|
FGTapeType_NORMAL,
|
|
|
|
FGTapeType_CONTINUOUS,
|
|
|
|
FGTapeType_RECOVERY,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct FGFrameInfo;
|
|
|
|
|
2012-11-10 21:25:31 +01:00
|
|
|
typedef std::deque < FGReplayData *> replay_list_type;
|
|
|
|
typedef std::vector < FGReplayMessages > replay_messages_type;
|
2003-07-17 18:24:17 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A recording/replay module for FlightGear flights
|
2018-04-03 12:21:33 +02:00
|
|
|
*
|
2003-07-17 18:24:17 +00:00
|
|
|
*/
|
|
|
|
|
2020-06-06 22:12:18 +01:00
|
|
|
class FGReplay : public SGSubsystem, SGPropertyChangeListener
|
2003-07-17 18:24:17 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
FGReplay ();
|
|
|
|
virtual ~FGReplay();
|
|
|
|
|
2018-04-03 10:41:27 +02:00
|
|
|
// Subsystem API.
|
|
|
|
void bind() override;
|
|
|
|
void init() override;
|
|
|
|
void reinit() override;
|
|
|
|
void unbind() override;
|
|
|
|
void update(double dt) override;
|
|
|
|
|
|
|
|
// Subsystem identification.
|
2018-05-04 14:18:07 +02:00
|
|
|
static const char* staticSubsystemClassId() { return "replay"; }
|
2018-04-03 10:41:27 +02:00
|
|
|
|
2012-11-10 21:25:31 +01:00
|
|
|
bool start(bool NewTape=false);
|
|
|
|
|
2020-06-18 16:17:44 +01:00
|
|
|
bool saveTape(const SGPropertyNode* ConfigData);
|
2012-11-10 21:25:31 +01:00
|
|
|
bool loadTape(const SGPropertyNode* ConfigData);
|
Allow replay of Continuous recordings if --load-tape is given a URL.
E.g. for --load-tape=http[s]://foo.com/foo/bar/wibble.fgtape, we download in
the background to a file called foo.com_[MD5]_wibble.fgtape, where [MD5] is an
8-character hash of /foo/bar.
We assume any existing file contains valid data and only download any remaining
data (by specifying an http Range header).
Also, when loading/downloading and replaying continuous recordings at startup,
we set the aircraft and airport from the recording.
src/Aircraft/replay.cxx
src/Aircraft/replay.hxx
FGReplay::loadContinuousHeader()
Loads properties from Continuous recording's header, distinguishing
between failure due to incorrect header, or due to a truncated file.
FGReplay::indexContinuousRecording()
Contains Continuous recording indexing code, in a form that can be used
in background while we are downloading.
Added a mutex to protect m_continuous_in_time_to_frameinfo, which can now
be modified in background as Continuous recording is downloaded.
src/Main/fg_init.cxx
src/Main/options.cxx
fgOptLoadTape():
Modified to handle --load-tape=<url>. We start download, and read
the header before returning, so that we can force the FDM to use the
recording's aircraft instead of the user's default. Limit recording
download rate if /sim/replay/download-max-bytes-per-sec is set, by
calling new filerequest->setMaxBytesPerSec().
2021-02-15 15:51:23 +00:00
|
|
|
|
|
|
|
// If filerequest is set, the local file is a Continuous recording and
|
|
|
|
// it might increase in size as downloading progresses, so we need to
|
|
|
|
// incrementally index the file until the file request has finished the
|
|
|
|
// download.
|
|
|
|
//
|
|
|
|
bool loadTape(
|
|
|
|
const SGPath& Filename,
|
|
|
|
bool Preview,
|
|
|
|
SGPropertyNode& MetaMeta,
|
2021-02-20 13:24:49 +00:00
|
|
|
simgear::HTTP::FileRequestRef filerequest=nullptr
|
Allow replay of Continuous recordings if --load-tape is given a URL.
E.g. for --load-tape=http[s]://foo.com/foo/bar/wibble.fgtape, we download in
the background to a file called foo.com_[MD5]_wibble.fgtape, where [MD5] is an
8-character hash of /foo/bar.
We assume any existing file contains valid data and only download any remaining
data (by specifying an http Range header).
Also, when loading/downloading and replaying continuous recordings at startup,
we set the aircraft and airport from the recording.
src/Aircraft/replay.cxx
src/Aircraft/replay.hxx
FGReplay::loadContinuousHeader()
Loads properties from Continuous recording's header, distinguishing
between failure due to incorrect header, or due to a truncated file.
FGReplay::indexContinuousRecording()
Contains Continuous recording indexing code, in a form that can be used
in background while we are downloading.
Added a mutex to protect m_continuous_in_time_to_frameinfo, which can now
be modified in background as Continuous recording is downloaded.
src/Main/fg_init.cxx
src/Main/options.cxx
fgOptLoadTape():
Modified to handle --load-tape=<url>. We start download, and read
the header before returning, so that we can force the FDM to use the
recording's aircraft instead of the user's default. Limit recording
download rate if /sim/replay/download-max-bytes-per-sec is set, by
calling new filerequest->setMaxBytesPerSec().
2021-02-15 15:51:23 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
// Attempts to load Continuous recording header properties into
|
|
|
|
// <properties>. If in is null we use internal std::fstream, otherwise we
|
|
|
|
// use *in.
|
|
|
|
//
|
|
|
|
// Returns 0 on success, +1 if we may succeed after further download, or -1
|
|
|
|
// if recording is not a Continuous recording.
|
|
|
|
//
|
|
|
|
static int loadContinuousHeader(const std::string& path, std::istream* in, SGPropertyNode* properties);
|
2003-07-17 18:24:17 +00:00
|
|
|
|
2021-02-22 23:16:26 +00:00
|
|
|
// Prepends /sim/replay/tape-directory and/or appends .fgtape etc.
|
|
|
|
//
|
|
|
|
static std::string makeTapePath(const std::string& tape_name);
|
|
|
|
|
2003-07-17 18:24:17 +00:00
|
|
|
private:
|
2011-03-21 23:07:05 +01:00
|
|
|
void clear();
|
2011-10-01 22:58:40 +02:00
|
|
|
FGReplayData* record(double time);
|
|
|
|
void interpolate(double time, const replay_list_type &list);
|
Added record/replay of extra properties, with specific support for window size/position and view settings.
Recording of extra properties is only supported in Continuous recordings.
Modified Continuous recording format to allow future forwards
compatibility. See docs-mini/README-recordings.md for details. This breaks
compatibility with previously-generated Continuous recordings, but this only
affects next.
To reduce overhead we record all extra property values in the first frame and
then later frames contain only extra property changes. When replaying, if the
user jumps backwards we replay all extra property changes since the start of
the recording. Similarly if the user jumps forwards, we replay any intervening
extra property changes.
Recording extra properties:
This is enabled by:
/sim/replay/record-extra-properties
The extra properties that are recorded are identified by the property
paths in the values of /sim/replay/record-extra-properties-paths/path[]
properties. We record the entire tree for each specified path.
Recording of main window position size:
We have specific support for record and replay of main window position/size.
This is enabled by:
/sim/replay/record-main-window
Recording of main window view:
We have specific support for recording the view type and direction/zoom
settings.
This is enabled by:
/sim/replay/record-main-view
We record the /sim/current-view/ property tree, excluding some subtrees
that continuously vary but are not required for replaying of the view.
When replaying, we allow separate control of what extra property changes are
replayed, with:
/sim/replay/replay-extra-property-changes
/sim/replay/replay-extra-property-removal
/sim/replay/replay-main-window-position
/sim/replay/replay-main-window-size
/sim/replay/replay-main-view
We work around some problems caused by the use of tied properties when
replaying changes to view-number.
Window position issue:
When replaying window position and size changes, things get a little tricky
because osgViewer::GraphicsWindow::setWindowRectangle() takes a position
for the entire window, but osgGA::GUIEventAdapter::RESIZE events contain
the position of the interior of the window; for example the y values will
differ by the height of the window's titlebar. This can cause windows to
move progressively further down each time they are positioned or resized.
There doesn't seem to be a way of finding the size of a window's
furniture directly. So instead this commit adds a new method
osgGA::GUIEventAdapter::setWindowRectangleInteriorWithCorrection() which
wraps osgViewer::GraphicsWindow::setWindowRectangle(). We listen for the
following osgGA::GUIEventAdapter::RESIZE event and calculate corrections
for x and y position that are used for subsequent calls.
docs-mini/README-recordings.md:
Updated to document new Continuous format.
scripts/python/recordreplay.py:
New script to test various aspects of record/replay.
Other:
We now create convenience softlink to most recent continuous recording, using
SGPath::makeLink(). Note that SGPath::makeLink() currently does nothing on
Windows.
Changed format of Continuous recordings to contain a single property tree
in header. This is much simpler than having separate Config and Meta trees.
2020-12-24 14:21:38 +00:00
|
|
|
void replay(
|
|
|
|
double time,
|
|
|
|
size_t offset,
|
|
|
|
size_t offset_old,
|
|
|
|
bool replay_signals,
|
|
|
|
bool replay_multiplayer,
|
|
|
|
bool replay_extra_properties,
|
|
|
|
int* xpos=nullptr,
|
|
|
|
int* ypos=nullptr,
|
|
|
|
int* xsize=nullptr,
|
|
|
|
int* ysize=nullptr
|
|
|
|
);
|
|
|
|
void replay(
|
|
|
|
double time,
|
|
|
|
FGReplayData* pCurrentFrame,
|
|
|
|
FGReplayData* pOldFrame=nullptr,
|
|
|
|
int* xpos=nullptr,
|
|
|
|
int* ypos=nullptr,
|
|
|
|
int* xsize=nullptr,
|
|
|
|
int* ysize=nullptr
|
|
|
|
);
|
2012-11-10 21:25:31 +01:00
|
|
|
void guiMessage(const char* message);
|
|
|
|
void loadMessages();
|
|
|
|
void fillRecycler();
|
2003-07-17 18:24:17 +00:00
|
|
|
|
2011-10-01 22:58:40 +02:00
|
|
|
bool replay( double time );
|
2012-11-10 21:25:31 +01:00
|
|
|
void replayMessage( double time );
|
|
|
|
|
2011-10-01 22:58:40 +02:00
|
|
|
double get_start_time();
|
|
|
|
double get_end_time();
|
2003-07-17 18:24:17 +00:00
|
|
|
|
2012-11-10 21:25:31 +01:00
|
|
|
bool listTapes(bool SameAircraftFilter, const SGPath& tapeDirectory);
|
2020-06-18 16:17:44 +01:00
|
|
|
bool saveTape(const SGPath& Filename, SGPropertyNode_ptr MetaData);
|
Allow replay of Continuous recordings if --load-tape is given a URL.
E.g. for --load-tape=http[s]://foo.com/foo/bar/wibble.fgtape, we download in
the background to a file called foo.com_[MD5]_wibble.fgtape, where [MD5] is an
8-character hash of /foo/bar.
We assume any existing file contains valid data and only download any remaining
data (by specifying an http Range header).
Also, when loading/downloading and replaying continuous recordings at startup,
we set the aircraft and airport from the recording.
src/Aircraft/replay.cxx
src/Aircraft/replay.hxx
FGReplay::loadContinuousHeader()
Loads properties from Continuous recording's header, distinguishing
between failure due to incorrect header, or due to a truncated file.
FGReplay::indexContinuousRecording()
Contains Continuous recording indexing code, in a form that can be used
in background while we are downloading.
Added a mutex to protect m_continuous_in_time_to_frameinfo, which can now
be modified in background as Continuous recording is downloaded.
src/Main/fg_init.cxx
src/Main/options.cxx
fgOptLoadTape():
Modified to handle --load-tape=<url>. We start download, and read
the header before returning, so that we can force the FDM to use the
recording's aircraft instead of the user's default. Limit recording
download rate if /sim/replay/download-max-bytes-per-sec is set, by
calling new filerequest->setMaxBytesPerSec().
2021-02-15 15:51:23 +00:00
|
|
|
|
|
|
|
// Build up in-memory cache of simulator time to file offset, so we can
|
|
|
|
// handle random access.
|
|
|
|
//
|
|
|
|
// We also cache any frames that modify extra-properties.
|
|
|
|
//
|
|
|
|
// Can be called multiple times, e.g. if recording is being downlaoded.
|
|
|
|
//
|
|
|
|
void indexContinuousRecording(const void* data, size_t numbytes);
|
|
|
|
|
2021-02-18 23:15:34 +00:00
|
|
|
// Callback for use with simgear::HTTP::FileRequest::setCallback().
|
|
|
|
//
|
|
|
|
static void call_indexContinuousRecording(void* ref, const void* data, size_t numbytes);
|
|
|
|
|
Added record/replay of extra properties, with specific support for window size/position and view settings.
Recording of extra properties is only supported in Continuous recordings.
Modified Continuous recording format to allow future forwards
compatibility. See docs-mini/README-recordings.md for details. This breaks
compatibility with previously-generated Continuous recordings, but this only
affects next.
To reduce overhead we record all extra property values in the first frame and
then later frames contain only extra property changes. When replaying, if the
user jumps backwards we replay all extra property changes since the start of
the recording. Similarly if the user jumps forwards, we replay any intervening
extra property changes.
Recording extra properties:
This is enabled by:
/sim/replay/record-extra-properties
The extra properties that are recorded are identified by the property
paths in the values of /sim/replay/record-extra-properties-paths/path[]
properties. We record the entire tree for each specified path.
Recording of main window position size:
We have specific support for record and replay of main window position/size.
This is enabled by:
/sim/replay/record-main-window
Recording of main window view:
We have specific support for recording the view type and direction/zoom
settings.
This is enabled by:
/sim/replay/record-main-view
We record the /sim/current-view/ property tree, excluding some subtrees
that continuously vary but are not required for replaying of the view.
When replaying, we allow separate control of what extra property changes are
replayed, with:
/sim/replay/replay-extra-property-changes
/sim/replay/replay-extra-property-removal
/sim/replay/replay-main-window-position
/sim/replay/replay-main-window-size
/sim/replay/replay-main-view
We work around some problems caused by the use of tied properties when
replaying changes to view-number.
Window position issue:
When replaying window position and size changes, things get a little tricky
because osgViewer::GraphicsWindow::setWindowRectangle() takes a position
for the entire window, but osgGA::GUIEventAdapter::RESIZE events contain
the position of the interior of the window; for example the y values will
differ by the height of the window's titlebar. This can cause windows to
move progressively further down each time they are positioned or resized.
There doesn't seem to be a way of finding the size of a window's
furniture directly. So instead this commit adds a new method
osgGA::GUIEventAdapter::setWindowRectangleInteriorWithCorrection() which
wraps osgViewer::GraphicsWindow::setWindowRectangle(). We listen for the
following osgGA::GUIEventAdapter::RESIZE event and calculate corrections
for x and y position that are used for subsequent calls.
docs-mini/README-recordings.md:
Updated to document new Continuous format.
scripts/python/recordreplay.py:
New script to test various aspects of record/replay.
Other:
We now create convenience softlink to most recent continuous recording, using
SGPath::makeLink(). Note that SGPath::makeLink() currently does nothing on
Windows.
Changed format of Continuous recordings to contain a single property tree
in header. This is much simpler than having separate Config and Meta trees.
2020-12-24 14:21:38 +00:00
|
|
|
SGPropertyNode_ptr continuousWriteHeader(
|
2020-06-18 16:17:44 +01:00
|
|
|
std::ofstream& out,
|
Added record/replay of extra properties, with specific support for window size/position and view settings.
Recording of extra properties is only supported in Continuous recordings.
Modified Continuous recording format to allow future forwards
compatibility. See docs-mini/README-recordings.md for details. This breaks
compatibility with previously-generated Continuous recordings, but this only
affects next.
To reduce overhead we record all extra property values in the first frame and
then later frames contain only extra property changes. When replaying, if the
user jumps backwards we replay all extra property changes since the start of
the recording. Similarly if the user jumps forwards, we replay any intervening
extra property changes.
Recording extra properties:
This is enabled by:
/sim/replay/record-extra-properties
The extra properties that are recorded are identified by the property
paths in the values of /sim/replay/record-extra-properties-paths/path[]
properties. We record the entire tree for each specified path.
Recording of main window position size:
We have specific support for record and replay of main window position/size.
This is enabled by:
/sim/replay/record-main-window
Recording of main window view:
We have specific support for recording the view type and direction/zoom
settings.
This is enabled by:
/sim/replay/record-main-view
We record the /sim/current-view/ property tree, excluding some subtrees
that continuously vary but are not required for replaying of the view.
When replaying, we allow separate control of what extra property changes are
replayed, with:
/sim/replay/replay-extra-property-changes
/sim/replay/replay-extra-property-removal
/sim/replay/replay-main-window-position
/sim/replay/replay-main-window-size
/sim/replay/replay-main-view
We work around some problems caused by the use of tied properties when
replaying changes to view-number.
Window position issue:
When replaying window position and size changes, things get a little tricky
because osgViewer::GraphicsWindow::setWindowRectangle() takes a position
for the entire window, but osgGA::GUIEventAdapter::RESIZE events contain
the position of the interior of the window; for example the y values will
differ by the height of the window's titlebar. This can cause windows to
move progressively further down each time they are positioned or resized.
There doesn't seem to be a way of finding the size of a window's
furniture directly. So instead this commit adds a new method
osgGA::GUIEventAdapter::setWindowRectangleInteriorWithCorrection() which
wraps osgViewer::GraphicsWindow::setWindowRectangle(). We listen for the
following osgGA::GUIEventAdapter::RESIZE event and calculate corrections
for x and y position that are used for subsequent calls.
docs-mini/README-recordings.md:
Updated to document new Continuous format.
scripts/python/recordreplay.py:
New script to test various aspects of record/replay.
Other:
We now create convenience softlink to most recent continuous recording, using
SGPath::makeLink(). Note that SGPath::makeLink() currently does nothing on
Windows.
Changed format of Continuous recordings to contain a single property tree
in header. This is much simpler than having separate Config and Meta trees.
2020-12-24 14:21:38 +00:00
|
|
|
const SGPath& path,
|
|
|
|
FGTapeType tape_type
|
2020-06-18 16:17:44 +01:00
|
|
|
);
|
Added record/replay of extra properties, with specific support for window size/position and view settings.
Recording of extra properties is only supported in Continuous recordings.
Modified Continuous recording format to allow future forwards
compatibility. See docs-mini/README-recordings.md for details. This breaks
compatibility with previously-generated Continuous recordings, but this only
affects next.
To reduce overhead we record all extra property values in the first frame and
then later frames contain only extra property changes. When replaying, if the
user jumps backwards we replay all extra property changes since the start of
the recording. Similarly if the user jumps forwards, we replay any intervening
extra property changes.
Recording extra properties:
This is enabled by:
/sim/replay/record-extra-properties
The extra properties that are recorded are identified by the property
paths in the values of /sim/replay/record-extra-properties-paths/path[]
properties. We record the entire tree for each specified path.
Recording of main window position size:
We have specific support for record and replay of main window position/size.
This is enabled by:
/sim/replay/record-main-window
Recording of main window view:
We have specific support for recording the view type and direction/zoom
settings.
This is enabled by:
/sim/replay/record-main-view
We record the /sim/current-view/ property tree, excluding some subtrees
that continuously vary but are not required for replaying of the view.
When replaying, we allow separate control of what extra property changes are
replayed, with:
/sim/replay/replay-extra-property-changes
/sim/replay/replay-extra-property-removal
/sim/replay/replay-main-window-position
/sim/replay/replay-main-window-size
/sim/replay/replay-main-view
We work around some problems caused by the use of tied properties when
replaying changes to view-number.
Window position issue:
When replaying window position and size changes, things get a little tricky
because osgViewer::GraphicsWindow::setWindowRectangle() takes a position
for the entire window, but osgGA::GUIEventAdapter::RESIZE events contain
the position of the interior of the window; for example the y values will
differ by the height of the window's titlebar. This can cause windows to
move progressively further down each time they are positioned or resized.
There doesn't seem to be a way of finding the size of a window's
furniture directly. So instead this commit adds a new method
osgGA::GUIEventAdapter::setWindowRectangleInteriorWithCorrection() which
wraps osgViewer::GraphicsWindow::setWindowRectangle(). We listen for the
following osgGA::GUIEventAdapter::RESIZE event and calculate corrections
for x and y position that are used for subsequent calls.
docs-mini/README-recordings.md:
Updated to document new Continuous format.
scripts/python/recordreplay.py:
New script to test various aspects of record/replay.
Other:
We now create convenience softlink to most recent continuous recording, using
SGPath::makeLink(). Note that SGPath::makeLink() currently does nothing on
Windows.
Changed format of Continuous recordings to contain a single property tree
in header. This is much simpler than having separate Config and Meta trees.
2020-12-24 14:21:38 +00:00
|
|
|
bool continuousWriteFrame(FGReplayData* r, std::ostream& out, SGPropertyNode_ptr meta);
|
2012-11-10 21:25:31 +01:00
|
|
|
|
2003-07-17 18:24:17 +00:00
|
|
|
double sim_time;
|
|
|
|
double last_mt_time;
|
|
|
|
double last_lt_time;
|
2012-11-10 21:25:31 +01:00
|
|
|
double last_msg_time;
|
|
|
|
replay_messages_type::iterator current_msg;
|
2011-03-21 23:07:05 +01:00
|
|
|
int last_replay_state;
|
2012-11-10 21:25:31 +01:00
|
|
|
bool was_finished_already;
|
2003-07-17 18:24:17 +00:00
|
|
|
|
|
|
|
replay_list_type short_term;
|
|
|
|
replay_list_type medium_term;
|
|
|
|
replay_list_type long_term;
|
2008-04-02 18:55:39 +00:00
|
|
|
replay_list_type recycler;
|
2012-11-10 21:25:31 +01:00
|
|
|
replay_messages_type replay_messages;
|
|
|
|
|
2005-07-31 09:04:18 +00:00
|
|
|
SGPropertyNode_ptr disable_replay;
|
2011-03-20 14:59:19 +01:00
|
|
|
SGPropertyNode_ptr replay_master;
|
2021-03-14 21:06:57 +00:00
|
|
|
SGPropertyNode_ptr replay_master_eof;
|
2011-03-21 23:07:05 +01:00
|
|
|
SGPropertyNode_ptr replay_time;
|
2011-10-01 22:58:40 +02:00
|
|
|
SGPropertyNode_ptr replay_time_str;
|
2011-05-14 09:17:51 +02:00
|
|
|
SGPropertyNode_ptr replay_looped;
|
2020-03-25 17:16:29 +01:00
|
|
|
SGPropertyNode_ptr replay_duration_act;
|
2011-10-01 22:58:40 +02:00
|
|
|
SGPropertyNode_ptr speed_up;
|
2020-06-14 02:18:08 +01:00
|
|
|
SGPropertyNode_ptr replay_multiplayer;
|
2020-06-18 16:17:44 +01:00
|
|
|
SGPropertyNode_ptr recovery_period;
|
|
|
|
|
Added record/replay of extra properties, with specific support for window size/position and view settings.
Recording of extra properties is only supported in Continuous recordings.
Modified Continuous recording format to allow future forwards
compatibility. See docs-mini/README-recordings.md for details. This breaks
compatibility with previously-generated Continuous recordings, but this only
affects next.
To reduce overhead we record all extra property values in the first frame and
then later frames contain only extra property changes. When replaying, if the
user jumps backwards we replay all extra property changes since the start of
the recording. Similarly if the user jumps forwards, we replay any intervening
extra property changes.
Recording extra properties:
This is enabled by:
/sim/replay/record-extra-properties
The extra properties that are recorded are identified by the property
paths in the values of /sim/replay/record-extra-properties-paths/path[]
properties. We record the entire tree for each specified path.
Recording of main window position size:
We have specific support for record and replay of main window position/size.
This is enabled by:
/sim/replay/record-main-window
Recording of main window view:
We have specific support for recording the view type and direction/zoom
settings.
This is enabled by:
/sim/replay/record-main-view
We record the /sim/current-view/ property tree, excluding some subtrees
that continuously vary but are not required for replaying of the view.
When replaying, we allow separate control of what extra property changes are
replayed, with:
/sim/replay/replay-extra-property-changes
/sim/replay/replay-extra-property-removal
/sim/replay/replay-main-window-position
/sim/replay/replay-main-window-size
/sim/replay/replay-main-view
We work around some problems caused by the use of tied properties when
replaying changes to view-number.
Window position issue:
When replaying window position and size changes, things get a little tricky
because osgViewer::GraphicsWindow::setWindowRectangle() takes a position
for the entire window, but osgGA::GUIEventAdapter::RESIZE events contain
the position of the interior of the window; for example the y values will
differ by the height of the window's titlebar. This can cause windows to
move progressively further down each time they are positioned or resized.
There doesn't seem to be a way of finding the size of a window's
furniture directly. So instead this commit adds a new method
osgGA::GUIEventAdapter::setWindowRectangleInteriorWithCorrection() which
wraps osgViewer::GraphicsWindow::setWindowRectangle(). We listen for the
following osgGA::GUIEventAdapter::RESIZE event and calculate corrections
for x and y position that are used for subsequent calls.
docs-mini/README-recordings.md:
Updated to document new Continuous format.
scripts/python/recordreplay.py:
New script to test various aspects of record/replay.
Other:
We now create convenience softlink to most recent continuous recording, using
SGPath::makeLink(). Note that SGPath::makeLink() currently does nothing on
Windows.
Changed format of Continuous recordings to contain a single property tree
in header. This is much simpler than having separate Config and Meta trees.
2020-12-24 14:21:38 +00:00
|
|
|
SGPropertyNode_ptr m_sim_startup_xpos;
|
|
|
|
SGPropertyNode_ptr m_sim_startup_ypos;
|
|
|
|
SGPropertyNode_ptr m_sim_startup_xsize;
|
|
|
|
SGPropertyNode_ptr m_sim_startup_ysize;
|
|
|
|
|
2020-05-28 09:50:06 +01:00
|
|
|
double replay_time_prev; // Used to detect jumps while replaying.
|
2011-10-01 22:58:40 +02:00
|
|
|
|
|
|
|
double m_high_res_time; // default: 60 secs of high res data
|
|
|
|
double m_medium_res_time; // default: 10 mins of 1 fps data
|
|
|
|
double m_low_res_time; // default: 1 hr of 10 spf data
|
|
|
|
// short term sample rate is as every frame
|
|
|
|
double m_medium_sample_rate; // medium term sample rate (sec)
|
|
|
|
double m_long_sample_rate; // long term sample rate (sec)
|
|
|
|
|
2020-05-28 09:50:06 +01:00
|
|
|
FGFlightRecorder* m_pRecorder;
|
|
|
|
|
2020-06-06 22:12:18 +01:00
|
|
|
FGMultiplayMgr* m_MultiplayMgr;
|
|
|
|
|
|
|
|
void valueChanged(SGPropertyNode * node);
|
|
|
|
|
|
|
|
// Things for replaying from uncompressed fgtape file.
|
Added record/replay of extra properties, with specific support for window size/position and view settings.
Recording of extra properties is only supported in Continuous recordings.
Modified Continuous recording format to allow future forwards
compatibility. See docs-mini/README-recordings.md for details. This breaks
compatibility with previously-generated Continuous recordings, but this only
affects next.
To reduce overhead we record all extra property values in the first frame and
then later frames contain only extra property changes. When replaying, if the
user jumps backwards we replay all extra property changes since the start of
the recording. Similarly if the user jumps forwards, we replay any intervening
extra property changes.
Recording extra properties:
This is enabled by:
/sim/replay/record-extra-properties
The extra properties that are recorded are identified by the property
paths in the values of /sim/replay/record-extra-properties-paths/path[]
properties. We record the entire tree for each specified path.
Recording of main window position size:
We have specific support for record and replay of main window position/size.
This is enabled by:
/sim/replay/record-main-window
Recording of main window view:
We have specific support for recording the view type and direction/zoom
settings.
This is enabled by:
/sim/replay/record-main-view
We record the /sim/current-view/ property tree, excluding some subtrees
that continuously vary but are not required for replaying of the view.
When replaying, we allow separate control of what extra property changes are
replayed, with:
/sim/replay/replay-extra-property-changes
/sim/replay/replay-extra-property-removal
/sim/replay/replay-main-window-position
/sim/replay/replay-main-window-size
/sim/replay/replay-main-view
We work around some problems caused by the use of tied properties when
replaying changes to view-number.
Window position issue:
When replaying window position and size changes, things get a little tricky
because osgViewer::GraphicsWindow::setWindowRectangle() takes a position
for the entire window, but osgGA::GUIEventAdapter::RESIZE events contain
the position of the interior of the window; for example the y values will
differ by the height of the window's titlebar. This can cause windows to
move progressively further down each time they are positioned or resized.
There doesn't seem to be a way of finding the size of a window's
furniture directly. So instead this commit adds a new method
osgGA::GUIEventAdapter::setWindowRectangleInteriorWithCorrection() which
wraps osgViewer::GraphicsWindow::setWindowRectangle(). We listen for the
following osgGA::GUIEventAdapter::RESIZE event and calculate corrections
for x and y position that are used for subsequent calls.
docs-mini/README-recordings.md:
Updated to document new Continuous format.
scripts/python/recordreplay.py:
New script to test various aspects of record/replay.
Other:
We now create convenience softlink to most recent continuous recording, using
SGPath::makeLink(). Note that SGPath::makeLink() currently does nothing on
Windows.
Changed format of Continuous recordings to contain a single property tree
in header. This is much simpler than having separate Config and Meta trees.
2020-12-24 14:21:38 +00:00
|
|
|
std::ifstream m_continuous_in;
|
|
|
|
bool m_continuous_in_multiplayer;
|
|
|
|
bool m_continuous_in_extra_properties;
|
Allow replay of Continuous recordings if --load-tape is given a URL.
E.g. for --load-tape=http[s]://foo.com/foo/bar/wibble.fgtape, we download in
the background to a file called foo.com_[MD5]_wibble.fgtape, where [MD5] is an
8-character hash of /foo/bar.
We assume any existing file contains valid data and only download any remaining
data (by specifying an http Range header).
Also, when loading/downloading and replaying continuous recordings at startup,
we set the aircraft and airport from the recording.
src/Aircraft/replay.cxx
src/Aircraft/replay.hxx
FGReplay::loadContinuousHeader()
Loads properties from Continuous recording's header, distinguishing
between failure due to incorrect header, or due to a truncated file.
FGReplay::indexContinuousRecording()
Contains Continuous recording indexing code, in a form that can be used
in background while we are downloading.
Added a mutex to protect m_continuous_in_time_to_frameinfo, which can now
be modified in background as Continuous recording is downloaded.
src/Main/fg_init.cxx
src/Main/options.cxx
fgOptLoadTape():
Modified to handle --load-tape=<url>. We start download, and read
the header before returning, so that we can force the FDM to use the
recording's aircraft instead of the user's default. Limit recording
download rate if /sim/replay/download-max-bytes-per-sec is set, by
calling new filerequest->setMaxBytesPerSec().
2021-02-15 15:51:23 +00:00
|
|
|
std::mutex m_continuous_in_time_to_frameinfo_lock;
|
Added record/replay of extra properties, with specific support for window size/position and view settings.
Recording of extra properties is only supported in Continuous recordings.
Modified Continuous recording format to allow future forwards
compatibility. See docs-mini/README-recordings.md for details. This breaks
compatibility with previously-generated Continuous recordings, but this only
affects next.
To reduce overhead we record all extra property values in the first frame and
then later frames contain only extra property changes. When replaying, if the
user jumps backwards we replay all extra property changes since the start of
the recording. Similarly if the user jumps forwards, we replay any intervening
extra property changes.
Recording extra properties:
This is enabled by:
/sim/replay/record-extra-properties
The extra properties that are recorded are identified by the property
paths in the values of /sim/replay/record-extra-properties-paths/path[]
properties. We record the entire tree for each specified path.
Recording of main window position size:
We have specific support for record and replay of main window position/size.
This is enabled by:
/sim/replay/record-main-window
Recording of main window view:
We have specific support for recording the view type and direction/zoom
settings.
This is enabled by:
/sim/replay/record-main-view
We record the /sim/current-view/ property tree, excluding some subtrees
that continuously vary but are not required for replaying of the view.
When replaying, we allow separate control of what extra property changes are
replayed, with:
/sim/replay/replay-extra-property-changes
/sim/replay/replay-extra-property-removal
/sim/replay/replay-main-window-position
/sim/replay/replay-main-window-size
/sim/replay/replay-main-view
We work around some problems caused by the use of tied properties when
replaying changes to view-number.
Window position issue:
When replaying window position and size changes, things get a little tricky
because osgViewer::GraphicsWindow::setWindowRectangle() takes a position
for the entire window, but osgGA::GUIEventAdapter::RESIZE events contain
the position of the interior of the window; for example the y values will
differ by the height of the window's titlebar. This can cause windows to
move progressively further down each time they are positioned or resized.
There doesn't seem to be a way of finding the size of a window's
furniture directly. So instead this commit adds a new method
osgGA::GUIEventAdapter::setWindowRectangleInteriorWithCorrection() which
wraps osgViewer::GraphicsWindow::setWindowRectangle(). We listen for the
following osgGA::GUIEventAdapter::RESIZE event and calculate corrections
for x and y position that are used for subsequent calls.
docs-mini/README-recordings.md:
Updated to document new Continuous format.
scripts/python/recordreplay.py:
New script to test various aspects of record/replay.
Other:
We now create convenience softlink to most recent continuous recording, using
SGPath::makeLink(). Note that SGPath::makeLink() currently does nothing on
Windows.
Changed format of Continuous recordings to contain a single property tree
in header. This is much simpler than having separate Config and Meta trees.
2020-12-24 14:21:38 +00:00
|
|
|
std::map<double, FGFrameInfo> m_continuous_in_time_to_frameinfo;
|
|
|
|
SGPropertyNode_ptr m_continuous_in_config;
|
|
|
|
double m_continuous_in_time_last;
|
2021-02-22 23:16:26 +00:00
|
|
|
double m_continuous_in_frame_time_last;
|
Allow replay of Continuous recordings if --load-tape is given a URL.
E.g. for --load-tape=http[s]://foo.com/foo/bar/wibble.fgtape, we download in
the background to a file called foo.com_[MD5]_wibble.fgtape, where [MD5] is an
8-character hash of /foo/bar.
We assume any existing file contains valid data and only download any remaining
data (by specifying an http Range header).
Also, when loading/downloading and replaying continuous recordings at startup,
we set the aircraft and airport from the recording.
src/Aircraft/replay.cxx
src/Aircraft/replay.hxx
FGReplay::loadContinuousHeader()
Loads properties from Continuous recording's header, distinguishing
between failure due to incorrect header, or due to a truncated file.
FGReplay::indexContinuousRecording()
Contains Continuous recording indexing code, in a form that can be used
in background while we are downloading.
Added a mutex to protect m_continuous_in_time_to_frameinfo, which can now
be modified in background as Continuous recording is downloaded.
src/Main/fg_init.cxx
src/Main/options.cxx
fgOptLoadTape():
Modified to handle --load-tape=<url>. We start download, and read
the header before returning, so that we can force the FDM to use the
recording's aircraft instead of the user's default. Limit recording
download rate if /sim/replay/download-max-bytes-per-sec is set, by
calling new filerequest->setMaxBytesPerSec().
2021-02-15 15:51:23 +00:00
|
|
|
|
|
|
|
std::ifstream m_continuous_indexing_in;
|
|
|
|
std::streampos m_continuous_indexing_pos;
|
|
|
|
|
|
|
|
// Only used for gathering statistics that are then written into
|
|
|
|
// properties.
|
|
|
|
//
|
|
|
|
int m_num_frames_extra_properties = 0;
|
|
|
|
int m_num_frames_multiplayer = 0;
|
2020-06-06 22:12:18 +01:00
|
|
|
|
|
|
|
// For writing uncompressed fgtape file.
|
Added record/replay of extra properties, with specific support for window size/position and view settings.
Recording of extra properties is only supported in Continuous recordings.
Modified Continuous recording format to allow future forwards
compatibility. See docs-mini/README-recordings.md for details. This breaks
compatibility with previously-generated Continuous recordings, but this only
affects next.
To reduce overhead we record all extra property values in the first frame and
then later frames contain only extra property changes. When replaying, if the
user jumps backwards we replay all extra property changes since the start of
the recording. Similarly if the user jumps forwards, we replay any intervening
extra property changes.
Recording extra properties:
This is enabled by:
/sim/replay/record-extra-properties
The extra properties that are recorded are identified by the property
paths in the values of /sim/replay/record-extra-properties-paths/path[]
properties. We record the entire tree for each specified path.
Recording of main window position size:
We have specific support for record and replay of main window position/size.
This is enabled by:
/sim/replay/record-main-window
Recording of main window view:
We have specific support for recording the view type and direction/zoom
settings.
This is enabled by:
/sim/replay/record-main-view
We record the /sim/current-view/ property tree, excluding some subtrees
that continuously vary but are not required for replaying of the view.
When replaying, we allow separate control of what extra property changes are
replayed, with:
/sim/replay/replay-extra-property-changes
/sim/replay/replay-extra-property-removal
/sim/replay/replay-main-window-position
/sim/replay/replay-main-window-size
/sim/replay/replay-main-view
We work around some problems caused by the use of tied properties when
replaying changes to view-number.
Window position issue:
When replaying window position and size changes, things get a little tricky
because osgViewer::GraphicsWindow::setWindowRectangle() takes a position
for the entire window, but osgGA::GUIEventAdapter::RESIZE events contain
the position of the interior of the window; for example the y values will
differ by the height of the window's titlebar. This can cause windows to
move progressively further down each time they are positioned or resized.
There doesn't seem to be a way of finding the size of a window's
furniture directly. So instead this commit adds a new method
osgGA::GUIEventAdapter::setWindowRectangleInteriorWithCorrection() which
wraps osgViewer::GraphicsWindow::setWindowRectangle(). We listen for the
following osgGA::GUIEventAdapter::RESIZE event and calculate corrections
for x and y position that are used for subsequent calls.
docs-mini/README-recordings.md:
Updated to document new Continuous format.
scripts/python/recordreplay.py:
New script to test various aspects of record/replay.
Other:
We now create convenience softlink to most recent continuous recording, using
SGPath::makeLink(). Note that SGPath::makeLink() currently does nothing on
Windows.
Changed format of Continuous recordings to contain a single property tree
in header. This is much simpler than having separate Config and Meta trees.
2020-12-24 14:21:38 +00:00
|
|
|
SGPropertyNode_ptr m_continuous_out_config;
|
|
|
|
std::ofstream m_continuous_out;
|
2021-04-02 10:16:08 +01:00
|
|
|
|
|
|
|
SGPropertyNode_ptr m_simple_time_enabled;
|
2003-07-17 18:24:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _FG_REPLAY_HXX
|