G: CemObjectStore (E120 Common Equipment Model)
Hierarchical object tree for equipment self-description. Each object carries a CemObjectType (Equipment / Subsystem / IODevice / Module / MaterialLocation / Other), an optional parent_objid, and a flat attribute map keyed by name (the wire shape S14F1 / F3 returns). Operations covered: add(CemObject) - dedup'd, validates parent exists get / has - lookup by objid get_attr / set_attr - E14 GetAttr / SetAttr semantics children(parent) - tree traversal; empty parent = roots The flat-map representation matches how E14 ObjectService traffic addresses nodes (by OBJSPEC string). Wiring S14F1/F2 GetAttr and S14F3/F4 SetAttr to this store is a downstream commit; the data model is what was missing. Joins EquipmentDataModel alongside the other top-level stores. Three test cases cover hierarchical add+dedup, children() traversal, and get/set/missing attribute semantics. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
#include "secsgem/gem/store/cem_objects.hpp"
|
||||
|
||||
namespace secsgem::gem {
|
||||
|
||||
const char* cem_object_type_name(CemObjectType t) {
|
||||
switch (t) {
|
||||
case CemObjectType::Equipment: return "Equipment";
|
||||
case CemObjectType::Subsystem: return "Subsystem";
|
||||
case CemObjectType::IODevice: return "IODevice";
|
||||
case CemObjectType::Module: return "Module";
|
||||
case CemObjectType::MaterialLoc: return "MaterialLocation";
|
||||
case CemObjectType::Other: return "Other";
|
||||
}
|
||||
return "?";
|
||||
}
|
||||
|
||||
} // namespace secsgem::gem
|
||||
Reference in New Issue
Block a user