Updated application to code to accomodate changes to TDF format (new pad elements and changes to variant elements)

This commit is contained in:
Nav
2024-08-16 22:50:06 +01:00
parent 129e54dd2d
commit c662e946ca
35 changed files with 534 additions and 311 deletions

View File

@@ -0,0 +1,50 @@
#pragma once
#include <cstdint>
#include <QMetaType>
#include "TargetPadDescriptor.hpp"
#include "src/Helpers/Pair.hpp"
namespace Targets
{
struct TargetGpioPadState
{
enum class State: std::uint8_t
{
HIGH,
LOW,
};
enum class DataDirection: std::uint8_t
{
INPUT,
OUTPUT,
};
State value;
DataDirection direction;
TargetGpioPadState(
State value,
DataDirection direction
)
: value(value)
, direction(direction)
{}
bool operator == (const TargetGpioPadState& other) const {
return this->value == other.value && this->direction == other.direction;
}
bool operator != (const TargetGpioPadState& other) const {
return !(*this == other);
}
};
using TargetGpioPadDescriptorAndStatePair = Pair<const TargetPadDescriptor&, TargetGpioPadState>;
using TargetGpioPadDescriptorAndStatePairs = std::vector<TargetGpioPadDescriptorAndStatePair>;
}
Q_DECLARE_METATYPE(Targets::TargetGpioPadState)