Beispiel #1
0
 def add_transformer_winding(self, osm_substation_id, winding_voltage, transformer):
     new_transformer_winding = TransformerWinding(name='TW_' + str(osm_substation_id) + '_' + str(winding_voltage),
                                                  b=0, x=1.0, r=1.0, connectionType='Yn',
                                                  ratedU=winding_voltage, ratedS=5000000,
                                                  BaseVoltage=self.base_voltage(winding_voltage))
     # init with primary
     index = 0
     for winding in transformer.getTransformerWindings():
         # already a primary winding with at least as high voltage as the new one
         if winding.ratedU >= winding_voltage:
             index += 1
         else:
             self.increase_winding_type(winding)
     new_transformer_winding.windingType = self.winding_types[index]
     new_transformer_winding.setPowerTransformer(transformer)
     new_transformer_winding.UUID = str(CimWriter.uuid())
     self.cimobject_by_uuid_dict[new_transformer_winding.UUID] = new_transformer_winding
     connectivity_node = ConnectivityNode(name='CN_' + str(osm_substation_id) + '_' + str(winding_voltage))
     connectivity_node.UUID = str(CimWriter.uuid())
     self.cimobject_by_uuid_dict[connectivity_node.UUID] = connectivity_node
     terminal = Terminal(ConnectivityNode=connectivity_node, ConductingEquipment=new_transformer_winding,
                         sequenceNumber=1)
     terminal.UUID = str(CimWriter.uuid())
     self.cimobject_by_uuid_dict[terminal.UUID] = terminal
     self.connectivity_by_uuid_dict[new_transformer_winding.UUID] = connectivity_node
     return new_transformer_winding
Beispiel #2
0
 def add_transformer_winding(self, osm_substation_id, winding_voltage, transformer):
     new_transformer_winding = TransformerWinding(name='TW_' + str(osm_substation_id) + '_' + str(winding_voltage),
                                                  b=0, x=1.0, r=1.0, connectionType='Yn',
                                                  ratedU=winding_voltage, ratedS=5000000,
                                                  BaseVoltage=self.base_voltage(winding_voltage))
     # init with primary
     index = 0
     for winding in transformer.getTransformerWindings():
         # already a primary winding with at least as high voltage as the new one
         if winding.ratedU >= winding_voltage:
             index += 1
         else:
             self.increase_winding_type(winding)
     new_transformer_winding.windingType = self.winding_types[index]
     new_transformer_winding.setPowerTransformer(transformer)
     new_transformer_winding.UUID = str(CimWriter.uuid())
     self.cimobject_by_uuid_dict[new_transformer_winding.UUID] = new_transformer_winding
     connectivity_node = ConnectivityNode(name='CN_' + str(osm_substation_id) + '_' + str(winding_voltage))
     connectivity_node.UUID = str(CimWriter.uuid())
     self.cimobject_by_uuid_dict[connectivity_node.UUID] = connectivity_node
     terminal = Terminal(ConnectivityNode=connectivity_node, ConductingEquipment=new_transformer_winding,
                         sequenceNumber=1)
     terminal.UUID = str(CimWriter.uuid())
     self.cimobject_by_uuid_dict[terminal.UUID] = terminal
     self.connectivity_by_uuid_dict[new_transformer_winding.UUID] = connectivity_node
     return new_transformer_winding
Beispiel #3
0
 def generator_to_cim(self, generator, circuit_voltage):
     if generator.id in self.uuid_by_osmid_dict:
         self.root.debug('Generator with OSMID %s already covered', str(generator.id))
         generating_unit = self.cimobject_by_uuid_dict[self.uuid_by_osmid_dict[generator.id]]
     else:
         self.root.debug('Create CIM Generator for OSMID %s', str(generator.id))
         generating_unit = GeneratingUnit(name='G_' + str(generator.id), maxOperatingP=generator.nominal_power,
                                          minOperatingP=0,
                                          nominalP=generator.nominal_power if generator.nominal_power else '',
                                          Location=self.add_location(generator.lat, generator.lon))
         synchronous_machine = SynchronousMachine(
             name='G_' + str(generator.id) + '_' + CimWriter.escape_string(generator.name),
             operatingMode='generator', qPercent=0, x=0.01,
             r=0.01, ratedS='' if generator.nominal_power is None else generator.nominal_power, type='generator',
             GeneratingUnit=generating_unit, BaseVoltage=self.base_voltage(int(circuit_voltage)))
         generating_unit.UUID = str(CimWriter.uuid())
         synchronous_machine.UUID = str(CimWriter.uuid())
         self.cimobject_by_uuid_dict[generating_unit.UUID] = generating_unit
         self.cimobject_by_uuid_dict[synchronous_machine.UUID] = synchronous_machine
         self.uuid_by_osmid_dict[generator.id] = generating_unit.UUID
         connectivity_node = ConnectivityNode(name='CN_' + str(generator.id) + '_' + circuit_voltage)
         connectivity_node.UUID = str(CimWriter.uuid())
         self.cimobject_by_uuid_dict[connectivity_node.UUID] = connectivity_node
         terminal = Terminal(ConnectivityNode=connectivity_node, ConductingEquipment=synchronous_machine,
                             sequenceNumber=1)
         terminal.UUID = str(CimWriter.uuid())
         self.cimobject_by_uuid_dict[terminal.UUID] = terminal
         self.connectivity_by_uuid_dict[generating_unit.UUID] = connectivity_node
     return self.connectivity_by_uuid_dict[generating_unit.UUID]
Beispiel #4
0
 def generator_to_cim(self, generator, circuit_voltage):
     if generator.id in self.uuid_by_osmid_dict:
         generating_unit = self.cimobject_by_uuid_dict[self.uuid_by_osmid_dict[generator.id]]
     else:
         generating_unit = GeneratingUnit(name='G_' + str(generator.id), maxOperatingP=generator.nominal_power,
                                          minOperatingP=0,
                                          nominalP=generator.nominal_power if generator.nominal_power else '',
                                          Location=self.add_location(generator.lat, generator.lon))
         synchronous_machine = SynchronousMachine(
             name='G_' + str(generator.id) + '_' + CimWriter.escape_string(str(generator.name.encode('utf-8') if generator.name else None)),
             operatingMode='generator', qPercent=0, x=0.01,
             r=0.01, ratedS='' if generator.nominal_power is None else generator.nominal_power, type='generator',
             GeneratingUnit=generating_unit, BaseVoltage=self.base_voltage(int(circuit_voltage)))
         generating_unit.UUID = str(CimWriter.uuid())
         synchronous_machine.UUID = str(CimWriter.uuid())
         self.cimobject_by_uuid_dict[generating_unit.UUID] = generating_unit
         self.cimobject_by_uuid_dict[synchronous_machine.UUID] = synchronous_machine
         self.uuid_by_osmid_dict[generator.id] = generating_unit.UUID
         connectivity_node = ConnectivityNode(name='CN_' + str(generator.id) + '_' + str(circuit_voltage))
         connectivity_node.UUID = str(CimWriter.uuid())
         self.cimobject_by_uuid_dict[connectivity_node.UUID] = connectivity_node
         terminal = Terminal(ConnectivityNode=connectivity_node, ConductingEquipment=synchronous_machine,
                             sequenceNumber=1)
         terminal.UUID = str(CimWriter.uuid())
         self.cimobject_by_uuid_dict[terminal.UUID] = terminal
         self.connectivity_by_uuid_dict[generating_unit.UUID] = connectivity_node
     return self.connectivity_by_uuid_dict[generating_unit.UUID]