Skip to content

Commit

Permalink
FIX: dss line switch=y parsing
Browse files Browse the repository at this point in the history
Dss does not consider units on switches, except in the case of b1,b0.
  • Loading branch information
pseudocubic committed Oct 31, 2023
1 parent 92c4936 commit c28ec19
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## staged

- none
- Fixed bug in parsing of dss lines where `switch=y`

## v0.15.1

Expand Down
35 changes: 21 additions & 14 deletions src/data_model/dss/edge_constructors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,27 @@ function create_dss_object(::Type{T}, property_pairs::Vector{Pair{String,String}
line.xmatrix .-= xgmod
line.xmatrix .*= lenmult * (line.basefreq / circuit_basefreq)


line.r1 = line.r1 / _convert_to_meters[line.units]
line.x1 = line.x1 / _convert_to_meters[line.units]
line.r0 = line.r0 / _convert_to_meters[line.units]
line.x0 = line.x0 / _convert_to_meters[line.units]
line.c1 = line.c1 / _convert_to_meters[line.units]
line.c0 = line.c0 / _convert_to_meters[line.units]
line.rmatrix = line.rmatrix / _convert_to_meters[line.units]
line.xmatrix = line.xmatrix / _convert_to_meters[line.units]
line.cmatrix = line.cmatrix / _convert_to_meters[line.units]
line.b1 = line.b1 / _convert_to_meters[line.units]
line.b0 = line.b0 / _convert_to_meters[line.units]
line.length = line.length * _convert_to_meters[line.units]
line.units = "m"
if !line.switch
line.r1 = line.r1 / _convert_to_meters[line.units]
line.x1 = line.x1 / _convert_to_meters[line.units]
line.r0 = line.r0 / _convert_to_meters[line.units]
line.x0 = line.x0 / _convert_to_meters[line.units]
line.c1 = line.c1 / _convert_to_meters[line.units]
line.c0 = line.c0 / _convert_to_meters[line.units]
line.rmatrix = line.rmatrix / _convert_to_meters[line.units]
line.xmatrix = line.xmatrix / _convert_to_meters[line.units]
line.cmatrix = line.cmatrix / _convert_to_meters[line.units]
line.b1 = line.b1 / _convert_to_meters[line.units]
line.b0 = line.b0 / _convert_to_meters[line.units]
line.length = line.length * _convert_to_meters[line.units]
line.units = "m"
else
# TODO: bug in DSS?
line.b1 = line.b1 / _convert_to_meters[line.units]
line.b0 = line.b0 / _convert_to_meters[line.units]
line.length = 0.001
line.units = "none"
end

return line
end
Expand Down

0 comments on commit c28ec19

Please sign in to comment.