@@ -491,6 +491,10 @@ def validate_values(data: SingleDataset, calculation_type: CalculationType | Non
491
491
errors += validate_generic_power_sensor (data , ComponentType .sym_power_sensor )
492
492
if "asym_power_sensor" in data :
493
493
errors += validate_generic_power_sensor (data , ComponentType .asym_power_sensor )
494
+ if "sym_current_sensor" in data :
495
+ errors += validate_generic_current_sensor (data , ComponentType .sym_current_sensor )
496
+ if "asym_current_sensor" in data :
497
+ errors += validate_generic_current_sensor (data , ComponentType .asym_current_sensor )
494
498
495
499
if calculation_type in (None , CalculationType .short_circuit ) and "fault" in data :
496
500
errors += validate_fault (data )
@@ -962,6 +966,62 @@ def validate_generic_power_sensor(data: SingleDataset, component: ComponentType)
962
966
return errors
963
967
964
968
969
+ def validate_generic_current_sensor (data : SingleDataset , component : ComponentType ) -> list [ValidationError ]:
970
+
971
+ errors = validate_base (data , component )
972
+ errors += _all_greater_than_zero (data , component , "i_sigma" )
973
+ errors += _all_greater_than_zero (data , component , "i_angle_sigma" )
974
+ errors += _all_valid_enum_values (data , component , "measured_terminal_type" , MeasuredTerminalType )
975
+ errors += _all_valid_ids (
976
+ data ,
977
+ component ,
978
+ field = "measured_object" ,
979
+ ref_components = [
980
+ ComponentType .line ,
981
+ ComponentType .generic_branch ,
982
+ ComponentType .transformer ,
983
+ ComponentType .three_winding_transformer ,
984
+ ],
985
+ )
986
+ errors += _all_valid_ids (
987
+ data ,
988
+ component ,
989
+ field = "measured_object" ,
990
+ ref_components = [ComponentType .line , ComponentType .generic_branch , ComponentType .transformer ],
991
+ measured_terminal_type = MeasuredTerminalType .branch_from ,
992
+ )
993
+ errors += _all_valid_ids (
994
+ data ,
995
+ component ,
996
+ field = "measured_object" ,
997
+ ref_components = [ComponentType .line , ComponentType .generic_branch , ComponentType .transformer ],
998
+ measured_terminal_type = MeasuredTerminalType .branch_to ,
999
+ )
1000
+ errors += _all_valid_ids (
1001
+ data ,
1002
+ component ,
1003
+ field = "measured_object" ,
1004
+ ref_components = ComponentType .three_winding_transformer ,
1005
+ measured_terminal_type = MeasuredTerminalType .branch3_1 ,
1006
+ )
1007
+ errors += _all_valid_ids (
1008
+ data ,
1009
+ component ,
1010
+ field = "measured_object" ,
1011
+ ref_components = ComponentType .three_winding_transformer ,
1012
+ measured_terminal_type = MeasuredTerminalType .branch3_2 ,
1013
+ )
1014
+ errors += _all_valid_ids (
1015
+ data ,
1016
+ component ,
1017
+ field = "measured_object" ,
1018
+ ref_components = ComponentType .three_winding_transformer ,
1019
+ measured_terminal_type = MeasuredTerminalType .branch3_3 ,
1020
+ )
1021
+
1022
+ return errors
1023
+
1024
+
965
1025
def validate_fault (data : SingleDataset ) -> list [ValidationError ]:
966
1026
errors = validate_base (data , ComponentType .fault )
967
1027
errors += _all_boolean (data , ComponentType .fault , "status" )
0 commit comments