mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-23 20:50:59 -05:00
Added some file handling to record conversion tasks
This commit is contained in:
@@ -45,6 +45,14 @@ public:
|
||||
Playback
|
||||
};
|
||||
|
||||
const std::string FileHeaderTitle = "OpenSpace_record/playback";
|
||||
constexpr const size_t FileHeaderVersionLength = 5;
|
||||
constexpr const char FileHeaderVersion[FileHeaderVersionLength] = {
|
||||
'0', '0', '.', '8', '5'
|
||||
};
|
||||
constexpr const char DataFormatAsciiTag = 'A';
|
||||
constexpr const char DataFormatBinaryTag = 'B';
|
||||
|
||||
using CallbackHandle = int;
|
||||
using StateChangeCallback = std::function<void()>;
|
||||
|
||||
|
||||
@@ -31,6 +31,13 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace {
|
||||
constexpr const char* KeyConvertToAscii = "ConvertToAscii";
|
||||
constexpr const char* KeyConvertToBinary = "ConvertToBinary";
|
||||
constexpr const char* KeyInFilePath = "InputFilePath";
|
||||
constexpr const char* KeyOutFilePath = "OutputFilePath";
|
||||
}
|
||||
|
||||
namespace openspace {
|
||||
|
||||
class ConvertRecFormatTask : public Task {
|
||||
@@ -40,13 +47,19 @@ public:
|
||||
ToBinary
|
||||
};
|
||||
ConvertRecFormatTask(const ghoul::Dictionary& dictionary);
|
||||
~ConvertRecFormatTask();
|
||||
std::string description() override;
|
||||
void perform(const Task::ProgressCallback& progressCallback) override;
|
||||
static documentation::Documentation documentation();
|
||||
|
||||
private:
|
||||
void convertToAscii();
|
||||
void convertToBinary();
|
||||
|
||||
std::string _inFilePath;
|
||||
std::string _outFilePath;
|
||||
std::ifstream _iFile;
|
||||
std::ifstream _oFile;
|
||||
|
||||
std::string _valueFunctionLua;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user