extractCableInfo static method

CableInfo extractCableInfo(
  1. ElectricalNode node
)

Extract cable info safely from any node type

Implementation

static CableInfo extractCableInfo(ElectricalNode node) {
  return node.map(
    source: (n) => CableInfo(cable: n.mainFeedCable, catalog: null),
    panel: (n) => CableInfo(cable: n.inputCable, catalog: null),
    protection: (n) => CableInfo(cable: null, catalog: n.catalogData),
    load: (n) => CableInfo(cable: n.inputCable, catalog: null),
  );
}