2021-04-04 21:04:12 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <QWidget>
|
2021-08-18 22:51:15 +01:00
|
|
|
#include <QBoxLayout>
|
2021-04-04 21:04:12 +01:00
|
|
|
#include <QLabel>
|
|
|
|
|
|
|
|
|
|
#include "../TargetPinWidget.hpp"
|
|
|
|
|
#include "PinBodyWidget.hpp"
|
|
|
|
|
#include "src/Targets/TargetVariant.hpp"
|
|
|
|
|
|
2021-07-07 20:54:45 +01:00
|
|
|
namespace Bloom::Widgets::InsightTargetWidgets::Qfp
|
2021-04-04 21:04:12 +01:00
|
|
|
{
|
|
|
|
|
class PinWidget: public TargetPinWidget
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
private:
|
2021-08-18 22:51:15 +01:00
|
|
|
QBoxLayout* layout = nullptr;
|
2021-04-04 21:04:12 +01:00
|
|
|
QLabel* pinNumberLabel = nullptr;
|
|
|
|
|
QLabel* pinNameLabel = nullptr;
|
|
|
|
|
QLabel* pinDirectionLabel = nullptr;
|
|
|
|
|
PinBodyWidget* bodyWidget = nullptr;
|
|
|
|
|
|
|
|
|
|
bool isLeftLayout = false;
|
|
|
|
|
bool isBottomLayout = false;
|
|
|
|
|
bool isRightLayout = false;
|
|
|
|
|
bool isTopLayout = false;
|
|
|
|
|
|
2021-09-02 21:20:48 +01:00
|
|
|
void setLabelColor(const QString& hexColor);
|
2021-04-04 21:04:12 +01:00
|
|
|
|
|
|
|
|
public:
|
2021-08-24 20:12:07 +01:00
|
|
|
static const int PIN_WIDGET_LAYOUT_PADDING = 46;
|
|
|
|
|
static const int PIN_WIDGET_SPACING = 8;
|
2021-04-04 21:04:12 +01:00
|
|
|
static const int MAXIMUM_LABEL_COUNT = 3;
|
|
|
|
|
static const int LABEL_HEIGHT = 20;
|
|
|
|
|
static const int MAXIMUM_LABEL_WIDTH = PinBodyWidget::WIDTH;
|
|
|
|
|
static const int MAXIMUM_LABEL_HEIGHT = 20;
|
2021-05-24 20:58:49 +01:00
|
|
|
static const int MAXIMUM_HORIZONTAL_WIDTH = PinBodyWidget::HEIGHT
|
|
|
|
|
+ (PinWidget::MAXIMUM_LABEL_WIDTH * PinWidget::MAXIMUM_LABEL_COUNT);
|
2021-04-04 21:04:12 +01:00
|
|
|
static const int MAXIMUM_HORIZONTAL_HEIGHT = PinBodyWidget::WIDTH;
|
2021-05-24 20:58:49 +01:00
|
|
|
static const int MAXIMUM_VERTICAL_HEIGHT = PinBodyWidget::HEIGHT
|
|
|
|
|
+ (PinWidget::MAXIMUM_LABEL_HEIGHT * PinWidget::MAXIMUM_LABEL_COUNT);
|
2021-04-04 21:04:12 +01:00
|
|
|
static const int MAXIMUM_VERTICAL_WIDTH = PinBodyWidget::WIDTH;
|
|
|
|
|
|
2021-05-24 20:58:49 +01:00
|
|
|
PinWidget(
|
|
|
|
|
QWidget* parent,
|
|
|
|
|
const Targets::TargetPinDescriptor& pinDescriptor,
|
|
|
|
|
const Targets::TargetVariant& targetVariant
|
|
|
|
|
);
|
2021-04-04 21:04:12 +01:00
|
|
|
|
2021-09-02 21:20:48 +01:00
|
|
|
void updatePinState(const Targets::TargetPinState& pinState) override;
|
2021-04-04 21:04:12 +01:00
|
|
|
};
|
|
|
|
|
}
|