2022-01-02 20:44:39 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
#include <map>
|
|
|
|
|
#include <string>
|
2022-01-22 16:10:55 +00:00
|
|
|
#include <optional>
|
|
|
|
|
#include <QSize>
|
2022-01-02 20:44:39 +00:00
|
|
|
#include <QJsonObject>
|
|
|
|
|
|
|
|
|
|
#include "src/Targets/TargetMemory.hpp"
|
|
|
|
|
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPaneSettings.hpp"
|
|
|
|
|
|
2022-01-22 16:10:55 +00:00
|
|
|
#include "src/Helpers/BiMap.hpp"
|
|
|
|
|
|
2022-01-02 20:44:39 +00:00
|
|
|
namespace Bloom
|
|
|
|
|
{
|
|
|
|
|
struct InsightProjectSettings
|
|
|
|
|
{
|
2022-01-22 16:10:55 +00:00
|
|
|
public:
|
|
|
|
|
std::optional<QSize> mainWindowSize;
|
|
|
|
|
|
2022-01-02 20:44:39 +00:00
|
|
|
std::map<
|
|
|
|
|
Targets::TargetMemoryType,
|
|
|
|
|
Widgets::TargetMemoryInspectionPaneSettings
|
|
|
|
|
> memoryInspectionPaneSettingsByMemoryType;
|
|
|
|
|
|
|
|
|
|
InsightProjectSettings() = default;
|
2022-01-22 16:10:55 +00:00
|
|
|
explicit InsightProjectSettings(const QJsonObject& jsonObject);
|
|
|
|
|
|
|
|
|
|
[[nodiscard]] QJsonObject toJson() const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
static const inline BiMap<Targets::TargetMemoryType, QString> memoryTypesByName = {
|
|
|
|
|
{Targets::TargetMemoryType::RAM, "ram"},
|
|
|
|
|
{Targets::TargetMemoryType::EEPROM, "eeprom"},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static const inline BiMap<MemoryRegionDataType, QString> regionDataTypesByName = {
|
|
|
|
|
{MemoryRegionDataType::UNKNOWN, "other"},
|
|
|
|
|
{MemoryRegionDataType::UNSIGNED_INTEGER, "unsigned_int"},
|
2022-02-02 20:51:26 +00:00
|
|
|
{MemoryRegionDataType::SIGNED_INTEGER, "signed_int"},
|
2022-01-22 16:10:55 +00:00
|
|
|
{MemoryRegionDataType::ASCII_STRING, "ascii_string"},
|
|
|
|
|
};
|
|
|
|
|
|
2022-02-02 21:52:31 +00:00
|
|
|
static const inline BiMap<Targets::TargetMemoryEndianness, QString> regionEndiannessByName = {
|
|
|
|
|
{Targets::TargetMemoryEndianness::LITTLE, "little"},
|
|
|
|
|
{Targets::TargetMemoryEndianness::BIG, "big"},
|
|
|
|
|
};
|
|
|
|
|
|
2022-01-22 16:10:55 +00:00
|
|
|
static const inline BiMap<MemoryRegionAddressInputType, QString> addressRangeInputTypesByName = {
|
|
|
|
|
{MemoryRegionAddressInputType::ABSOLUTE, "absolute"},
|
|
|
|
|
{MemoryRegionAddressInputType::RELATIVE, "relative"},
|
|
|
|
|
};
|
2022-01-02 20:44:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct ProjectSettings
|
|
|
|
|
{
|
|
|
|
|
InsightProjectSettings insightSettings;
|
|
|
|
|
|
|
|
|
|
ProjectSettings() = default;
|
|
|
|
|
explicit ProjectSettings(const QJsonObject& jsonObject);
|
2022-01-22 16:10:55 +00:00
|
|
|
|
|
|
|
|
[[nodiscard]] QJsonObject toJson() const;
|
2022-01-02 20:44:39 +00:00
|
|
|
};
|
|
|
|
|
}
|