MYNT-EYE-S-SDK/tools/writer/device_writer.h

71 lines
2.1 KiB
C
Raw Permalink Normal View History

2018-05-10 09:46:34 +03:00
// Copyright 2018 Slightech Co., Ltd. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
2018-04-21 10:45:33 +03:00
#ifndef MYNTEYE_TOOLS_DEVICE_WRITER_H_ // NOLINT
#define MYNTEYE_TOOLS_DEVICE_WRITER_H_
#pragma once
#include <memory>
#include <string>
#include "mynteye/mynteye.h"
2018-10-27 16:24:04 +03:00
#include "mynteye/device/channels.h"
#include "mynteye/device/types.h"
2018-04-21 10:45:33 +03:00
MYNTEYE_BEGIN_NAMESPACE
class Device;
namespace tools {
class DeviceWriter {
public:
using dev_info_t = DeviceInfo;
using img_params_t = device::img_params_t;
using imu_params_t = device::imu_params_t;
2018-04-21 10:45:33 +03:00
explicit DeviceWriter(std::shared_ptr<Device> device);
~DeviceWriter();
bool WriteDeviceInfo(const dev_info_t &info);
bool WriteDeviceInfo(const std::string &filepath);
bool WriteImgParams(const img_params_t &params);
bool WriteImgParams(const std::string &filepath);
bool WriteImuParams(const imu_params_t &params);
bool WriteImuParams(const std::string &filepath);
bool SaveDeviceInfo(const dev_info_t &info, const std::string &filepath);
2018-09-20 11:52:08 +03:00
bool SaveImgParams(
const dev_info_t &info, const img_params_t &params,
const std::string &filepath);
2018-04-21 10:45:33 +03:00
bool SaveImuParams(const imu_params_t &params, const std::string &filepath);
/** Save all infos of this device */
void SaveAllInfos(const std::string &dir);
private:
dev_info_t LoadDeviceInfo(const std::string &filepath);
img_params_t LoadImgParams(const std::string &filepath);
imu_params_t LoadImuParams(const std::string &filepath);
std::shared_ptr<Device> device_;
};
} // namespace tools
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_TOOLS_DEVICE_WRITER_H_ NOLINT