zepben.ewb 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- zepben/ewb/__init__.py +601 -0
- zepben/ewb/auth/__init__.py +10 -0
- zepben/ewb/auth/client/__init__.py +5 -0
- zepben/ewb/auth/client/zepben_token_fetcher.py +273 -0
- zepben/ewb/auth/common/__init__.py +5 -0
- zepben/ewb/auth/common/auth_exception.py +16 -0
- zepben/ewb/auth/common/auth_method.py +28 -0
- zepben/ewb/auth/common/auth_provider_config.py +96 -0
- zepben/ewb/database/__init__.py +4 -0
- zepben/ewb/database/paths/__init__.py +4 -0
- zepben/ewb/database/paths/database_type.py +34 -0
- zepben/ewb/database/paths/ewb_data_file_paths.py +237 -0
- zepben/ewb/database/sql/__init__.py +4 -0
- zepben/ewb/database/sql/column.py +37 -0
- zepben/ewb/database/sql/sql_table.py +142 -0
- zepben/ewb/database/sqlite/__init__.py +4 -0
- zepben/ewb/database/sqlite/common/__init__.py +4 -0
- zepben/ewb/database/sqlite/common/base_cim_reader.py +212 -0
- zepben/ewb/database/sqlite/common/base_cim_writer.py +159 -0
- zepben/ewb/database/sqlite/common/base_collection_reader.py +96 -0
- zepben/ewb/database/sqlite/common/base_collection_writer.py +73 -0
- zepben/ewb/database/sqlite/common/base_database_reader.py +127 -0
- zepben/ewb/database/sqlite/common/base_database_tables.py +137 -0
- zepben/ewb/database/sqlite/common/base_database_writer.py +195 -0
- zepben/ewb/database/sqlite/common/base_entry_writer.py +34 -0
- zepben/ewb/database/sqlite/common/base_service_reader.py +50 -0
- zepben/ewb/database/sqlite/common/base_service_writer.py +104 -0
- zepben/ewb/database/sqlite/common/metadata_collection_reader.py +39 -0
- zepben/ewb/database/sqlite/common/metadata_collection_writer.py +38 -0
- zepben/ewb/database/sqlite/common/metadata_entry_reader.py +45 -0
- zepben/ewb/database/sqlite/common/metadata_entry_writer.py +41 -0
- zepben/ewb/database/sqlite/common/reader_exceptions.py +30 -0
- zepben/ewb/database/sqlite/customer/__init__.py +4 -0
- zepben/ewb/database/sqlite/customer/customer_cim_reader.py +169 -0
- zepben/ewb/database/sqlite/customer/customer_cim_writer.py +137 -0
- zepben/ewb/database/sqlite/customer/customer_database_reader.py +44 -0
- zepben/ewb/database/sqlite/customer/customer_database_tables.py +37 -0
- zepben/ewb/database/sqlite/customer/customer_database_writer.py +45 -0
- zepben/ewb/database/sqlite/customer/customer_service_reader.py +57 -0
- zepben/ewb/database/sqlite/customer/customer_service_writer.py +47 -0
- zepben/ewb/database/sqlite/diagram/__init__.py +4 -0
- zepben/ewb/database/sqlite/diagram/diagram_cim_reader.py +105 -0
- zepben/ewb/database/sqlite/diagram/diagram_cim_writer.py +81 -0
- zepben/ewb/database/sqlite/diagram/diagram_database_reader.py +45 -0
- zepben/ewb/database/sqlite/diagram/diagram_database_tables.py +29 -0
- zepben/ewb/database/sqlite/diagram/diagram_database_writer.py +44 -0
- zepben/ewb/database/sqlite/diagram/diagram_service_reader.py +49 -0
- zepben/ewb/database/sqlite/diagram/diagram_service_writer.py +41 -0
- zepben/ewb/database/sqlite/extensions/__init__.py +4 -0
- zepben/ewb/database/sqlite/extensions/prepared_statement.py +112 -0
- zepben/ewb/database/sqlite/extensions/result_set.py +153 -0
- zepben/ewb/database/sqlite/network/__init__.py +4 -0
- zepben/ewb/database/sqlite/network/network_cim_reader.py +3167 -0
- zepben/ewb/database/sqlite/network/network_cim_writer.py +2561 -0
- zepben/ewb/database/sqlite/network/network_database_reader.py +175 -0
- zepben/ewb/database/sqlite/network/network_database_tables.py +242 -0
- zepben/ewb/database/sqlite/network/network_database_writer.py +43 -0
- zepben/ewb/database/sqlite/network/network_service_reader.py +265 -0
- zepben/ewb/database/sqlite/network/network_service_writer.py +209 -0
- zepben/ewb/database/sqlite/tables/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/associations/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/associations/loop_substation_relationship.py +17 -0
- zepben/ewb/database/sqlite/tables/associations/table_asset_organisation_roles_assets.py +40 -0
- zepben/ewb/database/sqlite/tables/associations/table_assets_power_system_resources.py +41 -0
- zepben/ewb/database/sqlite/tables/associations/table_battery_units_battery_controls.py +40 -0
- zepben/ewb/database/sqlite/tables/associations/table_circuits_substations.py +40 -0
- zepben/ewb/database/sqlite/tables/associations/table_circuits_terminals.py +40 -0
- zepben/ewb/database/sqlite/tables/associations/table_customer_agreements_pricing_structures.py +40 -0
- zepben/ewb/database/sqlite/tables/associations/table_end_devices_end_device_functions.py +40 -0
- zepben/ewb/database/sqlite/tables/associations/table_equipment_equipment_containers.py +40 -0
- zepben/ewb/database/sqlite/tables/associations/table_equipment_operational_restrictions.py +40 -0
- zepben/ewb/database/sqlite/tables/associations/table_equipment_usage_points.py +40 -0
- zepben/ewb/database/sqlite/tables/associations/table_loops_substations.py +43 -0
- zepben/ewb/database/sqlite/tables/associations/table_pricing_structures_tariffs.py +40 -0
- zepben/ewb/database/sqlite/tables/associations/table_protection_relay_functions_protected_switches.py +40 -0
- zepben/ewb/database/sqlite/tables/associations/table_protection_relay_functions_sensors.py +40 -0
- zepben/ewb/database/sqlite/tables/associations/table_protection_relay_schemes_protection_relay_functions.py +40 -0
- zepben/ewb/database/sqlite/tables/associations/table_synchronous_machines_reactive_capability_curves.py +39 -0
- zepben/ewb/database/sqlite/tables/associations/table_usage_points_end_devices.py +40 -0
- zepben/ewb/database/sqlite/tables/exceptions.py +10 -0
- zepben/ewb/database/sqlite/tables/extensions/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61968/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61968/assetinfo/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61968/assetinfo/table_reclose_delays.py +38 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61968/assetinfo/table_relay_info.py +21 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61968/metering/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61968/metering/table_pan_demand_response_functions.py +21 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/core/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/core/table_sites.py +15 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/feeder/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/feeder/table_loops.py +15 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/feeder/table_lv_feeders.py +20 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/generation/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/generation/production/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/generation/production/table_ev_charging_units.py +15 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/protection/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/protection/table_distance_relays.py +28 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/protection/table_protection_relay_function_thresholds.py +36 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/protection/table_protection_relay_function_time_limits.py +34 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/protection/table_protection_relay_functions.py +24 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/protection/table_protection_relay_schemes.py +20 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/protection/table_protection_relay_systems.py +20 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/protection/table_voltage_relays.py +15 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/wires/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/wires/table_battery_controls.py +23 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/wires/table_power_transformer_end_ratings.py +34 -0
- zepben/ewb/database/sqlite/tables/iec61968/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61968/assetinfo/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61968/assetinfo/table_cable_info.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61968/assetinfo/table_no_load_tests.py +24 -0
- zepben/ewb/database/sqlite/tables/iec61968/assetinfo/table_open_circuit_tests.py +24 -0
- zepben/ewb/database/sqlite/tables/iec61968/assetinfo/table_overhead_wire_info.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61968/assetinfo/table_power_transformer_info.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61968/assetinfo/table_short_circuit_tests.py +29 -0
- zepben/ewb/database/sqlite/tables/iec61968/assetinfo/table_shunt_compensator_info.py +23 -0
- zepben/ewb/database/sqlite/tables/iec61968/assetinfo/table_switch_info.py +20 -0
- zepben/ewb/database/sqlite/tables/iec61968/assetinfo/table_transformer_end_info.py +46 -0
- zepben/ewb/database/sqlite/tables/iec61968/assetinfo/table_transformer_tank_info.py +27 -0
- zepben/ewb/database/sqlite/tables/iec61968/assetinfo/table_transformer_test.py +19 -0
- zepben/ewb/database/sqlite/tables/iec61968/assetinfo/table_wire_info.py +19 -0
- zepben/ewb/database/sqlite/tables/iec61968/assets/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61968/assets/table_asset_containers.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61968/assets/table_asset_functions.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61968/assets/table_asset_info.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61968/assets/table_asset_organisation_roles.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61968/assets/table_asset_owners.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61968/assets/table_assets.py +18 -0
- zepben/ewb/database/sqlite/tables/iec61968/assets/table_streetlights.py +22 -0
- zepben/ewb/database/sqlite/tables/iec61968/assets/table_structures.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61968/common/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61968/common/table_agreements.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61968/common/table_documents.py +23 -0
- zepben/ewb/database/sqlite/tables/iec61968/common/table_location_street_address_field.py +18 -0
- zepben/ewb/database/sqlite/tables/iec61968/common/table_location_street_addresses.py +33 -0
- zepben/ewb/database/sqlite/tables/iec61968/common/table_locations.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61968/common/table_organisation_roles.py +18 -0
- zepben/ewb/database/sqlite/tables/iec61968/common/table_organisations.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61968/common/table_position_points.py +30 -0
- zepben/ewb/database/sqlite/tables/iec61968/common/table_street_addresses.py +26 -0
- zepben/ewb/database/sqlite/tables/iec61968/common/table_town_details.py +19 -0
- zepben/ewb/database/sqlite/tables/iec61968/customers/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61968/customers/table_customer_agreements.py +27 -0
- zepben/ewb/database/sqlite/tables/iec61968/customers/table_customers.py +22 -0
- zepben/ewb/database/sqlite/tables/iec61968/customers/table_pricing_structures.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61968/customers/table_tariffs.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61968/infiec61968/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61968/infiec61968/infassetinfo/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61968/infiec61968/infassetinfo/table_current_transformer_info.py +33 -0
- zepben/ewb/database/sqlite/tables/iec61968/infiec61968/infassetinfo/table_potential_transformer_info.py +26 -0
- zepben/ewb/database/sqlite/tables/iec61968/infiec61968/infassets/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61968/infiec61968/infassets/table_poles.py +20 -0
- zepben/ewb/database/sqlite/tables/iec61968/metering/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61968/metering/table_end_device_functions.py +18 -0
- zepben/ewb/database/sqlite/tables/iec61968/metering/table_end_devices.py +19 -0
- zepben/ewb/database/sqlite/tables/iec61968/metering/table_meters.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61968/metering/table_usage_points.py +23 -0
- zepben/ewb/database/sqlite/tables/iec61968/operations/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61968/operations/table_operational_restrictions.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/auxiliaryequipment/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/auxiliaryequipment/table_auxiliary_equipment.py +18 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/auxiliaryequipment/table_current_transformers.py +21 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/auxiliaryequipment/table_fault_indicators.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/auxiliaryequipment/table_potential_transformers.py +21 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/auxiliaryequipment/table_sensors.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_ac_dc_terminals.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_base_voltages.py +20 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_conducting_equipment.py +18 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_connectivity_node_containers.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_connectivity_nodes.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_curve_data.py +46 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_curves.py +17 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_equipment.py +20 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_equipment_containers.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_feeders.py +28 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_geographical_regions.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_identified_objects.py +29 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_name_types.py +28 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_names.py +36 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_power_system_resources.py +19 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_sub_geographical_regions.py +27 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_substations.py +27 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_terminals.py +35 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/diagramlayout/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/diagramlayout/table_diagram_object_points.py +35 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/diagramlayout/table_diagram_objects.py +31 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/diagramlayout/table_diagrams.py +21 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/equivalents/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/equivalents/table_equivalent_branches.py +35 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/equivalents/table_equivalent_equipment.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/generation/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/generation/production/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/generation/production/table_battery_units.py +22 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/generation/production/table_photo_voltaic_units.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/generation/production/table_power_electronics_units.py +26 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/generation/production/table_power_electronics_wind_units.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/meas/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/meas/table_accumulators.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/meas/table_analogs.py +20 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/meas/table_controls.py +20 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/meas/table_discretes.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/meas/table_io_points.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/meas/table_measurements.py +30 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/protection/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/protection/table_current_relays.py +22 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/scada/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/scada/table_remote_controls.py +20 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/scada/table_remote_points.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/scada/table_remote_sources.py +20 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_ac_line_segments.py +20 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_breakers.py +20 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_busbar_sections.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_clamps.py +23 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_conductors.py +21 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_connectors.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_cuts.py +23 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_disconnectors.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_earth_fault_compensators.py +22 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_energy_connections.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_energy_consumer_phases.py +37 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_energy_consumers.py +26 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_energy_source_phases.py +33 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_energy_sources.py +44 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_fuses.py +20 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_ground_disconnectors.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_grounding_impedances.py +24 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_grounds.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_jumpers.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_junctions.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_linear_shunt_compensators.py +23 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_lines.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_load_break_switches.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_per_length_impedances.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_per_length_line_parameters.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_per_length_phase_impedances.py +18 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_per_length_sequence_impedances.py +27 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_petersen_coils.py +27 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_phase_impedance_data.py +52 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_power_electronics_connection_phases.py +30 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_power_electronics_connections.py +50 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_power_transformer_ends.py +43 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_power_transformers.py +24 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_protected_switches.py +18 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_ratio_tap_changers.py +28 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_reactive_capability_curves.py +18 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_reclosers.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_regulating_cond_eq.py +19 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_regulating_controls.py +29 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_rotating_machines.py +36 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_series_compensators.py +25 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_shunt_compensators.py +22 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_static_var_compensator.py +24 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_switches.py +21 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_synchronous_machines.py +95 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_tap_changer_controls.py +28 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_tap_changers.py +25 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_transformer_ends.py +30 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_transformer_star_impedances.py +32 -0
- zepben/ewb/database/sqlite/tables/iec61970/infiec61970/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61970/infiec61970/feeder/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61970/infiec61970/feeder/table_circuits.py +27 -0
- zepben/ewb/database/sqlite/tables/sqlite_table.py +45 -0
- zepben/ewb/database/sqlite/tables/table_metadata_data_sources.py +21 -0
- zepben/ewb/database/sqlite/tables/table_version.py +39 -0
- zepben/ewb/dataclassy/__init__.py +15 -0
- zepben/ewb/dataclassy/dataclass.py +192 -0
- zepben/ewb/dataclassy/decorator.py +35 -0
- zepben/ewb/dataclassy/functions.py +80 -0
- zepben/ewb/examples/__init__.py +6 -0
- zepben/ewb/examples/simple_test_network.py +158 -0
- zepben/ewb/exceptions.py +52 -0
- zepben/ewb/model/__init__.py +4 -0
- zepben/ewb/model/busbranch/__init__.py +4 -0
- zepben/ewb/model/busbranch/bus_branch.py +1051 -0
- zepben/ewb/model/cim/__init__.py +4 -0
- zepben/ewb/model/cim/extensions/__init__.py +4 -0
- zepben/ewb/model/cim/extensions/iec61968/__init__.py +4 -0
- zepben/ewb/model/cim/extensions/iec61968/assetinfo/__init__.py +4 -0
- zepben/ewb/model/cim/extensions/iec61968/assetinfo/relay_info.py +128 -0
- zepben/ewb/model/cim/extensions/iec61968/metering/__init__.py +4 -0
- zepben/ewb/model/cim/extensions/iec61968/metering/pan_demand_reponse_function.py +112 -0
- zepben/ewb/model/cim/extensions/iec61970/__init__.py +4 -0
- zepben/ewb/model/cim/extensions/iec61970/base/__init__.py +4 -0
- zepben/ewb/model/cim/extensions/iec61970/base/core/__init__.py +4 -0
- zepben/ewb/model/cim/extensions/iec61970/base/core/site.py +37 -0
- zepben/ewb/model/cim/extensions/iec61970/base/feeder/__init__.py +4 -0
- zepben/ewb/model/cim/extensions/iec61970/base/feeder/loop.py +207 -0
- zepben/ewb/model/cim/extensions/iec61970/base/feeder/lv_feeder.py +258 -0
- zepben/ewb/model/cim/extensions/iec61970/base/generation/__init__.py +4 -0
- zepben/ewb/model/cim/extensions/iec61970/base/generation/production/__init__.py +4 -0
- zepben/ewb/model/cim/extensions/iec61970/base/generation/production/ev_charging_unit.py +18 -0
- zepben/ewb/model/cim/extensions/iec61970/base/protection/__init__.py +4 -0
- zepben/ewb/model/cim/extensions/iec61970/base/protection/distance_relay.py +69 -0
- zepben/ewb/model/cim/extensions/iec61970/base/protection/power_direction_kind.py +36 -0
- zepben/ewb/model/cim/extensions/iec61970/base/protection/protection_kind.py +112 -0
- zepben/ewb/model/cim/extensions/iec61970/base/protection/protection_relay_function.py +448 -0
- zepben/ewb/model/cim/extensions/iec61970/base/protection/protection_relay_scheme.py +97 -0
- zepben/ewb/model/cim/extensions/iec61970/base/protection/protection_relay_system.py +97 -0
- zepben/ewb/model/cim/extensions/iec61970/base/protection/relay_setting.py +35 -0
- zepben/ewb/model/cim/extensions/iec61970/base/protection/voltage_relay.py +20 -0
- zepben/ewb/model/cim/extensions/iec61970/base/wires/__init__.py +4 -0
- zepben/ewb/model/cim/extensions/iec61970/base/wires/battery_control.py +36 -0
- zepben/ewb/model/cim/extensions/iec61970/base/wires/battery_control_mode.py +83 -0
- zepben/ewb/model/cim/extensions/iec61970/base/wires/transformer_cooling_type.py +57 -0
- zepben/ewb/model/cim/extensions/iec61970/base/wires/transformer_end_rated_s.py +26 -0
- zepben/ewb/model/cim/extensions/iec61970/base/wires/vector_group.py +293 -0
- zepben/ewb/model/cim/extensions/zbex.py +17 -0
- zepben/ewb/model/cim/iec61968/__init__.py +4 -0
- zepben/ewb/model/cim/iec61968/assetinfo/__init__.py +4 -0
- zepben/ewb/model/cim/iec61968/assetinfo/cable_info.py +15 -0
- zepben/ewb/model/cim/iec61968/assetinfo/no_load_test.py +42 -0
- zepben/ewb/model/cim/iec61968/assetinfo/open_circuit_test.py +42 -0
- zepben/ewb/model/cim/iec61968/assetinfo/overhead_wire_info.py +15 -0
- zepben/ewb/model/cim/iec61968/assetinfo/power_transformer_info.py +103 -0
- zepben/ewb/model/cim/iec61968/assetinfo/short_circuit_test.py +67 -0
- zepben/ewb/model/cim/iec61968/assetinfo/shunt_compensator_info.py +26 -0
- zepben/ewb/model/cim/iec61968/assetinfo/switch_info.py +17 -0
- zepben/ewb/model/cim/iec61968/assetinfo/transformer_end_info.py +137 -0
- zepben/ewb/model/cim/iec61968/assetinfo/transformer_tank_info.py +108 -0
- zepben/ewb/model/cim/iec61968/assetinfo/transformer_test.py +26 -0
- zepben/ewb/model/cim/iec61968/assetinfo/wire_info.py +24 -0
- zepben/ewb/model/cim/iec61968/assetinfo/wire_material_kind.py +57 -0
- zepben/ewb/model/cim/iec61968/assets/__init__.py +4 -0
- zepben/ewb/model/cim/iec61968/assets/asset.py +154 -0
- zepben/ewb/model/cim/iec61968/assets/asset_container.py +16 -0
- zepben/ewb/model/cim/iec61968/assets/asset_function.py +15 -0
- zepben/ewb/model/cim/iec61968/assets/asset_info.py +19 -0
- zepben/ewb/model/cim/iec61968/assets/asset_organisation_role.py +13 -0
- zepben/ewb/model/cim/iec61968/assets/asset_owner.py +13 -0
- zepben/ewb/model/cim/iec61968/assets/streetlight.py +29 -0
- zepben/ewb/model/cim/iec61968/assets/structure.py +16 -0
- zepben/ewb/model/cim/iec61968/common/__init__.py +4 -0
- zepben/ewb/model/cim/iec61968/common/agreement.py +16 -0
- zepben/ewb/model/cim/iec61968/common/document.py +36 -0
- zepben/ewb/model/cim/iec61968/common/location.py +129 -0
- zepben/ewb/model/cim/iec61968/common/organisation.py +15 -0
- zepben/ewb/model/cim/iec61968/common/organisation_role.py +22 -0
- zepben/ewb/model/cim/iec61968/common/position_point.py +44 -0
- zepben/ewb/model/cim/iec61968/common/street_address.py +28 -0
- zepben/ewb/model/cim/iec61968/common/street_detail.py +46 -0
- zepben/ewb/model/cim/iec61968/common/town_detail.py +25 -0
- zepben/ewb/model/cim/iec61968/customers/__init__.py +4 -0
- zepben/ewb/model/cim/iec61968/customers/customer.py +93 -0
- zepben/ewb/model/cim/iec61968/customers/customer_agreement.py +107 -0
- zepben/ewb/model/cim/iec61968/customers/customer_kind.py +69 -0
- zepben/ewb/model/cim/iec61968/customers/pricing_structure.py +88 -0
- zepben/ewb/model/cim/iec61968/customers/tariff.py +18 -0
- zepben/ewb/model/cim/iec61968/infiec61968/__init__.py +4 -0
- zepben/ewb/model/cim/iec61968/infiec61968/infassetinfo/__init__.py +4 -0
- zepben/ewb/model/cim/iec61968/infiec61968/infassetinfo/current_transformer_info.py +51 -0
- zepben/ewb/model/cim/iec61968/infiec61968/infassetinfo/potential_transformer_info.py +33 -0
- zepben/ewb/model/cim/iec61968/infiec61968/infassetinfo/transformer_construction_kind.py +69 -0
- zepben/ewb/model/cim/iec61968/infiec61968/infassetinfo/transformer_function_kind.py +45 -0
- zepben/ewb/model/cim/iec61968/infiec61968/infassets/__init__.py +4 -0
- zepben/ewb/model/cim/iec61968/infiec61968/infassets/pole.py +87 -0
- zepben/ewb/model/cim/iec61968/infiec61968/infassets/streetlight_lamp_kind.py +27 -0
- zepben/ewb/model/cim/iec61968/infiec61968/infcommon/__init__.py +4 -0
- zepben/ewb/model/cim/iec61968/infiec61968/infcommon/ratio.py +34 -0
- zepben/ewb/model/cim/iec61968/metering/__init__.py +4 -0
- zepben/ewb/model/cim/iec61968/metering/controlled_appliance.py +152 -0
- zepben/ewb/model/cim/iec61968/metering/end_device.py +165 -0
- zepben/ewb/model/cim/iec61968/metering/end_device_function.py +17 -0
- zepben/ewb/model/cim/iec61968/metering/end_device_function_kind.py +48 -0
- zepben/ewb/model/cim/iec61968/metering/meter.py +28 -0
- zepben/ewb/model/cim/iec61968/metering/usage_point.py +186 -0
- zepben/ewb/model/cim/iec61968/operations/__init__.py +4 -0
- zepben/ewb/model/cim/iec61968/operations/operational_restriction.py +92 -0
- zepben/ewb/model/cim/iec61970/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/base/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/base/auxiliaryequipment/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/base/auxiliaryequipment/auxiliary_equipment.py +24 -0
- zepben/ewb/model/cim/iec61970/base/auxiliaryequipment/current_transformer.py +37 -0
- zepben/ewb/model/cim/iec61970/base/auxiliaryequipment/fault_indicator.py +18 -0
- zepben/ewb/model/cim/iec61970/base/auxiliaryequipment/potential_transformer.py +38 -0
- zepben/ewb/model/cim/iec61970/base/auxiliaryequipment/potential_transformer_kind.py +30 -0
- zepben/ewb/model/cim/iec61970/base/auxiliaryequipment/sensor.py +92 -0
- zepben/ewb/model/cim/iec61970/base/core/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/base/core/ac_dc_terminal.py +16 -0
- zepben/ewb/model/cim/iec61970/base/core/base_voltage.py +17 -0
- zepben/ewb/model/cim/iec61970/base/core/conducting_equipment.py +198 -0
- zepben/ewb/model/cim/iec61970/base/core/connectivity_node.py +105 -0
- zepben/ewb/model/cim/iec61970/base/core/connectivity_node_container.py +15 -0
- zepben/ewb/model/cim/iec61970/base/core/curve.py +125 -0
- zepben/ewb/model/cim/iec61970/base/core/curve_data.py +29 -0
- zepben/ewb/model/cim/iec61970/base/core/equipment.py +366 -0
- zepben/ewb/model/cim/iec61970/base/core/equipment_container.py +199 -0
- zepben/ewb/model/cim/iec61970/base/core/feeder.py +260 -0
- zepben/ewb/model/cim/iec61970/base/core/geographical_region.py +82 -0
- zepben/ewb/model/cim/iec61970/base/core/identified_object.py +239 -0
- zepben/ewb/model/cim/iec61970/base/core/name.py +36 -0
- zepben/ewb/model/cim/iec61970/base/core/name_type.py +203 -0
- zepben/ewb/model/cim/iec61970/base/core/phase_code.py +202 -0
- zepben/ewb/model/cim/iec61970/base/core/power_system_resource.py +106 -0
- zepben/ewb/model/cim/iec61970/base/core/sub_geographical_region.py +93 -0
- zepben/ewb/model/cim/iec61970/base/core/substation.py +277 -0
- zepben/ewb/model/cim/iec61970/base/core/terminal.py +171 -0
- zepben/ewb/model/cim/iec61970/base/diagramlayout/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/base/diagramlayout/diagram.py +109 -0
- zepben/ewb/model/cim/iec61970/base/diagramlayout/diagram_object.py +160 -0
- zepben/ewb/model/cim/iec61970/base/diagramlayout/diagram_object_point.py +25 -0
- zepben/ewb/model/cim/iec61970/base/diagramlayout/diagram_style.py +28 -0
- zepben/ewb/model/cim/iec61970/base/diagramlayout/orientation_kind.py +29 -0
- zepben/ewb/model/cim/iec61970/base/domain/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/base/domain/unit_symbol.py +494 -0
- zepben/ewb/model/cim/iec61970/base/equivalents/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/base/equivalents/equivalent_branch.py +113 -0
- zepben/ewb/model/cim/iec61970/base/equivalents/equivalent_equipment.py +15 -0
- zepben/ewb/model/cim/iec61970/base/generation/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/base/generation/production/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/base/generation/production/battery_state_kind.py +39 -0
- zepben/ewb/model/cim/iec61970/base/generation/production/battery_unit.py +108 -0
- zepben/ewb/model/cim/iec61970/base/generation/production/photo_voltaic_unit.py +13 -0
- zepben/ewb/model/cim/iec61970/base/generation/production/power_electronics_unit.py +28 -0
- zepben/ewb/model/cim/iec61970/base/generation/production/power_electronics_wind_unit.py +13 -0
- zepben/ewb/model/cim/iec61970/base/meas/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/base/meas/accumulator.py +13 -0
- zepben/ewb/model/cim/iec61970/base/meas/accumulator_value.py +20 -0
- zepben/ewb/model/cim/iec61970/base/meas/analog.py +18 -0
- zepben/ewb/model/cim/iec61970/base/meas/analog_value.py +20 -0
- zepben/ewb/model/cim/iec61970/base/meas/control.py +26 -0
- zepben/ewb/model/cim/iec61970/base/meas/discrete.py +13 -0
- zepben/ewb/model/cim/iec61970/base/meas/discrete_value.py +20 -0
- zepben/ewb/model/cim/iec61970/base/meas/iopoint.py +16 -0
- zepben/ewb/model/cim/iec61970/base/meas/measurement.py +60 -0
- zepben/ewb/model/cim/iec61970/base/meas/measurement_value.py +21 -0
- zepben/ewb/model/cim/iec61970/base/protection/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/base/protection/current_relay.py +23 -0
- zepben/ewb/model/cim/iec61970/base/scada/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/base/scada/remote_control.py +22 -0
- zepben/ewb/model/cim/iec61970/base/scada/remote_point.py +16 -0
- zepben/ewb/model/cim/iec61970/base/scada/remote_source.py +22 -0
- zepben/ewb/model/cim/iec61970/base/wires/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/base/wires/ac_line_segment.py +214 -0
- zepben/ewb/model/cim/iec61970/base/wires/breaker.py +32 -0
- zepben/ewb/model/cim/iec61970/base/wires/busbar_section.py +19 -0
- zepben/ewb/model/cim/iec61970/base/wires/clamp.py +32 -0
- zepben/ewb/model/cim/iec61970/base/wires/conductor.py +49 -0
- zepben/ewb/model/cim/iec61970/base/wires/connector.py +16 -0
- zepben/ewb/model/cim/iec61970/base/wires/cut.py +36 -0
- zepben/ewb/model/cim/iec61970/base/wires/disconnector.py +17 -0
- zepben/ewb/model/cim/iec61970/base/wires/earth_fault_compensator.py +21 -0
- zepben/ewb/model/cim/iec61970/base/wires/energy_connection.py +15 -0
- zepben/ewb/model/cim/iec61970/base/wires/energy_consumer.py +107 -0
- zepben/ewb/model/cim/iec61970/base/wires/energy_consumer_phase.py +56 -0
- zepben/ewb/model/cim/iec61970/base/wires/energy_source.py +172 -0
- zepben/ewb/model/cim/iec61970/base/wires/energy_source_phase.py +45 -0
- zepben/ewb/model/cim/iec61970/base/wires/fuse.py +23 -0
- zepben/ewb/model/cim/iec61970/base/wires/ground.py +15 -0
- zepben/ewb/model/cim/iec61970/base/wires/ground_disconnector.py +15 -0
- zepben/ewb/model/cim/iec61970/base/wires/grounding_impedance.py +19 -0
- zepben/ewb/model/cim/iec61970/base/wires/jumper.py +16 -0
- zepben/ewb/model/cim/iec61970/base/wires/junction.py +15 -0
- zepben/ewb/model/cim/iec61970/base/wires/line.py +13 -0
- zepben/ewb/model/cim/iec61970/base/wires/linear_shunt_compensator.py +26 -0
- zepben/ewb/model/cim/iec61970/base/wires/load_break_switch.py +14 -0
- zepben/ewb/model/cim/iec61970/base/wires/per_length_impedance.py +13 -0
- zepben/ewb/model/cim/iec61970/base/wires/per_length_line_parameter.py +13 -0
- zepben/ewb/model/cim/iec61970/base/wires/per_length_phase_impedance.py +99 -0
- zepben/ewb/model/cim/iec61970/base/wires/per_length_sequence_impedance.py +43 -0
- zepben/ewb/model/cim/iec61970/base/wires/petersen_coil.py +22 -0
- zepben/ewb/model/cim/iec61970/base/wires/phase_impedance_data.py +37 -0
- zepben/ewb/model/cim/iec61970/base/wires/phase_shunt_connection_kind.py +40 -0
- zepben/ewb/model/cim/iec61970/base/wires/power_electronics_connection.py +524 -0
- zepben/ewb/model/cim/iec61970/base/wires/power_electronics_connection_phase.py +34 -0
- zepben/ewb/model/cim/iec61970/base/wires/power_transformer.py +217 -0
- zepben/ewb/model/cim/iec61970/base/wires/power_transformer_end.py +208 -0
- zepben/ewb/model/cim/iec61970/base/wires/protected_switch.py +96 -0
- zepben/ewb/model/cim/iec61970/base/wires/ratio_tap_changer.py +30 -0
- zepben/ewb/model/cim/iec61970/base/wires/reactive_capability_curve.py +16 -0
- zepben/ewb/model/cim/iec61970/base/wires/recloser.py +15 -0
- zepben/ewb/model/cim/iec61970/base/wires/regulating_cond_eq.py +45 -0
- zepben/ewb/model/cim/iec61970/base/wires/regulating_control.py +173 -0
- zepben/ewb/model/cim/iec61970/base/wires/regulating_control_mode_kind.py +48 -0
- zepben/ewb/model/cim/iec61970/base/wires/rotating_machine.py +36 -0
- zepben/ewb/model/cim/iec61970/base/wires/series_compensator.py +42 -0
- zepben/ewb/model/cim/iec61970/base/wires/shunt_compensator.py +59 -0
- zepben/ewb/model/cim/iec61970/base/wires/single_phase_kind.py +107 -0
- zepben/ewb/model/cim/iec61970/base/wires/static_var_compensator.py +40 -0
- zepben/ewb/model/cim/iec61970/base/wires/svc_control_mode.py +30 -0
- zepben/ewb/model/cim/iec61970/base/wires/switch.py +119 -0
- zepben/ewb/model/cim/iec61970/base/wires/synchronous_machine.py +168 -0
- zepben/ewb/model/cim/iec61970/base/wires/synchronous_machine_kind.py +46 -0
- zepben/ewb/model/cim/iec61970/base/wires/tap_changer.py +150 -0
- zepben/ewb/model/cim/iec61970/base/wires/tap_changer_control.py +49 -0
- zepben/ewb/model/cim/iec61970/base/wires/transformer_end.py +73 -0
- zepben/ewb/model/cim/iec61970/base/wires/transformer_star_impedance.py +48 -0
- zepben/ewb/model/cim/iec61970/base/wires/winding_connection.py +45 -0
- zepben/ewb/model/cim/iec61970/infiec61970/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/infiec61970/feeder/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/infiec61970/feeder/circuit.py +144 -0
- zepben/ewb/model/phases.py +168 -0
- zepben/ewb/model/resistance_reactance.py +40 -0
- zepben/ewb/services/__init__.py +4 -0
- zepben/ewb/services/common/__init__.py +16 -0
- zepben/ewb/services/common/base_service.py +383 -0
- zepben/ewb/services/common/base_service_comparator.py +394 -0
- zepben/ewb/services/common/difference.py +47 -0
- zepben/ewb/services/common/enum_mapper.py +55 -0
- zepben/ewb/services/common/meta/__init__.py +4 -0
- zepben/ewb/services/common/meta/data_source.py +16 -0
- zepben/ewb/services/common/meta/metadata_collection.py +28 -0
- zepben/ewb/services/common/meta/metadata_translations.py +47 -0
- zepben/ewb/services/common/meta/service_info.py +22 -0
- zepben/ewb/services/common/reference_resolvers.py +374 -0
- zepben/ewb/services/common/resolver.py +597 -0
- zepben/ewb/services/common/translator/__init__.py +4 -0
- zepben/ewb/services/common/translator/base_cim2proto.py +115 -0
- zepben/ewb/services/common/translator/base_proto2cim.py +146 -0
- zepben/ewb/services/common/translator/service_differences.py +81 -0
- zepben/ewb/services/common/translator/util.py +75 -0
- zepben/ewb/services/customer/__init__.py +4 -0
- zepben/ewb/services/customer/customer_service_comparator.py +52 -0
- zepben/ewb/services/customer/customers.py +23 -0
- zepben/ewb/services/customer/translator/__init__.py +21 -0
- zepben/ewb/services/customer/translator/customer_cim2proto.py +71 -0
- zepben/ewb/services/customer/translator/customer_enum_mappers.py +18 -0
- zepben/ewb/services/customer/translator/customer_proto2cim.py +87 -0
- zepben/ewb/services/diagram/__init__.py +4 -0
- zepben/ewb/services/diagram/diagram_service_comparator.py +39 -0
- zepben/ewb/services/diagram/diagrams.py +107 -0
- zepben/ewb/services/diagram/translator/__init__.py +11 -0
- zepben/ewb/services/diagram/translator/diagram_cim2proto.py +51 -0
- zepben/ewb/services/diagram/translator/diagram_enum_mappers.py +21 -0
- zepben/ewb/services/diagram/translator/diagram_proto2cim.py +61 -0
- zepben/ewb/services/measurement/__init__.py +4 -0
- zepben/ewb/services/measurement/measurements.py +35 -0
- zepben/ewb/services/measurement/translator/__init__.py +6 -0
- zepben/ewb/services/measurement/translator/measurement_cim2proto.py +42 -0
- zepben/ewb/services/measurement/translator/measurement_proto2cim.py +52 -0
- zepben/ewb/services/network/__init__.py +4 -0
- zepben/ewb/services/network/network_extensions.py +119 -0
- zepben/ewb/services/network/network_service.py +302 -0
- zepben/ewb/services/network/network_service_comparator.py +1322 -0
- zepben/ewb/services/network/network_state.py +36 -0
- zepben/ewb/services/network/tracing/__init__.py +4 -0
- zepben/ewb/services/network/tracing/busbranch_trace.py +36 -0
- zepben/ewb/services/network/tracing/connectivity/__init__.py +4 -0
- zepben/ewb/services/network/tracing/connectivity/connectivity_result.py +105 -0
- zepben/ewb/services/network/tracing/connectivity/nominal_phase_path.py +23 -0
- zepben/ewb/services/network/tracing/connectivity/phase_paths.py +70 -0
- zepben/ewb/services/network/tracing/connectivity/terminal_connectivity_connected.py +226 -0
- zepben/ewb/services/network/tracing/connectivity/terminal_connectivity_internal.py +64 -0
- zepben/ewb/services/network/tracing/connectivity/transformer_phase_paths.py +202 -0
- zepben/ewb/services/network/tracing/connectivity/xy_candidate_phase_paths.py +235 -0
- zepben/ewb/services/network/tracing/connectivity/xy_phase_step.py +24 -0
- zepben/ewb/services/network/tracing/feeder/__init__.py +4 -0
- zepben/ewb/services/network/tracing/feeder/assign_to_feeders.py +202 -0
- zepben/ewb/services/network/tracing/feeder/assign_to_lv_feeders.py +202 -0
- zepben/ewb/services/network/tracing/feeder/clear_direction.py +80 -0
- zepben/ewb/services/network/tracing/feeder/direction_status.py +133 -0
- zepben/ewb/services/network/tracing/feeder/feeder_direction.py +107 -0
- zepben/ewb/services/network/tracing/feeder/set_direction.py +143 -0
- zepben/ewb/services/network/tracing/find_swer_equipment.py +175 -0
- zepben/ewb/services/network/tracing/networktrace/__init__.py +4 -0
- zepben/ewb/services/network/tracing/networktrace/actions/__init__.py +4 -0
- zepben/ewb/services/network/tracing/networktrace/actions/equipment_tree_builder.py +104 -0
- zepben/ewb/services/network/tracing/networktrace/actions/tree_node.py +35 -0
- zepben/ewb/services/network/tracing/networktrace/compute_data.py +60 -0
- zepben/ewb/services/network/tracing/networktrace/conditions/__init__.py +4 -0
- zepben/ewb/services/network/tracing/networktrace/conditions/conditions.py +73 -0
- zepben/ewb/services/network/tracing/networktrace/conditions/direction_condition.py +63 -0
- zepben/ewb/services/network/tracing/networktrace/conditions/equipment_step_limit_condition.py +26 -0
- zepben/ewb/services/network/tracing/networktrace/conditions/equipment_type_step_limit_condition.py +44 -0
- zepben/ewb/services/network/tracing/networktrace/conditions/network_trace_queue_condition.py +67 -0
- zepben/ewb/services/network/tracing/networktrace/conditions/network_trace_stop_condition.py +65 -0
- zepben/ewb/services/network/tracing/networktrace/conditions/open_condition.py +39 -0
- zepben/ewb/services/network/tracing/networktrace/network_trace.py +433 -0
- zepben/ewb/services/network/tracing/networktrace/network_trace_action_type.py +42 -0
- zepben/ewb/services/network/tracing/networktrace/network_trace_queue_next.py +84 -0
- zepben/ewb/services/network/tracing/networktrace/network_trace_step.py +128 -0
- zepben/ewb/services/network/tracing/networktrace/network_trace_step_path_provider.py +351 -0
- zepben/ewb/services/network/tracing/networktrace/network_trace_tracker.py +39 -0
- zepben/ewb/services/network/tracing/networktrace/operators/__init__.py +14 -0
- zepben/ewb/services/network/tracing/networktrace/operators/equipment_container_state_operators.py +264 -0
- zepben/ewb/services/network/tracing/networktrace/operators/feeder_direction_state_operations.py +181 -0
- zepben/ewb/services/network/tracing/networktrace/operators/in_service_state_operators.py +76 -0
- zepben/ewb/services/network/tracing/networktrace/operators/network_state_operators.py +120 -0
- zepben/ewb/services/network/tracing/networktrace/operators/open_state_operators.py +104 -0
- zepben/ewb/services/network/tracing/networktrace/operators/phase_state_operators.py +56 -0
- zepben/ewb/services/network/tracing/networktrace/tracing.py +132 -0
- zepben/ewb/services/network/tracing/phases/__init__.py +4 -0
- zepben/ewb/services/network/tracing/phases/phase_inferrer.py +205 -0
- zepben/ewb/services/network/tracing/phases/phase_status.py +101 -0
- zepben/ewb/services/network/tracing/phases/remove_phases.py +143 -0
- zepben/ewb/services/network/tracing/phases/set_phases.py +490 -0
- zepben/ewb/services/network/tracing/traversal/__init__.py +4 -0
- zepben/ewb/services/network/tracing/traversal/context_value_computer.py +63 -0
- zepben/ewb/services/network/tracing/traversal/debug_logging.py +124 -0
- zepben/ewb/services/network/tracing/traversal/queue.py +112 -0
- zepben/ewb/services/network/tracing/traversal/queue_condition.py +75 -0
- zepben/ewb/services/network/tracing/traversal/step_action.py +83 -0
- zepben/ewb/services/network/tracing/traversal/step_context.py +59 -0
- zepben/ewb/services/network/tracing/traversal/stop_condition.py +57 -0
- zepben/ewb/services/network/tracing/traversal/traversal.py +634 -0
- zepben/ewb/services/network/tracing/traversal/traversal_condition.py +22 -0
- zepben/ewb/services/network/tracing/traversal/weighted_priority_queue.py +85 -0
- zepben/ewb/services/network/tracing/util.py +93 -0
- zepben/ewb/services/network/translator/__init__.py +392 -0
- zepben/ewb/services/network/translator/network_cim2proto.py +1867 -0
- zepben/ewb/services/network/translator/network_enum_mappers.py +78 -0
- zepben/ewb/services/network/translator/network_proto2cim.py +2201 -0
- zepben/ewb/services/services.py +48 -0
- zepben/ewb/streaming/__init__.py +4 -0
- zepben/ewb/streaming/data/__init__.py +4 -0
- zepben/ewb/streaming/data/current_state_event.py +314 -0
- zepben/ewb/streaming/data/current_state_event_batch.py +25 -0
- zepben/ewb/streaming/data/set_current_states_status.py +286 -0
- zepben/ewb/streaming/exceptions.py +14 -0
- zepben/ewb/streaming/get/__init__.py +4 -0
- zepben/ewb/streaming/get/consumer.py +209 -0
- zepben/ewb/streaming/get/customer_consumer.py +111 -0
- zepben/ewb/streaming/get/diagram_consumer.py +107 -0
- zepben/ewb/streaming/get/hierarchy/__init__.py +4 -0
- zepben/ewb/streaming/get/hierarchy/data.py +27 -0
- zepben/ewb/streaming/get/included_energized_containers.py +36 -0
- zepben/ewb/streaming/get/included_energizing_containers.py +36 -0
- zepben/ewb/streaming/get/network_consumer.py +870 -0
- zepben/ewb/streaming/get/query_network_state_client.py +64 -0
- zepben/ewb/streaming/get/query_network_state_service.py +94 -0
- zepben/ewb/streaming/grpc/__init__.py +4 -0
- zepben/ewb/streaming/grpc/auth_token_plugin.py +24 -0
- zepben/ewb/streaming/grpc/connect.py +209 -0
- zepben/ewb/streaming/grpc/grpc.py +107 -0
- zepben/ewb/streaming/grpc/grpc_channel_builder.py +190 -0
- zepben/ewb/streaming/mutations/__init__.py +4 -0
- zepben/ewb/streaming/mutations/update_network_state_client.py +80 -0
- zepben/ewb/streaming/mutations/update_network_state_service.py +61 -0
- zepben/ewb/testing/__init__.py +4 -0
- zepben/ewb/testing/test_network_builder.py +816 -0
- zepben/ewb/types.py +17 -0
- zepben/ewb/util.py +200 -0
- zepben_ewb-1.0.0.dist-info/METADATA +90 -0
- zepben_ewb-1.0.0.dist-info/RECORD +641 -0
- zepben_ewb-1.0.0.dist-info/WHEEL +5 -0
- zepben_ewb-1.0.0.dist-info/licenses/LICENSE +374 -0
- zepben_ewb-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,1867 @@
|
|
|
1
|
+
# Copyright 2024 Zeppelin Bend Pty Ltd
|
|
2
|
+
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
3
|
+
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
|
+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
|
|
6
|
+
__all__ = [
|
|
7
|
+
"CimTranslationException", "cable_info_to_pb", "no_load_test_to_pb", "open_circuit_test_to_pb", "overhead_wire_info_to_pb", "power_transformer_info_to_pb",
|
|
8
|
+
"short_circuit_test_to_pb", "shunt_compensator_info_to_pb", "switch_info_to_pb", "transformer_end_info_to_pb", "transformer_tank_info_to_pb",
|
|
9
|
+
"transformer_test_to_pb", "wire_info_to_pb", "asset_to_pb", "asset_container_to_pb", "asset_info_to_pb", "asset_organisation_role_to_pb",
|
|
10
|
+
"asset_owner_to_pb", "pole_to_pb", "streetlight_to_pb", "structure_to_pb", "location_to_pb", "position_point_to_pb", "street_address_to_pb",
|
|
11
|
+
"street_detail_to_pb", "town_detail_to_pb", "relay_info_to_pb", "current_transformer_info_to_pb", "potential_transformer_info_to_pb",
|
|
12
|
+
"ratio_to_pb", "end_device_to_pb", "meter_to_pb", "usage_point_to_pb", "operational_restriction_to_pb", "auxiliary_equipment_to_pb",
|
|
13
|
+
"current_transformer_to_pb", "fault_indicator_to_pb", "potential_transformer_to_pb", "sensor_to_pb", "ac_dc_terminal_to_pb", "base_voltage_to_pb",
|
|
14
|
+
"conducting_equipment_to_pb", "connectivity_node_to_pb", "connectivity_node_container_to_pb", "equipment_to_pb", "equipment_container_to_pb",
|
|
15
|
+
"feeder_to_pb", "geographical_region_to_pb", "power_system_resource_to_pb", "site_to_pb", "sub_geographical_region_to_pb", "substation_to_pb",
|
|
16
|
+
"terminal_to_pb", "equivalent_branch_to_pb", "equivalent_equipment_to_pb", "accumulator_to_pb", "analog_to_pb", "control_to_pb", "discrete_to_pb",
|
|
17
|
+
"io_point_to_pb", "measurement_to_pb", "current_relay_to_pb", "distance_relay_to_pb", "voltage_relay_to_pb", "remote_control_to_pb", "remote_point_to_pb",
|
|
18
|
+
"remote_source_to_pb", "battery_unit_to_pb", "photo_voltaic_unit_to_pb", "power_electronics_unit_to_pb", "power_electronics_wind_unit_to_pb",
|
|
19
|
+
"ac_line_segment_to_pb", "breaker_to_pb", "conductor_to_pb", "connector_to_pb", "disconnector_to_pb", "energy_connection_to_pb", "energy_consumer_to_pb",
|
|
20
|
+
"energy_consumer_phase_to_pb", "energy_source_to_pb", "energy_source_phase_to_pb", "fuse_to_pb", "jumper_to_pb", "junction_to_pb", "busbar_section_to_pb",
|
|
21
|
+
"line_to_pb", "linear_shunt_compensator_to_pb", "load_break_switch_to_pb", "per_length_line_parameter_to_pb", "per_length_impedance_to_pb",
|
|
22
|
+
"per_length_sequence_impedance_to_pb", "power_electronics_connection_to_pb", "power_electronics_connection_phase_to_pb", "power_transformer_to_pb",
|
|
23
|
+
"power_transformer_end_to_pb", "protected_switch_to_pb", "ratio_tap_changer_to_pb", "recloser_to_pb", "regulating_cond_eq_to_pb", "shunt_compensator_to_pb",
|
|
24
|
+
"switch_to_pb", "tap_changer_to_pb", "transformer_end_to_pb", "transformer_star_impedance_to_pb", "circuit_to_pb", "loop_to_pb", "lv_feeder_to_pb",
|
|
25
|
+
"ev_charging_unit", "transformer_end_rated_s_to_pb", "tap_changer_control_to_pb", "regulating_control_to_pb", "protection_relay_function_to_pb",
|
|
26
|
+
"protection_relay_scheme_to_pb", "protection_relay_system_to_pb", "relay_setting_to_pb", "ground_to_pb", "ground_disconnector_to_pb",
|
|
27
|
+
"series_compensator_to_pb", "pan_demand_response_function_to_pb", "battery_control_to_pb", "asset_function_to_pb", "end_device_function_to_pb",
|
|
28
|
+
"static_var_compensator_to_pb", "per_length_phase_impedance_to_pb", "phase_impedance_data_to_pb",
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
from typing import Any, Optional
|
|
32
|
+
|
|
33
|
+
# noinspection PyPackageRequirements,PyUnresolvedReferences
|
|
34
|
+
from google.protobuf.timestamp_pb2 import Timestamp as PBTimestamp
|
|
35
|
+
from zepben.protobuf.cim.extensions.iec61968.assetinfo.RelayInfo_pb2 import RelayInfo as PBRelayInfo
|
|
36
|
+
from zepben.protobuf.cim.extensions.iec61968.metering.PanDemandResponseFunction_pb2 import PanDemandResponseFunction as PBPanDemandResponseFunction
|
|
37
|
+
from zepben.protobuf.cim.extensions.iec61970.base.core.Site_pb2 import Site as PBSite
|
|
38
|
+
from zepben.protobuf.cim.extensions.iec61970.base.feeder.Loop_pb2 import Loop as PBLoop
|
|
39
|
+
from zepben.protobuf.cim.extensions.iec61970.base.feeder.LvFeeder_pb2 import LvFeeder as PBLvFeeder
|
|
40
|
+
from zepben.protobuf.cim.extensions.iec61970.base.generation.production.EvChargingUnit_pb2 import EvChargingUnit as PBEvChargingUnit
|
|
41
|
+
from zepben.protobuf.cim.extensions.iec61970.base.protection.DistanceRelay_pb2 import DistanceRelay as PBDistanceRelay
|
|
42
|
+
from zepben.protobuf.cim.extensions.iec61970.base.protection.ProtectionRelayFunction_pb2 import ProtectionRelayFunction as PBProtectionRelayFunction
|
|
43
|
+
from zepben.protobuf.cim.extensions.iec61970.base.protection.ProtectionRelayScheme_pb2 import ProtectionRelayScheme as PBProtectionRelayScheme
|
|
44
|
+
from zepben.protobuf.cim.extensions.iec61970.base.protection.ProtectionRelaySystem_pb2 import ProtectionRelaySystem as PBProtectionRelaySystem
|
|
45
|
+
from zepben.protobuf.cim.extensions.iec61970.base.protection.RelaySetting_pb2 import RelaySetting as PBRelaySetting
|
|
46
|
+
from zepben.protobuf.cim.extensions.iec61970.base.protection.VoltageRelay_pb2 import VoltageRelay as PBVoltageRelay
|
|
47
|
+
from zepben.protobuf.cim.extensions.iec61970.base.wires.BatteryControl_pb2 import BatteryControl as PBBatteryControl
|
|
48
|
+
from zepben.protobuf.cim.extensions.iec61970.base.wires.TransformerEndRatedS_pb2 import TransformerEndRatedS as PBTransformerEndRatedS
|
|
49
|
+
from zepben.protobuf.cim.iec61968.assetinfo.CableInfo_pb2 import CableInfo as PBCableInfo
|
|
50
|
+
from zepben.protobuf.cim.iec61968.assetinfo.NoLoadTest_pb2 import NoLoadTest as PBNoLoadTest
|
|
51
|
+
from zepben.protobuf.cim.iec61968.assetinfo.OpenCircuitTest_pb2 import OpenCircuitTest as PBOpenCircuitTest
|
|
52
|
+
from zepben.protobuf.cim.iec61968.assetinfo.OverheadWireInfo_pb2 import OverheadWireInfo as PBOverheadWireInfo
|
|
53
|
+
from zepben.protobuf.cim.iec61968.assetinfo.PowerTransformerInfo_pb2 import PowerTransformerInfo as PBPowerTransformerInfo
|
|
54
|
+
from zepben.protobuf.cim.iec61968.assetinfo.ShortCircuitTest_pb2 import ShortCircuitTest as PBShortCircuitTest
|
|
55
|
+
from zepben.protobuf.cim.iec61968.assetinfo.ShuntCompensatorInfo_pb2 import ShuntCompensatorInfo as PBShuntCompensatorInfo
|
|
56
|
+
from zepben.protobuf.cim.iec61968.assetinfo.SwitchInfo_pb2 import SwitchInfo as PBSwitchInfo
|
|
57
|
+
from zepben.protobuf.cim.iec61968.assetinfo.TransformerEndInfo_pb2 import TransformerEndInfo as PBTransformerEndInfo
|
|
58
|
+
from zepben.protobuf.cim.iec61968.assetinfo.TransformerTankInfo_pb2 import TransformerTankInfo as PBTransformerTankInfo
|
|
59
|
+
from zepben.protobuf.cim.iec61968.assetinfo.TransformerTest_pb2 import TransformerTest as PBTransformerTest
|
|
60
|
+
from zepben.protobuf.cim.iec61968.assetinfo.WireInfo_pb2 import WireInfo as PBWireInfo
|
|
61
|
+
from zepben.protobuf.cim.iec61968.assets.AssetContainer_pb2 import AssetContainer as PBAssetContainer
|
|
62
|
+
from zepben.protobuf.cim.iec61968.assets.AssetFunction_pb2 import AssetFunction as PBAssetFunction
|
|
63
|
+
from zepben.protobuf.cim.iec61968.assets.AssetInfo_pb2 import AssetInfo as PBAssetInfo
|
|
64
|
+
from zepben.protobuf.cim.iec61968.assets.AssetOrganisationRole_pb2 import AssetOrganisationRole as PBAssetOrganisationRole
|
|
65
|
+
from zepben.protobuf.cim.iec61968.assets.AssetOwner_pb2 import AssetOwner as PBAssetOwner
|
|
66
|
+
from zepben.protobuf.cim.iec61968.assets.Asset_pb2 import Asset as PBAsset
|
|
67
|
+
from zepben.protobuf.cim.iec61968.assets.Streetlight_pb2 import Streetlight as PBStreetlight
|
|
68
|
+
from zepben.protobuf.cim.iec61968.assets.Structure_pb2 import Structure as PBStructure
|
|
69
|
+
from zepben.protobuf.cim.iec61968.common.Location_pb2 import Location as PBLocation
|
|
70
|
+
from zepben.protobuf.cim.iec61968.common.PositionPoint_pb2 import PositionPoint as PBPositionPoint
|
|
71
|
+
from zepben.protobuf.cim.iec61968.common.StreetAddress_pb2 import StreetAddress as PBStreetAddress
|
|
72
|
+
from zepben.protobuf.cim.iec61968.common.StreetDetail_pb2 import StreetDetail as PBStreetDetail
|
|
73
|
+
from zepben.protobuf.cim.iec61968.common.TownDetail_pb2 import TownDetail as PBTownDetail
|
|
74
|
+
from zepben.protobuf.cim.iec61968.infiec61968.infassetinfo.CurrentTransformerInfo_pb2 import CurrentTransformerInfo as PBCurrentTransformerInfo
|
|
75
|
+
from zepben.protobuf.cim.iec61968.infiec61968.infassetinfo.PotentialTransformerInfo_pb2 import PotentialTransformerInfo as PBPotentialTransformerInfo
|
|
76
|
+
from zepben.protobuf.cim.iec61968.infiec61968.infassets.Pole_pb2 import Pole as PBPole
|
|
77
|
+
from zepben.protobuf.cim.iec61968.infiec61968.infcommon.Ratio_pb2 import Ratio as PBRatio
|
|
78
|
+
from zepben.protobuf.cim.iec61968.metering.EndDeviceFunction_pb2 import EndDeviceFunction as PBEndDeviceFunction
|
|
79
|
+
from zepben.protobuf.cim.iec61968.metering.EndDevice_pb2 import EndDevice as PBEndDevice
|
|
80
|
+
from zepben.protobuf.cim.iec61968.metering.Meter_pb2 import Meter as PBMeter
|
|
81
|
+
from zepben.protobuf.cim.iec61968.metering.UsagePoint_pb2 import UsagePoint as PBUsagePoint
|
|
82
|
+
from zepben.protobuf.cim.iec61968.operations.OperationalRestriction_pb2 import OperationalRestriction as PBOperationalRestriction
|
|
83
|
+
from zepben.protobuf.cim.iec61970.base.auxiliaryequipment.AuxiliaryEquipment_pb2 import AuxiliaryEquipment as PBAuxiliaryEquipment
|
|
84
|
+
from zepben.protobuf.cim.iec61970.base.auxiliaryequipment.CurrentTransformer_pb2 import CurrentTransformer as PBCurrentTransformer
|
|
85
|
+
from zepben.protobuf.cim.iec61970.base.auxiliaryequipment.FaultIndicator_pb2 import FaultIndicator as PBFaultIndicator
|
|
86
|
+
from zepben.protobuf.cim.iec61970.base.auxiliaryequipment.PotentialTransformer_pb2 import PotentialTransformer as PBPotentialTransformer
|
|
87
|
+
from zepben.protobuf.cim.iec61970.base.auxiliaryequipment.Sensor_pb2 import Sensor as PBSensor
|
|
88
|
+
from zepben.protobuf.cim.iec61970.base.core.AcDcTerminal_pb2 import AcDcTerminal as PBAcDcTerminal
|
|
89
|
+
from zepben.protobuf.cim.iec61970.base.core.BaseVoltage_pb2 import BaseVoltage as PBBaseVoltage
|
|
90
|
+
from zepben.protobuf.cim.iec61970.base.core.ConductingEquipment_pb2 import ConductingEquipment as PBConductingEquipment
|
|
91
|
+
from zepben.protobuf.cim.iec61970.base.core.ConnectivityNodeContainer_pb2 import ConnectivityNodeContainer as PBConnectivityNodeContainer
|
|
92
|
+
from zepben.protobuf.cim.iec61970.base.core.ConnectivityNode_pb2 import ConnectivityNode as PBConnectivityNode
|
|
93
|
+
from zepben.protobuf.cim.iec61970.base.core.CurveData_pb2 import CurveData as PBCurveData
|
|
94
|
+
from zepben.protobuf.cim.iec61970.base.core.Curve_pb2 import Curve as PBCurve
|
|
95
|
+
from zepben.protobuf.cim.iec61970.base.core.EquipmentContainer_pb2 import EquipmentContainer as PBEquipmentContainer
|
|
96
|
+
from zepben.protobuf.cim.iec61970.base.core.Equipment_pb2 import Equipment as PBEquipment
|
|
97
|
+
from zepben.protobuf.cim.iec61970.base.core.Feeder_pb2 import Feeder as PBFeeder
|
|
98
|
+
from zepben.protobuf.cim.iec61970.base.core.GeographicalRegion_pb2 import GeographicalRegion as PBGeographicalRegion
|
|
99
|
+
from zepben.protobuf.cim.iec61970.base.core.PowerSystemResource_pb2 import PowerSystemResource as PBPowerSystemResource
|
|
100
|
+
from zepben.protobuf.cim.iec61970.base.core.SubGeographicalRegion_pb2 import SubGeographicalRegion as PBSubGeographicalRegion
|
|
101
|
+
from zepben.protobuf.cim.iec61970.base.core.Substation_pb2 import Substation as PBSubstation
|
|
102
|
+
from zepben.protobuf.cim.iec61970.base.core.Terminal_pb2 import Terminal as PBTerminal
|
|
103
|
+
from zepben.protobuf.cim.iec61970.base.equivalents.EquivalentBranch_pb2 import EquivalentBranch as PBEquivalentBranch
|
|
104
|
+
from zepben.protobuf.cim.iec61970.base.equivalents.EquivalentEquipment_pb2 import EquivalentEquipment as PBEquivalentEquipment
|
|
105
|
+
from zepben.protobuf.cim.iec61970.base.generation.production.BatteryUnit_pb2 import BatteryUnit as PBBatteryUnit
|
|
106
|
+
from zepben.protobuf.cim.iec61970.base.generation.production.PhotoVoltaicUnit_pb2 import PhotoVoltaicUnit as PBPhotoVoltaicUnit
|
|
107
|
+
from zepben.protobuf.cim.iec61970.base.generation.production.PowerElectronicsUnit_pb2 import PowerElectronicsUnit as PBPowerElectronicsUnit
|
|
108
|
+
from zepben.protobuf.cim.iec61970.base.generation.production.PowerElectronicsWindUnit_pb2 import PowerElectronicsWindUnit as PBPowerElectronicsWindUnit
|
|
109
|
+
from zepben.protobuf.cim.iec61970.base.meas.Accumulator_pb2 import Accumulator as PBAccumulator
|
|
110
|
+
from zepben.protobuf.cim.iec61970.base.meas.Analog_pb2 import Analog as PBAnalog
|
|
111
|
+
from zepben.protobuf.cim.iec61970.base.meas.Control_pb2 import Control as PBControl
|
|
112
|
+
from zepben.protobuf.cim.iec61970.base.meas.Discrete_pb2 import Discrete as PBDiscrete
|
|
113
|
+
from zepben.protobuf.cim.iec61970.base.meas.IoPoint_pb2 import IoPoint as PBIoPoint
|
|
114
|
+
from zepben.protobuf.cim.iec61970.base.meas.Measurement_pb2 import Measurement as PBMeasurement
|
|
115
|
+
from zepben.protobuf.cim.iec61970.base.protection.CurrentRelay_pb2 import CurrentRelay as PBCurrentRelay
|
|
116
|
+
from zepben.protobuf.cim.iec61970.base.scada.RemoteControl_pb2 import RemoteControl as PBRemoteControl
|
|
117
|
+
from zepben.protobuf.cim.iec61970.base.scada.RemotePoint_pb2 import RemotePoint as PBRemotePoint
|
|
118
|
+
from zepben.protobuf.cim.iec61970.base.scada.RemoteSource_pb2 import RemoteSource as PBRemoteSource
|
|
119
|
+
from zepben.protobuf.cim.iec61970.base.wires.AcLineSegment_pb2 import AcLineSegment as PBAcLineSegment
|
|
120
|
+
from zepben.protobuf.cim.iec61970.base.wires.Breaker_pb2 import Breaker as PBBreaker
|
|
121
|
+
from zepben.protobuf.cim.iec61970.base.wires.BusbarSection_pb2 import BusbarSection as PBBusbarSection
|
|
122
|
+
from zepben.protobuf.cim.iec61970.base.wires.Clamp_pb2 import Clamp as PBClamp
|
|
123
|
+
from zepben.protobuf.cim.iec61970.base.wires.Conductor_pb2 import Conductor as PBConductor
|
|
124
|
+
from zepben.protobuf.cim.iec61970.base.wires.Connector_pb2 import Connector as PBConnector
|
|
125
|
+
from zepben.protobuf.cim.iec61970.base.wires.Cut_pb2 import Cut as PBCut
|
|
126
|
+
from zepben.protobuf.cim.iec61970.base.wires.Disconnector_pb2 import Disconnector as PBDisconnector
|
|
127
|
+
from zepben.protobuf.cim.iec61970.base.wires.EarthFaultCompensator_pb2 import EarthFaultCompensator as PBEarthFaultCompensator
|
|
128
|
+
from zepben.protobuf.cim.iec61970.base.wires.EnergyConnection_pb2 import EnergyConnection as PBEnergyConnection
|
|
129
|
+
from zepben.protobuf.cim.iec61970.base.wires.EnergyConsumerPhase_pb2 import EnergyConsumerPhase as PBEnergyConsumerPhase
|
|
130
|
+
from zepben.protobuf.cim.iec61970.base.wires.EnergyConsumer_pb2 import EnergyConsumer as PBEnergyConsumer
|
|
131
|
+
from zepben.protobuf.cim.iec61970.base.wires.EnergySourcePhase_pb2 import EnergySourcePhase as PBEnergySourcePhase
|
|
132
|
+
from zepben.protobuf.cim.iec61970.base.wires.EnergySource_pb2 import EnergySource as PBEnergySource
|
|
133
|
+
from zepben.protobuf.cim.iec61970.base.wires.Fuse_pb2 import Fuse as PBFuse
|
|
134
|
+
from zepben.protobuf.cim.iec61970.base.wires.GroundDisconnector_pb2 import GroundDisconnector as PBGroundDisconnector
|
|
135
|
+
from zepben.protobuf.cim.iec61970.base.wires.Ground_pb2 import Ground as PBGround
|
|
136
|
+
from zepben.protobuf.cim.iec61970.base.wires.GroundingImpedance_pb2 import GroundingImpedance as PBGroundingImpedance
|
|
137
|
+
from zepben.protobuf.cim.iec61970.base.wires.Jumper_pb2 import Jumper as PBJumper
|
|
138
|
+
from zepben.protobuf.cim.iec61970.base.wires.Junction_pb2 import Junction as PBJunction
|
|
139
|
+
from zepben.protobuf.cim.iec61970.base.wires.Line_pb2 import Line as PBLine
|
|
140
|
+
from zepben.protobuf.cim.iec61970.base.wires.LinearShuntCompensator_pb2 import LinearShuntCompensator as PBLinearShuntCompensator
|
|
141
|
+
from zepben.protobuf.cim.iec61970.base.wires.LoadBreakSwitch_pb2 import LoadBreakSwitch as PBLoadBreakSwitch
|
|
142
|
+
from zepben.protobuf.cim.iec61970.base.wires.PerLengthImpedance_pb2 import PerLengthImpedance as PBPerLengthImpedance
|
|
143
|
+
from zepben.protobuf.cim.iec61970.base.wires.PerLengthLineParameter_pb2 import PerLengthLineParameter as PBPerLengthLineParameter
|
|
144
|
+
from zepben.protobuf.cim.iec61970.base.wires.PerLengthPhaseImpedance_pb2 import PerLengthPhaseImpedance as PBPerLengthPhaseImpedance
|
|
145
|
+
from zepben.protobuf.cim.iec61970.base.wires.PerLengthSequenceImpedance_pb2 import PerLengthSequenceImpedance as PBPerLengthSequenceImpedance
|
|
146
|
+
from zepben.protobuf.cim.iec61970.base.wires.PetersenCoil_pb2 import PetersenCoil as PBPetersenCoil
|
|
147
|
+
from zepben.protobuf.cim.iec61970.base.wires.PhaseImpedanceData_pb2 import PhaseImpedanceData as PBPhaseImpedanceData
|
|
148
|
+
from zepben.protobuf.cim.iec61970.base.wires.PowerElectronicsConnectionPhase_pb2 import PowerElectronicsConnectionPhase as PBPowerElectronicsConnectionPhase
|
|
149
|
+
from zepben.protobuf.cim.iec61970.base.wires.PowerElectronicsConnection_pb2 import PowerElectronicsConnection as PBPowerElectronicsConnection
|
|
150
|
+
from zepben.protobuf.cim.iec61970.base.wires.PowerTransformerEnd_pb2 import PowerTransformerEnd as PBPowerTransformerEnd
|
|
151
|
+
from zepben.protobuf.cim.iec61970.base.wires.PowerTransformer_pb2 import PowerTransformer as PBPowerTransformer
|
|
152
|
+
from zepben.protobuf.cim.iec61970.base.wires.ProtectedSwitch_pb2 import ProtectedSwitch as PBProtectedSwitch
|
|
153
|
+
from zepben.protobuf.cim.iec61970.base.wires.RatioTapChanger_pb2 import RatioTapChanger as PBRatioTapChanger
|
|
154
|
+
from zepben.protobuf.cim.iec61970.base.wires.ReactiveCapabilityCurve_pb2 import ReactiveCapabilityCurve as PBReactiveCapabilityCurve
|
|
155
|
+
from zepben.protobuf.cim.iec61970.base.wires.Recloser_pb2 import Recloser as PBRecloser
|
|
156
|
+
from zepben.protobuf.cim.iec61970.base.wires.RegulatingCondEq_pb2 import RegulatingCondEq as PBRegulatingCondEq
|
|
157
|
+
from zepben.protobuf.cim.iec61970.base.wires.RegulatingControl_pb2 import RegulatingControl as PBRegulatingControl
|
|
158
|
+
from zepben.protobuf.cim.iec61970.base.wires.RotatingMachine_pb2 import RotatingMachine as PBRotatingMachine
|
|
159
|
+
from zepben.protobuf.cim.iec61970.base.wires.SeriesCompensator_pb2 import SeriesCompensator as PBSeriesCompensator
|
|
160
|
+
from zepben.protobuf.cim.iec61970.base.wires.ShuntCompensator_pb2 import ShuntCompensator as PBShuntCompensator
|
|
161
|
+
from zepben.protobuf.cim.iec61970.base.wires.StaticVarCompensator_pb2 import StaticVarCompensator as PBStaticVarCompensator
|
|
162
|
+
from zepben.protobuf.cim.iec61970.base.wires.Switch_pb2 import Switch as PBSwitch
|
|
163
|
+
from zepben.protobuf.cim.iec61970.base.wires.SynchronousMachine_pb2 import SynchronousMachine as PBSynchronousMachine
|
|
164
|
+
from zepben.protobuf.cim.iec61970.base.wires.TapChangerControl_pb2 import TapChangerControl as PBTapChangerControl
|
|
165
|
+
from zepben.protobuf.cim.iec61970.base.wires.TapChanger_pb2 import TapChanger as PBTapChanger
|
|
166
|
+
from zepben.protobuf.cim.iec61970.base.wires.TransformerEnd_pb2 import TransformerEnd as PBTransformerEnd
|
|
167
|
+
from zepben.protobuf.cim.iec61970.base.wires.TransformerStarImpedance_pb2 import TransformerStarImpedance as PBTransformerStarImpedance
|
|
168
|
+
from zepben.protobuf.cim.iec61970.infiec61970.feeder.Circuit_pb2 import Circuit as PBCircuit
|
|
169
|
+
|
|
170
|
+
from zepben.ewb.model.cim.extensions.iec61968.assetinfo.relay_info import *
|
|
171
|
+
from zepben.ewb.model.cim.extensions.iec61968.metering.pan_demand_reponse_function import *
|
|
172
|
+
from zepben.ewb.model.cim.extensions.iec61970.base.core.site import *
|
|
173
|
+
from zepben.ewb.model.cim.extensions.iec61970.base.feeder.loop import *
|
|
174
|
+
from zepben.ewb.model.cim.extensions.iec61970.base.feeder.lv_feeder import *
|
|
175
|
+
from zepben.ewb.model.cim.extensions.iec61970.base.generation.production.ev_charging_unit import *
|
|
176
|
+
from zepben.ewb.model.cim.extensions.iec61970.base.protection.distance_relay import *
|
|
177
|
+
from zepben.ewb.model.cim.extensions.iec61970.base.protection.protection_relay_function import *
|
|
178
|
+
from zepben.ewb.model.cim.extensions.iec61970.base.protection.protection_relay_scheme import *
|
|
179
|
+
from zepben.ewb.model.cim.extensions.iec61970.base.protection.protection_relay_system import *
|
|
180
|
+
from zepben.ewb.model.cim.extensions.iec61970.base.protection.relay_setting import *
|
|
181
|
+
from zepben.ewb.model.cim.extensions.iec61970.base.protection.voltage_relay import *
|
|
182
|
+
from zepben.ewb.model.cim.extensions.iec61970.base.wires.battery_control import *
|
|
183
|
+
from zepben.ewb.model.cim.extensions.iec61970.base.wires.transformer_end_rated_s import *
|
|
184
|
+
from zepben.ewb.model.cim.iec61968.assetinfo.cable_info import *
|
|
185
|
+
from zepben.ewb.model.cim.iec61968.assetinfo.no_load_test import *
|
|
186
|
+
from zepben.ewb.model.cim.iec61968.assetinfo.open_circuit_test import *
|
|
187
|
+
from zepben.ewb.model.cim.iec61968.assetinfo.overhead_wire_info import *
|
|
188
|
+
from zepben.ewb.model.cim.iec61968.assetinfo.power_transformer_info import *
|
|
189
|
+
from zepben.ewb.model.cim.iec61968.assetinfo.short_circuit_test import *
|
|
190
|
+
from zepben.ewb.model.cim.iec61968.assetinfo.shunt_compensator_info import *
|
|
191
|
+
from zepben.ewb.model.cim.iec61968.assetinfo.switch_info import *
|
|
192
|
+
from zepben.ewb.model.cim.iec61968.assetinfo.transformer_end_info import *
|
|
193
|
+
from zepben.ewb.model.cim.iec61968.assetinfo.transformer_tank_info import *
|
|
194
|
+
from zepben.ewb.model.cim.iec61968.assetinfo.transformer_test import *
|
|
195
|
+
from zepben.ewb.model.cim.iec61968.assetinfo.wire_info import *
|
|
196
|
+
from zepben.ewb.model.cim.iec61968.assets.asset import *
|
|
197
|
+
from zepben.ewb.model.cim.iec61968.assets.asset_container import *
|
|
198
|
+
from zepben.ewb.model.cim.iec61968.assets.asset_function import *
|
|
199
|
+
from zepben.ewb.model.cim.iec61968.assets.asset_info import *
|
|
200
|
+
from zepben.ewb.model.cim.iec61968.assets.asset_organisation_role import *
|
|
201
|
+
from zepben.ewb.model.cim.iec61968.assets.asset_owner import *
|
|
202
|
+
from zepben.ewb.model.cim.iec61968.assets.streetlight import *
|
|
203
|
+
from zepben.ewb.model.cim.iec61968.assets.structure import *
|
|
204
|
+
from zepben.ewb.model.cim.iec61968.common.location import *
|
|
205
|
+
from zepben.ewb.model.cim.iec61968.common.position_point import *
|
|
206
|
+
from zepben.ewb.model.cim.iec61968.common.street_address import *
|
|
207
|
+
from zepben.ewb.model.cim.iec61968.common.street_detail import *
|
|
208
|
+
from zepben.ewb.model.cim.iec61968.common.town_detail import *
|
|
209
|
+
from zepben.ewb.model.cim.iec61968.infiec61968.infassetinfo.current_transformer_info import *
|
|
210
|
+
from zepben.ewb.model.cim.iec61968.infiec61968.infassetinfo.potential_transformer_info import *
|
|
211
|
+
from zepben.ewb.model.cim.iec61968.infiec61968.infassets.pole import *
|
|
212
|
+
from zepben.ewb.model.cim.iec61968.infiec61968.infcommon.ratio import *
|
|
213
|
+
from zepben.ewb.model.cim.iec61968.metering.end_device import *
|
|
214
|
+
from zepben.ewb.model.cim.iec61968.metering.end_device_function import *
|
|
215
|
+
from zepben.ewb.model.cim.iec61968.metering.meter import *
|
|
216
|
+
from zepben.ewb.model.cim.iec61968.metering.usage_point import *
|
|
217
|
+
from zepben.ewb.model.cim.iec61968.operations.operational_restriction import *
|
|
218
|
+
from zepben.ewb.model.cim.iec61970.base.auxiliaryequipment.auxiliary_equipment import *
|
|
219
|
+
from zepben.ewb.model.cim.iec61970.base.auxiliaryequipment.current_transformer import *
|
|
220
|
+
from zepben.ewb.model.cim.iec61970.base.auxiliaryequipment.fault_indicator import *
|
|
221
|
+
from zepben.ewb.model.cim.iec61970.base.auxiliaryequipment.potential_transformer import *
|
|
222
|
+
from zepben.ewb.model.cim.iec61970.base.auxiliaryequipment.sensor import *
|
|
223
|
+
from zepben.ewb.model.cim.iec61970.base.core.ac_dc_terminal import *
|
|
224
|
+
from zepben.ewb.model.cim.iec61970.base.core.base_voltage import *
|
|
225
|
+
from zepben.ewb.model.cim.iec61970.base.core.conducting_equipment import *
|
|
226
|
+
from zepben.ewb.model.cim.iec61970.base.core.connectivity_node import *
|
|
227
|
+
from zepben.ewb.model.cim.iec61970.base.core.connectivity_node_container import *
|
|
228
|
+
from zepben.ewb.model.cim.iec61970.base.core.curve import *
|
|
229
|
+
from zepben.ewb.model.cim.iec61970.base.core.curve_data import *
|
|
230
|
+
from zepben.ewb.model.cim.iec61970.base.core.equipment import *
|
|
231
|
+
from zepben.ewb.model.cim.iec61970.base.core.equipment_container import *
|
|
232
|
+
from zepben.ewb.model.cim.iec61970.base.core.feeder import *
|
|
233
|
+
from zepben.ewb.model.cim.iec61970.base.core.geographical_region import *
|
|
234
|
+
from zepben.ewb.model.cim.iec61970.base.core.power_system_resource import *
|
|
235
|
+
from zepben.ewb.model.cim.iec61970.base.core.sub_geographical_region import *
|
|
236
|
+
from zepben.ewb.model.cim.iec61970.base.core.substation import *
|
|
237
|
+
from zepben.ewb.model.cim.iec61970.base.core.terminal import *
|
|
238
|
+
from zepben.ewb.model.cim.iec61970.base.equivalents.equivalent_branch import *
|
|
239
|
+
from zepben.ewb.model.cim.iec61970.base.equivalents.equivalent_equipment import *
|
|
240
|
+
from zepben.ewb.model.cim.iec61970.base.generation.production.battery_unit import *
|
|
241
|
+
from zepben.ewb.model.cim.iec61970.base.generation.production.photo_voltaic_unit import *
|
|
242
|
+
from zepben.ewb.model.cim.iec61970.base.generation.production.power_electronics_unit import *
|
|
243
|
+
from zepben.ewb.model.cim.iec61970.base.generation.production.power_electronics_wind_unit import *
|
|
244
|
+
from zepben.ewb.model.cim.iec61970.base.meas.accumulator import *
|
|
245
|
+
from zepben.ewb.model.cim.iec61970.base.meas.analog import *
|
|
246
|
+
from zepben.ewb.model.cim.iec61970.base.meas.control import *
|
|
247
|
+
from zepben.ewb.model.cim.iec61970.base.meas.discrete import *
|
|
248
|
+
from zepben.ewb.model.cim.iec61970.base.meas.iopoint import *
|
|
249
|
+
from zepben.ewb.model.cim.iec61970.base.meas.measurement import *
|
|
250
|
+
from zepben.ewb.model.cim.iec61970.base.protection.current_relay import *
|
|
251
|
+
from zepben.ewb.model.cim.iec61970.base.scada.remote_control import *
|
|
252
|
+
from zepben.ewb.model.cim.iec61970.base.scada.remote_point import *
|
|
253
|
+
from zepben.ewb.model.cim.iec61970.base.scada.remote_source import *
|
|
254
|
+
from zepben.ewb.model.cim.iec61970.base.wires.ac_line_segment import *
|
|
255
|
+
from zepben.ewb.model.cim.iec61970.base.wires.breaker import *
|
|
256
|
+
from zepben.ewb.model.cim.iec61970.base.wires.busbar_section import *
|
|
257
|
+
from zepben.ewb.model.cim.iec61970.base.wires.clamp import *
|
|
258
|
+
from zepben.ewb.model.cim.iec61970.base.wires.conductor import *
|
|
259
|
+
from zepben.ewb.model.cim.iec61970.base.wires.connector import *
|
|
260
|
+
from zepben.ewb.model.cim.iec61970.base.wires.cut import *
|
|
261
|
+
from zepben.ewb.model.cim.iec61970.base.wires.disconnector import *
|
|
262
|
+
from zepben.ewb.model.cim.iec61970.base.wires.earth_fault_compensator import *
|
|
263
|
+
from zepben.ewb.model.cim.iec61970.base.wires.energy_connection import *
|
|
264
|
+
from zepben.ewb.model.cim.iec61970.base.wires.energy_consumer import *
|
|
265
|
+
from zepben.ewb.model.cim.iec61970.base.wires.energy_consumer_phase import *
|
|
266
|
+
from zepben.ewb.model.cim.iec61970.base.wires.energy_source import *
|
|
267
|
+
from zepben.ewb.model.cim.iec61970.base.wires.energy_source_phase import *
|
|
268
|
+
from zepben.ewb.model.cim.iec61970.base.wires.fuse import *
|
|
269
|
+
from zepben.ewb.model.cim.iec61970.base.wires.ground import *
|
|
270
|
+
from zepben.ewb.model.cim.iec61970.base.wires.ground_disconnector import *
|
|
271
|
+
from zepben.ewb.model.cim.iec61970.base.wires.grounding_impedance import *
|
|
272
|
+
from zepben.ewb.model.cim.iec61970.base.wires.jumper import *
|
|
273
|
+
from zepben.ewb.model.cim.iec61970.base.wires.junction import *
|
|
274
|
+
from zepben.ewb.model.cim.iec61970.base.wires.line import *
|
|
275
|
+
from zepben.ewb.model.cim.iec61970.base.wires.linear_shunt_compensator import *
|
|
276
|
+
from zepben.ewb.model.cim.iec61970.base.wires.load_break_switch import *
|
|
277
|
+
from zepben.ewb.model.cim.iec61970.base.wires.per_length_impedance import *
|
|
278
|
+
from zepben.ewb.model.cim.iec61970.base.wires.per_length_line_parameter import *
|
|
279
|
+
from zepben.ewb.model.cim.iec61970.base.wires.per_length_phase_impedance import *
|
|
280
|
+
from zepben.ewb.model.cim.iec61970.base.wires.per_length_sequence_impedance import *
|
|
281
|
+
from zepben.ewb.model.cim.iec61970.base.wires.petersen_coil import *
|
|
282
|
+
from zepben.ewb.model.cim.iec61970.base.wires.phase_impedance_data import *
|
|
283
|
+
from zepben.ewb.model.cim.iec61970.base.wires.power_electronics_connection import *
|
|
284
|
+
from zepben.ewb.model.cim.iec61970.base.wires.power_electronics_connection_phase import *
|
|
285
|
+
from zepben.ewb.model.cim.iec61970.base.wires.power_transformer import *
|
|
286
|
+
from zepben.ewb.model.cim.iec61970.base.wires.power_transformer_end import *
|
|
287
|
+
from zepben.ewb.model.cim.iec61970.base.wires.protected_switch import *
|
|
288
|
+
from zepben.ewb.model.cim.iec61970.base.wires.ratio_tap_changer import *
|
|
289
|
+
from zepben.ewb.model.cim.iec61970.base.wires.reactive_capability_curve import *
|
|
290
|
+
from zepben.ewb.model.cim.iec61970.base.wires.recloser import *
|
|
291
|
+
from zepben.ewb.model.cim.iec61970.base.wires.regulating_cond_eq import *
|
|
292
|
+
from zepben.ewb.model.cim.iec61970.base.wires.regulating_control import *
|
|
293
|
+
from zepben.ewb.model.cim.iec61970.base.wires.rotating_machine import *
|
|
294
|
+
from zepben.ewb.model.cim.iec61970.base.wires.series_compensator import *
|
|
295
|
+
from zepben.ewb.model.cim.iec61970.base.wires.shunt_compensator import *
|
|
296
|
+
from zepben.ewb.model.cim.iec61970.base.wires.static_var_compensator import *
|
|
297
|
+
from zepben.ewb.model.cim.iec61970.base.wires.switch import *
|
|
298
|
+
from zepben.ewb.model.cim.iec61970.base.wires.synchronous_machine import *
|
|
299
|
+
from zepben.ewb.model.cim.iec61970.base.wires.tap_changer import *
|
|
300
|
+
from zepben.ewb.model.cim.iec61970.base.wires.tap_changer_control import *
|
|
301
|
+
from zepben.ewb.model.cim.iec61970.base.wires.transformer_end import *
|
|
302
|
+
from zepben.ewb.model.cim.iec61970.base.wires.transformer_star_impedance import *
|
|
303
|
+
from zepben.ewb.model.cim.iec61970.infiec61970.feeder.circuit import *
|
|
304
|
+
from zepben.ewb.services.common.translator.base_cim2proto import identified_object_to_pb, organisation_role_to_pb, document_to_pb, bind_to_pb, set_or_null
|
|
305
|
+
from zepben.ewb.services.common.translator.util import mrid_or_empty, from_nullable_int, from_nullable_float, from_nullable_long, from_nullable_uint, \
|
|
306
|
+
nullable_bool_settings
|
|
307
|
+
# noinspection PyProtectedMember
|
|
308
|
+
from zepben.ewb.services.network.translator.network_enum_mappers import _map_battery_control_mode, _map_battery_state_kind, _map_end_device_function_kind, \
|
|
309
|
+
_map_feeder_direction, _map_phase_code, _map_phase_shunt_connection_kind, _map_potential_transformer_kind, _map_power_direction_kind, _map_protection_kind, \
|
|
310
|
+
_map_regulating_control_mode_kind, _map_single_phase_kind, _map_streetlight_lamp_kind, _map_svc_control_mode, _map_synchronous_machine_kind, \
|
|
311
|
+
_map_transformer_construction_kind, _map_transformer_cooling_type, _map_transformer_function_kind, _map_unit_symbol, _map_vector_group, \
|
|
312
|
+
_map_winding_connection, _map_wire_material_kind
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
def _get_or_none(getter, obj) -> Optional[Any]:
|
|
316
|
+
return getter(obj) if obj else None
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
class CimTranslationException(Exception):
|
|
320
|
+
pass
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
##################################
|
|
324
|
+
# Extensions IEC61968 Asset Info #
|
|
325
|
+
##################################
|
|
326
|
+
|
|
327
|
+
@bind_to_pb
|
|
328
|
+
def relay_info_to_pb(cim: RelayInfo) -> PBRelayInfo:
|
|
329
|
+
return PBRelayInfo(
|
|
330
|
+
ai=asset_info_to_pb(cim),
|
|
331
|
+
recloseDelays=cim.reclose_delays,
|
|
332
|
+
**set_or_null(
|
|
333
|
+
curveSetting=cim.curve_setting,
|
|
334
|
+
recloseFast=cim.reclose_fast,
|
|
335
|
+
)
|
|
336
|
+
)
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
################################
|
|
340
|
+
# Extensions IEC61968 Metering #
|
|
341
|
+
################################
|
|
342
|
+
|
|
343
|
+
@bind_to_pb
|
|
344
|
+
def pan_demand_response_function_to_pb(cim: PanDemandResponseFunction) -> PBPanDemandResponseFunction:
|
|
345
|
+
"""
|
|
346
|
+
Convert the :class:`PanDemandResponseFunction` into its protobuf counterpart.
|
|
347
|
+
:param cim: The :class:`PanDemandResponseFunction` to convert.
|
|
348
|
+
:return: The protobuf builder.
|
|
349
|
+
"""
|
|
350
|
+
# noinspection PyProtectedMember
|
|
351
|
+
return PBPanDemandResponseFunction(
|
|
352
|
+
edf=end_device_function_to_pb(cim),
|
|
353
|
+
kind=_map_end_device_function_kind.to_pb(cim.kind),
|
|
354
|
+
**set_or_null(
|
|
355
|
+
appliance=cim._appliance_bitmask
|
|
356
|
+
)
|
|
357
|
+
)
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
#################################
|
|
361
|
+
# Extensions IEC61970 Base Core #
|
|
362
|
+
#################################
|
|
363
|
+
|
|
364
|
+
@bind_to_pb
|
|
365
|
+
def site_to_pb(cim: Site) -> PBSite:
|
|
366
|
+
return PBSite(ec=equipment_container_to_pb(cim))
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
###################################
|
|
370
|
+
# Extensions IEC61970 Base Feeder #
|
|
371
|
+
###################################
|
|
372
|
+
|
|
373
|
+
@bind_to_pb
|
|
374
|
+
def loop_to_pb(cim: Loop) -> PBLoop:
|
|
375
|
+
return PBLoop(
|
|
376
|
+
io=identified_object_to_pb(cim),
|
|
377
|
+
circuitMRIDs=[str(io.mrid) for io in cim.circuits],
|
|
378
|
+
substationMRIDs=[str(io.mrid) for io in cim.substations],
|
|
379
|
+
normalEnergizingSubstationMRIDs=[str(io.mrid) for io in cim.energizing_substations]
|
|
380
|
+
)
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
@bind_to_pb
|
|
384
|
+
def lv_feeder_to_pb(cim: LvFeeder) -> PBLvFeeder:
|
|
385
|
+
return PBLvFeeder(
|
|
386
|
+
ec=equipment_container_to_pb(cim),
|
|
387
|
+
normalHeadTerminalMRID=mrid_or_empty(cim.normal_head_terminal),
|
|
388
|
+
normalEnergizingFeederMRIDs=[str(io.mrid) for io in cim.normal_energizing_feeders],
|
|
389
|
+
currentlyEnergizingFeederMRIDs=[str(io.mrid) for io in cim.current_energizing_feeders]
|
|
390
|
+
)
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
##################################################
|
|
394
|
+
# Extensions IEC61970 Base Generation Production #
|
|
395
|
+
##################################################
|
|
396
|
+
|
|
397
|
+
@bind_to_pb
|
|
398
|
+
def ev_charging_unit(cim: EvChargingUnit) -> PBEvChargingUnit:
|
|
399
|
+
return PBEvChargingUnit(peu=power_electronics_unit_to_pb(cim))
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
#######################################
|
|
403
|
+
# Extensions IEC61970 Base Protection #
|
|
404
|
+
#######################################
|
|
405
|
+
|
|
406
|
+
@bind_to_pb
|
|
407
|
+
def distance_relay_to_pb(cim: DistanceRelay) -> PBDistanceRelay:
|
|
408
|
+
return PBDistanceRelay(
|
|
409
|
+
prf=protection_relay_function_to_pb(cim, True),
|
|
410
|
+
**set_or_null(
|
|
411
|
+
backwardBlind=cim.backward_blind,
|
|
412
|
+
backwardReach=cim.backward_reach,
|
|
413
|
+
backwardReactance=cim.backward_reactance,
|
|
414
|
+
forwardBlind=cim.forward_blind,
|
|
415
|
+
forwardReach=cim.forward_reach,
|
|
416
|
+
forwardReactance=cim.forward_reactance,
|
|
417
|
+
operationPhaseAngle1=cim.operation_phase_angle1,
|
|
418
|
+
operationPhaseAngle2=cim.operation_phase_angle2,
|
|
419
|
+
operationPhaseAngle3=cim.operation_phase_angle3,
|
|
420
|
+
)
|
|
421
|
+
)
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
def protection_relay_function_to_pb(cim: ProtectionRelayFunction, include_asset_info: bool = False) -> PBProtectionRelayFunction:
|
|
425
|
+
return PBProtectionRelayFunction(
|
|
426
|
+
psr=power_system_resource_to_pb(cim, include_asset_info),
|
|
427
|
+
timeLimits=cim.time_limits,
|
|
428
|
+
thresholds=[relay_setting_to_pb(rs) for rs in cim.thresholds],
|
|
429
|
+
protectionKind=_map_protection_kind.to_pb(cim.protection_kind),
|
|
430
|
+
protectedSwitchMRIDs=[str(io.mrid) for io in cim.protected_switches],
|
|
431
|
+
powerDirection=_map_power_direction_kind.to_pb(cim.power_direction),
|
|
432
|
+
sensorMRIDs=[str(io.mrid) for io in cim.sensors],
|
|
433
|
+
schemeMRIDs=[str(io.mrid) for io in cim.schemes],
|
|
434
|
+
**set_or_null(
|
|
435
|
+
model=cim.model,
|
|
436
|
+
reclosing=cim.reclosing,
|
|
437
|
+
relayDelayTime=cim.relay_delay_time,
|
|
438
|
+
directable=cim.directable,
|
|
439
|
+
)
|
|
440
|
+
)
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
@bind_to_pb
|
|
444
|
+
def protection_relay_scheme_to_pb(cim: ProtectionRelayScheme) -> PBProtectionRelayScheme:
|
|
445
|
+
return PBProtectionRelayScheme(
|
|
446
|
+
io=identified_object_to_pb(cim),
|
|
447
|
+
functionMRIDs=[str(io.mrid) for io in cim.functions],
|
|
448
|
+
systemMRID=mrid_or_empty(cim.system),
|
|
449
|
+
)
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
@bind_to_pb
|
|
453
|
+
def protection_relay_system_to_pb(cim: ProtectionRelaySystem) -> PBProtectionRelaySystem:
|
|
454
|
+
return PBProtectionRelaySystem(
|
|
455
|
+
eq=equipment_to_pb(cim),
|
|
456
|
+
protectionKind=_map_protection_kind.to_pb(cim.protection_kind),
|
|
457
|
+
schemeMRIDs=[str(io.mrid) for io in cim.schemes],
|
|
458
|
+
)
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
def relay_setting_to_pb(cim: RelaySetting) -> PBRelaySetting:
|
|
462
|
+
return PBRelaySetting(
|
|
463
|
+
unitSymbol=_map_unit_symbol.to_pb(cim.unit_symbol),
|
|
464
|
+
value=from_nullable_float(cim.value),
|
|
465
|
+
**set_or_null(
|
|
466
|
+
name=cim.name,
|
|
467
|
+
)
|
|
468
|
+
)
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
@bind_to_pb
|
|
472
|
+
def voltage_relay_to_pb(cim: VoltageRelay) -> PBVoltageRelay:
|
|
473
|
+
return PBVoltageRelay(
|
|
474
|
+
prf=protection_relay_function_to_pb(cim, True),
|
|
475
|
+
)
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
##################################
|
|
479
|
+
# Extensions IEC61970 Base Wires #
|
|
480
|
+
##################################
|
|
481
|
+
|
|
482
|
+
@bind_to_pb
|
|
483
|
+
def battery_control_to_pb(cim: BatteryControl) -> PBBatteryControl:
|
|
484
|
+
"""
|
|
485
|
+
Convert the :class:`BatteryControl` into its protobuf counterpart.
|
|
486
|
+
:param cim: The :class:`BatteryControl` to convert.
|
|
487
|
+
:return: The protobuf builder.
|
|
488
|
+
"""
|
|
489
|
+
|
|
490
|
+
return PBBatteryControl(
|
|
491
|
+
rc=regulating_control_to_pb(cim),
|
|
492
|
+
controlMode=_map_battery_control_mode.to_pb(cim.control_mode),
|
|
493
|
+
**set_or_null(
|
|
494
|
+
chargingRate=cim.charging_rate,
|
|
495
|
+
dischargingRate=cim.discharging_rate,
|
|
496
|
+
reservePercent=cim.reserve_percent,
|
|
497
|
+
)
|
|
498
|
+
)
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
#######################
|
|
502
|
+
# IEC61968 Asset Info #
|
|
503
|
+
#######################
|
|
504
|
+
|
|
505
|
+
@bind_to_pb
|
|
506
|
+
def cable_info_to_pb(cim: CableInfo) -> PBCableInfo:
|
|
507
|
+
return PBCableInfo(wi=wire_info_to_pb(cim))
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
@bind_to_pb
|
|
511
|
+
def no_load_test_to_pb(cim: NoLoadTest) -> PBNoLoadTest:
|
|
512
|
+
return PBNoLoadTest(
|
|
513
|
+
tt=transformer_test_to_pb(cim),
|
|
514
|
+
**set_or_null(
|
|
515
|
+
energisedEndVoltage=cim.energised_end_voltage,
|
|
516
|
+
excitingCurrent=cim.exciting_current,
|
|
517
|
+
excitingCurrentZero=cim.exciting_current_zero,
|
|
518
|
+
loss=cim.loss,
|
|
519
|
+
lossZero=cim.loss_zero,
|
|
520
|
+
)
|
|
521
|
+
)
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
@bind_to_pb
|
|
525
|
+
def open_circuit_test_to_pb(cim: OpenCircuitTest) -> PBOpenCircuitTest:
|
|
526
|
+
return PBOpenCircuitTest(
|
|
527
|
+
tt=transformer_test_to_pb(cim),
|
|
528
|
+
**set_or_null(
|
|
529
|
+
energisedEndStep=cim.energised_end_step,
|
|
530
|
+
energisedEndVoltage=cim.energised_end_voltage,
|
|
531
|
+
openEndStep=cim.open_end_step,
|
|
532
|
+
openEndVoltage=cim.open_end_voltage,
|
|
533
|
+
phaseShift=cim.phase_shift,
|
|
534
|
+
)
|
|
535
|
+
)
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
@bind_to_pb
|
|
539
|
+
def overhead_wire_info_to_pb(cim: OverheadWireInfo) -> PBOverheadWireInfo:
|
|
540
|
+
return PBOverheadWireInfo(wi=wire_info_to_pb(cim))
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
@bind_to_pb
|
|
544
|
+
def power_transformer_info_to_pb(cim: PowerTransformerInfo) -> PBPowerTransformerInfo:
|
|
545
|
+
return PBPowerTransformerInfo(
|
|
546
|
+
ai=asset_info_to_pb(cim),
|
|
547
|
+
transformerTankInfoMRIDs=[tti.mrid for tti in cim.transformer_tank_infos]
|
|
548
|
+
)
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
@bind_to_pb
|
|
552
|
+
def short_circuit_test_to_pb(cim: ShortCircuitTest) -> PBShortCircuitTest:
|
|
553
|
+
return PBShortCircuitTest(
|
|
554
|
+
tt=transformer_test_to_pb(cim),
|
|
555
|
+
**set_or_null(
|
|
556
|
+
current=cim.current,
|
|
557
|
+
energisedEndStep=cim.energised_end_step,
|
|
558
|
+
groundedEndStep=cim.grounded_end_step,
|
|
559
|
+
leakageImpedance=cim.leakage_impedance,
|
|
560
|
+
leakageImpedanceZero=cim.leakage_impedance_zero,
|
|
561
|
+
loss=cim.loss,
|
|
562
|
+
lossZero=cim.loss_zero,
|
|
563
|
+
power=cim.power,
|
|
564
|
+
voltage=cim.voltage,
|
|
565
|
+
voltageOhmicPart=cim.voltage_ohmic_part,
|
|
566
|
+
)
|
|
567
|
+
)
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
@bind_to_pb
|
|
571
|
+
def shunt_compensator_info_to_pb(cim: ShuntCompensatorInfo) -> PBShuntCompensatorInfo:
|
|
572
|
+
return PBShuntCompensatorInfo(
|
|
573
|
+
ai=asset_info_to_pb(cim),
|
|
574
|
+
**set_or_null(
|
|
575
|
+
maxPowerLoss=cim.max_power_loss,
|
|
576
|
+
ratedCurrent=cim.rated_current,
|
|
577
|
+
ratedReactivePower=cim.rated_reactive_power,
|
|
578
|
+
ratedVoltage=cim.rated_voltage,
|
|
579
|
+
)
|
|
580
|
+
)
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
@bind_to_pb
|
|
584
|
+
def switch_info_to_pb(cim: SwitchInfo) -> PBSwitchInfo:
|
|
585
|
+
return PBSwitchInfo(
|
|
586
|
+
ai=asset_info_to_pb(cim),
|
|
587
|
+
**set_or_null(
|
|
588
|
+
ratedInterruptingTime=cim.rated_interrupting_time
|
|
589
|
+
)
|
|
590
|
+
)
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
@bind_to_pb
|
|
594
|
+
def transformer_end_info_to_pb(cim: TransformerEndInfo) -> PBTransformerEndInfo:
|
|
595
|
+
return PBTransformerEndInfo(
|
|
596
|
+
ai=asset_info_to_pb(cim),
|
|
597
|
+
connectionKind=_map_winding_connection.to_pb(cim.connection_kind),
|
|
598
|
+
endNumber=cim.end_number,
|
|
599
|
+
transformerTankInfoMRID=mrid_or_empty(cim.transformer_tank_info),
|
|
600
|
+
transformerStarImpedanceMRID=mrid_or_empty(cim.transformer_star_impedance),
|
|
601
|
+
energisedEndNoLoadTestsMRID=mrid_or_empty(cim.energised_end_no_load_tests),
|
|
602
|
+
energisedEndShortCircuitTestsMRID=mrid_or_empty(cim.energised_end_short_circuit_tests),
|
|
603
|
+
groundedEndShortCircuitTestsMRID=mrid_or_empty(cim.grounded_end_short_circuit_tests),
|
|
604
|
+
openEndOpenCircuitTestsMRID=mrid_or_empty(cim.open_end_open_circuit_tests),
|
|
605
|
+
energisedEndOpenCircuitTestsMRID=mrid_or_empty(cim.energised_end_open_circuit_tests),
|
|
606
|
+
**set_or_null(
|
|
607
|
+
emergencyS=cim.emergency_s,
|
|
608
|
+
insulationU=cim.insulation_u,
|
|
609
|
+
phaseAngleClock=cim.phase_angle_clock,
|
|
610
|
+
r=cim.r,
|
|
611
|
+
ratedS=cim.rated_s,
|
|
612
|
+
ratedU=cim.rated_u,
|
|
613
|
+
shortTermS=cim.short_term_s,
|
|
614
|
+
)
|
|
615
|
+
)
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
@bind_to_pb
|
|
619
|
+
def transformer_tank_info_to_pb(cim: TransformerTankInfo) -> PBTransformerTankInfo:
|
|
620
|
+
return PBTransformerTankInfo(
|
|
621
|
+
ai=asset_info_to_pb(cim),
|
|
622
|
+
transformerEndInfoMRIDs=[str(tei.mrid) for tei in cim.transformer_end_infos]
|
|
623
|
+
)
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
@bind_to_pb
|
|
627
|
+
def transformer_test_to_pb(cim: TransformerTest) -> PBTransformerTest:
|
|
628
|
+
return PBTransformerTest(
|
|
629
|
+
io=identified_object_to_pb(cim),
|
|
630
|
+
**set_or_null(
|
|
631
|
+
basePower=cim.base_power,
|
|
632
|
+
temperature=cim.temperature,
|
|
633
|
+
)
|
|
634
|
+
)
|
|
635
|
+
|
|
636
|
+
|
|
637
|
+
@bind_to_pb
|
|
638
|
+
def wire_info_to_pb(cim: WireInfo) -> PBWireInfo:
|
|
639
|
+
return PBWireInfo(
|
|
640
|
+
ai=asset_info_to_pb(cim),
|
|
641
|
+
material=_map_wire_material_kind.to_pb(cim.material),
|
|
642
|
+
**set_or_null(
|
|
643
|
+
ratedCurrent=cim.rated_current,
|
|
644
|
+
)
|
|
645
|
+
)
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
###################
|
|
649
|
+
# IEC61968 Assets #
|
|
650
|
+
###################
|
|
651
|
+
|
|
652
|
+
def asset_to_pb(cim: Asset) -> PBAsset:
|
|
653
|
+
return PBAsset(
|
|
654
|
+
io=identified_object_to_pb(cim),
|
|
655
|
+
locationMRID=cim.location.mrid if cim.location else None,
|
|
656
|
+
organisationRoleMRIDs=[str(io.mrid) for io in cim.organisation_roles],
|
|
657
|
+
powerSystemResourceMRIDs=[str(io.mrid) for io in cim.power_system_resources],
|
|
658
|
+
)
|
|
659
|
+
|
|
660
|
+
|
|
661
|
+
def asset_container_to_pb(cim: AssetContainer) -> PBAssetContainer:
|
|
662
|
+
return PBAssetContainer(at=asset_to_pb(cim))
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
def asset_function_to_pb(cim: AssetFunction) -> PBAssetFunction:
|
|
666
|
+
"""
|
|
667
|
+
Convert the :class:`AssetFunction` into its protobuf counterpart.
|
|
668
|
+
:param cim: The :class:`AssetFunction` to convert.
|
|
669
|
+
:return: The protobuf builder.
|
|
670
|
+
"""
|
|
671
|
+
return PBAssetFunction(io=identified_object_to_pb(cim))
|
|
672
|
+
|
|
673
|
+
|
|
674
|
+
def asset_info_to_pb(cim: AssetInfo) -> PBAssetInfo:
|
|
675
|
+
return PBAssetInfo(io=identified_object_to_pb(cim))
|
|
676
|
+
|
|
677
|
+
|
|
678
|
+
def asset_organisation_role_to_pb(cim: AssetOrganisationRole) -> PBAssetOrganisationRole:
|
|
679
|
+
pb = PBAssetOrganisationRole()
|
|
680
|
+
getattr(pb, "or").CopyFrom(organisation_role_to_pb(cim))
|
|
681
|
+
return pb
|
|
682
|
+
|
|
683
|
+
|
|
684
|
+
@bind_to_pb
|
|
685
|
+
def asset_owner_to_pb(cim: AssetOwner) -> PBAssetOwner:
|
|
686
|
+
return PBAssetOwner(aor=asset_organisation_role_to_pb(cim))
|
|
687
|
+
|
|
688
|
+
|
|
689
|
+
@bind_to_pb
|
|
690
|
+
def streetlight_to_pb(cim: Streetlight) -> PBStreetlight:
|
|
691
|
+
return PBStreetlight(
|
|
692
|
+
at=asset_to_pb(cim),
|
|
693
|
+
poleMRID=mrid_or_empty(cim.pole),
|
|
694
|
+
lampKind=_map_streetlight_lamp_kind.to_pb(cim.lamp_kind),
|
|
695
|
+
**set_or_null(
|
|
696
|
+
lightRating=cim.light_rating,
|
|
697
|
+
)
|
|
698
|
+
)
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
def structure_to_pb(cim: Structure) -> PBStructure:
|
|
702
|
+
return PBStructure(ac=asset_container_to_pb(cim))
|
|
703
|
+
|
|
704
|
+
|
|
705
|
+
###################
|
|
706
|
+
# IEC61968 Common #
|
|
707
|
+
###################
|
|
708
|
+
|
|
709
|
+
@bind_to_pb
|
|
710
|
+
def location_to_pb(cim: Location) -> PBLocation:
|
|
711
|
+
return PBLocation(
|
|
712
|
+
io=identified_object_to_pb(cim),
|
|
713
|
+
mainAddress=_get_or_none(street_address_to_pb, cim.main_address),
|
|
714
|
+
positionPoints=[position_point_to_pb(point) for point in cim.points]
|
|
715
|
+
)
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
def position_point_to_pb(cim: PositionPoint) -> PBPositionPoint:
|
|
719
|
+
return PBPositionPoint(
|
|
720
|
+
xPosition=cim.x_position,
|
|
721
|
+
yPosition=cim.y_position
|
|
722
|
+
)
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
def street_address_to_pb(cim: StreetAddress) -> PBStreetAddress:
|
|
726
|
+
return PBStreetAddress(
|
|
727
|
+
townDetail=_get_or_none(town_detail_to_pb, cim.town_detail),
|
|
728
|
+
streetDetail=_get_or_none(street_detail_to_pb, cim.street_detail),
|
|
729
|
+
**set_or_null(
|
|
730
|
+
postalCode=cim.postal_code,
|
|
731
|
+
poBox=cim.po_box,
|
|
732
|
+
)
|
|
733
|
+
)
|
|
734
|
+
|
|
735
|
+
|
|
736
|
+
def street_detail_to_pb(cim: StreetDetail) -> PBStreetDetail:
|
|
737
|
+
return PBStreetDetail(
|
|
738
|
+
**set_or_null(
|
|
739
|
+
buildingName=cim.building_name,
|
|
740
|
+
floorIdentification=cim.floor_identification,
|
|
741
|
+
name=cim.name,
|
|
742
|
+
number=cim.number,
|
|
743
|
+
suiteNumber=cim.suite_number,
|
|
744
|
+
type=cim.type,
|
|
745
|
+
displayAddress=cim.display_address
|
|
746
|
+
)
|
|
747
|
+
)
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
def town_detail_to_pb(cim: TownDetail) -> PBTownDetail:
|
|
751
|
+
return PBTownDetail(
|
|
752
|
+
**set_or_null(
|
|
753
|
+
name=cim.name,
|
|
754
|
+
stateOrProvince=cim.state_or_province
|
|
755
|
+
)
|
|
756
|
+
)
|
|
757
|
+
|
|
758
|
+
|
|
759
|
+
#####################################
|
|
760
|
+
# IEC61968 InfIEC61968 InfAssetInfo #
|
|
761
|
+
#####################################
|
|
762
|
+
|
|
763
|
+
@bind_to_pb
|
|
764
|
+
def current_transformer_info_to_pb(cim: CurrentTransformerInfo) -> PBCurrentTransformerInfo:
|
|
765
|
+
return PBCurrentTransformerInfo(
|
|
766
|
+
ai=asset_info_to_pb(cim),
|
|
767
|
+
maxRatio=_get_or_none(ratio_to_pb, cim.max_ratio),
|
|
768
|
+
nominalRatio=_get_or_none(ratio_to_pb, cim.nominal_ratio),
|
|
769
|
+
**set_or_null(
|
|
770
|
+
accuracyClass=cim.accuracy_class,
|
|
771
|
+
accuracyLimit=cim.accuracy_limit,
|
|
772
|
+
coreCount=cim.core_count,
|
|
773
|
+
ctClass=cim.ct_class,
|
|
774
|
+
kneePointVoltage=cim.knee_point_voltage,
|
|
775
|
+
primaryRatio=cim.primary_ratio,
|
|
776
|
+
ratedCurrent=cim.rated_current,
|
|
777
|
+
secondaryFlsRating=cim.secondary_fls_rating,
|
|
778
|
+
secondaryRatio=cim.secondary_ratio,
|
|
779
|
+
usage=cim.usage,
|
|
780
|
+
)
|
|
781
|
+
)
|
|
782
|
+
|
|
783
|
+
|
|
784
|
+
@bind_to_pb
|
|
785
|
+
def potential_transformer_info_to_pb(cim: PotentialTransformerInfo) -> PBPotentialTransformerInfo:
|
|
786
|
+
return PBPotentialTransformerInfo(
|
|
787
|
+
ai=asset_info_to_pb(cim),
|
|
788
|
+
nominalRatio=_get_or_none(ratio_to_pb, cim.nominal_ratio),
|
|
789
|
+
**set_or_null(
|
|
790
|
+
accuracyClass=cim.accuracy_class,
|
|
791
|
+
primaryRatio=cim.primary_ratio,
|
|
792
|
+
ptClass=cim.pt_class,
|
|
793
|
+
ratedVoltage=cim.rated_voltage,
|
|
794
|
+
secondaryRatio=cim.secondary_ratio,
|
|
795
|
+
|
|
796
|
+
)
|
|
797
|
+
)
|
|
798
|
+
|
|
799
|
+
|
|
800
|
+
##################################
|
|
801
|
+
# IEC61968 InfIEC61968 InfAssets #
|
|
802
|
+
##################################
|
|
803
|
+
|
|
804
|
+
@bind_to_pb
|
|
805
|
+
def pole_to_pb(cim: Pole) -> PBPole:
|
|
806
|
+
return PBPole(
|
|
807
|
+
st=structure_to_pb(cim),
|
|
808
|
+
streetlightMRIDs=[str(io.mrid) for io in cim.streetlights],
|
|
809
|
+
**set_or_null(
|
|
810
|
+
classification=cim.classification,
|
|
811
|
+
)
|
|
812
|
+
)
|
|
813
|
+
|
|
814
|
+
|
|
815
|
+
##################################
|
|
816
|
+
# IEC61968 InfIEC61968 InfCommon #
|
|
817
|
+
##################################
|
|
818
|
+
|
|
819
|
+
def ratio_to_pb(cim: Ratio) -> PBRatio:
|
|
820
|
+
return PBRatio(denominator=cim.denominator, numerator=cim.numerator)
|
|
821
|
+
|
|
822
|
+
|
|
823
|
+
#####################
|
|
824
|
+
# IEC61968 Metering #
|
|
825
|
+
#####################
|
|
826
|
+
|
|
827
|
+
def end_device_to_pb(cim: EndDevice) -> PBEndDevice:
|
|
828
|
+
"""
|
|
829
|
+
Convert the :class:`EndDevice` into its protobuf counterpart.
|
|
830
|
+
:param cim: The :class:`EndDevice` to convert.
|
|
831
|
+
:return: The protobuf builder.
|
|
832
|
+
"""
|
|
833
|
+
return PBEndDevice(
|
|
834
|
+
ac=asset_container_to_pb(cim),
|
|
835
|
+
usagePointMRIDs=[str(io.mrid) for io in cim.usage_points],
|
|
836
|
+
endDeviceFunctionMRIDs=[str(io.mrid) for io in cim.functions],
|
|
837
|
+
customerMRID=cim.customer_mrid,
|
|
838
|
+
serviceLocationMRID=mrid_or_empty(cim.service_location),
|
|
839
|
+
)
|
|
840
|
+
|
|
841
|
+
|
|
842
|
+
def end_device_function_to_pb(cim: EndDeviceFunction) -> PBEndDeviceFunction:
|
|
843
|
+
"""
|
|
844
|
+
Convert the :class:`EndDeviceFunction` into its protobuf counterpart.
|
|
845
|
+
:param cim: The :class:`EndDeviceFunction` to convert.
|
|
846
|
+
:return: The protobuf builder.
|
|
847
|
+
"""
|
|
848
|
+
return PBEndDeviceFunction(
|
|
849
|
+
af=asset_function_to_pb(cim),
|
|
850
|
+
**set_or_null(
|
|
851
|
+
enabled=cim.enabled,
|
|
852
|
+
)
|
|
853
|
+
)
|
|
854
|
+
|
|
855
|
+
|
|
856
|
+
@bind_to_pb
|
|
857
|
+
def meter_to_pb(cim: Meter) -> PBMeter:
|
|
858
|
+
return PBMeter(ed=end_device_to_pb(cim))
|
|
859
|
+
|
|
860
|
+
|
|
861
|
+
@bind_to_pb
|
|
862
|
+
def usage_point_to_pb(cim: UsagePoint) -> PBUsagePoint:
|
|
863
|
+
return PBUsagePoint(
|
|
864
|
+
io=identified_object_to_pb(cim),
|
|
865
|
+
usagePointLocationMRID=mrid_or_empty(cim.usage_point_location),
|
|
866
|
+
equipmentMRIDs=[str(io.mrid) for io in cim.equipment],
|
|
867
|
+
endDeviceMRIDs=[str(io.mrid) for io in cim.end_devices],
|
|
868
|
+
phaseCode=_map_phase_code.to_pb(cim.phase_code),
|
|
869
|
+
**set_or_null(
|
|
870
|
+
isVirtual=cim.is_virtual,
|
|
871
|
+
connectionCategory=cim.connection_category,
|
|
872
|
+
ratedPower=cim.rated_power,
|
|
873
|
+
approvedInverterCapacity=cim.approved_inverter_capacity,
|
|
874
|
+
),
|
|
875
|
+
)
|
|
876
|
+
|
|
877
|
+
|
|
878
|
+
#######################
|
|
879
|
+
# IEC61968 Operations #
|
|
880
|
+
#######################
|
|
881
|
+
|
|
882
|
+
@bind_to_pb
|
|
883
|
+
def operational_restriction_to_pb(cim: OperationalRestriction) -> PBOperationalRestriction:
|
|
884
|
+
return PBOperationalRestriction(doc=document_to_pb(cim))
|
|
885
|
+
|
|
886
|
+
|
|
887
|
+
#####################################
|
|
888
|
+
# IEC61970 Base Auxiliary Equipment #
|
|
889
|
+
#####################################
|
|
890
|
+
|
|
891
|
+
def auxiliary_equipment_to_pb(cim: AuxiliaryEquipment, include_asset_info: bool = False) -> PBAuxiliaryEquipment:
|
|
892
|
+
return PBAuxiliaryEquipment(
|
|
893
|
+
eq=equipment_to_pb(cim, include_asset_info),
|
|
894
|
+
terminalMRID=mrid_or_empty(cim.terminal)
|
|
895
|
+
)
|
|
896
|
+
|
|
897
|
+
|
|
898
|
+
@bind_to_pb
|
|
899
|
+
def current_transformer_to_pb(cim: CurrentTransformer) -> PBCurrentTransformer:
|
|
900
|
+
return PBCurrentTransformer(
|
|
901
|
+
sn=sensor_to_pb(cim, True),
|
|
902
|
+
**set_or_null(
|
|
903
|
+
coreBurden=cim.core_burden,
|
|
904
|
+
)
|
|
905
|
+
)
|
|
906
|
+
|
|
907
|
+
|
|
908
|
+
@bind_to_pb
|
|
909
|
+
def fault_indicator_to_pb(cim: FaultIndicator) -> PBFaultIndicator:
|
|
910
|
+
return PBFaultIndicator(ae=auxiliary_equipment_to_pb(cim))
|
|
911
|
+
|
|
912
|
+
|
|
913
|
+
@bind_to_pb
|
|
914
|
+
def potential_transformer_to_pb(cim: PotentialTransformer) -> PBPotentialTransformer:
|
|
915
|
+
return PBPotentialTransformer(
|
|
916
|
+
sn=sensor_to_pb(cim, True),
|
|
917
|
+
type=_map_potential_transformer_kind.to_pb(cim.type)
|
|
918
|
+
)
|
|
919
|
+
|
|
920
|
+
|
|
921
|
+
def sensor_to_pb(cim: Sensor, include_asset_info: bool = False) -> PBSensor:
|
|
922
|
+
return PBSensor(
|
|
923
|
+
ae=auxiliary_equipment_to_pb(cim, include_asset_info),
|
|
924
|
+
relayFunctionMRIDs=[str(io.mrid) for io in cim.relay_functions],
|
|
925
|
+
)
|
|
926
|
+
|
|
927
|
+
|
|
928
|
+
######################
|
|
929
|
+
# IEC61970 Base Core #
|
|
930
|
+
######################
|
|
931
|
+
|
|
932
|
+
def ac_dc_terminal_to_pb(cim: AcDcTerminal) -> PBAcDcTerminal:
|
|
933
|
+
return PBAcDcTerminal(io=identified_object_to_pb(cim))
|
|
934
|
+
|
|
935
|
+
|
|
936
|
+
@bind_to_pb
|
|
937
|
+
def base_voltage_to_pb(cim: BaseVoltage) -> PBBaseVoltage:
|
|
938
|
+
return PBBaseVoltage(
|
|
939
|
+
io=identified_object_to_pb(cim),
|
|
940
|
+
nominalVoltage=cim.nominal_voltage
|
|
941
|
+
)
|
|
942
|
+
|
|
943
|
+
|
|
944
|
+
def conducting_equipment_to_pb(cim: ConductingEquipment, include_asset_info: bool = False) -> PBConductingEquipment:
|
|
945
|
+
return PBConductingEquipment(
|
|
946
|
+
eq=equipment_to_pb(cim, include_asset_info),
|
|
947
|
+
baseVoltageMRID=mrid_or_empty(cim.base_voltage),
|
|
948
|
+
terminalMRIDs=[str(io.mrid) for io in cim.terminals]
|
|
949
|
+
)
|
|
950
|
+
|
|
951
|
+
|
|
952
|
+
@bind_to_pb
|
|
953
|
+
def connectivity_node_to_pb(cim: ConnectivityNode) -> PBConnectivityNode:
|
|
954
|
+
return PBConnectivityNode(io=identified_object_to_pb(cim))
|
|
955
|
+
|
|
956
|
+
|
|
957
|
+
def connectivity_node_container_to_pb(cim: ConnectivityNodeContainer) -> PBConnectivityNodeContainer:
|
|
958
|
+
return PBConnectivityNodeContainer(psr=power_system_resource_to_pb(cim))
|
|
959
|
+
|
|
960
|
+
|
|
961
|
+
def curve_to_pb(cim: Curve) -> PBCurve:
|
|
962
|
+
return PBCurve(
|
|
963
|
+
io=identified_object_to_pb(cim),
|
|
964
|
+
curveData=[curve_data_to_pb(it) for it in cim.data]
|
|
965
|
+
)
|
|
966
|
+
|
|
967
|
+
|
|
968
|
+
def curve_data_to_pb(cim: CurveData) -> PBCurveData:
|
|
969
|
+
return PBCurveData(
|
|
970
|
+
xValue=cim.x_value,
|
|
971
|
+
y1Value=cim.y1_value,
|
|
972
|
+
**set_or_null(
|
|
973
|
+
y2Value=cim.y2_value,
|
|
974
|
+
y3Value=cim.y3_value
|
|
975
|
+
)
|
|
976
|
+
)
|
|
977
|
+
|
|
978
|
+
|
|
979
|
+
def equipment_to_pb(cim: Equipment, include_asset_info: bool = False) -> PBEquipment:
|
|
980
|
+
ts = None
|
|
981
|
+
if cim.commissioned_date:
|
|
982
|
+
ts = PBTimestamp()
|
|
983
|
+
ts.FromDatetime(cim.commissioned_date)
|
|
984
|
+
return PBEquipment(
|
|
985
|
+
psr=power_system_resource_to_pb(cim, include_asset_info),
|
|
986
|
+
inService=cim.in_service,
|
|
987
|
+
normallyInService=cim.normally_in_service,
|
|
988
|
+
equipmentContainerMRIDs=[str(io.mrid) for io in cim.containers],
|
|
989
|
+
usagePointMRIDs=[str(io.mrid) for io in cim.usage_points],
|
|
990
|
+
operationalRestrictionMRIDs=[str(io.mrid) for io in cim.operational_restrictions],
|
|
991
|
+
currentContainerMRIDs=[str(io.mrid) for io in cim.current_containers],
|
|
992
|
+
commissionedDate=ts,
|
|
993
|
+
)
|
|
994
|
+
|
|
995
|
+
|
|
996
|
+
def equipment_container_to_pb(cim: EquipmentContainer) -> PBEquipmentContainer:
|
|
997
|
+
return PBEquipmentContainer(cnc=connectivity_node_container_to_pb(cim))
|
|
998
|
+
|
|
999
|
+
|
|
1000
|
+
@bind_to_pb
|
|
1001
|
+
def feeder_to_pb(cim: Feeder) -> PBFeeder:
|
|
1002
|
+
return PBFeeder(
|
|
1003
|
+
ec=equipment_container_to_pb(cim),
|
|
1004
|
+
normalHeadTerminalMRID=mrid_or_empty(cim.normal_head_terminal),
|
|
1005
|
+
normalEnergizingSubstationMRID=mrid_or_empty(cim.normal_energizing_substation),
|
|
1006
|
+
normalEnergizedLvFeederMRIDs=[str(io.mrid) for io in cim.normal_energized_lv_feeders],
|
|
1007
|
+
currentlyEnergizedLvFeedersMRIDs=[str(io.mrid) for io in cim.current_energized_lv_feeders]
|
|
1008
|
+
)
|
|
1009
|
+
|
|
1010
|
+
|
|
1011
|
+
@bind_to_pb
|
|
1012
|
+
def geographical_region_to_pb(cim: GeographicalRegion) -> PBGeographicalRegion:
|
|
1013
|
+
return PBGeographicalRegion(
|
|
1014
|
+
io=identified_object_to_pb(cim),
|
|
1015
|
+
subGeographicalRegionMRIDs=[str(io.mrid) for io in cim.sub_geographical_regions]
|
|
1016
|
+
)
|
|
1017
|
+
|
|
1018
|
+
|
|
1019
|
+
def power_system_resource_to_pb(cim: PowerSystemResource, include_asset_info: bool = False) -> PBPowerSystemResource:
|
|
1020
|
+
return PBPowerSystemResource(
|
|
1021
|
+
io=identified_object_to_pb(cim),
|
|
1022
|
+
assetInfoMRID=mrid_or_empty(cim.asset_info) if include_asset_info else None,
|
|
1023
|
+
locationMRID=mrid_or_empty(cim.location),
|
|
1024
|
+
assetMRIDs=[str(io.mrid) for io in cim.assets]
|
|
1025
|
+
)
|
|
1026
|
+
|
|
1027
|
+
|
|
1028
|
+
@bind_to_pb
|
|
1029
|
+
def sub_geographical_region_to_pb(cim: SubGeographicalRegion) -> PBSubGeographicalRegion:
|
|
1030
|
+
return PBSubGeographicalRegion(
|
|
1031
|
+
io=identified_object_to_pb(cim),
|
|
1032
|
+
geographicalRegionMRID=mrid_or_empty(cim.geographical_region),
|
|
1033
|
+
substationMRIDs=[str(io.mrid) for io in cim.substations]
|
|
1034
|
+
)
|
|
1035
|
+
|
|
1036
|
+
|
|
1037
|
+
@bind_to_pb
|
|
1038
|
+
def substation_to_pb(cim: Substation) -> PBSubstation:
|
|
1039
|
+
return PBSubstation(
|
|
1040
|
+
ec=equipment_container_to_pb(cim),
|
|
1041
|
+
subGeographicalRegionMRID=mrid_or_empty(cim.sub_geographical_region),
|
|
1042
|
+
normalEnergizedFeederMRIDs=[str(io.mrid) for io in cim.feeders],
|
|
1043
|
+
loopMRIDs=[str(io.mrid) for io in cim.loops],
|
|
1044
|
+
normalEnergizedLoopMRIDs=[str(io.mrid) for io in cim.energized_loops],
|
|
1045
|
+
circuitMRIDs=[str(io.mrid) for io in cim.circuits]
|
|
1046
|
+
)
|
|
1047
|
+
|
|
1048
|
+
|
|
1049
|
+
@bind_to_pb
|
|
1050
|
+
def terminal_to_pb(cim: Terminal) -> PBTerminal:
|
|
1051
|
+
# noinspection PyProtectedMember
|
|
1052
|
+
return PBTerminal(
|
|
1053
|
+
ad=ac_dc_terminal_to_pb(cim),
|
|
1054
|
+
conductingEquipmentMRID=mrid_or_empty(cim.conducting_equipment),
|
|
1055
|
+
connectivityNodeMRID=mrid_or_empty(cim.connectivity_node),
|
|
1056
|
+
phases=_map_phase_code.to_pb(cim.phases),
|
|
1057
|
+
sequenceNumber=cim.sequence_number,
|
|
1058
|
+
normalFeederDirection=_map_feeder_direction.to_pb(cim.normal_feeder_direction),
|
|
1059
|
+
currentFeederDirection=_map_feeder_direction.to_pb(cim.current_feeder_direction),
|
|
1060
|
+
# phases=cim.pha
|
|
1061
|
+
)
|
|
1062
|
+
|
|
1063
|
+
|
|
1064
|
+
#############################
|
|
1065
|
+
# IEC61970 Base Equivalents #
|
|
1066
|
+
#############################
|
|
1067
|
+
|
|
1068
|
+
@bind_to_pb
|
|
1069
|
+
def equivalent_branch_to_pb(cim: EquivalentBranch) -> PBEquivalentBranch:
|
|
1070
|
+
return PBEquivalentBranch(
|
|
1071
|
+
ee=equivalent_equipment_to_pb(cim),
|
|
1072
|
+
**set_or_null(
|
|
1073
|
+
negativeR12=cim.negative_r12,
|
|
1074
|
+
negativeR21=cim.negative_r21,
|
|
1075
|
+
negativeX12=cim.negative_x12,
|
|
1076
|
+
negativeX21=cim.negative_x21,
|
|
1077
|
+
positiveR12=cim.positive_r12,
|
|
1078
|
+
positiveR21=cim.positive_r21,
|
|
1079
|
+
positiveX12=cim.positive_x12,
|
|
1080
|
+
positiveX21=cim.positive_x21,
|
|
1081
|
+
r=cim.r,
|
|
1082
|
+
r21=cim.r21,
|
|
1083
|
+
x=cim.x,
|
|
1084
|
+
x21=cim.x21,
|
|
1085
|
+
zeroR12=cim.zero_r12,
|
|
1086
|
+
zeroR21=cim.zero_r21,
|
|
1087
|
+
zeroX12=cim.zero_x12,
|
|
1088
|
+
zeroX21=cim.zero_x21,
|
|
1089
|
+
)
|
|
1090
|
+
)
|
|
1091
|
+
|
|
1092
|
+
|
|
1093
|
+
def equivalent_equipment_to_pb(cim: EquivalentEquipment) -> PBEquivalentEquipment:
|
|
1094
|
+
return PBEquivalentEquipment(ce=conducting_equipment_to_pb(cim))
|
|
1095
|
+
|
|
1096
|
+
|
|
1097
|
+
#######################################
|
|
1098
|
+
# IEC61970 Base Generation Production #
|
|
1099
|
+
#######################################
|
|
1100
|
+
|
|
1101
|
+
@bind_to_pb
|
|
1102
|
+
def battery_unit_to_pb(cim: BatteryUnit) -> PBBatteryUnit:
|
|
1103
|
+
"""
|
|
1104
|
+
Convert the :class:`BatteryUnit` into its protobuf counterpart.
|
|
1105
|
+
:param cim: The :class:`BatteryUnit` to convert.
|
|
1106
|
+
:return: The protobuf builder.
|
|
1107
|
+
"""
|
|
1108
|
+
return PBBatteryUnit(
|
|
1109
|
+
peu=power_electronics_unit_to_pb(cim),
|
|
1110
|
+
batteryControlMRIDs=[str(io.mrid) for io in cim.controls],
|
|
1111
|
+
batteryState=_map_battery_state_kind.to_pb(cim.battery_state),
|
|
1112
|
+
**set_or_null(
|
|
1113
|
+
ratedE=cim.rated_e,
|
|
1114
|
+
storedE=cim.stored_e,
|
|
1115
|
+
)
|
|
1116
|
+
)
|
|
1117
|
+
|
|
1118
|
+
|
|
1119
|
+
@bind_to_pb
|
|
1120
|
+
def photo_voltaic_unit_to_pb(cim: PhotoVoltaicUnit) -> PBPhotoVoltaicUnit:
|
|
1121
|
+
return PBPhotoVoltaicUnit(peu=power_electronics_unit_to_pb(cim))
|
|
1122
|
+
|
|
1123
|
+
|
|
1124
|
+
def power_electronics_unit_to_pb(cim: PowerElectronicsUnit) -> PBPowerElectronicsUnit:
|
|
1125
|
+
return PBPowerElectronicsUnit(
|
|
1126
|
+
eq=equipment_to_pb(cim),
|
|
1127
|
+
powerElectronicsConnectionMRID=mrid_or_empty(cim.power_electronics_connection),
|
|
1128
|
+
**set_or_null(
|
|
1129
|
+
maxP=cim.max_p,
|
|
1130
|
+
minP=cim.min_p,
|
|
1131
|
+
)
|
|
1132
|
+
)
|
|
1133
|
+
|
|
1134
|
+
|
|
1135
|
+
@bind_to_pb
|
|
1136
|
+
def power_electronics_wind_unit_to_pb(cim: PowerElectronicsWindUnit) -> PBPowerElectronicsWindUnit:
|
|
1137
|
+
return PBPowerElectronicsWindUnit(peu=power_electronics_unit_to_pb(cim))
|
|
1138
|
+
|
|
1139
|
+
|
|
1140
|
+
######################
|
|
1141
|
+
# IEC61970 Base Meas #
|
|
1142
|
+
######################
|
|
1143
|
+
|
|
1144
|
+
@bind_to_pb
|
|
1145
|
+
def accumulator_to_pb(cim: Accumulator) -> PBAccumulator:
|
|
1146
|
+
return PBAccumulator(measurement=measurement_to_pb(cim))
|
|
1147
|
+
|
|
1148
|
+
|
|
1149
|
+
@bind_to_pb
|
|
1150
|
+
def analog_to_pb(cim: Analog) -> PBAnalog:
|
|
1151
|
+
return PBAnalog(
|
|
1152
|
+
measurement=measurement_to_pb(cim),
|
|
1153
|
+
**set_or_null(
|
|
1154
|
+
positiveFlowIn=cim.positive_flow_in
|
|
1155
|
+
)
|
|
1156
|
+
)
|
|
1157
|
+
|
|
1158
|
+
|
|
1159
|
+
@bind_to_pb
|
|
1160
|
+
def control_to_pb(cim: Control) -> PBControl:
|
|
1161
|
+
return PBControl(
|
|
1162
|
+
ip=io_point_to_pb(cim),
|
|
1163
|
+
remoteControlMRID=mrid_or_empty(cim.remote_control),
|
|
1164
|
+
powerSystemResourceMRID=cim.power_system_resource_mrid
|
|
1165
|
+
)
|
|
1166
|
+
|
|
1167
|
+
|
|
1168
|
+
@bind_to_pb
|
|
1169
|
+
def discrete_to_pb(cim: Discrete) -> PBDiscrete:
|
|
1170
|
+
return PBDiscrete(measurement=measurement_to_pb(cim))
|
|
1171
|
+
|
|
1172
|
+
|
|
1173
|
+
def io_point_to_pb(cim: IoPoint) -> PBIoPoint:
|
|
1174
|
+
return PBIoPoint(io=identified_object_to_pb(cim))
|
|
1175
|
+
|
|
1176
|
+
|
|
1177
|
+
def measurement_to_pb(cim: Measurement) -> PBMeasurement:
|
|
1178
|
+
return PBMeasurement(
|
|
1179
|
+
io=identified_object_to_pb(cim),
|
|
1180
|
+
remoteSourceMRID=mrid_or_empty(cim.remote_source),
|
|
1181
|
+
powerSystemResourceMRID=cim.power_system_resource_mrid,
|
|
1182
|
+
terminalMRID=cim.terminal_mrid,
|
|
1183
|
+
phases=_map_phase_code.to_pb(cim.phases),
|
|
1184
|
+
unitSymbol=_map_unit_symbol.to_pb(cim.unit_symbol)
|
|
1185
|
+
)
|
|
1186
|
+
|
|
1187
|
+
|
|
1188
|
+
############################
|
|
1189
|
+
# IEC61970 Base Protection #
|
|
1190
|
+
############################
|
|
1191
|
+
|
|
1192
|
+
@bind_to_pb
|
|
1193
|
+
def current_relay_to_pb(cim: CurrentRelay) -> PBCurrentRelay:
|
|
1194
|
+
return PBCurrentRelay(
|
|
1195
|
+
prf=protection_relay_function_to_pb(cim, True),
|
|
1196
|
+
**set_or_null(
|
|
1197
|
+
currentLimit1=cim.current_limit_1,
|
|
1198
|
+
inverseTimeFlag=cim.inverse_time_flag,
|
|
1199
|
+
timeDelay1=cim.time_delay_1,
|
|
1200
|
+
)
|
|
1201
|
+
)
|
|
1202
|
+
|
|
1203
|
+
|
|
1204
|
+
#######################
|
|
1205
|
+
# IEC61970 Base Scada #
|
|
1206
|
+
#######################
|
|
1207
|
+
|
|
1208
|
+
@bind_to_pb
|
|
1209
|
+
def remote_control_to_pb(cim: RemoteControl) -> PBRemoteControl:
|
|
1210
|
+
return PBRemoteControl(
|
|
1211
|
+
rp=remote_point_to_pb(cim),
|
|
1212
|
+
controlMRID=mrid_or_empty(cim.control)
|
|
1213
|
+
)
|
|
1214
|
+
|
|
1215
|
+
|
|
1216
|
+
def remote_point_to_pb(cim: RemotePoint) -> PBRemotePoint:
|
|
1217
|
+
return PBRemotePoint(io=identified_object_to_pb(cim))
|
|
1218
|
+
|
|
1219
|
+
|
|
1220
|
+
@bind_to_pb
|
|
1221
|
+
def remote_source_to_pb(cim: RemoteSource) -> PBRemoteSource:
|
|
1222
|
+
return PBRemoteSource(
|
|
1223
|
+
rp=remote_point_to_pb(cim),
|
|
1224
|
+
measurementMRID=mrid_or_empty(cim.measurement)
|
|
1225
|
+
)
|
|
1226
|
+
|
|
1227
|
+
|
|
1228
|
+
#######################
|
|
1229
|
+
# IEC61970 Base Wires #
|
|
1230
|
+
#######################
|
|
1231
|
+
|
|
1232
|
+
@bind_to_pb
|
|
1233
|
+
def ac_line_segment_to_pb(cim: AcLineSegment) -> PBAcLineSegment:
|
|
1234
|
+
"""
|
|
1235
|
+
Convert the :class:`AcLineSegment` into its protobuf counterpart.
|
|
1236
|
+
:param cim: The :class:`AcLineSegment` to convert.
|
|
1237
|
+
:return: The protobuf builder.
|
|
1238
|
+
"""
|
|
1239
|
+
return PBAcLineSegment(
|
|
1240
|
+
cd=conductor_to_pb(cim),
|
|
1241
|
+
perLengthImpedanceMRID=mrid_or_empty(cim.per_length_impedance),
|
|
1242
|
+
cutMRIDs=[str(it.mrid) for it in cim.cuts],
|
|
1243
|
+
clampMRIDs=[str(it.mrid) for it in cim.clamps]
|
|
1244
|
+
)
|
|
1245
|
+
|
|
1246
|
+
|
|
1247
|
+
@bind_to_pb
|
|
1248
|
+
def breaker_to_pb(cim: Breaker) -> PBBreaker:
|
|
1249
|
+
return PBBreaker(
|
|
1250
|
+
sw=protected_switch_to_pb(cim),
|
|
1251
|
+
**set_or_null(
|
|
1252
|
+
inTransitTime=cim.in_transit_time,
|
|
1253
|
+
)
|
|
1254
|
+
)
|
|
1255
|
+
|
|
1256
|
+
|
|
1257
|
+
@bind_to_pb
|
|
1258
|
+
def busbar_section_to_pb(cim: BusbarSection) -> PBBusbarSection:
|
|
1259
|
+
return PBBusbarSection(cn=connector_to_pb(cim))
|
|
1260
|
+
|
|
1261
|
+
|
|
1262
|
+
@bind_to_pb
|
|
1263
|
+
def clamp_to_pb(cim: Clamp) -> PBClamp:
|
|
1264
|
+
return PBClamp(
|
|
1265
|
+
ce=conducting_equipment_to_pb(cim),
|
|
1266
|
+
acLineSegmentMRID=mrid_or_empty(cim.ac_line_segment),
|
|
1267
|
+
**set_or_null(
|
|
1268
|
+
lengthFromTerminal1=cim.length_from_terminal_1,
|
|
1269
|
+
)
|
|
1270
|
+
)
|
|
1271
|
+
|
|
1272
|
+
|
|
1273
|
+
def conductor_to_pb(cim: Conductor) -> PBConductor:
|
|
1274
|
+
return PBConductor(
|
|
1275
|
+
ce=conducting_equipment_to_pb(cim, True),
|
|
1276
|
+
**set_or_null(
|
|
1277
|
+
length=cim.length,
|
|
1278
|
+
designTemperature=cim.design_temperature,
|
|
1279
|
+
designRating=cim.design_rating,
|
|
1280
|
+
)
|
|
1281
|
+
)
|
|
1282
|
+
|
|
1283
|
+
|
|
1284
|
+
def connector_to_pb(cim: Connector) -> PBConnector:
|
|
1285
|
+
return PBConnector(ce=conducting_equipment_to_pb(cim))
|
|
1286
|
+
|
|
1287
|
+
|
|
1288
|
+
@bind_to_pb
|
|
1289
|
+
def cut_to_pb(cim: Cut) -> PBCut:
|
|
1290
|
+
return PBCut(
|
|
1291
|
+
sw=switch_to_pb(cim),
|
|
1292
|
+
acLineSegmentMRID=mrid_or_empty(cim.ac_line_segment),
|
|
1293
|
+
**set_or_null(
|
|
1294
|
+
lengthFromTerminal1=cim.length_from_terminal_1,
|
|
1295
|
+
)
|
|
1296
|
+
)
|
|
1297
|
+
|
|
1298
|
+
|
|
1299
|
+
@bind_to_pb
|
|
1300
|
+
def disconnector_to_pb(cim: Disconnector) -> PBDisconnector:
|
|
1301
|
+
return PBDisconnector(sw=switch_to_pb(cim))
|
|
1302
|
+
|
|
1303
|
+
|
|
1304
|
+
def earth_fault_compensator_to_pb(cim: EarthFaultCompensator) -> PBEarthFaultCompensator:
|
|
1305
|
+
return PBEarthFaultCompensator(
|
|
1306
|
+
ce=conducting_equipment_to_pb(cim),
|
|
1307
|
+
**set_or_null(
|
|
1308
|
+
r=cim.r
|
|
1309
|
+
)
|
|
1310
|
+
)
|
|
1311
|
+
|
|
1312
|
+
|
|
1313
|
+
def energy_connection_to_pb(cim: EnergyConnection, include_asset_info=False) -> PBEnergyConnection:
|
|
1314
|
+
return PBEnergyConnection(ce=conducting_equipment_to_pb(cim, include_asset_info))
|
|
1315
|
+
|
|
1316
|
+
|
|
1317
|
+
@bind_to_pb
|
|
1318
|
+
def energy_consumer_to_pb(cim: EnergyConsumer) -> PBEnergyConsumer:
|
|
1319
|
+
return PBEnergyConsumer(
|
|
1320
|
+
ec=energy_connection_to_pb(cim),
|
|
1321
|
+
energyConsumerPhasesMRIDs=[str(io.mrid) for io in cim.phases],
|
|
1322
|
+
phaseConnection=_map_phase_shunt_connection_kind.to_pb(cim.phase_connection),
|
|
1323
|
+
**set_or_null(
|
|
1324
|
+
p=cim.p,
|
|
1325
|
+
pFixed=cim.p_fixed,
|
|
1326
|
+
q=cim.q,
|
|
1327
|
+
qFixed=cim.q_fixed,
|
|
1328
|
+
customerCount=cim.customer_count,
|
|
1329
|
+
grounded=cim.grounded,
|
|
1330
|
+
)
|
|
1331
|
+
)
|
|
1332
|
+
|
|
1333
|
+
|
|
1334
|
+
@bind_to_pb
|
|
1335
|
+
def energy_consumer_phase_to_pb(cim: EnergyConsumerPhase) -> PBEnergyConsumerPhase:
|
|
1336
|
+
return PBEnergyConsumerPhase(
|
|
1337
|
+
psr=power_system_resource_to_pb(cim),
|
|
1338
|
+
energyConsumerMRID=mrid_or_empty(cim.energy_consumer),
|
|
1339
|
+
phase=_map_single_phase_kind.to_pb(cim.phase),
|
|
1340
|
+
**set_or_null(
|
|
1341
|
+
p=cim.p,
|
|
1342
|
+
pFixed=cim.p_fixed,
|
|
1343
|
+
q=cim.q,
|
|
1344
|
+
qFixed=cim.q_fixed,
|
|
1345
|
+
)
|
|
1346
|
+
)
|
|
1347
|
+
|
|
1348
|
+
|
|
1349
|
+
@bind_to_pb
|
|
1350
|
+
def energy_source_to_pb(cim: EnergySource) -> PBEnergySource:
|
|
1351
|
+
return PBEnergySource(
|
|
1352
|
+
ec=energy_connection_to_pb(cim),
|
|
1353
|
+
energySourcePhasesMRIDs=[str(io.mrid) for io in cim.phases],
|
|
1354
|
+
**set_or_null(
|
|
1355
|
+
activePower=cim.active_power,
|
|
1356
|
+
reactivePower=cim.reactive_power,
|
|
1357
|
+
voltageAngle=cim.voltage_angle,
|
|
1358
|
+
voltageMagnitude=cim.voltage_magnitude,
|
|
1359
|
+
r=cim.r,
|
|
1360
|
+
x=cim.x,
|
|
1361
|
+
pMax=cim.p_max,
|
|
1362
|
+
pMin=cim.p_min,
|
|
1363
|
+
r0=cim.r0,
|
|
1364
|
+
rn=cim.rn,
|
|
1365
|
+
x0=cim.x0,
|
|
1366
|
+
xn=cim.xn,
|
|
1367
|
+
isExternalGrid=cim.is_external_grid,
|
|
1368
|
+
rMin=cim.r_min,
|
|
1369
|
+
rnMin=cim.rn_min,
|
|
1370
|
+
r0Min=cim.r0_min,
|
|
1371
|
+
xMin=cim.x_min,
|
|
1372
|
+
xnMin=cim.xn_min,
|
|
1373
|
+
x0Min=cim.x0_min,
|
|
1374
|
+
rMax=cim.r_max,
|
|
1375
|
+
rnMax=cim.rn_max,
|
|
1376
|
+
r0Max=cim.r0_max,
|
|
1377
|
+
xMax=cim.x_max,
|
|
1378
|
+
xnMax=cim.xn_max,
|
|
1379
|
+
x0Max=cim.x0_max,
|
|
1380
|
+
)
|
|
1381
|
+
)
|
|
1382
|
+
|
|
1383
|
+
|
|
1384
|
+
@bind_to_pb
|
|
1385
|
+
def energy_source_phase_to_pb(cim: EnergySourcePhase) -> PBEnergySourcePhase:
|
|
1386
|
+
return PBEnergySourcePhase(
|
|
1387
|
+
psr=power_system_resource_to_pb(cim),
|
|
1388
|
+
energySourceMRID=mrid_or_empty(cim.energy_source),
|
|
1389
|
+
phase=_map_single_phase_kind.to_pb(cim.phase)
|
|
1390
|
+
)
|
|
1391
|
+
|
|
1392
|
+
|
|
1393
|
+
@bind_to_pb
|
|
1394
|
+
def fuse_to_pb(cim: Fuse) -> PBFuse:
|
|
1395
|
+
return PBFuse(
|
|
1396
|
+
sw=switch_to_pb(cim),
|
|
1397
|
+
functionMRID=mrid_or_empty(cim.function)
|
|
1398
|
+
)
|
|
1399
|
+
|
|
1400
|
+
|
|
1401
|
+
@bind_to_pb
|
|
1402
|
+
def ground_to_pb(cim: Ground) -> PBGround:
|
|
1403
|
+
return PBGround(
|
|
1404
|
+
ce=conducting_equipment_to_pb(cim, True)
|
|
1405
|
+
)
|
|
1406
|
+
|
|
1407
|
+
|
|
1408
|
+
@bind_to_pb
|
|
1409
|
+
def ground_disconnector_to_pb(cim: GroundDisconnector) -> PBGroundDisconnector:
|
|
1410
|
+
return PBGroundDisconnector(
|
|
1411
|
+
sw=switch_to_pb(cim)
|
|
1412
|
+
)
|
|
1413
|
+
|
|
1414
|
+
|
|
1415
|
+
@bind_to_pb
|
|
1416
|
+
def grounding_impedance_to_pb(cim: GroundingImpedance) -> PBGroundingImpedance:
|
|
1417
|
+
return PBGroundingImpedance(
|
|
1418
|
+
efc=earth_fault_compensator_to_pb(cim),
|
|
1419
|
+
**set_or_null(
|
|
1420
|
+
x=cim.x,
|
|
1421
|
+
)
|
|
1422
|
+
)
|
|
1423
|
+
|
|
1424
|
+
|
|
1425
|
+
@bind_to_pb
|
|
1426
|
+
def jumper_to_pb(cim: Jumper) -> PBJumper:
|
|
1427
|
+
return PBJumper(sw=switch_to_pb(cim))
|
|
1428
|
+
|
|
1429
|
+
|
|
1430
|
+
@bind_to_pb
|
|
1431
|
+
def junction_to_pb(cim: Junction) -> PBJunction:
|
|
1432
|
+
return PBJunction(cn=connector_to_pb(cim))
|
|
1433
|
+
|
|
1434
|
+
|
|
1435
|
+
def line_to_pb(cim: Line) -> PBLine:
|
|
1436
|
+
return PBLine(ec=equipment_container_to_pb(cim))
|
|
1437
|
+
|
|
1438
|
+
|
|
1439
|
+
@bind_to_pb
|
|
1440
|
+
def linear_shunt_compensator_to_pb(cim: LinearShuntCompensator) -> PBLinearShuntCompensator:
|
|
1441
|
+
return PBLinearShuntCompensator(
|
|
1442
|
+
sc=shunt_compensator_to_pb(cim),
|
|
1443
|
+
**set_or_null(
|
|
1444
|
+
b0PerSection=cim.b0_per_section,
|
|
1445
|
+
bPerSection=cim.b_per_section,
|
|
1446
|
+
g0PerSection=cim.g0_per_section,
|
|
1447
|
+
gPerSection=cim.g_per_section,
|
|
1448
|
+
)
|
|
1449
|
+
)
|
|
1450
|
+
|
|
1451
|
+
|
|
1452
|
+
@bind_to_pb
|
|
1453
|
+
def load_break_switch_to_pb(cim: LoadBreakSwitch) -> PBLoadBreakSwitch:
|
|
1454
|
+
return PBLoadBreakSwitch(ps=protected_switch_to_pb(cim))
|
|
1455
|
+
|
|
1456
|
+
|
|
1457
|
+
def per_length_impedance_to_pb(cim: PerLengthImpedance) -> PBPerLengthImpedance:
|
|
1458
|
+
return PBPerLengthImpedance(lp=per_length_line_parameter_to_pb(cim))
|
|
1459
|
+
|
|
1460
|
+
|
|
1461
|
+
def per_length_line_parameter_to_pb(cim: PerLengthLineParameter) -> PBPerLengthLineParameter:
|
|
1462
|
+
return PBPerLengthLineParameter(io=identified_object_to_pb(cim))
|
|
1463
|
+
|
|
1464
|
+
|
|
1465
|
+
@bind_to_pb
|
|
1466
|
+
def per_length_phase_impedance_to_pb(cim: PerLengthPhaseImpedance) -> PBPerLengthPhaseImpedance:
|
|
1467
|
+
"""
|
|
1468
|
+
Convert the :class:`PerLengthPhaseImpedance` into its protobuf counterpart.
|
|
1469
|
+
:param cim: The :class:`PerLengthPhaseImpedance` to convert.
|
|
1470
|
+
:return: The protobuf builder.
|
|
1471
|
+
"""
|
|
1472
|
+
return PBPerLengthPhaseImpedance(
|
|
1473
|
+
pli=per_length_impedance_to_pb(cim),
|
|
1474
|
+
phaseImpedanceData=[phase_impedance_data_to_pb(it) for it in cim.data]
|
|
1475
|
+
)
|
|
1476
|
+
|
|
1477
|
+
|
|
1478
|
+
@bind_to_pb
|
|
1479
|
+
def per_length_sequence_impedance_to_pb(cim: PerLengthSequenceImpedance) -> PBPerLengthSequenceImpedance:
|
|
1480
|
+
return PBPerLengthSequenceImpedance(
|
|
1481
|
+
pli=per_length_impedance_to_pb(cim),
|
|
1482
|
+
**set_or_null(
|
|
1483
|
+
r=cim.r,
|
|
1484
|
+
x=cim.x,
|
|
1485
|
+
r0=cim.r0,
|
|
1486
|
+
x0=cim.x0,
|
|
1487
|
+
bch=cim.bch,
|
|
1488
|
+
gch=cim.gch,
|
|
1489
|
+
b0ch=cim.b0ch,
|
|
1490
|
+
g0ch=cim.g0ch,
|
|
1491
|
+
)
|
|
1492
|
+
)
|
|
1493
|
+
|
|
1494
|
+
|
|
1495
|
+
@bind_to_pb
|
|
1496
|
+
def petersen_coil_to_pb(cim: PetersenCoil) -> PBPetersenCoil:
|
|
1497
|
+
return PBPetersenCoil(
|
|
1498
|
+
efc=earth_fault_compensator_to_pb(cim),
|
|
1499
|
+
**set_or_null(
|
|
1500
|
+
xGroundNominal=cim.x_ground_nominal
|
|
1501
|
+
)
|
|
1502
|
+
)
|
|
1503
|
+
|
|
1504
|
+
|
|
1505
|
+
def phase_impedance_data_to_pb(cim: PhaseImpedanceData) -> PBPhaseImpedanceData:
|
|
1506
|
+
"""
|
|
1507
|
+
Convert the :class:`PhaseImpedanceData` into its protobuf counterpart.
|
|
1508
|
+
:param cim: The :class:`PhaseImpedanceData` to convert.
|
|
1509
|
+
:return: The protobuf builder.
|
|
1510
|
+
"""
|
|
1511
|
+
return PBPhaseImpedanceData(
|
|
1512
|
+
fromPhase=_map_single_phase_kind.to_pb(cim.from_phase),
|
|
1513
|
+
toPhase=_map_single_phase_kind.to_pb(cim.to_phase),
|
|
1514
|
+
**set_or_null(
|
|
1515
|
+
b=cim.b,
|
|
1516
|
+
g=cim.g,
|
|
1517
|
+
r=cim.r,
|
|
1518
|
+
x=cim.x,
|
|
1519
|
+
)
|
|
1520
|
+
)
|
|
1521
|
+
|
|
1522
|
+
|
|
1523
|
+
@bind_to_pb
|
|
1524
|
+
def power_electronics_connection_to_pb(cim: PowerElectronicsConnection) -> PBPowerElectronicsConnection:
|
|
1525
|
+
return PBPowerElectronicsConnection(
|
|
1526
|
+
rce=regulating_cond_eq_to_pb(cim),
|
|
1527
|
+
powerElectronicsUnitMRIDs=[str(io.mrid) for io in cim.units],
|
|
1528
|
+
powerElectronicsConnectionPhaseMRIDs=[str(io.mrid) for io in cim.phases],
|
|
1529
|
+
**set_or_null(
|
|
1530
|
+
maxIFault=cim.max_i_fault,
|
|
1531
|
+
maxQ=cim.max_q,
|
|
1532
|
+
minQ=cim.min_q,
|
|
1533
|
+
p=cim.p,
|
|
1534
|
+
q=cim.q,
|
|
1535
|
+
ratedS=cim.rated_s,
|
|
1536
|
+
ratedU=cim.rated_u,
|
|
1537
|
+
inverterStandard=cim.inverter_standard,
|
|
1538
|
+
sustainOpOvervoltLimit=cim.sustain_op_overvolt_limit,
|
|
1539
|
+
stopAtOverFreq=cim.stop_at_over_freq,
|
|
1540
|
+
stopAtUnderFreq=cim.stop_at_under_freq,
|
|
1541
|
+
invVoltWattRespMode=cim.inv_volt_watt_resp_mode,
|
|
1542
|
+
invWattRespV1=cim.inv_watt_resp_v1,
|
|
1543
|
+
invWattRespV2=cim.inv_watt_resp_v2,
|
|
1544
|
+
invWattRespV3=cim.inv_watt_resp_v3,
|
|
1545
|
+
invWattRespV4=cim.inv_watt_resp_v4,
|
|
1546
|
+
invWattRespPAtV1=cim.inv_watt_resp_p_at_v1,
|
|
1547
|
+
invWattRespPAtV2=cim.inv_watt_resp_p_at_v2,
|
|
1548
|
+
invWattRespPAtV3=cim.inv_watt_resp_p_at_v3,
|
|
1549
|
+
invWattRespPAtV4=cim.inv_watt_resp_p_at_v4,
|
|
1550
|
+
invVoltVarRespMode=cim.inv_volt_var_resp_mode,
|
|
1551
|
+
invVarRespV1=cim.inv_var_resp_v1,
|
|
1552
|
+
invVarRespV2=cim.inv_var_resp_v2,
|
|
1553
|
+
invVarRespV3=cim.inv_var_resp_v3,
|
|
1554
|
+
invVarRespV4=cim.inv_var_resp_v4,
|
|
1555
|
+
invVarRespQAtV1=cim.inv_var_resp_q_at_v1,
|
|
1556
|
+
invVarRespQAtV2=cim.inv_var_resp_q_at_v2,
|
|
1557
|
+
invVarRespQAtV3=cim.inv_var_resp_q_at_v3,
|
|
1558
|
+
invVarRespQAtV4=cim.inv_var_resp_q_at_v4,
|
|
1559
|
+
invReactivePowerMode=cim.inv_reactive_power_mode,
|
|
1560
|
+
invFixReactivePower=cim.inv_fix_reactive_power,
|
|
1561
|
+
)
|
|
1562
|
+
)
|
|
1563
|
+
|
|
1564
|
+
|
|
1565
|
+
@bind_to_pb
|
|
1566
|
+
def power_electronics_connection_phase_to_pb(cim: PowerElectronicsConnectionPhase) -> PBPowerElectronicsConnectionPhase:
|
|
1567
|
+
return PBPowerElectronicsConnectionPhase(
|
|
1568
|
+
psr=power_system_resource_to_pb(cim),
|
|
1569
|
+
powerElectronicsConnectionMRID=mrid_or_empty(cim.power_electronics_connection),
|
|
1570
|
+
phase=_map_single_phase_kind.to_pb(cim.phase),
|
|
1571
|
+
**set_or_null(
|
|
1572
|
+
p=cim.p,
|
|
1573
|
+
q=cim.q,
|
|
1574
|
+
)
|
|
1575
|
+
)
|
|
1576
|
+
|
|
1577
|
+
|
|
1578
|
+
@bind_to_pb
|
|
1579
|
+
def power_transformer_to_pb(cim: PowerTransformer) -> PBPowerTransformer:
|
|
1580
|
+
return PBPowerTransformer(
|
|
1581
|
+
ce=conducting_equipment_to_pb(cim, True),
|
|
1582
|
+
powerTransformerEndMRIDs=[str(io.mrid) for io in cim.ends],
|
|
1583
|
+
vectorGroup=_map_vector_group.to_pb(cim.vector_group),
|
|
1584
|
+
constructionKind=_map_transformer_construction_kind.to_pb(cim.construction_kind),
|
|
1585
|
+
function=_map_transformer_function_kind.to_pb(cim.function),
|
|
1586
|
+
**set_or_null(
|
|
1587
|
+
transformerUtilisation=cim.transformer_utilisation,
|
|
1588
|
+
)
|
|
1589
|
+
)
|
|
1590
|
+
|
|
1591
|
+
|
|
1592
|
+
@bind_to_pb
|
|
1593
|
+
def power_transformer_end_to_pb(cim: PowerTransformerEnd) -> PBPowerTransformerEnd:
|
|
1594
|
+
return PBPowerTransformerEnd(
|
|
1595
|
+
te=transformer_end_to_pb(cim),
|
|
1596
|
+
powerTransformerMRID=mrid_or_empty(cim.power_transformer),
|
|
1597
|
+
connectionKind=_map_winding_connection.to_pb(cim.connection_kind),
|
|
1598
|
+
ratings=[transformer_end_rated_s_to_pb(it) for it in cim.s_ratings],
|
|
1599
|
+
**set_or_null(
|
|
1600
|
+
ratedS=cim.rated_s,
|
|
1601
|
+
ratedU=cim.rated_u,
|
|
1602
|
+
r=cim.r,
|
|
1603
|
+
r0=cim.r0,
|
|
1604
|
+
x=cim.x,
|
|
1605
|
+
x0=cim.x0,
|
|
1606
|
+
b=cim.b,
|
|
1607
|
+
b0=cim.b0,
|
|
1608
|
+
g=cim.g,
|
|
1609
|
+
g0=cim.g0,
|
|
1610
|
+
phaseAngleClock=cim.phase_angle_clock,
|
|
1611
|
+
)
|
|
1612
|
+
)
|
|
1613
|
+
|
|
1614
|
+
|
|
1615
|
+
def protected_switch_to_pb(cim: ProtectedSwitch) -> PBProtectedSwitch:
|
|
1616
|
+
return PBProtectedSwitch(
|
|
1617
|
+
sw=switch_to_pb(cim),
|
|
1618
|
+
relayFunctionMRIDs=[str(io.mrid) for io in cim.relay_functions],
|
|
1619
|
+
**set_or_null(
|
|
1620
|
+
breakingCapacity=cim.breaking_capacity,
|
|
1621
|
+
)
|
|
1622
|
+
)
|
|
1623
|
+
|
|
1624
|
+
|
|
1625
|
+
@bind_to_pb
|
|
1626
|
+
def ratio_tap_changer_to_pb(cim: RatioTapChanger) -> PBRatioTapChanger:
|
|
1627
|
+
return PBRatioTapChanger(
|
|
1628
|
+
tc=tap_changer_to_pb(cim),
|
|
1629
|
+
transformerEndMRID=mrid_or_empty(cim.transformer_end),
|
|
1630
|
+
**set_or_null(
|
|
1631
|
+
stepVoltageIncrement=cim.step_voltage_increment,
|
|
1632
|
+
)
|
|
1633
|
+
)
|
|
1634
|
+
|
|
1635
|
+
|
|
1636
|
+
@bind_to_pb
|
|
1637
|
+
def reactive_capability_curve_to_pb(cim: ReactiveCapabilityCurve) -> PBReactiveCapabilityCurve:
|
|
1638
|
+
return PBReactiveCapabilityCurve(c=curve_to_pb(cim))
|
|
1639
|
+
|
|
1640
|
+
|
|
1641
|
+
@bind_to_pb
|
|
1642
|
+
def recloser_to_pb(cim: Recloser) -> PBRecloser:
|
|
1643
|
+
return PBRecloser(sw=protected_switch_to_pb(cim))
|
|
1644
|
+
|
|
1645
|
+
|
|
1646
|
+
def regulating_cond_eq_to_pb(cim: RegulatingCondEq, include_asset_info=False) -> PBRegulatingCondEq:
|
|
1647
|
+
return PBRegulatingCondEq(
|
|
1648
|
+
ec=energy_connection_to_pb(cim, include_asset_info),
|
|
1649
|
+
regulatingControlMRID=mrid_or_empty(cim.regulating_control),
|
|
1650
|
+
**set_or_null(
|
|
1651
|
+
controlEnabled=cim.control_enabled,
|
|
1652
|
+
)
|
|
1653
|
+
)
|
|
1654
|
+
|
|
1655
|
+
|
|
1656
|
+
def regulating_control_to_pb(cim: RegulatingControl) -> PBRegulatingControl:
|
|
1657
|
+
"""
|
|
1658
|
+
Convert the :class:`RegulatingControl` into its protobuf counterpart.
|
|
1659
|
+
:param cim: The :class:`RegulatingControl` to convert.
|
|
1660
|
+
:return: The protobuf builder.
|
|
1661
|
+
"""
|
|
1662
|
+
return PBRegulatingControl(
|
|
1663
|
+
psr=power_system_resource_to_pb(cim),
|
|
1664
|
+
mode=_map_regulating_control_mode_kind.to_pb(cim.mode),
|
|
1665
|
+
monitoredPhase=_map_phase_code.to_pb(cim.monitored_phase),
|
|
1666
|
+
terminalMRID=mrid_or_empty(cim.terminal),
|
|
1667
|
+
regulatingCondEqMRIDs=[str(io.mrid) for io in cim.regulating_conducting_equipment],
|
|
1668
|
+
**set_or_null(
|
|
1669
|
+
discrete=cim.discrete,
|
|
1670
|
+
targetDeadband=cim.target_deadband,
|
|
1671
|
+
targetValue=cim.target_value,
|
|
1672
|
+
enabled=cim.enabled,
|
|
1673
|
+
maxAllowedTargetValue=cim.max_allowed_target_value,
|
|
1674
|
+
minAllowedTargetValue=cim.min_allowed_target_value,
|
|
1675
|
+
ratedCurrent=cim.rated_current,
|
|
1676
|
+
ctPrimary=cim.ct_primary,
|
|
1677
|
+
minTargetDeadband=cim.min_target_deadband,
|
|
1678
|
+
)
|
|
1679
|
+
)
|
|
1680
|
+
|
|
1681
|
+
|
|
1682
|
+
def rotating_machine_to_pb(cim: RotatingMachine) -> PBRotatingMachine:
|
|
1683
|
+
return PBRotatingMachine(
|
|
1684
|
+
rce=regulating_cond_eq_to_pb(cim, True),
|
|
1685
|
+
**set_or_null(
|
|
1686
|
+
ratedPowerFactor=cim.rated_power_factor,
|
|
1687
|
+
ratedS=cim.rated_s,
|
|
1688
|
+
ratedU=cim.rated_u,
|
|
1689
|
+
p=cim.p,
|
|
1690
|
+
q=cim.q,
|
|
1691
|
+
)
|
|
1692
|
+
)
|
|
1693
|
+
|
|
1694
|
+
|
|
1695
|
+
@bind_to_pb
|
|
1696
|
+
def series_compensator_to_pb(cim: SeriesCompensator) -> PBSeriesCompensator:
|
|
1697
|
+
return PBSeriesCompensator(
|
|
1698
|
+
ce=conducting_equipment_to_pb(cim, True),
|
|
1699
|
+
**set_or_null(
|
|
1700
|
+
r=cim.r,
|
|
1701
|
+
r0=cim.r0,
|
|
1702
|
+
x=cim.x,
|
|
1703
|
+
x0=cim.x0,
|
|
1704
|
+
varistorRatedCurrent=cim.varistor_rated_current,
|
|
1705
|
+
varistorVoltageThreshold=cim.varistor_voltage_threshold,
|
|
1706
|
+
)
|
|
1707
|
+
)
|
|
1708
|
+
|
|
1709
|
+
|
|
1710
|
+
def shunt_compensator_to_pb(cim: ShuntCompensator) -> PBShuntCompensator:
|
|
1711
|
+
return PBShuntCompensator(
|
|
1712
|
+
rce=regulating_cond_eq_to_pb(cim, True),
|
|
1713
|
+
phaseConnection=_map_phase_shunt_connection_kind.to_pb(cim.phase_connection),
|
|
1714
|
+
**set_or_null(
|
|
1715
|
+
sections=cim.sections,
|
|
1716
|
+
grounded=cim.grounded,
|
|
1717
|
+
nomU=cim.nom_u,
|
|
1718
|
+
)
|
|
1719
|
+
)
|
|
1720
|
+
|
|
1721
|
+
|
|
1722
|
+
@bind_to_pb
|
|
1723
|
+
def static_var_compensator_to_pb(cim: StaticVarCompensator) -> PBStaticVarCompensator:
|
|
1724
|
+
"""
|
|
1725
|
+
Convert the :class:`StaticVarCompensator` into its protobuf counterpart.
|
|
1726
|
+
:param cim: The :class:`StaticVarCompensator` to convert.
|
|
1727
|
+
:return: The protobuf builder.
|
|
1728
|
+
"""
|
|
1729
|
+
return PBStaticVarCompensator(
|
|
1730
|
+
rce=regulating_cond_eq_to_pb(cim),
|
|
1731
|
+
svcControlMode=_map_svc_control_mode.to_pb(cim.svc_control_mode),
|
|
1732
|
+
**set_or_null(
|
|
1733
|
+
capacitiveRating=cim.capacitive_rating,
|
|
1734
|
+
inductiveRating=cim.inductive_rating,
|
|
1735
|
+
q=cim.q,
|
|
1736
|
+
voltageSetPoint=cim.voltage_set_point,
|
|
1737
|
+
)
|
|
1738
|
+
)
|
|
1739
|
+
|
|
1740
|
+
|
|
1741
|
+
def switch_to_pb(cim: Switch) -> PBSwitch:
|
|
1742
|
+
return PBSwitch(
|
|
1743
|
+
ce=conducting_equipment_to_pb(cim, True),
|
|
1744
|
+
normalOpen=cim.get_normal_state() != 0,
|
|
1745
|
+
open=cim.get_state() != 0,
|
|
1746
|
+
**set_or_null(
|
|
1747
|
+
ratedCurrent=cim.rated_current,
|
|
1748
|
+
)
|
|
1749
|
+
)
|
|
1750
|
+
|
|
1751
|
+
|
|
1752
|
+
@bind_to_pb
|
|
1753
|
+
def synchronous_machine_to_pb(cim: SynchronousMachine) -> PBSynchronousMachine:
|
|
1754
|
+
return PBSynchronousMachine(
|
|
1755
|
+
rm=rotating_machine_to_pb(cim),
|
|
1756
|
+
|
|
1757
|
+
reactiveCapabilityCurveMRIDs=[str(it.mrid) for it in cim.curves],
|
|
1758
|
+
type=_map_synchronous_machine_kind.to_pb(cim.type),
|
|
1759
|
+
operatingMode=_map_synchronous_machine_kind.to_pb(cim.operating_mode),
|
|
1760
|
+
**set_or_null(
|
|
1761
|
+
baseQ=cim.base_q,
|
|
1762
|
+
condenserP=cim.condenser_p,
|
|
1763
|
+
earthing=cim.earthing,
|
|
1764
|
+
earthingStarPointR=cim.earthing_star_point_r,
|
|
1765
|
+
earthingStarPointX=cim.earthing_star_point_x,
|
|
1766
|
+
ikk=cim.ikk,
|
|
1767
|
+
maxQ=cim.max_q,
|
|
1768
|
+
maxU=cim.max_u,
|
|
1769
|
+
minQ=cim.min_q,
|
|
1770
|
+
minU=cim.min_u,
|
|
1771
|
+
mu=cim.mu,
|
|
1772
|
+
r=cim.r,
|
|
1773
|
+
r0=cim.r0,
|
|
1774
|
+
r2=cim.r2,
|
|
1775
|
+
satDirectSubtransX=cim.sat_direct_subtrans_x,
|
|
1776
|
+
satDirectSyncX=cim.sat_direct_sync_x,
|
|
1777
|
+
satDirectTransX=cim.sat_direct_trans_x,
|
|
1778
|
+
x0=cim.x0,
|
|
1779
|
+
x2=cim.x2,
|
|
1780
|
+
)
|
|
1781
|
+
)
|
|
1782
|
+
|
|
1783
|
+
|
|
1784
|
+
def tap_changer_to_pb(cim: TapChanger) -> PBTapChanger:
|
|
1785
|
+
return PBTapChanger(
|
|
1786
|
+
psr=power_system_resource_to_pb(cim),
|
|
1787
|
+
tapChangerControlMRID=mrid_or_empty(cim.tap_changer_control),
|
|
1788
|
+
**set_or_null(
|
|
1789
|
+
highStep=cim.high_step,
|
|
1790
|
+
lowStep=cim.low_step,
|
|
1791
|
+
step=cim.step,
|
|
1792
|
+
neutralStep=cim.neutral_step,
|
|
1793
|
+
neutralU=cim.neutral_u,
|
|
1794
|
+
normalStep=cim.normal_step,
|
|
1795
|
+
controlEnabled=cim.control_enabled,
|
|
1796
|
+
)
|
|
1797
|
+
)
|
|
1798
|
+
|
|
1799
|
+
|
|
1800
|
+
@bind_to_pb
|
|
1801
|
+
def tap_changer_control_to_pb(cim: TapChangerControl) -> PBTapChangerControl:
|
|
1802
|
+
return PBTapChangerControl(
|
|
1803
|
+
rc=regulating_control_to_pb(cim),
|
|
1804
|
+
**set_or_null(
|
|
1805
|
+
limitVoltage=cim.limit_voltage,
|
|
1806
|
+
lineDropCompensation=cim.line_drop_compensation,
|
|
1807
|
+
lineDropR=cim.line_drop_r,
|
|
1808
|
+
lineDropX=cim.line_drop_x,
|
|
1809
|
+
reverseLineDropR=cim.reverse_line_drop_r,
|
|
1810
|
+
reverseLineDropX=cim.reverse_line_drop_x,
|
|
1811
|
+
forwardLDCBlocking=cim.forward_ldc_blocking,
|
|
1812
|
+
timeDelay=cim.time_delay,
|
|
1813
|
+
coGenerationEnabled=cim.co_generation_enabled
|
|
1814
|
+
)
|
|
1815
|
+
)
|
|
1816
|
+
|
|
1817
|
+
|
|
1818
|
+
def transformer_end_to_pb(cim: TransformerEnd) -> PBTransformerEnd:
|
|
1819
|
+
return PBTransformerEnd(
|
|
1820
|
+
io=identified_object_to_pb(cim),
|
|
1821
|
+
terminalMRID=mrid_or_empty(cim.terminal),
|
|
1822
|
+
baseVoltageMRID=mrid_or_empty(cim.base_voltage),
|
|
1823
|
+
ratioTapChangerMRID=mrid_or_empty(cim.ratio_tap_changer),
|
|
1824
|
+
starImpedanceMRID=mrid_or_empty(cim.star_impedance),
|
|
1825
|
+
endNumber=cim.end_number,
|
|
1826
|
+
**set_or_null(
|
|
1827
|
+
grounded=cim.grounded,
|
|
1828
|
+
rGround=cim.r_ground,
|
|
1829
|
+
xGround=cim.x_ground,
|
|
1830
|
+
)
|
|
1831
|
+
)
|
|
1832
|
+
|
|
1833
|
+
|
|
1834
|
+
def transformer_end_rated_s_to_pb(cim: TransformerEndRatedS) -> PBTransformerEndRatedS:
|
|
1835
|
+
return PBTransformerEndRatedS(
|
|
1836
|
+
coolingType=_map_transformer_cooling_type.to_pb(cim.cooling_type),
|
|
1837
|
+
ratedS=cim.rated_s,
|
|
1838
|
+
)
|
|
1839
|
+
|
|
1840
|
+
|
|
1841
|
+
@bind_to_pb
|
|
1842
|
+
def transformer_star_impedance_to_pb(cim: TransformerStarImpedance) -> PBTransformerStarImpedance:
|
|
1843
|
+
return PBTransformerStarImpedance(
|
|
1844
|
+
io=identified_object_to_pb(cim),
|
|
1845
|
+
transformerEndInfoMRID=mrid_or_empty(cim.transformer_end_info),
|
|
1846
|
+
**set_or_null(
|
|
1847
|
+
r=cim.r,
|
|
1848
|
+
r0=cim.r0,
|
|
1849
|
+
x=cim.x,
|
|
1850
|
+
x0=cim.x0
|
|
1851
|
+
)
|
|
1852
|
+
)
|
|
1853
|
+
|
|
1854
|
+
|
|
1855
|
+
###############################
|
|
1856
|
+
# IEC61970 InfIEC61970 Feeder #
|
|
1857
|
+
###############################
|
|
1858
|
+
|
|
1859
|
+
|
|
1860
|
+
@bind_to_pb
|
|
1861
|
+
def circuit_to_pb(cim: Circuit) -> PBCircuit:
|
|
1862
|
+
return PBCircuit(
|
|
1863
|
+
l=line_to_pb(cim),
|
|
1864
|
+
loopMRID=mrid_or_empty(cim.loop),
|
|
1865
|
+
endTerminalMRIDs=[str(io.mrid) for io in cim.end_terminals],
|
|
1866
|
+
endSubstationMRIDs=[str(io.mrid) for io in cim.end_substations]
|
|
1867
|
+
)
|