2020-12-30 12:46:05 +01:00
|
|
|
# NPC
|
2017-10-26 21:37:44 +02:00
|
|
|
|
|
|
|
```plantuml
|
|
|
|
|
2020-12-30 12:46:05 +01:00
|
|
|
package Core {
|
|
|
|
|
|
|
|
package Control {
|
|
|
|
class RepositoryFactory
|
|
|
|
class ModelFactory
|
|
|
|
class StructureFactory
|
|
|
|
class FieldFactory{
|
|
|
|
+ createField()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
package Model as PKGmodel {
|
|
|
|
class Repository {
|
|
|
|
+addStructure()
|
|
|
|
+removeStructure()
|
|
|
|
+getStructure()
|
|
|
|
}
|
|
|
|
class Model {
|
|
|
|
+getBinary():byte[]
|
|
|
|
+getStructures():Structure[]
|
|
|
|
+addStructure()
|
|
|
|
+removeStructure()
|
|
|
|
}
|
|
|
|
class Structure {
|
|
|
|
-name
|
|
|
|
-description
|
|
|
|
-fields
|
|
|
|
-data
|
|
|
|
+putData(Field, data)
|
|
|
|
+validateData(Field, data)
|
|
|
|
+updateData()
|
|
|
|
}
|
|
|
|
class Field {
|
|
|
|
- owningStructure
|
|
|
|
- binary
|
|
|
|
- logical
|
|
|
|
- visual
|
|
|
|
- representation
|
|
|
|
}
|
|
|
|
}
|
2017-10-26 21:37:44 +02:00
|
|
|
|
|
|
|
}
|
2020-12-30 12:46:05 +01:00
|
|
|
package Editor {
|
|
|
|
class MainWindow
|
|
|
|
class DockWidget_Tools
|
|
|
|
class DockWidget_Helpers
|
|
|
|
class StackContainer
|
|
|
|
class Syntax
|
|
|
|
class Name
|
|
|
|
class Input
|
|
|
|
class Representation
|
|
|
|
class StructureField
|
|
|
|
|
|
|
|
StructureField *-- Syntax
|
|
|
|
StructureField *-- Name
|
|
|
|
StructureField *-- Input
|
|
|
|
StructureField *-- Representation
|
|
|
|
|
|
|
|
MainWindow *- StackContainer: as centralWidget
|
2017-10-26 21:37:44 +02:00
|
|
|
}
|
|
|
|
|
2020-12-30 12:46:05 +01:00
|
|
|
|
2017-10-26 21:37:44 +02:00
|
|
|
|
|
|
|
class RandomAccessBinary {
|
|
|
|
- binaryData
|
|
|
|
+ setBytes(uint position, std::vector<uint8_t> data)
|
2020-12-30 12:46:05 +01:00
|
|
|
+ setByte(uint position, uint8_t data)
|
2017-10-26 21:37:44 +02:00
|
|
|
|
2020-12-30 12:46:05 +01:00
|
|
|
+ setBit(uint64_t position, bool value)
|
|
|
|
+ setBit(uint bytePosition, uint bitPosition, bool value)
|
|
|
|
+ setBits(uint64_t position, uint bits, uint value)
|
|
|
|
+ setBits(uint bytePosition, uint bitPosition, uint bits, uint value)
|
2017-10-26 21:37:44 +02:00
|
|
|
|
2020-12-30 12:46:05 +01:00
|
|
|
+ getByte(uint position)
|
|
|
|
+ getBytes(uint position, uint bytes)
|
2017-10-26 21:37:44 +02:00
|
|
|
|
2020-12-30 12:46:05 +01:00
|
|
|
+ getBit(uint64_t position)
|
|
|
|
+ getBit(uint bytePosition, uint bitPosition)
|
|
|
|
+ getBits(uint64_t position, uint bits)
|
|
|
|
+ getBits(uint bytePosition, uint bitPosition, uint bits)
|
2017-10-26 21:37:44 +02:00
|
|
|
|
2020-12-30 12:46:05 +01:00
|
|
|
+ get_uint32(uint position)
|
|
|
|
+ get_uint16(uint position)
|
|
|
|
+ get_uint64(uint position)
|
|
|
|
+ get_float(uint position)
|
|
|
|
+ get_double(uint position)
|
2017-10-26 21:37:44 +02:00
|
|
|
|
2020-12-30 12:46:05 +01:00
|
|
|
+ get_string(uint position, uint length)
|
2017-10-26 21:37:44 +02:00
|
|
|
|
2020-12-30 12:46:05 +01:00
|
|
|
+ get_hex_string(uint position, uint length)
|
|
|
|
+ get_hex_string()
|
2017-10-26 21:37:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
RepositoryFactory --> Repository : creates >
|
|
|
|
|
2020-12-30 12:46:05 +01:00
|
|
|
ModelFactory -> Model: creates >
|
|
|
|
|
|
|
|
StructureFactory -> Structure : creates >
|
|
|
|
Model *- Structure
|
|
|
|
Repository *- Structure
|
2017-10-26 21:37:44 +02:00
|
|
|
|
2020-12-30 12:46:05 +01:00
|
|
|
FieldFactory -> Field : creates >
|
2017-10-26 21:37:44 +02:00
|
|
|
|
2020-12-30 12:46:05 +01:00
|
|
|
Structure *- Field
|
2017-10-26 21:37:44 +02:00
|
|
|
|
2020-12-30 12:46:05 +01:00
|
|
|
Model *-- "1" RandomAccessBinary
|
2017-10-26 21:37:44 +02:00
|
|
|
|
2020-12-30 12:46:05 +01:00
|
|
|
StructureField *-- Field
|
|
|
|
StackContainer *-- StructureField
|
2017-10-26 21:37:44 +02:00
|
|
|
|
|
|
|
```
|