This commit is contained in:
Nav
2021-10-29 22:48:28 +01:00
parent 77cefd8308
commit 8f3a51e644
3 changed files with 5 additions and 10 deletions

View File

@@ -58,7 +58,7 @@ void EnvironmentConfig::init(std::string name, QJsonObject jsonObject) {
throw Exceptions::InvalidConfig("No target configuration provided."); throw Exceptions::InvalidConfig("No target configuration provided.");
} }
this->name = name; this->name = std::move(name);
this->debugToolConfig.init(jsonObject.find("debugTool")->toObject()); this->debugToolConfig.init(jsonObject.find("debugTool")->toObject());
this->targetConfig.init(jsonObject.find("target")->toObject()); this->targetConfig.init(jsonObject.find("target")->toObject());

View File

@@ -29,7 +29,7 @@ namespace Bloom::Widgets
std::size_t currentColumnIndex = 0; std::size_t currentColumnIndex = 0;
ByteItem( ByteItem(
std::size_t byteNumber, std::size_t byteIndex,
std::uint32_t address, std::uint32_t address,
std::optional<ByteItem*>& hoveredByteItem std::optional<ByteItem*>& hoveredByteItem
); );
@@ -45,11 +45,6 @@ namespace Bloom::Widgets
} }
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) override; void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) override;
signals:
void selected(Bloom::Widgets::ByteItem*);
void enter(Bloom::Widgets::ByteItem*);
void leave(Bloom::Widgets::ByteItem*);
private: private:
bool valueChanged = false; bool valueChanged = false;

View File

@@ -36,8 +36,8 @@ parent(parent) {
const auto memorySize = this->targetMemoryDescriptor.size(); const auto memorySize = this->targetMemoryDescriptor.size();
const auto startAddress = this->targetMemoryDescriptor.addressRange.startAddress; const auto startAddress = this->targetMemoryDescriptor.addressRange.startAddress;
Logger::error("Constructing bytes begin"); Logger::error("Constructing bytes begin");
for (std::size_t i = 0; i < memorySize; i++) { for (std::uint32_t i = 0; i < memorySize; i++) {
const auto address = static_cast<std::uint32_t>(startAddress + i); const auto address = startAddress + i;
auto* byteWidget = new ByteItem(i, address, this->hoveredByteWidget); auto* byteWidget = new ByteItem(i, address, this->hoveredByteWidget);
this->byteWidgetsByAddress.insert(std::pair( this->byteWidgetsByAddress.insert(std::pair(
@@ -87,7 +87,7 @@ void ByteItemGraphicsScene::adjustByteWidgets() {
); );
const auto columnIndex = static_cast<std::size_t>( const auto columnIndex = static_cast<std::size_t>(
static_cast<double>(byteWidget->byteIndex) static_cast<double>(byteWidget->byteIndex)
- (std::floor(byteWidget->byteIndex / rowCapacity) * static_cast<double>(rowCapacity)) - (std::floor(byteWidget->byteIndex / rowCapacity) * static_cast<double>(rowCapacity))
); );
byteWidget->setPos( byteWidget->setPos(