nodes: Added Selected Region node

This commit is contained in:
WerWolv 2022-02-07 22:46:22 +01:00
parent 137bfe48ca
commit a8e49c5a85
6 changed files with 44 additions and 0 deletions

View File

@ -383,6 +383,29 @@ namespace hex::plugin::builtin {
}
};
class NodeDataSelection : public dp::Node {
public:
NodeDataSelection() : Node("hex.builtin.nodes.data_access.selection.header", { dp::Attribute(dp::Attribute::IOType::Out, dp::Attribute::Type::Integer, "hex.builtin.nodes.data_access.selection.address"), dp::Attribute(dp::Attribute::IOType::Out, dp::Attribute::Type::Integer, "hex.builtin.nodes.data_access.selection.size") }) {
EventManager::subscribe<EventRegionSelected>(this, [this](const Region &region) {
this->m_address = region.address;
this->m_size = region.size;
});
}
~NodeDataSelection() override {
EventManager::unsubscribe<EventRegionSelected>(this);
}
void process() override {
this->setIntegerOnOutput(0, this->m_address);
this->setIntegerOnOutput(1, this->m_size);
}
private:
u64 m_address = 0;
size_t m_size = 0;
};
class NodeCastIntegerToBuffer : public dp::Node {
public:
NodeCastIntegerToBuffer() : Node("hex.builtin.nodes.casting.int_to_buffer.header", { dp::Attribute(dp::Attribute::IOType::In, dp::Attribute::Type::Integer, "hex.builtin.nodes.common.input"), dp::Attribute(dp::Attribute::IOType::Out, dp::Attribute::Type::Buffer, "hex.builtin.nodes.common.output") }) { }
@ -988,6 +1011,7 @@ namespace hex::plugin::builtin {
ContentRegistry::DataProcessorNode::add<NodeReadData>("hex.builtin.nodes.data_access", "hex.builtin.nodes.data_access.read");
ContentRegistry::DataProcessorNode::add<NodeWriteData>("hex.builtin.nodes.data_access", "hex.builtin.nodes.data_access.write");
ContentRegistry::DataProcessorNode::add<NodeDataSize>("hex.builtin.nodes.data_access", "hex.builtin.nodes.data_access.size");
ContentRegistry::DataProcessorNode::add<NodeDataSelection>("hex.builtin.nodes.data_access", "hex.builtin.nodes.data_access.selection");
ContentRegistry::DataProcessorNode::add<NodeCastIntegerToBuffer>("hex.builtin.nodes.casting", "hex.builtin.nodes.casting.int_to_buffer");
ContentRegistry::DataProcessorNode::add<NodeCastBufferToInteger>("hex.builtin.nodes.casting", "hex.builtin.nodes.casting.buffer_to_int");

View File

@ -463,6 +463,10 @@ namespace hex::plugin::builtin {
{ "hex.builtin.nodes.data_access.size", "Datengrösse"},
{ "hex.builtin.nodes.data_access.size.header", "Datengrösse"},
{ "hex.builtin.nodes.data_access.size.size", "Grösse"},
{ "hex.builtin.nodes.data_access.selection", "Angewählte Region"},
{ "hex.builtin.nodes.data_access.selection.header", "Angewählte Region"},
{ "hex.builtin.nodes.data_access.selection.address", "Adresse"},
{ "hex.builtin.nodes.data_access.selection.size", "Grösse"},
{ "hex.builtin.nodes.casting", "Datenumwandlung" },
{ "hex.builtin.nodes.casting.int_to_buffer", "Integral zu Buffer" },

View File

@ -468,6 +468,10 @@ namespace hex::plugin::builtin {
{ "hex.builtin.nodes.data_access.size", "Data Size"},
{ "hex.builtin.nodes.data_access.size.header", "Data Size"},
{ "hex.builtin.nodes.data_access.size.size", "Size"},
{ "hex.builtin.nodes.data_access.selection", "Selected Region"},
{ "hex.builtin.nodes.data_access.selection.header", "Selected Region"},
{ "hex.builtin.nodes.data_access.selection.address", "Address"},
{ "hex.builtin.nodes.data_access.selection.size", "Size"},
{ "hex.builtin.nodes.casting", "Data conversion" },
{ "hex.builtin.nodes.casting.int_to_buffer", "Integer to Buffer" },

View File

@ -464,6 +464,10 @@ namespace hex::plugin::builtin {
{ "hex.builtin.nodes.data_access.size", "Dati Dimensione"},
{ "hex.builtin.nodes.data_access.size.header", "Dati Dimensione"},
{ "hex.builtin.nodes.data_access.size.size", "Dimensione"},
//{ "hex.builtin.nodes.data_access.selection", "Selected Region"},
//{ "hex.builtin.nodes.data_access.selection.header", "Selected Region"},
//{ "hex.builtin.nodes.data_access.selection.address", "Address"},
//{ "hex.builtin.nodes.data_access.selection.size", "Size"},
{ "hex.builtin.nodes.casting", "Conversione Dati" },
{ "hex.builtin.nodes.casting.int_to_buffer", "Da Intero a Buffer" },

View File

@ -467,6 +467,10 @@ namespace hex::plugin::builtin {
{ "hex.builtin.nodes.data_access.size", "データサイズ"},
{ "hex.builtin.nodes.data_access.size.header", "データサイズ"},
{ "hex.builtin.nodes.data_access.size.size", "サイズ"},
//{ "hex.builtin.nodes.data_access.selection", "Selected Region"},
//{ "hex.builtin.nodes.data_access.selection.header", "Selected Region"},
//{ "hex.builtin.nodes.data_access.selection.address", "Address"},
//{ "hex.builtin.nodes.data_access.selection.size", "Size"},
{ "hex.builtin.nodes.casting", "データ変換" },
{ "hex.builtin.nodes.casting.int_to_buffer", "整数からバッファ" },

View File

@ -459,6 +459,10 @@ namespace hex::plugin::builtin {
{ "hex.builtin.nodes.data_access.size", "数据大小"},
{ "hex.builtin.nodes.data_access.size.header", "数据大小"},
{ "hex.builtin.nodes.data_access.size.size", "大小"},
//{ "hex.builtin.nodes.data_access.selection", "Selected Region"},
//{ "hex.builtin.nodes.data_access.selection.header", "Selected Region"},
//{ "hex.builtin.nodes.data_access.selection.address", "Address"},
//{ "hex.builtin.nodes.data_access.selection.size", "Size"},
{ "hex.builtin.nodes.casting", "数据转换" },
{ "hex.builtin.nodes.casting.int_to_buffer", "整数到缓冲区" },