def get_objects_dictionary(): """ creates a dictionary with the types and the circuit objects :return: Dictionary instance """ object_types = {'area': dev.Area(), 'zone': dev.Zone(), 'substation': dev.Substation(), 'country': dev.Country(), 'bus': dev.Bus(), 'load': dev.Load(), 'static_generator': dev.StaticGenerator(), 'battery': dev.Battery(), 'generator': dev.Generator(), 'shunt': dev.Shunt(), 'wires': dev.Wire(), 'overhead_line_types': dev.Tower(), 'underground_cable_types': dev.UndergroundLineType(), 'sequence_line_types': dev.SequenceLineType(), 'transformer_types': dev.TransformerType(), 'branch': dev.Branch(), 'transformer2w': dev.Transformer2W(), 'line': dev.Line(), 'dc_line': dev.DcLine(None, None), 'hvdc': dev.HvdcLine(), 'vsc': dev.VSC(None, None), 'upfc': dev.UPFC(None, None), } return object_types
def parse_power_transformer(self, cim: CIMCircuit, circuit: MultiCircuit, busbar_dict): """ :param cim: :param circuit: :param busbar_dict: :return: """ if 'PowerTransformer' in cim.elements_by_type.keys(): for elm in cim.elements_by_type['PowerTransformer']: b1, b2 = elm.get_buses() B1, B2 = try_buses(b1, b2, busbar_dict) if B1 is not None and B2 is not None: R, X, G, B = elm.get_pu_values() rate = elm.get_rate() voltages = elm.get_voltages() voltages.sort() if len(voltages) == 2: lv, hv = voltages else: lv = 1 hv = 1 self.logger.add_error( 'Could not parse transformer nominal voltages', self.name) line = gcdev.Transformer2W(idtag=cimdev.rfid2uuid( elm.rfid), bus_from=B1, bus_to=B2, name=str(elm.name), r=R, x=X, g=G, b=B, rate=rate, tap=1.0, shift_angle=0, active=True, HV=hv, LV=lv) circuit.add_branch(line) else: self.logger.add_error('Bus not found', elm.rfid)