zepben.ewb 1.0.0b6__py3-none-any.whl → 1.0.0b8__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/services/common/translator/base_cim2proto.py +21 -10
- zepben/ewb/services/common/translator/base_proto2cim.py +42 -13
- zepben/ewb/services/common/translator/util.py +3 -6
- zepben/ewb/services/network/translator/network_cim2proto.py +88 -132
- zepben/ewb/services/network/translator/network_proto2cim.py +259 -223
- zepben/ewb/streaming/grpc/grpc_channel_builder.py +6 -1
- {zepben_ewb-1.0.0b6.dist-info → zepben_ewb-1.0.0b8.dist-info}/METADATA +1 -1
- {zepben_ewb-1.0.0b6.dist-info → zepben_ewb-1.0.0b8.dist-info}/RECORD +11 -11
- {zepben_ewb-1.0.0b6.dist-info → zepben_ewb-1.0.0b8.dist-info}/WHEEL +0 -0
- {zepben_ewb-1.0.0b6.dist-info → zepben_ewb-1.0.0b8.dist-info}/licenses/LICENSE +0 -0
- {zepben_ewb-1.0.0b6.dist-info → zepben_ewb-1.0.0b8.dist-info}/top_level.txt +0 -0
|
@@ -301,7 +301,7 @@ from zepben.ewb.model.cim.iec61970.base.wires.tap_changer_control import *
|
|
|
301
301
|
from zepben.ewb.model.cim.iec61970.base.wires.transformer_end import *
|
|
302
302
|
from zepben.ewb.model.cim.iec61970.base.wires.transformer_star_impedance import *
|
|
303
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
|
|
304
|
+
from zepben.ewb.services.common.translator.base_cim2proto import identified_object_to_pb, organisation_role_to_pb, document_to_pb, bind_to_pb
|
|
305
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
306
|
nullable_bool_settings
|
|
307
307
|
# noinspection PyProtectedMember
|
|
@@ -324,6 +324,7 @@ class CimTranslationException(Exception):
|
|
|
324
324
|
# Extensions IEC61968 Asset Info #
|
|
325
325
|
##################################
|
|
326
326
|
|
|
327
|
+
@bind_to_pb
|
|
327
328
|
def relay_info_to_pb(cim: RelayInfo) -> PBRelayInfo:
|
|
328
329
|
return PBRelayInfo(
|
|
329
330
|
ai=asset_info_to_pb(cim),
|
|
@@ -333,13 +334,11 @@ def relay_info_to_pb(cim: RelayInfo) -> PBRelayInfo:
|
|
|
333
334
|
)
|
|
334
335
|
|
|
335
336
|
|
|
336
|
-
RelayInfo.to_pb = relay_info_to_pb
|
|
337
|
-
|
|
338
|
-
|
|
339
337
|
################################
|
|
340
338
|
# Extensions IEC61968 Metering #
|
|
341
339
|
################################
|
|
342
340
|
|
|
341
|
+
@bind_to_pb
|
|
343
342
|
def pan_demand_response_function_to_pb(cim: PanDemandResponseFunction) -> PBPanDemandResponseFunction:
|
|
344
343
|
"""
|
|
345
344
|
Convert the :class:`PanDemandResponseFunction` into its protobuf counterpart.
|
|
@@ -354,24 +353,20 @@ def pan_demand_response_function_to_pb(cim: PanDemandResponseFunction) -> PBPanD
|
|
|
354
353
|
)
|
|
355
354
|
|
|
356
355
|
|
|
357
|
-
PanDemandResponseFunction.to_pb = pan_demand_response_function_to_pb
|
|
358
|
-
|
|
359
|
-
|
|
360
356
|
#################################
|
|
361
357
|
# Extensions IEC61970 Base Core #
|
|
362
358
|
#################################
|
|
363
359
|
|
|
360
|
+
@bind_to_pb
|
|
364
361
|
def site_to_pb(cim: Site) -> PBSite:
|
|
365
362
|
return PBSite(ec=equipment_container_to_pb(cim))
|
|
366
363
|
|
|
367
364
|
|
|
368
|
-
Site.to_pb = site_to_pb
|
|
369
|
-
|
|
370
|
-
|
|
371
365
|
###################################
|
|
372
366
|
# Extensions IEC61970 Base Feeder #
|
|
373
367
|
###################################
|
|
374
368
|
|
|
369
|
+
@bind_to_pb
|
|
375
370
|
def loop_to_pb(cim: Loop) -> PBLoop:
|
|
376
371
|
return PBLoop(
|
|
377
372
|
io=identified_object_to_pb(cim),
|
|
@@ -381,6 +376,7 @@ def loop_to_pb(cim: Loop) -> PBLoop:
|
|
|
381
376
|
)
|
|
382
377
|
|
|
383
378
|
|
|
379
|
+
@bind_to_pb
|
|
384
380
|
def lv_feeder_to_pb(cim: LvFeeder) -> PBLvFeeder:
|
|
385
381
|
return PBLvFeeder(
|
|
386
382
|
ec=equipment_container_to_pb(cim),
|
|
@@ -390,25 +386,20 @@ def lv_feeder_to_pb(cim: LvFeeder) -> PBLvFeeder:
|
|
|
390
386
|
)
|
|
391
387
|
|
|
392
388
|
|
|
393
|
-
Loop.to_pb = loop_to_pb
|
|
394
|
-
LvFeeder.to_pb = lv_feeder_to_pb
|
|
395
|
-
|
|
396
|
-
|
|
397
389
|
##################################################
|
|
398
390
|
# Extensions IEC61970 Base Generation Production #
|
|
399
391
|
##################################################
|
|
400
392
|
|
|
393
|
+
@bind_to_pb
|
|
401
394
|
def ev_charging_unit(cim: EvChargingUnit) -> PBEvChargingUnit:
|
|
402
395
|
return PBEvChargingUnit(peu=power_electronics_unit_to_pb(cim))
|
|
403
396
|
|
|
404
397
|
|
|
405
|
-
EvChargingUnit.to_pb = ev_charging_unit
|
|
406
|
-
|
|
407
|
-
|
|
408
398
|
#######################################
|
|
409
399
|
# Extensions IEC61970 Base Protection #
|
|
410
400
|
#######################################
|
|
411
401
|
|
|
402
|
+
@bind_to_pb
|
|
412
403
|
def distance_relay_to_pb(cim: DistanceRelay) -> PBDistanceRelay:
|
|
413
404
|
return PBDistanceRelay(
|
|
414
405
|
prf=protection_relay_function_to_pb(cim, True),
|
|
@@ -441,6 +432,7 @@ def protection_relay_function_to_pb(cim: ProtectionRelayFunction, include_asset_
|
|
|
441
432
|
)
|
|
442
433
|
|
|
443
434
|
|
|
435
|
+
@bind_to_pb
|
|
444
436
|
def protection_relay_scheme_to_pb(cim: ProtectionRelayScheme) -> PBProtectionRelayScheme:
|
|
445
437
|
return PBProtectionRelayScheme(
|
|
446
438
|
io=identified_object_to_pb(cim),
|
|
@@ -449,6 +441,7 @@ def protection_relay_scheme_to_pb(cim: ProtectionRelayScheme) -> PBProtectionRel
|
|
|
449
441
|
)
|
|
450
442
|
|
|
451
443
|
|
|
444
|
+
@bind_to_pb
|
|
452
445
|
def protection_relay_system_to_pb(cim: ProtectionRelaySystem) -> PBProtectionRelaySystem:
|
|
453
446
|
return PBProtectionRelaySystem(
|
|
454
447
|
eq=equipment_to_pb(cim),
|
|
@@ -465,22 +458,18 @@ def relay_setting_to_pb(cim: RelaySetting) -> PBRelaySetting:
|
|
|
465
458
|
)
|
|
466
459
|
|
|
467
460
|
|
|
461
|
+
@bind_to_pb
|
|
468
462
|
def voltage_relay_to_pb(cim: VoltageRelay) -> PBVoltageRelay:
|
|
469
463
|
return PBVoltageRelay(
|
|
470
464
|
prf=protection_relay_function_to_pb(cim, True),
|
|
471
465
|
)
|
|
472
466
|
|
|
473
467
|
|
|
474
|
-
DistanceRelay.to_pb = distance_relay_to_pb
|
|
475
|
-
ProtectionRelayScheme.to_pb = protection_relay_scheme_to_pb
|
|
476
|
-
ProtectionRelaySystem.to_pb = protection_relay_system_to_pb
|
|
477
|
-
VoltageRelay.to_pb = voltage_relay_to_pb
|
|
478
|
-
|
|
479
|
-
|
|
480
468
|
##################################
|
|
481
469
|
# Extensions IEC61970 Base Wires #
|
|
482
470
|
##################################
|
|
483
471
|
|
|
472
|
+
@bind_to_pb
|
|
484
473
|
def battery_control_to_pb(cim: BatteryControl) -> PBBatteryControl:
|
|
485
474
|
"""
|
|
486
475
|
Convert the :class:`BatteryControl` into its protobuf counterpart.
|
|
@@ -497,17 +486,16 @@ def battery_control_to_pb(cim: BatteryControl) -> PBBatteryControl:
|
|
|
497
486
|
)
|
|
498
487
|
|
|
499
488
|
|
|
500
|
-
BatteryControl.to_pb = battery_control_to_pb
|
|
501
|
-
|
|
502
|
-
|
|
503
489
|
#######################
|
|
504
490
|
# IEC61968 Asset Info #
|
|
505
491
|
#######################
|
|
506
492
|
|
|
493
|
+
@bind_to_pb
|
|
507
494
|
def cable_info_to_pb(cim: CableInfo) -> PBCableInfo:
|
|
508
495
|
return PBCableInfo(wi=wire_info_to_pb(cim))
|
|
509
496
|
|
|
510
497
|
|
|
498
|
+
@bind_to_pb
|
|
511
499
|
def no_load_test_to_pb(cim: NoLoadTest) -> PBNoLoadTest:
|
|
512
500
|
return PBNoLoadTest(
|
|
513
501
|
tt=transformer_test_to_pb(cim),
|
|
@@ -519,6 +507,7 @@ def no_load_test_to_pb(cim: NoLoadTest) -> PBNoLoadTest:
|
|
|
519
507
|
)
|
|
520
508
|
|
|
521
509
|
|
|
510
|
+
@bind_to_pb
|
|
522
511
|
def open_circuit_test_to_pb(cim: OpenCircuitTest) -> PBOpenCircuitTest:
|
|
523
512
|
return PBOpenCircuitTest(
|
|
524
513
|
tt=transformer_test_to_pb(cim),
|
|
@@ -530,10 +519,12 @@ def open_circuit_test_to_pb(cim: OpenCircuitTest) -> PBOpenCircuitTest:
|
|
|
530
519
|
)
|
|
531
520
|
|
|
532
521
|
|
|
522
|
+
@bind_to_pb
|
|
533
523
|
def overhead_wire_info_to_pb(cim: OverheadWireInfo) -> PBOverheadWireInfo:
|
|
534
524
|
return PBOverheadWireInfo(wi=wire_info_to_pb(cim))
|
|
535
525
|
|
|
536
526
|
|
|
527
|
+
@bind_to_pb
|
|
537
528
|
def power_transformer_info_to_pb(cim: PowerTransformerInfo) -> PBPowerTransformerInfo:
|
|
538
529
|
return PBPowerTransformerInfo(
|
|
539
530
|
ai=asset_info_to_pb(cim),
|
|
@@ -541,6 +532,7 @@ def power_transformer_info_to_pb(cim: PowerTransformerInfo) -> PBPowerTransforme
|
|
|
541
532
|
)
|
|
542
533
|
|
|
543
534
|
|
|
535
|
+
@bind_to_pb
|
|
544
536
|
def short_circuit_test_to_pb(cim: ShortCircuitTest) -> PBShortCircuitTest:
|
|
545
537
|
return PBShortCircuitTest(
|
|
546
538
|
tt=transformer_test_to_pb(cim),
|
|
@@ -557,6 +549,7 @@ def short_circuit_test_to_pb(cim: ShortCircuitTest) -> PBShortCircuitTest:
|
|
|
557
549
|
)
|
|
558
550
|
|
|
559
551
|
|
|
552
|
+
@bind_to_pb
|
|
560
553
|
def shunt_compensator_info_to_pb(cim: ShuntCompensatorInfo) -> PBShuntCompensatorInfo:
|
|
561
554
|
return PBShuntCompensatorInfo(
|
|
562
555
|
ai=asset_info_to_pb(cim),
|
|
@@ -567,6 +560,7 @@ def shunt_compensator_info_to_pb(cim: ShuntCompensatorInfo) -> PBShuntCompensato
|
|
|
567
560
|
)
|
|
568
561
|
|
|
569
562
|
|
|
563
|
+
@bind_to_pb
|
|
570
564
|
def switch_info_to_pb(cim: SwitchInfo) -> PBSwitchInfo:
|
|
571
565
|
return PBSwitchInfo(
|
|
572
566
|
ai=asset_info_to_pb(cim),
|
|
@@ -574,6 +568,7 @@ def switch_info_to_pb(cim: SwitchInfo) -> PBSwitchInfo:
|
|
|
574
568
|
)
|
|
575
569
|
|
|
576
570
|
|
|
571
|
+
@bind_to_pb
|
|
577
572
|
def transformer_end_info_to_pb(cim: TransformerEndInfo) -> PBTransformerEndInfo:
|
|
578
573
|
return PBTransformerEndInfo(
|
|
579
574
|
ai=asset_info_to_pb(cim),
|
|
@@ -596,6 +591,7 @@ def transformer_end_info_to_pb(cim: TransformerEndInfo) -> PBTransformerEndInfo:
|
|
|
596
591
|
)
|
|
597
592
|
|
|
598
593
|
|
|
594
|
+
@bind_to_pb
|
|
599
595
|
def transformer_tank_info_to_pb(cim: TransformerTankInfo) -> PBTransformerTankInfo:
|
|
600
596
|
return PBTransformerTankInfo(
|
|
601
597
|
ai=asset_info_to_pb(cim),
|
|
@@ -603,6 +599,7 @@ def transformer_tank_info_to_pb(cim: TransformerTankInfo) -> PBTransformerTankIn
|
|
|
603
599
|
)
|
|
604
600
|
|
|
605
601
|
|
|
602
|
+
@bind_to_pb
|
|
606
603
|
def transformer_test_to_pb(cim: TransformerTest) -> PBTransformerTest:
|
|
607
604
|
return PBTransformerTest(
|
|
608
605
|
io=identified_object_to_pb(cim),
|
|
@@ -611,6 +608,7 @@ def transformer_test_to_pb(cim: TransformerTest) -> PBTransformerTest:
|
|
|
611
608
|
)
|
|
612
609
|
|
|
613
610
|
|
|
611
|
+
@bind_to_pb
|
|
614
612
|
def wire_info_to_pb(cim: WireInfo) -> PBWireInfo:
|
|
615
613
|
return PBWireInfo(
|
|
616
614
|
ai=asset_info_to_pb(cim),
|
|
@@ -619,18 +617,6 @@ def wire_info_to_pb(cim: WireInfo) -> PBWireInfo:
|
|
|
619
617
|
)
|
|
620
618
|
|
|
621
619
|
|
|
622
|
-
CableInfo.to_pb = cable_info_to_pb
|
|
623
|
-
NoLoadTest.to_pb = no_load_test_to_pb
|
|
624
|
-
OpenCircuitTest.to_pb = open_circuit_test_to_pb
|
|
625
|
-
OverheadWireInfo.to_pb = overhead_wire_info_to_pb
|
|
626
|
-
PowerTransformerInfo.to_pb = power_transformer_info_to_pb
|
|
627
|
-
ShortCircuitTest.to_pb = short_circuit_test_to_pb
|
|
628
|
-
ShuntCompensatorInfo.to_pb = shunt_compensator_info_to_pb
|
|
629
|
-
SwitchInfo.to_pb = switch_info_to_pb
|
|
630
|
-
TransformerEndInfo.to_pb = transformer_end_info_to_pb
|
|
631
|
-
TransformerTankInfo.to_pb = transformer_tank_info_to_pb
|
|
632
|
-
|
|
633
|
-
|
|
634
620
|
###################
|
|
635
621
|
# IEC61968 Assets #
|
|
636
622
|
###################
|
|
@@ -667,10 +653,12 @@ def asset_organisation_role_to_pb(cim: AssetOrganisationRole) -> PBAssetOrganisa
|
|
|
667
653
|
return pb
|
|
668
654
|
|
|
669
655
|
|
|
656
|
+
@bind_to_pb
|
|
670
657
|
def asset_owner_to_pb(cim: AssetOwner) -> PBAssetOwner:
|
|
671
658
|
return PBAssetOwner(aor=asset_organisation_role_to_pb(cim))
|
|
672
659
|
|
|
673
660
|
|
|
661
|
+
@bind_to_pb
|
|
674
662
|
def streetlight_to_pb(cim: Streetlight) -> PBStreetlight:
|
|
675
663
|
return PBStreetlight(
|
|
676
664
|
at=asset_to_pb(cim),
|
|
@@ -684,14 +672,11 @@ def structure_to_pb(cim: Structure) -> PBStructure:
|
|
|
684
672
|
return PBStructure(ac=asset_container_to_pb(cim))
|
|
685
673
|
|
|
686
674
|
|
|
687
|
-
AssetOwner.to_pb = asset_owner_to_pb
|
|
688
|
-
Streetlight.to_pb = streetlight_to_pb
|
|
689
|
-
|
|
690
|
-
|
|
691
675
|
###################
|
|
692
676
|
# IEC61968 Common #
|
|
693
677
|
###################
|
|
694
678
|
|
|
679
|
+
@bind_to_pb
|
|
695
680
|
def location_to_pb(cim: Location) -> PBLocation:
|
|
696
681
|
return PBLocation(
|
|
697
682
|
io=identified_object_to_pb(cim),
|
|
@@ -729,13 +714,11 @@ def town_detail_to_pb(cim: TownDetail) -> PBTownDetail:
|
|
|
729
714
|
return PBTownDetail(name=cim.name, stateOrProvince=cim.state_or_province)
|
|
730
715
|
|
|
731
716
|
|
|
732
|
-
Location.to_pb = location_to_pb
|
|
733
|
-
|
|
734
|
-
|
|
735
717
|
#####################################
|
|
736
718
|
# IEC61968 InfIEC61968 InfAssetInfo #
|
|
737
719
|
#####################################
|
|
738
720
|
|
|
721
|
+
@bind_to_pb
|
|
739
722
|
def current_transformer_info_to_pb(cim: CurrentTransformerInfo) -> PBCurrentTransformerInfo:
|
|
740
723
|
return PBCurrentTransformerInfo(
|
|
741
724
|
ai=asset_info_to_pb(cim),
|
|
@@ -754,6 +737,7 @@ def current_transformer_info_to_pb(cim: CurrentTransformerInfo) -> PBCurrentTran
|
|
|
754
737
|
)
|
|
755
738
|
|
|
756
739
|
|
|
740
|
+
@bind_to_pb
|
|
757
741
|
def potential_transformer_info_to_pb(cim: PotentialTransformerInfo) -> PBPotentialTransformerInfo:
|
|
758
742
|
return PBPotentialTransformerInfo(
|
|
759
743
|
ai=asset_info_to_pb(cim),
|
|
@@ -766,14 +750,11 @@ def potential_transformer_info_to_pb(cim: PotentialTransformerInfo) -> PBPotenti
|
|
|
766
750
|
)
|
|
767
751
|
|
|
768
752
|
|
|
769
|
-
CurrentTransformerInfo.to_pb = current_transformer_info_to_pb
|
|
770
|
-
PotentialTransformerInfo.to_pb = potential_transformer_info_to_pb
|
|
771
|
-
|
|
772
|
-
|
|
773
753
|
##################################
|
|
774
754
|
# IEC61968 InfIEC61968 InfAssets #
|
|
775
755
|
##################################
|
|
776
756
|
|
|
757
|
+
@bind_to_pb
|
|
777
758
|
def pole_to_pb(cim: Pole) -> PBPole:
|
|
778
759
|
return PBPole(
|
|
779
760
|
st=structure_to_pb(cim),
|
|
@@ -782,9 +763,6 @@ def pole_to_pb(cim: Pole) -> PBPole:
|
|
|
782
763
|
)
|
|
783
764
|
|
|
784
765
|
|
|
785
|
-
Pole.to_pb = pole_to_pb
|
|
786
|
-
|
|
787
|
-
|
|
788
766
|
##################################
|
|
789
767
|
# IEC61968 InfIEC61968 InfCommon #
|
|
790
768
|
##################################
|
|
@@ -824,10 +802,12 @@ def end_device_function_to_pb(cim: EndDeviceFunction) -> PBEndDeviceFunction:
|
|
|
824
802
|
)
|
|
825
803
|
|
|
826
804
|
|
|
805
|
+
@bind_to_pb
|
|
827
806
|
def meter_to_pb(cim: Meter) -> PBMeter:
|
|
828
807
|
return PBMeter(ed=end_device_to_pb(cim))
|
|
829
808
|
|
|
830
809
|
|
|
810
|
+
@bind_to_pb
|
|
831
811
|
def usage_point_to_pb(cim: UsagePoint) -> PBUsagePoint:
|
|
832
812
|
return PBUsagePoint(
|
|
833
813
|
io=identified_object_to_pb(cim),
|
|
@@ -842,21 +822,15 @@ def usage_point_to_pb(cim: UsagePoint) -> PBUsagePoint:
|
|
|
842
822
|
)
|
|
843
823
|
|
|
844
824
|
|
|
845
|
-
Meter.to_pb = meter_to_pb
|
|
846
|
-
UsagePoint.to_pb = usage_point_to_pb
|
|
847
|
-
|
|
848
|
-
|
|
849
825
|
#######################
|
|
850
826
|
# IEC61968 Operations #
|
|
851
827
|
#######################
|
|
852
828
|
|
|
829
|
+
@bind_to_pb
|
|
853
830
|
def operational_restriction_to_pb(cim: OperationalRestriction) -> PBOperationalRestriction:
|
|
854
831
|
return PBOperationalRestriction(doc=document_to_pb(cim))
|
|
855
832
|
|
|
856
833
|
|
|
857
|
-
OperationalRestriction.to_pb = operational_restriction_to_pb
|
|
858
|
-
|
|
859
|
-
|
|
860
834
|
#####################################
|
|
861
835
|
# IEC61970 Base Auxiliary Equipment #
|
|
862
836
|
#####################################
|
|
@@ -868,6 +842,7 @@ def auxiliary_equipment_to_pb(cim: AuxiliaryEquipment, include_asset_info: bool
|
|
|
868
842
|
)
|
|
869
843
|
|
|
870
844
|
|
|
845
|
+
@bind_to_pb
|
|
871
846
|
def current_transformer_to_pb(cim: CurrentTransformer) -> PBCurrentTransformer:
|
|
872
847
|
return PBCurrentTransformer(
|
|
873
848
|
sn=sensor_to_pb(cim, True),
|
|
@@ -875,10 +850,12 @@ def current_transformer_to_pb(cim: CurrentTransformer) -> PBCurrentTransformer:
|
|
|
875
850
|
)
|
|
876
851
|
|
|
877
852
|
|
|
853
|
+
@bind_to_pb
|
|
878
854
|
def fault_indicator_to_pb(cim: FaultIndicator) -> PBFaultIndicator:
|
|
879
855
|
return PBFaultIndicator(ae=auxiliary_equipment_to_pb(cim))
|
|
880
856
|
|
|
881
857
|
|
|
858
|
+
@bind_to_pb
|
|
882
859
|
def potential_transformer_to_pb(cim: PotentialTransformer) -> PBPotentialTransformer:
|
|
883
860
|
return PBPotentialTransformer(
|
|
884
861
|
sn=sensor_to_pb(cim, True),
|
|
@@ -893,11 +870,6 @@ def sensor_to_pb(cim: Sensor, include_asset_info: bool = False) -> PBSensor:
|
|
|
893
870
|
)
|
|
894
871
|
|
|
895
872
|
|
|
896
|
-
CurrentTransformer.to_pb = current_transformer_to_pb
|
|
897
|
-
FaultIndicator.to_pb = fault_indicator_to_pb
|
|
898
|
-
PotentialTransformer.to_pb = potential_transformer_to_pb
|
|
899
|
-
|
|
900
|
-
|
|
901
873
|
######################
|
|
902
874
|
# IEC61970 Base Core #
|
|
903
875
|
######################
|
|
@@ -906,6 +878,7 @@ def ac_dc_terminal_to_pb(cim: AcDcTerminal) -> PBAcDcTerminal:
|
|
|
906
878
|
return PBAcDcTerminal(io=identified_object_to_pb(cim))
|
|
907
879
|
|
|
908
880
|
|
|
881
|
+
@bind_to_pb
|
|
909
882
|
def base_voltage_to_pb(cim: BaseVoltage) -> PBBaseVoltage:
|
|
910
883
|
return PBBaseVoltage(
|
|
911
884
|
io=identified_object_to_pb(cim),
|
|
@@ -921,6 +894,7 @@ def conducting_equipment_to_pb(cim: ConductingEquipment, include_asset_info: boo
|
|
|
921
894
|
)
|
|
922
895
|
|
|
923
896
|
|
|
897
|
+
@bind_to_pb
|
|
924
898
|
def connectivity_node_to_pb(cim: ConnectivityNode) -> PBConnectivityNode:
|
|
925
899
|
return PBConnectivityNode(io=identified_object_to_pb(cim))
|
|
926
900
|
|
|
@@ -966,6 +940,7 @@ def equipment_container_to_pb(cim: EquipmentContainer) -> PBEquipmentContainer:
|
|
|
966
940
|
return PBEquipmentContainer(cnc=connectivity_node_container_to_pb(cim))
|
|
967
941
|
|
|
968
942
|
|
|
943
|
+
@bind_to_pb
|
|
969
944
|
def feeder_to_pb(cim: Feeder) -> PBFeeder:
|
|
970
945
|
return PBFeeder(
|
|
971
946
|
ec=equipment_container_to_pb(cim),
|
|
@@ -976,6 +951,7 @@ def feeder_to_pb(cim: Feeder) -> PBFeeder:
|
|
|
976
951
|
)
|
|
977
952
|
|
|
978
953
|
|
|
954
|
+
@bind_to_pb
|
|
979
955
|
def geographical_region_to_pb(cim: GeographicalRegion) -> PBGeographicalRegion:
|
|
980
956
|
return PBGeographicalRegion(
|
|
981
957
|
io=identified_object_to_pb(cim),
|
|
@@ -992,6 +968,7 @@ def power_system_resource_to_pb(cim: PowerSystemResource, include_asset_info: bo
|
|
|
992
968
|
)
|
|
993
969
|
|
|
994
970
|
|
|
971
|
+
@bind_to_pb
|
|
995
972
|
def sub_geographical_region_to_pb(cim: SubGeographicalRegion) -> PBSubGeographicalRegion:
|
|
996
973
|
return PBSubGeographicalRegion(
|
|
997
974
|
io=identified_object_to_pb(cim),
|
|
@@ -1000,6 +977,7 @@ def sub_geographical_region_to_pb(cim: SubGeographicalRegion) -> PBSubGeographic
|
|
|
1000
977
|
)
|
|
1001
978
|
|
|
1002
979
|
|
|
980
|
+
@bind_to_pb
|
|
1003
981
|
def substation_to_pb(cim: Substation) -> PBSubstation:
|
|
1004
982
|
return PBSubstation(
|
|
1005
983
|
ec=equipment_container_to_pb(cim),
|
|
@@ -1011,6 +989,7 @@ def substation_to_pb(cim: Substation) -> PBSubstation:
|
|
|
1011
989
|
)
|
|
1012
990
|
|
|
1013
991
|
|
|
992
|
+
@bind_to_pb
|
|
1014
993
|
def terminal_to_pb(cim: Terminal) -> PBTerminal:
|
|
1015
994
|
# noinspection PyProtectedMember
|
|
1016
995
|
return PBTerminal(
|
|
@@ -1025,19 +1004,11 @@ def terminal_to_pb(cim: Terminal) -> PBTerminal:
|
|
|
1025
1004
|
)
|
|
1026
1005
|
|
|
1027
1006
|
|
|
1028
|
-
BaseVoltage.to_pb = base_voltage_to_pb
|
|
1029
|
-
ConnectivityNode.to_pb = connectivity_node_to_pb
|
|
1030
|
-
Feeder.to_pb = feeder_to_pb
|
|
1031
|
-
GeographicalRegion.to_pb = geographical_region_to_pb
|
|
1032
|
-
SubGeographicalRegion.to_pb = sub_geographical_region_to_pb
|
|
1033
|
-
Substation.to_pb = substation_to_pb
|
|
1034
|
-
Terminal.to_pb = terminal_to_pb
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
1007
|
#############################
|
|
1038
1008
|
# IEC61970 Base Equivalents #
|
|
1039
1009
|
#############################
|
|
1040
1010
|
|
|
1011
|
+
@bind_to_pb
|
|
1041
1012
|
def equivalent_branch_to_pb(cim: EquivalentBranch) -> PBEquivalentBranch:
|
|
1042
1013
|
return PBEquivalentBranch(
|
|
1043
1014
|
ee=equivalent_equipment_to_pb(cim),
|
|
@@ -1064,13 +1035,11 @@ def equivalent_equipment_to_pb(cim: EquivalentEquipment) -> PBEquivalentEquipmen
|
|
|
1064
1035
|
return PBEquivalentEquipment(ce=conducting_equipment_to_pb(cim))
|
|
1065
1036
|
|
|
1066
1037
|
|
|
1067
|
-
EquivalentBranch.to_pb = equivalent_branch_to_pb
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
1038
|
#######################################
|
|
1071
1039
|
# IEC61970 Base Generation Production #
|
|
1072
1040
|
#######################################
|
|
1073
1041
|
|
|
1042
|
+
@bind_to_pb
|
|
1074
1043
|
def battery_unit_to_pb(cim: BatteryUnit) -> PBBatteryUnit:
|
|
1075
1044
|
"""
|
|
1076
1045
|
Convert the :class:`BatteryUnit` into its protobuf counterpart.
|
|
@@ -1086,6 +1055,7 @@ def battery_unit_to_pb(cim: BatteryUnit) -> PBBatteryUnit:
|
|
|
1086
1055
|
)
|
|
1087
1056
|
|
|
1088
1057
|
|
|
1058
|
+
@bind_to_pb
|
|
1089
1059
|
def photo_voltaic_unit_to_pb(cim: PhotoVoltaicUnit) -> PBPhotoVoltaicUnit:
|
|
1090
1060
|
return PBPhotoVoltaicUnit(peu=power_electronics_unit_to_pb(cim))
|
|
1091
1061
|
|
|
@@ -1099,23 +1069,21 @@ def power_electronics_unit_to_pb(cim: PowerElectronicsUnit) -> PBPowerElectronic
|
|
|
1099
1069
|
)
|
|
1100
1070
|
|
|
1101
1071
|
|
|
1072
|
+
@bind_to_pb
|
|
1102
1073
|
def power_electronics_wind_unit_to_pb(cim: PowerElectronicsWindUnit) -> PBPowerElectronicsWindUnit:
|
|
1103
1074
|
return PBPowerElectronicsWindUnit(peu=power_electronics_unit_to_pb(cim))
|
|
1104
1075
|
|
|
1105
1076
|
|
|
1106
|
-
BatteryUnit.to_pb = battery_unit_to_pb
|
|
1107
|
-
PhotoVoltaicUnit.to_pb = photo_voltaic_unit_to_pb
|
|
1108
|
-
PowerElectronicsWindUnit.to_pb = power_electronics_wind_unit_to_pb
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
1077
|
######################
|
|
1112
1078
|
# IEC61970 Base Meas #
|
|
1113
1079
|
######################
|
|
1114
1080
|
|
|
1081
|
+
@bind_to_pb
|
|
1115
1082
|
def accumulator_to_pb(cim: Accumulator) -> PBAccumulator:
|
|
1116
1083
|
return PBAccumulator(measurement=measurement_to_pb(cim))
|
|
1117
1084
|
|
|
1118
1085
|
|
|
1086
|
+
@bind_to_pb
|
|
1119
1087
|
def analog_to_pb(cim: Analog) -> PBAnalog:
|
|
1120
1088
|
return PBAnalog(
|
|
1121
1089
|
measurement=measurement_to_pb(cim),
|
|
@@ -1123,6 +1091,7 @@ def analog_to_pb(cim: Analog) -> PBAnalog:
|
|
|
1123
1091
|
)
|
|
1124
1092
|
|
|
1125
1093
|
|
|
1094
|
+
@bind_to_pb
|
|
1126
1095
|
def control_to_pb(cim: Control) -> PBControl:
|
|
1127
1096
|
return PBControl(
|
|
1128
1097
|
ip=io_point_to_pb(cim),
|
|
@@ -1131,6 +1100,7 @@ def control_to_pb(cim: Control) -> PBControl:
|
|
|
1131
1100
|
)
|
|
1132
1101
|
|
|
1133
1102
|
|
|
1103
|
+
@bind_to_pb
|
|
1134
1104
|
def discrete_to_pb(cim: Discrete) -> PBDiscrete:
|
|
1135
1105
|
return PBDiscrete(measurement=measurement_to_pb(cim))
|
|
1136
1106
|
|
|
@@ -1150,16 +1120,11 @@ def measurement_to_pb(cim: Measurement) -> PBMeasurement:
|
|
|
1150
1120
|
)
|
|
1151
1121
|
|
|
1152
1122
|
|
|
1153
|
-
Accumulator.to_pb = accumulator_to_pb
|
|
1154
|
-
Analog.to_pb = analog_to_pb
|
|
1155
|
-
Control.to_pb = control_to_pb
|
|
1156
|
-
Discrete.to_pb = discrete_to_pb
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
1123
|
############################
|
|
1160
1124
|
# IEC61970 Base Protection #
|
|
1161
1125
|
############################
|
|
1162
1126
|
|
|
1127
|
+
@bind_to_pb
|
|
1163
1128
|
def current_relay_to_pb(cim: CurrentRelay) -> PBCurrentRelay:
|
|
1164
1129
|
return PBCurrentRelay(
|
|
1165
1130
|
prf=protection_relay_function_to_pb(cim, True),
|
|
@@ -1169,13 +1134,11 @@ def current_relay_to_pb(cim: CurrentRelay) -> PBCurrentRelay:
|
|
|
1169
1134
|
)
|
|
1170
1135
|
|
|
1171
1136
|
|
|
1172
|
-
CurrentRelay.to_pb = current_relay_to_pb
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
1137
|
#######################
|
|
1176
1138
|
# IEC61970 Base Scada #
|
|
1177
1139
|
#######################
|
|
1178
1140
|
|
|
1141
|
+
@bind_to_pb
|
|
1179
1142
|
def remote_control_to_pb(cim: RemoteControl) -> PBRemoteControl:
|
|
1180
1143
|
return PBRemoteControl(
|
|
1181
1144
|
rp=remote_point_to_pb(cim),
|
|
@@ -1187,6 +1150,7 @@ def remote_point_to_pb(cim: RemotePoint) -> PBRemotePoint:
|
|
|
1187
1150
|
return PBRemotePoint(io=identified_object_to_pb(cim))
|
|
1188
1151
|
|
|
1189
1152
|
|
|
1153
|
+
@bind_to_pb
|
|
1190
1154
|
def remote_source_to_pb(cim: RemoteSource) -> PBRemoteSource:
|
|
1191
1155
|
return PBRemoteSource(
|
|
1192
1156
|
rp=remote_point_to_pb(cim),
|
|
@@ -1194,14 +1158,11 @@ def remote_source_to_pb(cim: RemoteSource) -> PBRemoteSource:
|
|
|
1194
1158
|
)
|
|
1195
1159
|
|
|
1196
1160
|
|
|
1197
|
-
RemoteControl.to_pb = remote_control_to_pb
|
|
1198
|
-
RemoteSource.to_pb = remote_source_to_pb
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
1161
|
#######################
|
|
1202
1162
|
# IEC61970 Base Wires #
|
|
1203
1163
|
#######################
|
|
1204
1164
|
|
|
1165
|
+
@bind_to_pb
|
|
1205
1166
|
def ac_line_segment_to_pb(cim: AcLineSegment) -> PBAcLineSegment:
|
|
1206
1167
|
"""
|
|
1207
1168
|
Convert the :class:`AcLineSegment` into its protobuf counterpart.
|
|
@@ -1216,6 +1177,7 @@ def ac_line_segment_to_pb(cim: AcLineSegment) -> PBAcLineSegment:
|
|
|
1216
1177
|
)
|
|
1217
1178
|
|
|
1218
1179
|
|
|
1180
|
+
@bind_to_pb
|
|
1219
1181
|
def breaker_to_pb(cim: Breaker) -> PBBreaker:
|
|
1220
1182
|
return PBBreaker(
|
|
1221
1183
|
sw=protected_switch_to_pb(cim),
|
|
@@ -1223,10 +1185,12 @@ def breaker_to_pb(cim: Breaker) -> PBBreaker:
|
|
|
1223
1185
|
)
|
|
1224
1186
|
|
|
1225
1187
|
|
|
1188
|
+
@bind_to_pb
|
|
1226
1189
|
def busbar_section_to_pb(cim: BusbarSection) -> PBBusbarSection:
|
|
1227
1190
|
return PBBusbarSection(cn=connector_to_pb(cim))
|
|
1228
1191
|
|
|
1229
1192
|
|
|
1193
|
+
@bind_to_pb
|
|
1230
1194
|
def clamp_to_pb(cim: Clamp) -> PBClamp:
|
|
1231
1195
|
return PBClamp(
|
|
1232
1196
|
ce=conducting_equipment_to_pb(cim),
|
|
@@ -1248,6 +1212,7 @@ def connector_to_pb(cim: Connector) -> PBConnector:
|
|
|
1248
1212
|
return PBConnector(ce=conducting_equipment_to_pb(cim))
|
|
1249
1213
|
|
|
1250
1214
|
|
|
1215
|
+
@bind_to_pb
|
|
1251
1216
|
def cut_to_pb(cim: Cut) -> PBCut:
|
|
1252
1217
|
return PBCut(
|
|
1253
1218
|
sw=switch_to_pb(cim),
|
|
@@ -1256,6 +1221,7 @@ def cut_to_pb(cim: Cut) -> PBCut:
|
|
|
1256
1221
|
)
|
|
1257
1222
|
|
|
1258
1223
|
|
|
1224
|
+
@bind_to_pb
|
|
1259
1225
|
def disconnector_to_pb(cim: Disconnector) -> PBDisconnector:
|
|
1260
1226
|
return PBDisconnector(sw=switch_to_pb(cim))
|
|
1261
1227
|
|
|
@@ -1271,6 +1237,7 @@ def energy_connection_to_pb(cim: EnergyConnection, include_asset_info=False) ->
|
|
|
1271
1237
|
return PBEnergyConnection(ce=conducting_equipment_to_pb(cim, include_asset_info))
|
|
1272
1238
|
|
|
1273
1239
|
|
|
1240
|
+
@bind_to_pb
|
|
1274
1241
|
def energy_consumer_to_pb(cim: EnergyConsumer) -> PBEnergyConsumer:
|
|
1275
1242
|
return PBEnergyConsumer(
|
|
1276
1243
|
ec=energy_connection_to_pb(cim),
|
|
@@ -1285,6 +1252,7 @@ def energy_consumer_to_pb(cim: EnergyConsumer) -> PBEnergyConsumer:
|
|
|
1285
1252
|
)
|
|
1286
1253
|
|
|
1287
1254
|
|
|
1255
|
+
@bind_to_pb
|
|
1288
1256
|
def energy_consumer_phase_to_pb(cim: EnergyConsumerPhase) -> PBEnergyConsumerPhase:
|
|
1289
1257
|
return PBEnergyConsumerPhase(
|
|
1290
1258
|
psr=power_system_resource_to_pb(cim),
|
|
@@ -1297,6 +1265,7 @@ def energy_consumer_phase_to_pb(cim: EnergyConsumerPhase) -> PBEnergyConsumerPha
|
|
|
1297
1265
|
)
|
|
1298
1266
|
|
|
1299
1267
|
|
|
1268
|
+
@bind_to_pb
|
|
1300
1269
|
def energy_source_to_pb(cim: EnergySource) -> PBEnergySource:
|
|
1301
1270
|
return PBEnergySource(
|
|
1302
1271
|
ec=energy_connection_to_pb(cim),
|
|
@@ -1329,6 +1298,7 @@ def energy_source_to_pb(cim: EnergySource) -> PBEnergySource:
|
|
|
1329
1298
|
)
|
|
1330
1299
|
|
|
1331
1300
|
|
|
1301
|
+
@bind_to_pb
|
|
1332
1302
|
def energy_source_phase_to_pb(cim: EnergySourcePhase) -> PBEnergySourcePhase:
|
|
1333
1303
|
return PBEnergySourcePhase(
|
|
1334
1304
|
psr=power_system_resource_to_pb(cim),
|
|
@@ -1337,6 +1307,7 @@ def energy_source_phase_to_pb(cim: EnergySourcePhase) -> PBEnergySourcePhase:
|
|
|
1337
1307
|
)
|
|
1338
1308
|
|
|
1339
1309
|
|
|
1310
|
+
@bind_to_pb
|
|
1340
1311
|
def fuse_to_pb(cim: Fuse) -> PBFuse:
|
|
1341
1312
|
return PBFuse(
|
|
1342
1313
|
sw=switch_to_pb(cim),
|
|
@@ -1344,18 +1315,21 @@ def fuse_to_pb(cim: Fuse) -> PBFuse:
|
|
|
1344
1315
|
)
|
|
1345
1316
|
|
|
1346
1317
|
|
|
1318
|
+
@bind_to_pb
|
|
1347
1319
|
def ground_to_pb(cim: Ground) -> PBGround:
|
|
1348
1320
|
return PBGround(
|
|
1349
1321
|
ce=conducting_equipment_to_pb(cim, True)
|
|
1350
1322
|
)
|
|
1351
1323
|
|
|
1352
1324
|
|
|
1325
|
+
@bind_to_pb
|
|
1353
1326
|
def ground_disconnector_to_pb(cim: GroundDisconnector) -> PBGroundDisconnector:
|
|
1354
1327
|
return PBGroundDisconnector(
|
|
1355
1328
|
sw=switch_to_pb(cim)
|
|
1356
1329
|
)
|
|
1357
1330
|
|
|
1358
1331
|
|
|
1332
|
+
@bind_to_pb
|
|
1359
1333
|
def grounding_impedance_to_pb(cim: GroundingImpedance) -> PBGroundingImpedance:
|
|
1360
1334
|
return PBGroundingImpedance(
|
|
1361
1335
|
efc=earth_fault_compensator_to_pb(cim),
|
|
@@ -1363,10 +1337,12 @@ def grounding_impedance_to_pb(cim: GroundingImpedance) -> PBGroundingImpedance:
|
|
|
1363
1337
|
)
|
|
1364
1338
|
|
|
1365
1339
|
|
|
1340
|
+
@bind_to_pb
|
|
1366
1341
|
def jumper_to_pb(cim: Jumper) -> PBJumper:
|
|
1367
1342
|
return PBJumper(sw=switch_to_pb(cim))
|
|
1368
1343
|
|
|
1369
1344
|
|
|
1345
|
+
@bind_to_pb
|
|
1370
1346
|
def junction_to_pb(cim: Junction) -> PBJunction:
|
|
1371
1347
|
return PBJunction(cn=connector_to_pb(cim))
|
|
1372
1348
|
|
|
@@ -1375,6 +1351,7 @@ def line_to_pb(cim: Line) -> PBLine:
|
|
|
1375
1351
|
return PBLine(ec=equipment_container_to_pb(cim))
|
|
1376
1352
|
|
|
1377
1353
|
|
|
1354
|
+
@bind_to_pb
|
|
1378
1355
|
def linear_shunt_compensator_to_pb(cim: LinearShuntCompensator) -> PBLinearShuntCompensator:
|
|
1379
1356
|
return PBLinearShuntCompensator(
|
|
1380
1357
|
sc=shunt_compensator_to_pb(cim),
|
|
@@ -1385,6 +1362,7 @@ def linear_shunt_compensator_to_pb(cim: LinearShuntCompensator) -> PBLinearShunt
|
|
|
1385
1362
|
)
|
|
1386
1363
|
|
|
1387
1364
|
|
|
1365
|
+
@bind_to_pb
|
|
1388
1366
|
def load_break_switch_to_pb(cim: LoadBreakSwitch) -> PBLoadBreakSwitch:
|
|
1389
1367
|
return PBLoadBreakSwitch(ps=protected_switch_to_pb(cim))
|
|
1390
1368
|
|
|
@@ -1397,6 +1375,7 @@ def per_length_line_parameter_to_pb(cim: PerLengthLineParameter) -> PBPerLengthL
|
|
|
1397
1375
|
return PBPerLengthLineParameter(io=identified_object_to_pb(cim))
|
|
1398
1376
|
|
|
1399
1377
|
|
|
1378
|
+
@bind_to_pb
|
|
1400
1379
|
def per_length_phase_impedance_to_pb(cim: PerLengthPhaseImpedance) -> PBPerLengthPhaseImpedance:
|
|
1401
1380
|
"""
|
|
1402
1381
|
Convert the :class:`PerLengthPhaseImpedance` into its protobuf counterpart.
|
|
@@ -1409,6 +1388,7 @@ def per_length_phase_impedance_to_pb(cim: PerLengthPhaseImpedance) -> PBPerLengt
|
|
|
1409
1388
|
)
|
|
1410
1389
|
|
|
1411
1390
|
|
|
1391
|
+
@bind_to_pb
|
|
1412
1392
|
def per_length_sequence_impedance_to_pb(cim: PerLengthSequenceImpedance) -> PBPerLengthSequenceImpedance:
|
|
1413
1393
|
return PBPerLengthSequenceImpedance(
|
|
1414
1394
|
pli=per_length_impedance_to_pb(cim),
|
|
@@ -1423,6 +1403,7 @@ def per_length_sequence_impedance_to_pb(cim: PerLengthSequenceImpedance) -> PBPe
|
|
|
1423
1403
|
)
|
|
1424
1404
|
|
|
1425
1405
|
|
|
1406
|
+
@bind_to_pb
|
|
1426
1407
|
def petersen_coil_to_pb(cim: PetersenCoil) -> PBPetersenCoil:
|
|
1427
1408
|
return PBPetersenCoil(
|
|
1428
1409
|
efc=earth_fault_compensator_to_pb(cim),
|
|
@@ -1446,6 +1427,7 @@ def phase_impedance_data_to_pb(cim: PhaseImpedanceData) -> PBPhaseImpedanceData:
|
|
|
1446
1427
|
)
|
|
1447
1428
|
|
|
1448
1429
|
|
|
1430
|
+
@bind_to_pb
|
|
1449
1431
|
def power_electronics_connection_to_pb(cim: PowerElectronicsConnection) -> PBPowerElectronicsConnection:
|
|
1450
1432
|
return PBPowerElectronicsConnection(
|
|
1451
1433
|
rce=regulating_cond_eq_to_pb(cim),
|
|
@@ -1485,6 +1467,7 @@ def power_electronics_connection_to_pb(cim: PowerElectronicsConnection) -> PBPow
|
|
|
1485
1467
|
)
|
|
1486
1468
|
|
|
1487
1469
|
|
|
1470
|
+
@bind_to_pb
|
|
1488
1471
|
def power_electronics_connection_phase_to_pb(cim: PowerElectronicsConnectionPhase) -> PBPowerElectronicsConnectionPhase:
|
|
1489
1472
|
return PBPowerElectronicsConnectionPhase(
|
|
1490
1473
|
psr=power_system_resource_to_pb(cim),
|
|
@@ -1495,6 +1478,7 @@ def power_electronics_connection_phase_to_pb(cim: PowerElectronicsConnectionPhas
|
|
|
1495
1478
|
)
|
|
1496
1479
|
|
|
1497
1480
|
|
|
1481
|
+
@bind_to_pb
|
|
1498
1482
|
def power_transformer_to_pb(cim: PowerTransformer) -> PBPowerTransformer:
|
|
1499
1483
|
return PBPowerTransformer(
|
|
1500
1484
|
ce=conducting_equipment_to_pb(cim, True),
|
|
@@ -1506,6 +1490,7 @@ def power_transformer_to_pb(cim: PowerTransformer) -> PBPowerTransformer:
|
|
|
1506
1490
|
)
|
|
1507
1491
|
|
|
1508
1492
|
|
|
1493
|
+
@bind_to_pb
|
|
1509
1494
|
def power_transformer_end_to_pb(cim: PowerTransformerEnd) -> PBPowerTransformerEnd:
|
|
1510
1495
|
return PBPowerTransformerEnd(
|
|
1511
1496
|
te=transformer_end_to_pb(cim),
|
|
@@ -1534,6 +1519,7 @@ def protected_switch_to_pb(cim: ProtectedSwitch) -> PBProtectedSwitch:
|
|
|
1534
1519
|
)
|
|
1535
1520
|
|
|
1536
1521
|
|
|
1522
|
+
@bind_to_pb
|
|
1537
1523
|
def ratio_tap_changer_to_pb(cim: RatioTapChanger) -> PBRatioTapChanger:
|
|
1538
1524
|
return PBRatioTapChanger(
|
|
1539
1525
|
tc=tap_changer_to_pb(cim),
|
|
@@ -1542,10 +1528,12 @@ def ratio_tap_changer_to_pb(cim: RatioTapChanger) -> PBRatioTapChanger:
|
|
|
1542
1528
|
)
|
|
1543
1529
|
|
|
1544
1530
|
|
|
1531
|
+
@bind_to_pb
|
|
1545
1532
|
def reactive_capability_curve_to_pb(cim: ReactiveCapabilityCurve) -> PBReactiveCapabilityCurve:
|
|
1546
1533
|
return PBReactiveCapabilityCurve(c=curve_to_pb(cim))
|
|
1547
1534
|
|
|
1548
1535
|
|
|
1536
|
+
@bind_to_pb
|
|
1549
1537
|
def recloser_to_pb(cim: Recloser) -> PBRecloser:
|
|
1550
1538
|
return PBRecloser(sw=protected_switch_to_pb(cim))
|
|
1551
1539
|
|
|
@@ -1593,6 +1581,7 @@ def rotating_machine_to_pb(cim: RotatingMachine) -> PBRotatingMachine:
|
|
|
1593
1581
|
)
|
|
1594
1582
|
|
|
1595
1583
|
|
|
1584
|
+
@bind_to_pb
|
|
1596
1585
|
def series_compensator_to_pb(cim: SeriesCompensator) -> PBSeriesCompensator:
|
|
1597
1586
|
return PBSeriesCompensator(
|
|
1598
1587
|
ce=conducting_equipment_to_pb(cim, True),
|
|
@@ -1615,6 +1604,7 @@ def shunt_compensator_to_pb(cim: ShuntCompensator) -> PBShuntCompensator:
|
|
|
1615
1604
|
)
|
|
1616
1605
|
|
|
1617
1606
|
|
|
1607
|
+
@bind_to_pb
|
|
1618
1608
|
def static_var_compensator_to_pb(cim: StaticVarCompensator) -> PBStaticVarCompensator:
|
|
1619
1609
|
"""
|
|
1620
1610
|
Convert the :class:`StaticVarCompensator` into its protobuf counterpart.
|
|
@@ -1640,6 +1630,7 @@ def switch_to_pb(cim: Switch) -> PBSwitch:
|
|
|
1640
1630
|
)
|
|
1641
1631
|
|
|
1642
1632
|
|
|
1633
|
+
@bind_to_pb
|
|
1643
1634
|
def synchronous_machine_to_pb(cim: SynchronousMachine) -> PBSynchronousMachine:
|
|
1644
1635
|
return PBSynchronousMachine(
|
|
1645
1636
|
rm=rotating_machine_to_pb(cim),
|
|
@@ -1683,6 +1674,7 @@ def tap_changer_to_pb(cim: TapChanger) -> PBTapChanger:
|
|
|
1683
1674
|
)
|
|
1684
1675
|
|
|
1685
1676
|
|
|
1677
|
+
@bind_to_pb
|
|
1686
1678
|
def tap_changer_control_to_pb(cim: TapChangerControl) -> PBTapChangerControl:
|
|
1687
1679
|
return PBTapChangerControl(
|
|
1688
1680
|
rc=regulating_control_to_pb(cim),
|
|
@@ -1719,6 +1711,7 @@ def transformer_end_rated_s_to_pb(cim: TransformerEndRatedS) -> PBTransformerEnd
|
|
|
1719
1711
|
)
|
|
1720
1712
|
|
|
1721
1713
|
|
|
1714
|
+
@bind_to_pb
|
|
1722
1715
|
def transformer_star_impedance_to_pb(cim: TransformerStarImpedance) -> PBTransformerStarImpedance:
|
|
1723
1716
|
return PBTransformerStarImpedance(
|
|
1724
1717
|
io=identified_object_to_pb(cim),
|
|
@@ -1730,46 +1723,12 @@ def transformer_star_impedance_to_pb(cim: TransformerStarImpedance) -> PBTransfo
|
|
|
1730
1723
|
)
|
|
1731
1724
|
|
|
1732
1725
|
|
|
1733
|
-
AcLineSegment.to_pb = ac_line_segment_to_pb
|
|
1734
|
-
Breaker.to_pb = breaker_to_pb
|
|
1735
|
-
BusbarSection.to_pb = busbar_section_to_pb
|
|
1736
|
-
Clamp.to_pb = clamp_to_pb
|
|
1737
|
-
Cut.to_pb = cut_to_pb
|
|
1738
|
-
Disconnector.to_pb = disconnector_to_pb
|
|
1739
|
-
EnergyConsumer.to_pb = energy_consumer_to_pb
|
|
1740
|
-
EnergyConsumerPhase.to_pb = energy_consumer_phase_to_pb
|
|
1741
|
-
EnergySource.to_pb = energy_source_to_pb
|
|
1742
|
-
EnergySourcePhase.to_pb = energy_source_phase_to_pb
|
|
1743
|
-
Fuse.to_pb = fuse_to_pb
|
|
1744
|
-
Ground.to_pb = ground_to_pb
|
|
1745
|
-
GroundDisconnector.to_pb = ground_disconnector_to_pb
|
|
1746
|
-
GroundingImpedance.to_pb = grounding_impedance_to_pb
|
|
1747
|
-
Jumper.to_pb = jumper_to_pb
|
|
1748
|
-
Junction.to_pb = junction_to_pb
|
|
1749
|
-
LinearShuntCompensator.to_pb = linear_shunt_compensator_to_pb
|
|
1750
|
-
LoadBreakSwitch.to_pb = load_break_switch_to_pb
|
|
1751
|
-
PerLengthPhaseImpedance.to_pb = per_length_phase_impedance_to_pb
|
|
1752
|
-
PerLengthSequenceImpedance.to_pb = per_length_sequence_impedance_to_pb
|
|
1753
|
-
PetersenCoil.to_pb = petersen_coil_to_pb
|
|
1754
|
-
PowerElectronicsConnection.to_pb = power_electronics_connection_to_pb
|
|
1755
|
-
PowerElectronicsConnectionPhase.to_pb = power_electronics_connection_phase_to_pb
|
|
1756
|
-
PowerTransformer.to_pb = power_transformer_to_pb
|
|
1757
|
-
PowerTransformerEnd.to_pb = power_transformer_end_to_pb
|
|
1758
|
-
RatioTapChanger.to_pb = ratio_tap_changer_to_pb
|
|
1759
|
-
ReactiveCapabilityCurve.to_pb = reactive_capability_curve_to_pb
|
|
1760
|
-
Recloser.to_pb = recloser_to_pb
|
|
1761
|
-
SeriesCompensator.to_pb = series_compensator_to_pb
|
|
1762
|
-
StaticVarCompensator.to_pb = static_var_compensator_to_pb
|
|
1763
|
-
SynchronousMachine.to_pb = synchronous_machine_to_pb
|
|
1764
|
-
TapChangerControl.to_pb = tap_changer_control_to_pb
|
|
1765
|
-
TransformerStarImpedance.to_pb = transformer_star_impedance_to_pb
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
1726
|
###############################
|
|
1769
1727
|
# IEC61970 InfIEC61970 Feeder #
|
|
1770
1728
|
###############################
|
|
1771
1729
|
|
|
1772
1730
|
|
|
1731
|
+
@bind_to_pb
|
|
1773
1732
|
def circuit_to_pb(cim: Circuit) -> PBCircuit:
|
|
1774
1733
|
return PBCircuit(
|
|
1775
1734
|
l=line_to_pb(cim),
|
|
@@ -1777,6 +1736,3 @@ def circuit_to_pb(cim: Circuit) -> PBCircuit:
|
|
|
1777
1736
|
endTerminalMRIDs=[str(io.mrid) for io in cim.end_terminals],
|
|
1778
1737
|
endSubstationMRIDs=[str(io.mrid) for io in cim.end_substations]
|
|
1779
1738
|
)
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
Circuit.to_pb = circuit_to_pb
|